domainBindings.create
POST
/domain-bindings
const url = 'https://example.com/api/domain-bindings';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"projectId":"example","environmentId":"example","resourceId":"example","serverId":"example","destinationId":"example","domainName":"example","pathPrefix":"/","proxyKind":"none","tlsMode":"auto","redirectTo":"example","redirectStatus":301,"certificatePolicy":"auto","idempotencyKey":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/domain-bindings \ --header 'Content-Type: application/json' \ --data '{ "projectId": "example", "environmentId": "example", "resourceId": "example", "serverId": "example", "destinationId": "example", "domainName": "example", "pathPrefix": "/", "proxyKind": "none", "tlsMode": "auto", "redirectTo": "example", "redirectStatus": 301, "certificatePolicy": "auto", "idempotencyKey": "example" }'Creates a custom domain binding for a resource. Public docs: /docs/access/domains/custom-domains/#domain-binding-purpose
Request Body required
Section titled “Request Body required ” Media type application/json
object
projectId
required
string
environmentId
required
string
resourceId
required
string
serverId
required
string
destinationId
required
string
domainName
required
string
pathPrefix
string
proxyKind
required
string
tlsMode
string
redirectTo
string
certificatePolicy
string
idempotencyKey
string
Responses
Section titled “ Responses ”OK
Media type application/json
object
id
required
string
Example generated
{ "id": "example"}