メインコンテンツへスキップ
POST
/
api
/
v0
/
service-accounts
/
{serviceAccountId}
/
api-keys
/
{keyId}
/
rotate
Rotate a service account API key
curl --request POST \
  --url https://api.factory.ai/api/v0/service-accounts/{serviceAccountId}/api-keys/{keyId}/rotate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "expiresAt": 1,
  "gracePeriodMinutes": 5
}
'
{
  "apiKey": {
    "id": "<string>",
    "value": "<string>",
    "fingerprint": "<string>",
    "name": "<string>",
    "expiresAt": 123
  }
}

承認

Authorization
string
header
必須

Factory API key or JWT token for authentication

パスパラメータ

serviceAccountId
string
必須

Service account ID

Minimum string length: 1
keyId
string
必須

API key ID

Minimum string length: 1

ボディ

application/json
expiresAt
integer
必須範囲: x > 0
gracePeriodMinutes
integer

How long (0-10 minutes) the rotated-from key stays valid after rotation. Omit or 0 revokes it immediately. Rejected with a 400 if the key would expire before the grace window ends (the grace period never extends a key lifetime).

必須範囲: 0 <= x <= 10

レスポンス

Response for status 200

apiKey
object
必須