CustomDomain Docs
ReferenceAPI referenceProvider accounts

Connect a provider account with a key

Connect a provider account with a key: CustomDomain™ API reference in the provider accounts group. Covers parameters, request body, responses and error codes.

POST
/provider-accounts

Keeps a DNS provider or registrar key for the workspace, encrypted (503 when keys cannot be kept). 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.

A provider whose credential is a login or a short lived token (ALL-INKL, Arsys, Azure DNS, Binary Lane, Google Cloud DNS, INWX, Loopia, Openprovider, Plesk, Subreg) is used once and never kept: access defaults to one_time for it, and continuous answers 422 use_once_credential.

Anyone whose role operates applications may connect a key and read the accounts. Renaming an account, changing its access, scope or domains, listing the domains its key reaches, connecting domains with it, replacing its key, renewing it by signing in again, checking it and removing it take an admin, an owner or the member who connected it (can_manage); a key a customer's sign-in made, which no member connected, is managed by an admin or an owner alone. Every change, every Check now (provider_account.checked) and every call that connects domains (provider_account.domains_connected) is recorded in the audit log (provider_account.*, GET /audit).

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": {    "needs_you": {      "reason": "refused",      "until": "2019-08-24T14:15:22Z"    },    "health": {      "state": "ok",      "checked_at": "2019-08-24T14:15:22Z",      "failures": 0    },    "made_by": {      "how": "pasted",      "by": "string"    },    "enforced_by": "provider",    "more_domains": [      "string"    ],    "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,    "application_id": "string",    "application_ids": [      "string"    ],    "origin": "browser_agent",    "agent_key": {      "name": "string",      "scopes": [        "string"      ],      "account": "string",      "session_id": "string",      "verified_at": "2019-08-24T14:15:22Z",      "expires_at": "2019-08-24T14:15:22Z",      "notice": "d30",      "reconnect_reason": "expiring",      "reconnect_sent_at": "2019-08-24T14:15:22Z",      "renewed_at": "2019-08-24T14:15:22Z",      "old_key": "revoke_by_hand",      "revoke_url": "http://example.com",      "rights": [        "transfer"      ]    },    "owner_kind": "workspace",    "end_user_ref": "string",    "account_ref": "string"  },  "zones": [    "string"  ]}
{  "code": "account_not_verifiable",  "title": "string",  "details": "string",  "challenge": {    "value": "string",    "bits": 1,    "expires_at": "2019-08-24T14:15:22Z"  }}
{  "code": "account_not_verifiable",  "title": "string",  "details": "string",  "challenge": {    "value": "string",    "bits": 1,    "expires_at": "2019-08-24T14:15:22Z"  }}
{  "code": "account_not_verifiable",  "title": "string",  "details": "string",  "challenge": {    "value": "string",    "bits": 1,    "expires_at": "2019-08-24T14:15:22Z"  }}
Empty
{  "code": "account_not_verifiable",  "title": "string",  "details": "string",  "challenge": {    "value": "string",    "bits": 1,    "expires_at": "2019-08-24T14:15:22Z"  }}