Create an API key

A key for an app you build, to keep as a secret (for example TEXTKIT_API_KEY).

POST/v1/api_keys

Body Parameters

  • namestringrequired

    What the key is for, e.g. "Booking app" At most 60 characters.

  • scopesarray of string

    Limit the key to these scopes (see /docs/authentication). Omit for full access (full-access callers only).

Details

Same mode as the calling key. A key with limited scopes can only create keys with scopes inside its own.

The secret is returned once. The owner and admins are emailed. 20 per hour.

Responses

  • 201ApiKey

    The key, with its secret (shown once)

  • 400Error

    Invalid request

  • 401Error

    Missing, malformed, or revoked API key

  • 402Error

    Billable live calls only: the prepaid credit balance cannot cover the call (insufficient_credits); nothing was done or charged

  • 429Error

    Rate limit or quota exceeded

Response Fields

  • idstring
  • objectapi_key
  • namestring
  • modetest, live
  • prefixstring

    The start of the secret, for recognizing it

  • scopesarray of string

    Empty = full access

  • statusactive, paused, revoked
  • created_atstring (date-time)
  • last_used_atstring (date-time)

    Nullable.

Errors

Every error has the same JSON shape, and request_id matches the X-Request-Id response header. Errors lists every code and what to do about it.

  • 400

    Invalid request

  • 401

    Missing, malformed, or revoked API key

  • 402

    Billable live calls only: the prepaid credit balance cannot cover the call (insufficient_credits); nothing was done or charged

  • 429

    Rate limit or quota exceeded