Account

Issue or rotate the API key

POST/v1/account/api-key

Issues the first key, or rotates the current one. Plaintext returned once.

Dashboard session · API keys refused.

Request

Shell
curl -fsS "$API/v1/account/api-key" \
  -H "Authorization: Bearer $DASHBOARD_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "expected_generation": 3 }'

Response

200 OK
{
  "api_key": "payday_live_…",
  "generation": 4,
  "replaced_previous_key": true
}

Dashboard session only. On rotation the previous key remains valid for 24 hours. expected_generation must equal the account's current generation.

Body

expected_generationintegerrequired

Response

api_keystring
Plaintext. Once.
generationinteger
replaced_previous_keyboolean

Status codes

  • 201First issuance.
  • 200Rotation.
  • 401identity_unauthorized API key presented.
  • 409api_key_generation_conflict Generation mismatch.