Skip to content

Create API key

POST
/v1/api-keys

Create a new API key for the project. The full key value is only returned once in this response - store it securely as it cannot be retrieved again.

Important: The plaintext key in the response is the only time you will see the full key. Store it securely immediately.

object
label

Optional human-readable label for the key

string
<= 255 characters
Example
Production backend
Examples

Create an API key with label

{
"label": "Production backend"
}

API key created successfully

object
data
object
key_id

Unique key identifier

string
Example
key_abc123
key

The full API key - shown only once! Store this securely as it cannot be retrieved again.

string
Example
hb_live_abcdefghijklmnopqrstuvwxyz123456
prefix

First 11 characters of the key (for identification)

string
Example
hb_live_abc
label

Human-readable label

string
Example
Production backend
created_at
string format: date-time
Example
2025-12-06T01:30:00Z
meta
object
request_id

Unique identifier for this request (useful for support)

string
Example
req_xyz123
Example
{
"data": {
"key_id": "key_abc123",
"key": "hb_live_abcdefghijklmnopqrstuvwxyz123456",
"prefix": "hb_live_abc",
"label": "Production backend",
"created_at": "2025-12-06T01:30:00Z"
},
"meta": {
"request_id": "req_xyz123"
}
}

Invalid request

object
error
object
code

Machine-readable error code

string
Example
INVALID_REQUEST
message

Human-readable error message

string
Example
endpoint must be a valid HTTPS URL
meta
object
request_id

Unique identifier for this request (useful for support)

string
Example
req_xyz123
Examples

Endpoint not found

{
"error": {
"code": "ENDPOINT_NOT_FOUND",
"message": "endpoint not found"
},
"meta": {
"request_id": "req_xyz123"
}
}

Unauthorized - Invalid or missing API key

object
error
object
code

Machine-readable error code

string
Example
INVALID_REQUEST
message

Human-readable error message

string
Example
endpoint must be a valid HTTPS URL
meta
object
request_id

Unique identifier for this request (useful for support)

string
Example
req_xyz123
Example
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
},
"meta": {
"request_id": "req_xyz123"
}
}

API key limit exceeded

object
error
object
code

Machine-readable error code

string
Example
INVALID_REQUEST
message

Human-readable error message

string
Example
endpoint must be a valid HTTPS URL
meta
object
request_id

Unique identifier for this request (useful for support)

string
Example
req_xyz123
Example
{
"error": {
"code": "KEY_LIMIT_EXCEEDED",
"message": "Maximum of 20 API keys per project"
},
"meta": {
"request_id": "req_xyz123"
}
}
Personalize Examples

Enter your credentials to populate code examples throughout the docs.