Skip to content

Create a secondary API secret

POST
/v1/Accounts/{auth_id}/ApiCredentials/Secondary
curl --request POST \
--url https://api.siprtc.io/v1/Accounts/example/ApiCredentials/Secondary \
--header 'Authorization: Basic <credentials>'

First step of a rotation without downtime: creates a second secret that authenticates alongside the primary from now on, and returns it in full. This reply is the only one that carries it without revealApiSecret. Move your applications to the new secret, then make it the primary with promoteSecondaryApiSecret, or discard it with deleteSecondaryApiSecret.

An account has at most one secondary secret (409 while one exists). The secret is also accepted where you call a sub-account’s paths with your own credentials. The change applies at once.

Only the account itself may call this: {auth_id} must be the Auth ID you authenticate with (a parent cannot manage a sub-account’s credentials, 403), and agent, supervisor and member accounts have no API credentials to manage (403). Replies carry Cache-Control: no-store.

auth_id
required
string

Your Auth ID.

The credentials, with the new secondary secret in full.

Media type application/json
object
data

The credentials, with the new secondary secret in full.

object
auth_id

The account’s Auth ID: the Basic-auth user name.

string
primary

The primary secret, the one in use.

object
hint

Eight bullets and the secret’s last four characters.

string
rotated_at

When a secondary secret was last promoted to primary (RFC 3339), or null if never.

string
rotated_by

Auth ID (or sign-in id) that promoted it, or null if never.

string
secondary

The secondary secret, or null when there is none.

object
created_at

When the secondary secret was created (RFC 3339).

string
created_by

Auth ID (or sign-in id) that created it.

string
hint

Eight bullets and the secret’s last four characters.

string
secret

The new secondary secret in full. Store it now; later reads show only its hint.

string
status

Always “success”.

string

Example

{
"data": {
"auth_id": "AC000000000000000001",
"primary": {
"hint": "••••••••0000",
"rotated_at": "2026-11-20T10:00:00Z",
"rotated_by": "AC000000000000000001"
},
"secondary": {
"created_at": "2026-11-26T09:30:00Z",
"created_by": "AC000000000000000001",
"hint": "••••••••1111"
},
"secret": "EXAMPLESECRET000000000000000000000000000"
},
"status": "success"
}

Authentication failed: wrong or missing credentials, a disabled account, or an {auth_id} that is neither you nor your direct sub-account.

Media type application/json
string

Example generated

example

{auth_id} is not the authenticated account, or the account has no API credentials to manage.

Media type application/json
object
error

The underlying error text. Only some 400 responses of the tenant list carry it.

string
message

What went wrong, in English.

string
status

Always “failed”.

string

Example

{
"error": "sql: connection is already closed",
"message": "Account Details not found",
"status": "failed"
}

The account was not found.

Media type application/json
object
error

The underlying error text. Only some 400 responses of the tenant list carry it.

string
message

What went wrong, in English.

string
status

Always “failed”.

string

Example

{
"error": "sql: connection is already closed",
"message": "Account Details not found",
"status": "failed"
}

A secondary secret already exists: promote or delete it first.

Media type application/json
object
error

The underlying error text. Only some 400 responses of the tenant list carry it.

string
message

What went wrong, in English.

string
status

Always “failed”.

string

Example

{
"error": "sql: connection is already closed",
"message": "Account Details not found",
"status": "failed"
}

The secret could not be created.

Media type application/json
object
error

The underlying error text. Only some 400 responses of the tenant list carry it.

string
message

What went wrong, in English.

string
status

Always “failed”.

string

Example

{
"error": "sql: connection is already closed",
"message": "Account Details not found",
"status": "failed"
}