Docs
/
/

API keys mAPI reference

Complete reference documentation for the API keys resource.

API keys

#

API keys are used to authenticate requests to the Knock API.

Exchange for API key

#

Given an authenticated service token, exchanges it for an API key that can be used to make requests to the public API. Returns the environment's secret key by default. Pass type=public to get its public key instead, for client-side integrations.

Endpoint

POST/v1/api_keys/exchange

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

type
enum(string)

The type of API key to return: secret or public.

secretpublic

Returns

ExchangeForApiKeyResponse

Returns an API key that can be used to make requests to the public API.

api_key
string

The API key exchanged from the service token, of the requested type.

New chat