Rotate Service Account API Key Private Preview
Rotates the API key for the specified service account and generates a new secret.
During the optional overlap period, both the old and new secrets remain valid, allowing zero-downtime credential rotation.
Note: Only a regular user can perform this operation.
Request schema
Path parameters
The unique identifier for the user within the account.
Header parameters
HTTP: basicAuth
HTTP AuthorizationScheme: basic
Request
The number of days until the API key expires. Defaults to 90. Maximum is 365.
The number of days the old and new API keys both remain valid after rotation. Maximum is 30 days.
POST /v1/users/userId/api-keys/rotate HTTP/1.1 Accept: application/json Authorization: BasicContent-Type: application/json Host: api.fivetran.com Content-Length: 55 { "expiration_period_days": 90, "overlap_days": 7 }
Responses
200
Response status code
Response status text
The public identifier of the API key.
The secret portion of the API key. Only returned at creation time and cannot be retrieved again.
The status of the API key. Possible values: ACTIVE: The key has a single active secret, ACTIVE_GRACE: The key has two active secrets during rotation overlap, and EXPIRED: The key has expired.
The timestamp when the API key expires.
The timestamp when the previous secret expires after rotation. Only present during the overlap period.
{ "code": "Success", "message": "API key rotated successfully", "data": { "key_value": "key_abc123", "key_secret": "secret_xyz789", "key_status": "ACTIVE", "expires_at": "2024-04-01T00:00:00Z", "overlap_expires_at": "2024-03-08T00:00:00Z", "last_rotated_at": "2019-08-24T14:15:22Z" } }