Skip to content
Ona Docs

CreateCustomDomain

organizations.custom_domains.create(CustomDomainCreateParams**kwargs) -> CustomDomainCreateResponse
POST/gitpod.v1.OrganizationService/CreateCustomDomain

Creates a custom domain configuration for an organization.

Use this method to configure custom domains for organization workspaces

Examples

  • Configure AWS custom domain:

    Sets up a custom domain with AWS provider.

    organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
    domainName: "workspaces.acme-corp.com"
    provider: CUSTOM_DOMAIN_PROVIDER_AWS
    awsAccountId: "123456789012"
ParametersExpand Collapse
domain_name: str

domain_name is the custom domain name

maxLength253
minLength4
organization_id: str

organization_id is the ID of the organization to create the custom domain for

formatuuid
Deprecatedaws_account_id: Optional[str]

aws_account_id is the AWS account ID (deprecated: use cloud_account_id)

cloud_account_id: Optional[str]

cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID)

provider: Optional[CustomDomainProvider]

provider is the cloud provider for this custom domain

One of the following:
"CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"
"CUSTOM_DOMAIN_PROVIDER_AWS"
"CUSTOM_DOMAIN_PROVIDER_GCP"
ReturnsExpand Collapse
class CustomDomainCreateResponse:

CreateCustomDomainResponse is the response message for creating a custom domain

custom_domain: CustomDomain

custom_domain is the created custom domain

id: str

id is the unique identifier of the custom domain

formatuuid
created_at: datetime

created_at is when the custom domain was created

formatdate-time
domain_name: str

domain_name is the custom domain name

maxLength253
minLength4
organization_id: str

organization_id is the ID of the organization this custom domain belongs to

formatuuid
updated_at: datetime

updated_at is when the custom domain was last updated

formatdate-time
Deprecatedaws_account_id: Optional[str]

aws_account_id is the AWS account ID (deprecated: use cloud_account_id)

cloud_account_id: Optional[str]

cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID)

provider: Optional[CustomDomainProvider]

provider is the cloud provider for this custom domain

One of the following:
"CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"
"CUSTOM_DOMAIN_PROVIDER_AWS"
"CUSTOM_DOMAIN_PROVIDER_GCP"

CreateCustomDomain

import os
from gitpod import Gitpod

client = Gitpod(
    bearer_token=os.environ.get("GITPOD_API_KEY"),  # This is the default and can be omitted
)
custom_domain = client.organizations.custom_domains.create(
    domain_name="workspaces.acme-corp.com",
    organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
    aws_account_id="123456789012",
    provider="CUSTOM_DOMAIN_PROVIDER_AWS",
)
print(custom_domain.custom_domain)
{
  "customDomain": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "createdAt": "2019-12-27T18:11:19.117Z",
    "domainName": "xxxx",
    "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "updatedAt": "2019-12-27T18:11:19.117Z",
    "awsAccountId": "awsAccountId",
    "cloudAccountId": "cloudAccountId",
    "provider": "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"
  }
}
Returns Examples
{
  "customDomain": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "createdAt": "2019-12-27T18:11:19.117Z",
    "domainName": "xxxx",
    "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "updatedAt": "2019-12-27T18:11:19.117Z",
    "awsAccountId": "awsAccountId",
    "cloudAccountId": "cloudAccountId",
    "provider": "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"
  }
}