Skip to content

API Reference

Base URL: https://api.hookbase.app

Authentication

All API requests require authentication via Bearer token:

Authorization: Bearer {api_key}

Response Format

Successful responses return JSON in this format:

json
{
  "data": { ... }
}

List responses include pagination:

json
{
  "data": [ ... ],
  "total": 100,
  "limit": 50,
  "offset": 0,
  "hasMore": true
}

Error responses:

json
{
  "error": {
    "message": "Error description",
    "code": "error_code"
  }
}

Applications

List Applications

GET /applications

Query Parameters:

ParameterTypeDescription
limitnumberMax results (default: 50, max: 100)
offsetnumberPagination offset
searchstringSearch by name

Get Application

GET /applications/{id}

Get Application by UID

GET /applications/uid/{uid}

Create Application

POST /applications

Body:

json
{
  "name": "Acme Corp",
  "uid": "customer_123",
  "metadata": { "plan": "enterprise" }
}

Update Application

PATCH /applications/{id}

Body:

json
{
  "name": "New Name",
  "metadata": { "plan": "business" }
}

Delete Application

DELETE /applications/{id}

Endpoints

List Endpoints

GET /applications/{appId}/endpoints

Get Endpoint

GET /applications/{appId}/endpoints/{id}

Create Endpoint

POST /applications/{appId}/endpoints

Body:

json
{
  "url": "https://example.com/webhooks",
  "description": "Production endpoint",
  "headers": { "X-Custom": "value" },
  "filterTypes": ["order.*"],
  "rateLimit": 100,
  "rateLimitPeriod": 60
}

Response includes signing secret:

json
{
  "data": {
    "id": "ep_123",
    "url": "https://example.com/webhooks",
    "secret": "whsec_..."
  }
}

Update Endpoint

PATCH /applications/{appId}/endpoints/{id}

Delete Endpoint

DELETE /applications/{appId}/endpoints/{id}

Rotate Secret

POST /applications/{appId}/endpoints/{id}/rotate-secret

Get Statistics

GET /applications/{appId}/endpoints/{id}/stats

Recover Circuit

POST /applications/{appId}/endpoints/{id}/recover

Event Types

List Event Types

GET /event-types

Query Parameters:

ParameterTypeDescription
categorystringFilter by category
isArchivedbooleanInclude archived
searchstringSearch by name

Get Event Type

GET /event-types/{id}

Get Event Type by Name

GET /event-types/name/{name}

Create Event Type

POST /event-types

Body:

json
{
  "name": "order.created",
  "displayName": "Order Created",
  "description": "Triggered when an order is placed",
  "category": "Orders",
  "schema": { "type": "object" }
}

Update Event Type

PATCH /event-types/{id}

Delete Event Type

DELETE /event-types/{id}

Subscriptions

List Subscriptions

GET /applications/{appId}/subscriptions

Query Parameters:

ParameterTypeDescription
endpointIdstringFilter by endpoint
eventTypeIdstringFilter by event type
isEnabledbooleanFilter by status

Get Subscription

GET /applications/{appId}/subscriptions/{id}

Create Subscription

POST /applications/{appId}/subscriptions

Body:

json
{
  "endpointId": "ep_123",
  "eventTypeId": "evt_456"
}

Update Subscription

PATCH /applications/{appId}/subscriptions/{id}

Body:

json
{
  "isEnabled": false
}

Delete Subscription

DELETE /applications/{appId}/subscriptions/{id}

Messages

Send Message

POST /applications/{appId}/messages

Body:

json
{
  "eventType": "order.created",
  "payload": {
    "orderId": "ord_123",
    "amount": 99.99
  },
  "eventId": "unique_event_id",
  "metadata": { "source": "api" },
  "endpointIds": ["ep_123"]
}

Response:

json
{
  "data": {
    "messageId": "msg_123",
    "outboundMessages": [
      { "id": "out_1", "endpointId": "ep_123", "status": "pending" }
    ]
  }
}

List Messages

GET /applications/{appId}/messages

Query Parameters:

ParameterTypeDescription
eventTypestringFilter by event type
startDatestringISO date
endDatestringISO date

Get Message

GET /applications/{appId}/messages/{id}

Resend Message

POST /applications/{appId}/messages/{id}/resend

List Outbound Messages

GET /applications/{appId}/outbound-messages

Query Parameters:

ParameterTypeDescription
endpointIdstringFilter by endpoint
statusstringpending, success, failed, exhausted
eventTypestringFilter by event type

Get Outbound Message

GET /applications/{appId}/outbound-messages/{id}

List Attempts

GET /applications/{appId}/outbound-messages/{id}/attempts

Retry Outbound Message

POST /applications/{appId}/outbound-messages/{id}/retry

Portal Tokens

Create Portal Token

POST /applications/{appId}/portal-tokens

Body:

json
{
  "expiresIn": 3600
}

Response:

json
{
  "data": {
    "id": "ptk_123",
    "token": "whpt_...",
    "expiresAt": "2024-01-15T11:30:00Z"
  }
}

Revoke Portal Token

DELETE /applications/{appId}/portal-tokens/{id}

Portal API

The Portal API is authenticated with portal tokens (whpt_...) and provides a subset of functionality for embedded use.

Get Application Info

GET /portal/application

Endpoints

GET /portal/endpoints
POST /portal/endpoints
PATCH /portal/endpoints/{id}
DELETE /portal/endpoints/{id}
POST /portal/endpoints/{id}/rotate-secret

Event Types

GET /portal/event-types

Subscriptions

GET /portal/subscriptions
POST /portal/subscriptions
DELETE /portal/subscriptions/{id}

Messages

GET /portal/messages
GET /portal/messages/{id}

Webhook Signature Verification

Webhooks include signature headers for verification:

HeaderDescription
webhook-idUnique message identifier
webhook-timestampUnix timestamp
webhook-signaturev1,{signature}

Verify using:

signature = HMAC-SHA256(
  key: base64_decode(secret),
  message: "{webhook-id}.{webhook-timestamp}.{body}"
)

Status Codes

CodeDescription
200Success
201Created
204No Content
400Bad Request
401Unauthorized
403Forbidden
404Not Found
422Validation Error
429Rate Limited
500Server Error

Rate Limits

Requests are rate limited per API key:

EndpointLimit
General API1000/minute
Message Send10000/minute
Portal Tokens100/hour

Headers:

  • X-RateLimit-Limit
  • X-RateLimit-Remaining
  • X-RateLimit-Reset

Released under the MIT License.