Skip to content
Docs

Request Secrets Rotation

Optional
POST/v1/installations/{installationId}/resources/{resourceId}/secrets/rotate
Request rotation of secrets for a specific resource
Expected for any integration that provisions resources with secrets. Vercel calls this endpoint when a user requests credential rotation through the dashboard, for example after a security incident. Return new credentials that Vercel stores as updated environment variables.
/v1/installations/{installationId}/resources/{resourceId}/secrets/rotate
const response = await fetch('/v1/installations/installationId/resources/resourceId/secrets/rotate', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"reason": "Customer requested refund",
"delayOldSecretsExpirationHours": "123"
}),
});
const data = await response.json();
console.log(data);
Response
{
"sync": "false"
}
Errors
{
"error": {
"code": "validation_error",
"message": "string",
"user": {
"message": "string",
"url": "https://example.com"
},
"fields": [
{
"key": "string",
"message": "string"
}
]
}
}
AuthorizationUser Authentication

Default authentication mechanism

AuthorizationSystem Authentication

Default authentication mechanism

installationIdstringRequired
resourceIdstringRequired
X-Vercel-AuthstringOptional
The auth style used in the request (system, user, etc)
Idempotency-KeystringOptional
A unique key to identify a request across multiple retries

This endpoint expects an object.

reasonstringOptional
Optional reason for the secrets rotation request.
delayOldSecretsExpirationHoursnumberOptional
Delay in hours before old secrets expire after rotation. The value can be fractional.
200Return the secrets rotation result
syncbooleanRequired
Indicates that the secrets rotation will be performed asynchronously. It's expected that the update-resource-secrets API will be called shortly after this response to complete the rotation.
400Input has failed validation
errorobjectRequired
403Operation failed because the authentication is not allowed to perform this operation
errorobjectRequired
409Operation failed because of a conflict with the current state of the resource
errorobjectRequired
Request Secrets Rotation | Partner API