Generated from Postwind commit a19b2e4 OpenAPI 0.1.0 synced

Keys HTTP API

POST/api/v1/projects/{project_id}/keys

create_api_key

Creates an API key of a project with the scopes it needs: read, write, send, keys.

Call it
to give an integration or another agent the least access it needs.
Needs
an admin key with project_id, or a project key with scope keys, which works in its own project (its project_id argument is ignored) and grants only scopes it holds and no later expiry than its own.
Returns
the key with key, the key string, shown this once and never again: hand it to its user now. The same as POST /api/v1/projects/{project_id}/keys.

Arguments

  • object
  • namestringrequired

    What the key is for: 1 to 128 characters.

    example billing backend

  • scopesarray of stringrequired

    What the key may do: one or more of read, write, send, keys, each once. A project key grants only scopes it holds itself.

    example ["read","write"]

  • expires_atstring · date-time | null

    When the key stops working, RFC 3339, later than now; null or left out: never. A project key that expires grants no later expiry.

    example 2027-01-01T00:00:00Z

  • project_idstring · uuid | null

    The project to create the key in. An admin key must pass it; a project key’s own project is used and this is ignored.

No other arguments are accepted.

Result

The result comes back as structuredContent, with the same JSON as a text block.

  • object · all fields required
  • created_atstring · date-time
  • expires_atstring · date-time | null
  • idstring · uuid
  • keystring

    The key string to send as Authorization: Bearer. It is not stored and no other call shows it: hand it to its user now.

  • The kind of an API key.

    admin Everything, projects and admin keys included.

    project One project, within its scopes.

  • last_used_atstring · date-time | null
  • namestring
  • prefixstring
  • project_idstring · uuid | null
  • revoked_atstring · date-time | null
  • scopesarray of KeyScope

Definitions

KeyKind

The kind of an API key.

string · enum

admin Everything, projects and admin keys included.

project One project, within its scopes.

KeyScope

A right of a project key. An admin key has all of them.

string · enum

  • read
  • write
  • send
  • keys

Errors

A failed call answers isError: true with a code from the same table as the HTTP API, and detail. How tools report errors

HTTP API

The same operation over HTTP: POST /api/v1/projects/{project_id}/keys