CustomDomain™ docs
API referenceProvider accounts

Connect a provider account with a key

POST
/provider-accounts

Keeps a DNS provider or registrar key for the workspace, encrypted (GRANT_ENCRYPTION_KEY; 503 without it). The key is checked first by listing the provider's domains, or, for a provider that cannot list them, by reading one of the selected domains or check_domain; with neither, 400 check_domain_required, and a key is never kept unchecked. access is continuous (kept until revoked, used only to put back records it wrote that disappear where the deployment has automatic repair on, remove records when a domain is removed, and re-apply the records it wrote on request) or one_time (usable for an hour, and deleted as soon as the chosen domains are connected or the hour passes). scope is all of the account's domains or selected ones. The key is never returned.

Anyone whose role operates applications may connect a key, read the accounts and revoke one. Changing an account's access, scope or domains, connecting domains with it and replacing its key take an admin, an owner or the member who connected it (can_manage).

AuthorizationBearer <token>

Long-lived tenant API key, cd_live_… (production) or cd_test_… (staging, development), stored hashed. Keys created before the switch to cd_ start with sk_live_… / sk_test_… and are still accepted. Scoped to the owning application's tenant.

In: header

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

curl -X POST "https://example.com/provider-accounts" \  -H "Content-Type: application/json" \  -d '{    "provider": "string",    "credential": {      "token": "string"    }  }'
{  "account": {    "id": "string",    "kind": "api_key",    "provider": "string",    "provider_name": "string",    "label": "string",    "access": "continuous",    "scope": "all",    "domains": [      "string"    ],    "credential_held": true,    "status": "active",    "last_error": "string",    "created_by": "string",    "last_used_at": "2019-08-24T14:15:22Z",    "expires_at": "2019-08-24T14:15:22Z",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "connections": [      {        "id": "string",        "application_id": "string",        "domain": "string",        "status": "string"      }    ],    "uses": [      "string"    ],    "can_manage": true  },  "zones": [    "string"  ]}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}
{  "code": "string",  "title": "string",  "details": "string"}
Empty
{  "code": "string",  "title": "string",  "details": "string"}