Accounts

Issue a new API key

Requires api_keys:w.

post/v1/accounts/{id}/api-keys

Request

  • Base URL: https://api.honkio.ca
  • URL: https://api.honkio.ca/v1/accounts/{id}/api-keys
  • Auth: one of:
    • HTTP bearer
    • API key in header X-API-Key

Path parameters

idstring required

Headers

x-step-up-tokenstring

A token from POST /v1/auth/step-up with the api_keys:elevate scope. Only needed to request permissions broader than the calling key's own, or when the calling key is a dashboard session key.

Request body

mode'live' | 'test'

Defaults to the calling key's mode. A test key can only create test keys.

labelstring
permissionsobject

Per-resource permissions. Each key is a resource name; value is a string of allowed operations: r=read, w=write, m=modify, d=delete. Omit a resource to deny all access to it. Example: { "messages": "rw", "contacts": "r" }. When omitted, the new key gets the calling key's permissions. A key can only grant permissions it holds itself, unless the request carries an api_keys:elevate step-up token (X-Step-Up-Token). A test key can only create test keys. A dashboard session key (the one login mints) always needs that step-up to create a key, even one no broader than itself.

email_domain_idsstring[]

Restrict the key to sending email from these domains (ids from /v1/email-domains). Omitted: the key inherits the calling key's restriction, if any. A restricted key can only create keys restricted to a subset of its own domains, unless the request carries an api_keys:elevate step-up token.

Response

API key issued. The raw key is shown only once: store it securely.

keystring

Full API key (shown once only)

prefixstring

Non-secret prefix for display/identification

mode'live' | 'test'
permissionsDef0

Per-resource permissions.

email_domain_idsstring[] nullable
noticestring

Changes

No recorded changes to this operation across all 1 revision of this API.