Give an account a new key
Give an account a new key: CustomDomain™ API reference in the provider accounts group. Covers request parameters, the request body, responses and error codes.
A new key for an account, in one of two ways (method). Both take an admin, an owner or the member who connected the account (403 otherwise), and the key is recorded in the audit log (provider_account.key_replaced).
api_key (the default), for a key a person pasted: for an account the provider stopped accepting, or a one time account whose key was deleted. Everything is checked before anything is kept: the access mode, then the key (listing the provider's domains, or reading check_domain, a selected domain or a domain the account connected, for a provider that cannot list them), and for a selected account that the key reaches every selected domain. params sent with the key replace the kept ones. A key made at a secure sign-in answers 409: it is renewed by signing in again, not by pasting a key. continuous access (asked, or the account's own) for a credential that is used once and never kept answers 422 use_once_credential; send access one_time.
secure_sign_in, for a key made at a secure sign-in a member started in the console: starts the same account sign in as POST /provider-accounts:sign-in, for the account's own provider and application, and answers 201 with session_id and popup_url. The new key swaps into this same account when the person keeps it (POST /browser-sessions/{sid}:keep with an empty body), so the account keeps its id, its domains, its scope and the domains linked to it; only its key changes, it is active again with its daily check started afresh, and the key it replaces is named for deletion at the provider (replaced_key). It is the console's own call (an API key on the signed visitor forward, 403 browser_account_unavailable otherwise) and takes the sign in's body (return_origin, consent_version, locale, viewport_hint) and no key. A key a person pasted is renewed by pasting (409), and a key a customer's own secure sign-in made is renewed by that customer, never from the console (403). The keep refuses a key of another provider account (422 different_account): where the provider names the account, the two must be the same; where it does not (IONOS), the new key must list every domain the account holds. An account that holds no domain and has no account number gives nothing to compare, so its renewal is refused (422 account_not_verifiable): remove the account and add it again with a new sign in. The refused key stays pending and is named for deletion when the sign in is cancelled.
Authorization
apiKey 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
Path Parameters
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
application/json
application/json
curl -X POST "https://example.com/provider-accounts/string/reconnect" \ -H "Content-Type: application/json" \ -d '{}'{ "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" }}{ "session_id": "string", "popup_url": "http://example.com"}{ "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" }}{ "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" }}{ "code": "account_not_verifiable", "title": "string", "details": "string", "challenge": { "value": "string", "bits": 1, "expires_at": "2019-08-24T14:15:22Z" }}