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
const result = await api.projects.createCustomDomain({
pathParams: { project_id: "prj_xxx" },
body: {
domain: "db.example.com",
},
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| pathParams.project_id | string | Yes | Unique project identifier (prefixed, e.g. prj_xxx). |
| body.domain | string | Yes | The custom domain name to add (e.g., db.example.com). |
Response
Promise<CustomDomain> — custom domain created.
Example
import { PgBeamClient } from "pgbeam";
const client = new PgBeamClient({
token: "pbk_...",
baseUrl: "https://api.pgbeam.com",
});
const result = await client.api.projects.createCustomDomain({
pathParams: { project_id: "prj_xxx" },
body: {
domain: "db.example.com",
},
});Errors
| Status | Description |
|---|---|
| 400 | Invalid request parameters. |
| 401 | Missing or invalid authentication. |
| 403 | Custom domains require a Scale or Enterprise plan. |
| 404 | Resource not found. |
| 409 | Resource already exists or conflicts with current state. |
| 429 | Rate limited. Try again later. |