Create an API key
POST
/v1/api-keys
const url = 'https://api.hooks.events/v1/api-keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","scopes":["endpoints:read"],"expiresAt":"2026-04-15T12:00:00Z"}'};
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.hooks.events/v1/api-keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "scopes": [ "endpoints:read" ], "expiresAt": "2026-04-15T12:00:00Z" }'The plaintext key is returned once, in key.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
scopes
required
Array<string>
expiresAt
string format: date-time
Responses
Section titled “Responses”Success
Media typeapplication/json
object
data
required
key
additional properties
Example generated
{ "data": { "id": "example", "name": "example", "prefix": "example", "scopes": [ "example" ], "lastUsedAt": "example", "expiresAt": "example", "createdAt": "example" }}Validation error
Media typeapplication/json
object
error
required
object
code
required
Machine-readable error code
string
message
required
string
requestId
required
Request id, also echoed in x-request-id
string
key
additional properties
Example generated
{ "error": { "code": "example", "message": "example", "requestId": "example" }}Missing or invalid credentials
Media typeapplication/json
object
error
required
object
code
required
Machine-readable error code
string
message
required
string
requestId
required
Request id, also echoed in x-request-id
string
key
additional properties
Example generated
{ "error": { "code": "example", "message": "example", "requestId": "example" }}The credential lacks the required scope, or the workspace is not writable
Media typeapplication/json
object
error
required
object
code
required
Machine-readable error code
string
message
required
string
requestId
required
Request id, also echoed in x-request-id
string
key
additional properties
Example generated
{ "error": { "code": "example", "message": "example", "requestId": "example" }}Rate limited
Media typeapplication/json
object
error
required
object
code
required
Machine-readable error code
string
message
required
string
requestId
required
Request id, also echoed in x-request-id
string
key
additional properties
Example generated
{ "error": { "code": "example", "message": "example", "requestId": "example" }}Headers
Section titled “Headers”X-RateLimit-Limit
integer
Requests allowed per window
X-RateLimit-Remaining
integer
X-RateLimit-Reset
integer
Seconds until the window resets