PgBeam Docs
Projects

CreateCustomDomain

Add a custom domain

Registers a new custom domain for the project. Returns DNS verification instructions. Requires a Scale or Enterprise plan.

Usage

result, err := client.Projects.CreateCustomDomain(ctx, &pgbeam.CreateCustomDomainRequest{
    Domain: "...",
  })

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context
req*pgbeam.CreateCustomDomainRequestYesRequest body
req.DomainstringYesThe custom domain name to add (e.g., db.example.com).

Response

(*pgbeam.CustomDomain, error) — custom domain created.

Example

import pgbeam "github.com/pgbeam/pgbeam-go"

client := pgbeam.NewClient(&pgbeam.ClientOptions{
  APIKey: "pgb_your_api_key",
})

result, err := client.Projects.CreateCustomDomain(ctx, &pgbeam.CreateCustomDomainRequest{
    Domain: "...",
  })
if err != nil {
  log.Fatal(err)
}
fmt.Println(result)

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
403Custom domains require a Scale or Enterprise plan.
404Resource not found.
409Resource already exists or conflicts with current state.
429Rate limited. Try again later.

On this page