Create an API key

Create a new API key.

Headers

AuthorizationstringRequired

Bearer token. Use Bearer YOUR_API_KEY.

Request

This endpoint expects an object.
namestringOptional
Key name.
expiry_datedatetimeOptional

Expiry date (ISO 8601).

max_usageintegerOptionalDefaults to -1

Max usage count. -1 = unlimited.

rate_limitintegerOptional
Calls per minute. Overridden by plan limit.
spending_limitdoubleOptional
Spending limit in USD for gateway usage.
is_testbooleanOptionalDefaults to false

Test key (true) or production key (false).

Response

Created API key.
idstring
API key ID.
namestring
Key name.
prefixstring
Key prefix.
is_testboolean
Test or production key.
expiry_datedatetime
Expiry date.
max_usageinteger

Max usage count. -1 = unlimited.

rate_limitinteger
Calls per minute.
spending_limitdouble
Spending limit in USD.
created_atdatetime
api_keystring

The API key value. Only returned on creation - store it securely.

key_usageinteger
Number of times this key has been used.

Errors

401
Unauthorized Error