Generated from Postwind commit a19b2e4 OpenAPI 0.1.0 synced

POST/api/v1/admin/keys

Admin keys only%!(EXTRA string=)Idempotency-KeyMCP tool: create_admin_key operationId create_admin_key

Create an admin key

Creates an admin key, which may do everything, and records key.created. The answer carries the key string, once. Admin keys only.

Parameters

NameInTypeDescription
Idempotency-Key header string

1–128 characters · pattern ^[!-~]{1,128}$

A key of the client’s choosing, one per request it means to send once (a UUID will do). A repeat with the same key and the same body within 24 h creates nothing again and gets the first answer, marked Idempotent-Replayed: true. The key belongs to the API key that sent it. Only a 2xx answer is kept: after any other answer the key is free again.

Request body

application/json · required

  • CreateAdminKeyRequest object
  • namestringrequired

    What the key is for: 1 to 128 characters, trimmed.

    example ops

  • expires_atstring · date-time | null

    When the key stops working, RFC 3339, later than now; null or left out: never.

Responses

201

The key and its key string, shown this once

HeaderTypeDescription
Cache-Controlstringno-store
Idempotent-Replayedstring · enumtrue when the answer is a replay of an earlier request with the same Idempotency-Key; absent otherwise.
LocationstringThe key’s URL (DELETE revokes it)
  • CreatedApiKey object · all fields required
  • created_atstring · date-time
  • expires_atstring · date-time | null
  • idstring · uuid
  • keystring | null

    The key string to send as Authorization: Bearer. It is not stored and no other answer shows it: keep it now. null in a replay (Idempotent-Replayed: true) of a request sent again with the same Idempotency-Key: the key was created by the first request, whose answer carried its string; revoke it and create another with a new Idempotency-Key if that answer was lost.

    example pw_prj_1a2b3c4d_...

  • The kind of an API key.

    • admin
    • project
  • last_used_atstring · date-time | null
  • namestring
  • prefixstring
  • project_idstring · uuid | null
  • revoked_atstring · date-time | null
  • scopesarray of Scope

409

A request with the same Idempotency-Key has not answered yet (idempotency_key_in_progress)

Problem (application/problem+json)

422

Invalid fields, every one in errors (validation_failed); or the Idempotency-Key was used in the last 24 h for another request (idempotency_key_reused), or is not 1 to 128 visible ASCII characters (validation_failed, field Idempotency-Key)

Problem (application/problem+json)

429

The key is over its rate limit, api.rate_limit_per_minute requests a minute on this node (rate_limited)

HeaderTypeDescription
Retry-AfterintegerSeconds until the key’s next request passes; rounded up.

Problem (application/problem+json)

504

Postwind’s storage did not answer within its time limit (storage_timeout). A change the request makes may still take effect: check before repeating it. A repeat with the same Idempotency-Key never runs it twice: it is 409 idempotency_key_in_progress until the key’s 24 h end

Problem (application/problem+json)