Skip to content

Create an API key

POST
/v1/keys
curl --request POST \
--url https://api.pensievelabs.co/v1/keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "Staging services" }'

The secret is in this response only.

Idempotency-Key
string
<= 255 characters

Any unique string. Sending it again within 24 hours returns the first response.

Media typeapplication/json
object
name
required
string
>= 1 characters <= 80 characters

Example

{
"name": "Staging services"
}

The key and its secret.

Media typeapplication/json
object
id
required
string
object
required
Allowed value: api_key
name
required
string
prefix
required
string
secret

The whole key, in the response that creates it only.

string
created_at
required
string format: date-time
last_used_at
required
string | null format: date-time
revoked_at
required
string | null format: date-time

Example

{
"id": "key_8c1f20",
"object": "api_key",
"prefix": "pk_live_7f3a"
}

Something went wrong; error.type says what.

Media typeapplication/json
object
error
required
object
type
required
string
Allowed values: invalid_request authentication permission not_found conflict rate_limit not_available server
message
required
string
param

The request field the error is about.

string | null
request_id
required
string

Example

{
"error": {
"type": "invalid_request"
}
}