Rotate a company API key

Replace an API key without a gap.

Use this endpoint to replace a company API key. It issues a new key with the same label and settings, shown in the response once, and schedules the old key to stop working after expireInHours hours, from 0 to 24. In that window both keys work, so you can move the integration over without an outage. With 0, the old key stops now.

Once the old key has expired, requests that use it get a 401. See Authentication & API tokens.

A key that already has an expiry scheduled can't be rotated: cancel the expiry first, or wait for it.

Errors

StatusMeaning
400The key already has an expiry scheduled, or has already expired.
401The API key is missing, malformed or expired.
404No company with this ID belongs to your partner account, or the company has no key with this ID.
412Custom API integrations aren't enabled for this company.
422expireInHours is missing, or isn't from 0 to 24.
📘

Part of Company API keys. Authenticate with your partner API key, as for every endpoint in this section: see Authentication.

Path Params
integer
required

The company's ID, as returned when the company was created.

string
required

The key's ID.

Body Params
integer
required
0 to 24

Hours until the key stops working, from 0 to 24. 0 ends it now.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Choose an example:
application/json