Custom Domains
A CustomDomain object represents an additional customer-owned domain that routes to a Files.com site.
List Custom Domains
SDK Method
custom_domain.List()
Return Values
Returns a *custom_domain.Iter and an error. Range over All() to receive files_sdk.CustomDomain values and errors.
Check each loop error before using its resource. Next() and Err() remain supported.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
Additional Arguments
Show Custom Domain
SDK Method
custom_domain.Find()
Return Values
Returns a files_sdk.CustomDomain value and an error.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
CustomDomainFindParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Custom Domain ID. |
Create Custom Domain
SDK Method
custom_domain.Create()
Return Values
Returns a files_sdk.CustomDomain value and an error.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
CustomDomainCreateParams Fields
| Field | Default | Description |
|---|---|---|
| AvailableToAllWorkspaces boolean | false | Allow all workspaces to use this default-workspace Custom Domain. |
| WorkspaceId int64 | 0 | Workspace ID (0 for the default workspace). |
| Destination string | "site_alias" | Where this custom domain routes. Can be site_alias, public_hosting, s3_endpoint, file_content, or unassigned (not routing traffic). Each Site can have one File Content domain in its default workspace. It applies to the whole Site and uses the Site's existing dedicated HTTPS IPs. Set to unassigned automatically when a bound public_hosting folder behavior is deleted, and can be set manually via the API for any reason.Possible values: site_alias, public_hosting, s3_endpoint, unassigned, file_content |
| FolderBehaviorId int64 | Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when destination becomes unassigned. | |
| SslCertificateId int64 | Current SSL certificate ID. | |
| Domain string Required | Customer-owned domain name. |
Allocate dedicated IP addresses to this Custom Domain
SDK Method
custom_domain.CreateAllocateIp()
Return Values
Returns a files_sdk.CustomDomain value and an error.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
CustomDomainCreateAllocateIpParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Custom Domain ID. |
| Count int64 Required | Number of dedicated IP addresses to allocate. Possible values: 1, 2 |
Update Custom Domain
SDK Method
custom_domain.Update()
Return Values
Returns a files_sdk.CustomDomain value and an error.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
CustomDomainUpdateParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Custom Domain ID. |
| AvailableToAllWorkspaces boolean | Allow all workspaces to use this default-workspace Custom Domain. |
| WorkspaceId int64 | Workspace ID (0 for the default workspace). |
| Destination string | Where this custom domain routes. Can be site_alias, public_hosting, s3_endpoint, file_content, or unassigned (not routing traffic). Each Site can have one File Content domain in its default workspace. It applies to the whole Site and uses the Site's existing dedicated HTTPS IPs. Set to unassigned automatically when a bound public_hosting folder behavior is deleted, and can be set manually via the API for any reason.Possible values: site_alias, public_hosting, s3_endpoint, unassigned, file_content |
| FolderBehaviorId int64 | Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when destination becomes unassigned. |
| SslCertificateId int64 | Current SSL certificate ID. |
| Domain string | Customer-owned domain name. |
Delete Custom Domain
SDK Method
custom_domain.Delete()
Return Values
Returns an error, or nil on success.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
CustomDomainDeleteParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Custom Domain ID. |
The CustomDomain Object
Some of the methods above return a CustomDomain object. The attributes of this object are listed below.
| Attribute | Description |
|---|---|
| Id int64 | Custom Domain ID. |
| WorkspaceId int64 | Workspace ID (0 for the default workspace). |
| AvailableToAllWorkspaces boolean | Allow all workspaces to use this default-workspace Custom Domain. |
| OutboundIpAddresses array(string) | Eligible public IP addresses for Remote Server outbound connections. Empty when this Custom Domain is not eligible for outbound selection. |
| Domain string | Customer-owned domain name. |
| Destination string | Where this custom domain routes. Can be site_alias, public_hosting, s3_endpoint, file_content, or unassigned (not routing traffic). Each Site can have one File Content domain in its default workspace. It applies to the whole Site and uses the Site's existing dedicated HTTPS IPs. Set to unassigned automatically when a bound public_hosting folder behavior is deleted, and can be set manually via the API for any reason.Possible values: site_alias, public_hosting, s3_endpoint, unassigned, file_content |
| DnsStatus string | Current DNS verification status. Possible values: disabled, correct, no_records, cname_wrong, a_record, caa_conflict |
| SslCertificateId int64 | Current SSL certificate ID. |
| BrickManaged boolean | Is this domain's SSL certificate automatically managed and renewed by Files.com? |
| FolderBehaviorId int64 | Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when destination becomes unassigned. |
| IpAddresses array(string) | Dedicated public IP addresses allocated to this Custom Domain. |
| CreatedAt date-time | When this Custom Domain was created. |
| UpdatedAt date-time | When this Custom Domain was last updated. |