curl --request POST \
--url https://api.usedatabrain.com/api/v2/data-app/rotate-api \
--header 'Authorization: Bearer 550e8400-e29b-41d4-a716-446655440000' \
--header 'Content-Type: application/json' \
--data '{
"expireAt": 0
}'
{
"key": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
curl --request POST \
--url https://api.usedatabrain.com/api/v2/data-app/rotate-api \
--header 'Authorization: Bearer 550e8400-e29b-41d4-a716-446655440000' \
--header 'Content-Type: application/json' \
--data '{
"expireAt": 0
}'
{
"key": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
Rotate your Data App API key to enhance security and manage key lifecycle effectively.
curl --request POST \
--url https://api.usedatabrain.com/api/v2/data-app/rotate-api \
--header 'Authorization: Bearer 550e8400-e29b-41d4-a716-446655440000' \
--header 'Content-Type: application/json' \
--data '{
"expireAt": 0
}'
{
"key": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
curl --request POST \
--url https://api.usedatabrain.com/api/v2/data-app/rotate-api \
--header 'Authorization: Bearer 550e8400-e29b-41d4-a716-446655440000' \
--header 'Content-Type: application/json' \
--data '{
"expireAt": 0
}'
{
"key": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
Authorization header is the key being rotated. You only need to provide expireAt in the request body — no key field required.Authorization header. The key used for authentication is the key that will be expired and replaced with a new one.
To access your data app API key:
Authorization: Bearer 550e8400-e29b-41d4-a716-446655440000
application/json for all requests.Content-Type: application/json
Show Common expiration durations
0 - Expire immediately (instant rotation)300 - 5 minutes3600 - 1 hour86400 - 24 hours604800 - 7 days3600) to allow time for updating your applications without service interruption.| Status Code | Description |
|---|---|
200 | OK - Key rotated successfully |
400 | Bad Request - Invalid request parameters or invalid key state |
401 | Unauthorized - API key not found in DB or already expired |
500 | Internal Server Error - Server error occurred |
| Error Code | HTTP Status | Description |
|---|---|---|
INVALID_REQUEST_BODY | 400 | Missing or invalid expireAt parameter |
AUTHENTICATION_ERROR | 400 / 401 | API key missing or not a valid UUID (400); or not found / already expired in DB (401) |
INVALID_DATA_APP_API_KEY | 400 | Token is a service token (no dataAppId), key not found, belongs to a different org, or the key already has an expiry date set |
INTERNAL_SERVER_ERROR | 500 | Server error |