PgBeam Docs
Projects

Add a custom domain

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

Feature flag: custom-domains

This endpoint is currently under a feature flag and available only to select testers. It may change or be removed before general availability.

At a glance

ItemValue
MethodPOST
Path/v1/projects/{project_id}/domains
AuthAuthorization: Bearer <token-or-api-key>

Quick request

Use this as a starting point. Replace the placeholder IDs, set PGBEAM_TOKEN, and create body.json from the schema below.

curl -X POST \
  "$PGBEAM_API_URL/v1/projects/<project_id>/domains" \
  -H "Authorization: Bearer $PGBEAM_TOKEN" \
  -H "Content-Type: application/json" \
  --data @body.json
POST
/v1/projects/{project_id}/domains
AuthorizationBearer <token>

JWT issued by Better Auth. Verified via JWKS.

In: header

Path Parameters

project_id*string

Unique project identifier (prefixed, e.g. prj_xxx).

Match^[a-zA-Z0-9_.-]+$

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.pgbeam.com/v1/projects/string/domains" \  -H "Content-Type: application/json" \  -d '{    "domain": "string"  }'
{
  "id": "dom_01h455vb4pex5vsknk084sn02q",
  "project_id": "string",
  "domain": "db.example.com",
  "verified": true,
  "verified_at": "2019-08-24T14:15:22Z",
  "tls_cert_expiry": "2019-08-24T14:15:22Z",
  "dns_verification_token": "string",
  "dns_instructions": {
    "cname_host": "db.example.com",
    "cname_target": "abc.aws.pgbeam.app",
    "txt_host": "_pgbeam-verify.db.example.com",
    "txt_value": "pgbeam-verify=abc123token",
    "acme_cname_host": "_acme-challenge.db.example.com",
    "acme_cname_target": "_acme-challenge.abc.aws.pgbeam.app"
  },
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}