curl -X POST https://api.vouchmark.com/v1/developers/api-keys/rotate \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"environment":"live"}'
{
"success": true,
"data": {
"id": "...",
"environment": "live",
"publicKey": "live_pk_...",
"secretPrefix": "live_sk_xxxx",
"secretSuffix": "abc",
"secretKey": "live_sk_...",
"rotatedAt": "...",
"createdAt": "..."
}
}
Developers
Rotate API key
Rotate the secret key for an environment.
POST
/
v1
/
developers
/
api-keys
/
rotate
curl -X POST https://api.vouchmark.com/v1/developers/api-keys/rotate \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"environment":"live"}'
{
"success": true,
"data": {
"id": "...",
"environment": "live",
"publicKey": "live_pk_...",
"secretPrefix": "live_sk_xxxx",
"secretSuffix": "abc",
"secretKey": "live_sk_...",
"rotatedAt": "...",
"createdAt": "..."
}
}
Generates a new secret key for the given environment and invalidates the previous one. The old secret stops working immediately.
Returns
Body
string
required
Environment to rotate. One of
sandbox or live.curl -X POST https://api.vouchmark.com/v1/developers/api-keys/rotate \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"environment":"live"}'
{
"success": true,
"data": {
"id": "...",
"environment": "live",
"publicKey": "live_pk_...",
"secretPrefix": "live_sk_xxxx",
"secretSuffix": "abc",
"secretKey": "live_sk_...",
"rotatedAt": "...",
"createdAt": "..."
}
}
201 Created.
Response fields
boolean
object
Show rotatedKey
Show rotatedKey
string
string
One of
sandbox or live.string
Full public key. Prefixed
live_pk_ (live) or test_pk_ (sandbox).string
First 12 characters of the new secret.
string | null
Last 3 characters of the new secret. May be
null.string
The full new secret key. Returned only in this response — copy it now and store it securely.
string
string
The
secretKey is shown in full only once, in this response. It is masked in List API keys thereafter.