# Custom Domains ## CreateCustomDomain `client.Organizations.CustomDomains.New(ctx, body) (*OrganizationCustomDomainNewResponse, error)` **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. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" domainName: "workspaces.acme-corp.com" provider: CUSTOM_DOMAIN_PROVIDER_AWS awsAccountId: "123456789012" ``` ### Parameters - `body OrganizationCustomDomainNewParams` - `DomainName param.Field[string]` domain_name is the custom domain name - `OrganizationID param.Field[string]` organization_id is the ID of the organization to create the custom domain for - `AwsAccountID param.Field[string]` aws_account_id is the AWS account ID (deprecated: use cloud_account_id) - `CloudAccountID param.Field[string]` cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID) - `Provider param.Field[CustomDomainProvider]` provider is the cloud provider for this custom domain ### Returns - `type OrganizationCustomDomainNewResponse struct{…}` CreateCustomDomainResponse is the response message for creating a custom domain - `CustomDomain CustomDomain` custom_domain is the created custom domain - `ID string` id is the unique identifier of the custom domain - `CreatedAt Time` created_at is when the custom domain was created - `DomainName string` domain_name is the custom domain name - `OrganizationID string` organization_id is the ID of the organization this custom domain belongs to - `UpdatedAt Time` updated_at is when the custom domain was last updated - `AwsAccountID string` aws_account_id is the AWS account ID (deprecated: use cloud_account_id) - `CloudAccountID string` cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID) - `Provider CustomDomainProvider` provider is the cloud provider for this custom domain - `const CustomDomainProviderUnspecified CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"` - `const CustomDomainProviderAws CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_AWS"` - `const CustomDomainProviderGcp CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_GCP"` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) customDomain, err := client.Organizations.CustomDomains.New(context.TODO(), gitpod.OrganizationCustomDomainNewParams{ DomainName: gitpod.F("workspaces.acme-corp.com"), OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), AwsAccountID: gitpod.F("123456789012"), Provider: gitpod.F(gitpod.CustomDomainProviderAws), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", customDomain.CustomDomain) } ``` #### Response ```json { "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" } } ``` ## DeleteCustomDomain `client.Organizations.CustomDomains.Delete(ctx, body) (*OrganizationCustomDomainDeleteResponse, error)` **post** `/gitpod.v1.OrganizationService/DeleteCustomDomain` Removes a custom domain configuration from an organization. Use this method to: - Disable custom domain functionality - Remove outdated configurations - Clean up unused domains ### Examples - Delete custom domain configuration: Removes a specific custom domain configuration. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body OrganizationCustomDomainDeleteParams` - `OrganizationID param.Field[string]` organization_id is the ID of the organization to delete custom domain for ### Returns - `type OrganizationCustomDomainDeleteResponse interface{…}` DeleteCustomDomainResponse is the response message for deleting a custom domain ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) customDomain, err := client.Organizations.CustomDomains.Delete(context.TODO(), gitpod.OrganizationCustomDomainDeleteParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", customDomain) } ``` #### Response ```json {} ``` ## GetCustomDomain `client.Organizations.CustomDomains.Get(ctx, body) (*OrganizationCustomDomainGetResponse, error)` **post** `/gitpod.v1.OrganizationService/GetCustomDomain` Retrieves a specific custom domain configuration. Use this method to view custom domain details ### Examples - Get custom domain configuration: Retrieves details of a specific custom domain. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body OrganizationCustomDomainGetParams` - `OrganizationID param.Field[string]` organization_id is the ID of the organization to retrieve custom domain for ### Returns - `type OrganizationCustomDomainGetResponse struct{…}` - `CustomDomain CustomDomain` CustomDomain represents a custom domain configuration for an organization - `ID string` id is the unique identifier of the custom domain - `CreatedAt Time` created_at is when the custom domain was created - `DomainName string` domain_name is the custom domain name - `OrganizationID string` organization_id is the ID of the organization this custom domain belongs to - `UpdatedAt Time` updated_at is when the custom domain was last updated - `AwsAccountID string` aws_account_id is the AWS account ID (deprecated: use cloud_account_id) - `CloudAccountID string` cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID) - `Provider CustomDomainProvider` provider is the cloud provider for this custom domain - `const CustomDomainProviderUnspecified CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"` - `const CustomDomainProviderAws CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_AWS"` - `const CustomDomainProviderGcp CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_GCP"` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) customDomain, err := client.Organizations.CustomDomains.Get(context.TODO(), gitpod.OrganizationCustomDomainGetParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", customDomain.CustomDomain) } ``` #### Response ```json { "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" } } ``` ## UpdateCustomDomain `client.Organizations.CustomDomains.Update(ctx, body) (*OrganizationCustomDomainUpdateResponse, error)` **post** `/gitpod.v1.OrganizationService/UpdateCustomDomain` Updates custom domain configuration settings. Use this method to: - Update cloud provider settings - Change AWS account ID - Modify domain configuration ### Examples - Update AWS account ID: Changes the AWS account ID for the custom domain. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" domainName: "workspaces.acme-corp.com" awsAccountId: "987654321098" ``` ### Parameters - `body OrganizationCustomDomainUpdateParams` - `DomainName param.Field[string]` domain_name is the custom domain name - `OrganizationID param.Field[string]` organization_id is the ID of the organization to update custom domain for - `AwsAccountID param.Field[string]` aws_account_id is the AWS account ID (deprecated: use cloud_account_id) - `CloudAccountID param.Field[string]` cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID) - `Provider param.Field[CustomDomainProvider]` provider is the cloud provider for this custom domain ### Returns - `type OrganizationCustomDomainUpdateResponse struct{…}` UpdateCustomDomainResponse is the response message for updating a custom domain - `CustomDomain CustomDomain` custom_domain is the updated custom domain - `ID string` id is the unique identifier of the custom domain - `CreatedAt Time` created_at is when the custom domain was created - `DomainName string` domain_name is the custom domain name - `OrganizationID string` organization_id is the ID of the organization this custom domain belongs to - `UpdatedAt Time` updated_at is when the custom domain was last updated - `AwsAccountID string` aws_account_id is the AWS account ID (deprecated: use cloud_account_id) - `CloudAccountID string` cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID) - `Provider CustomDomainProvider` provider is the cloud provider for this custom domain - `const CustomDomainProviderUnspecified CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"` - `const CustomDomainProviderAws CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_AWS"` - `const CustomDomainProviderGcp CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_GCP"` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) customDomain, err := client.Organizations.CustomDomains.Update(context.TODO(), gitpod.OrganizationCustomDomainUpdateParams{ DomainName: gitpod.F("workspaces.acme-corp.com"), OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), AwsAccountID: gitpod.F("987654321098"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", customDomain.CustomDomain) } ``` #### Response ```json { "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" } } ``` ## Domain Types ### Custom Domain - `type CustomDomain struct{…}` CustomDomain represents a custom domain configuration for an organization - `ID string` id is the unique identifier of the custom domain - `CreatedAt Time` created_at is when the custom domain was created - `DomainName string` domain_name is the custom domain name - `OrganizationID string` organization_id is the ID of the organization this custom domain belongs to - `UpdatedAt Time` updated_at is when the custom domain was last updated - `AwsAccountID string` aws_account_id is the AWS account ID (deprecated: use cloud_account_id) - `CloudAccountID string` cloud_account_id is the unified cloud account identifier (AWS Account ID or GCP Project ID) - `Provider CustomDomainProvider` provider is the cloud provider for this custom domain - `const CustomDomainProviderUnspecified CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"` - `const CustomDomainProviderAws CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_AWS"` - `const CustomDomainProviderGcp CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_GCP"` ### Custom Domain Provider - `type CustomDomainProvider string` CustomDomainProvider represents the cloud provider for custom domain configuration - `const CustomDomainProviderUnspecified CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_UNSPECIFIED"` - `const CustomDomainProviderAws CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_AWS"` - `const CustomDomainProviderGcp CustomDomainProvider = "CUSTOM_DOMAIN_PROVIDER_GCP"`