Skip to content

Rotate keys

POST /keys issues a new partner key. The key you called with keeps working for overlap_days, so you can deploy the new key before the old one stops.

curl -X GET "https://sandbox-api.tryflume.ai/partner/v1/keys" \
-H "X-Flume-Partner-Key: $FLUME_PARTNER_KEY"
Response: 200
{
"keys": [
{
"key_id": "pk_3f9a1c2e5b7d4a6f8e0c1b2d3a4f5e6d",
"prefix": "sk_dev_acme_Qm4t",
"label": "rotation 2026-Q4",
"status": "ACTIVE",
"created_at": "2026-10-16T08:00:00Z",
"last_used_at": "2026-10-16T09:14:22Z",
"expires_at": null
},
{
"key_id": "pk_9e1b4d7a2c5f4068b3a1d9c7e5f2a0b4",
"prefix": "sk_dev_acme_8f3k",
"label": null,
"status": "EXPIRING",
"created_at": "2026-07-02T10:30:00Z",
"last_used_at": "2026-10-16T07:58:41Z",
"expires_at": "2026-10-23T08:00:00Z"
}
]
}
statusMeaning
ACTIVEWorking
EXPIRINGReplaced by a newer key. Works until expires_at
REVOKEDStopped by you
EXPIREDIts overlap ran out

The list never contains a secret.

Idempotency-Key is required.

curl -X POST "https://sandbox-api.tryflume.ai/partner/v1/keys" \
-H "X-Flume-Partner-Key: $FLUME_PARTNER_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"label": "rotation 2026-Q4",
"overlap_days": 7
}'
Response: 201
{
"key_id": "pk_3f9a1c2e5b7d4a6f8e0c1b2d3a4f5e6d",
"prefix": "sk_dev_acme_Qm4t",
"label": "rotation 2026-Q4",
"status": "ACTIVE",
"created_at": "2026-10-16T08:00:00Z",
"last_used_at": null,
"expires_at": null,
"secret": "sk_dev_acme_Qm4tW…"
}
  • secret is the new key. It is shown once.
  • The key you called with becomes EXPIRING. It stops after overlap_days.
  • overlap_days is 0 to 30. The default is 7.
  • A replay of the same Idempotency-Key returns secret: null.
  1. Store the new secret in your secret manager.
  2. Deploy it everywhere.
  3. Check last_used_at on the old key with GET /keys.
  4. Revoke the old key, or let its overlap run out.
curl -X DELETE "https://sandbox-api.tryflume.ai/partner/v1/keys/pk_9e1b4d7a2c5f4068b3a1d9c7e5f2a0b4" \
-H "X-Flume-Partner-Key: $FLUME_PARTNER_KEY"

Response: 204. No body.

A revoke takes effect at once. You cannot revoke your only working key.

SandboxLive
Active keys52
Keys issued in 24 hours101
The leaked key isDo this
Not the one you call withCall DELETE /keys/{key_id} on it. It stops at once
The one you call withCall POST /keys with overlap_days: 0. The old key stops at once. Deploy the new secret

Then tell Flume. Send the key prefix, never the key.

You getDo this
409 KEY_LIMIT_REACHEDRevoke a key you no longer use, then rotate
429 KEY_ROTATION_RATE_LIMITEDWait. Your current key keeps working
409 LAST_ACTIVE_KEYIssue a replacement before you revoke
400 IDEMPOTENCY_KEY_REQUIRED on POST /keysSend the Idempotency-Key header
422 VALIDATION_FAILED on POST /keysFix the field named in error.field, for example overlap_days
404 NOT_FOUNDCheck key_id