Skip to main content
POST
/
api
/
canary
/
authentication
/
api-key
/
create
Create API Key
curl --request POST \
  --url https://api.cashful.africa/api/canary/authentication/api-key/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "My API Key",
  "expiresIn": 3600,
  "prefix": "pk_live_",
  "metadata": {
    "env": "production"
  }
}
'
{
  "apiKey": {
    "id": "key_123",
    "name": "My API Key",
    "prefix": "pk_live_"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string

The name of the API key

Example:

"My API Key"

expiresIn
number

Expiration time in seconds

Example:

3600

prefix
string

Prefix for the API key

Example:

"pk_live_"

metadata
object

Metadata for the API key

Example:
{ "env": "production" }

Response

API key created successfully

apiKey
object
required

API key created successfully

Example:
{
"id": "key_123",
"name": "My API Key",
"prefix": "pk_live_"
}