Create API key
const url = 'https://api.hookbridge.io/v1/api-keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"label":"Production backend"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.hookbridge.io/v1/api-keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "label": "Production backend" }'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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Optional human-readable label for the key
Examples
Create an API key with label
{ "label": "Production backend"}Create an API key without label
{}Responses
Section titled “Responses”API key created successfully
object
object
Unique key identifier
The full API key - shown only once! Store this securely as it cannot be retrieved again.
First 11 characters of the key (for identification)
Human-readable label
object
Unique identifier for this request (useful for support)
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
object
Machine-readable error code
Human-readable error message
object
Unique identifier for this request (useful for support)
Examples
Endpoint not found
{ "error": { "code": "ENDPOINT_NOT_FOUND", "message": "endpoint not found" }, "meta": { "request_id": "req_xyz123" }}Invalid endpoint ID format
{ "error": { "code": "INVALID_REQUEST", "message": "endpoint_id must be in format ep_xxx" }, "meta": { "request_id": "req_xyz123" }}Invalid payload
{ "error": { "code": "INVALID_REQUEST", "message": "payload must be valid JSON" }, "meta": { "request_id": "req_xyz123" }}Invalid headers
{ "error": { "code": "INVALID_HEADERS", "message": "header 'Host' is forbidden and cannot be overridden" }, "meta": { "request_id": "req_xyz123" }}Unauthorized - Invalid or missing API key
object
object
Machine-readable error code
Human-readable error message
object
Unique identifier for this request (useful for support)
Example
{ "error": { "code": "UNAUTHORIZED", "message": "Invalid or missing API key" }, "meta": { "request_id": "req_xyz123" }}API key limit exceeded
object
object
Machine-readable error code
Human-readable error message
object
Unique identifier for this request (useful for support)
Example
{ "error": { "code": "KEY_LIMIT_EXCEEDED", "message": "Maximum of 20 API keys per project" }, "meta": { "request_id": "req_xyz123" }}Enter your credentials to populate code examples throughout the docs.