Credentials

Roll a secret

Creates a new secret for the account's application or client credential in the given environment and returns it once. The secret it replaces keeps working until expireOldIn has passed: 7 days by default for a client secret, until it is revoked for an app secret, so shipped apps keep working until they are updated. A credential holds at most two active secrets, so a third roll is refused until one is revoked or has expired. The caller must be a member of the account, signed in with a user token.

post/api/v1/account/credentials/roll

Request

  • Base URL
    https://api.sahha.ai (the document declares no server; this is the origin it was published from)
  • Auth
    API key in header Authorization

Query parameters

environmentstring

Request body

accountIdstring uuid

The account the credential belongs to.

environmentstring

sandbox or production. It must be the environment the request is sent to.

credentialTypestring

application or client.

expireOldInstring nullable

How long the secret being replaced keeps working: immediate, 24h, 7d, 30d or untilRevoked. Defaults to 7d for a client secret and untilRevoked for an app secret. Ignored when the credential has no secret yet.

Example request

{
  "environment": "sandbox",
  "credentialType": "client",
  "expireOldIn": "7d"
}

Response

The new secret and every secret of the credential.

secretstring

The new secret. It is shown once and cannot be retrieved again; store it now.

secretIdstring uuid

The new secret's id, as listed in secrets.

Changes

No recorded changes to this operation across all 1 revision of this API.