rotatePrivateAppSecret
Requires permission settings:apps:manage.
Issue a new client secret for a private app. The old secret keeps working for the grace window (24 hours by default, 7 days at most).
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation RotatePrivateAppSecret($input: RotatePrivateAppSecretInputGql!) {
rotatePrivateAppSecret(input: $input) {
clientId
clientSecret
previousSecretExpiresAt
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation RotatePrivateAppSecret($input: RotatePrivateAppSecretInputGql!) {\n rotatePrivateAppSecret(input: $input) {\n clientId\n clientSecret\n previousSecretExpiresAt\n }\n}",
"variables": {
"input": {
"appId": "id"
}
}
}
EOF
Variables:
{
"input": {
"appId": "id"
}
}
Response:
{
"data": {
"rotatePrivateAppSecret": {
"clientId": "string",
"clientSecret": "string",
"previousSecretExpiresAt": "2025-01-15T00:00:00Z"
}
}
}
rotatePrivateAppSecret(
input: RotatePrivateAppSecretInputGql!
): PrivateAppSecretRotationResult!
Arguments
rotatePrivateAppSecret.input ● RotatePrivateAppSecretInputGql! non-null input
Which app, and how long the old secret keeps working.
Type
PrivateAppSecretRotationResult object
A rotated client secret. The new secret is shown only once; the old one keeps working until previousSecretExpiresAt.