Create an API key.
Session only: a key cannot create keys.
POST/api/v1/api-keys
Keysession only
scopes must be listed; a key has approve only when it is in that list. The answer carries the token once; Koidog keeps only its hash. To call it outside the dashboard, send the dashboard's koidog_session cookie and Origin: https://app.koi.dog. No path or query parameters.
Headers.
Idempotency-Keystring
Makes a retry safe: the same key with the same request returns the first answer and does nothing else.
Body.
namestringrequired
A name for the key, shown in the dashboard and on the timeline. 1 to 80 characters.
scopesarrayrequired
Listed explicitly: there is no wildcard and no scope implies another. Any of read, crews, config, approve. At least 1 item.
rateLimitPerMinute1–6000
Requests a minute this key may make; past it the answer is 429 rate_limited. Default 600.
expiresAtstring
When the key stops working, as an ISO 8601 time in UTC (2027-01-01T00:00:00Z). Left out, it does not expire. Matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$.
Response.
201 Created: a JSON object. The example has placeholder values.
- 422 validation_failed
- The body does not match its schema; each problem is in
details.