Hookbase
Docs
GuideAPI ReferenceIntegrationsUse CasesCLIMCP
Getting StartedSDK ReferencePortal ComponentsAPI Reference
Get Started

Getting Started

OverviewIntegration Guide

SDK & Portal

SDK ReferencePortal OverviewMagic LinksComponentsHooksStylingPortal API Reference

API Reference

REST API
DocsSendAPI

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:

{
  "data": { ... }
}

List responses include pagination:

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

Error responses:

{
  "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:

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

Update Application

PATCH /applications/{id}

Body:

{
  "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:

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

Response includes signing secret:

{
  "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:

{
  "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:

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

Update Subscription

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

Body:

{
  "isEnabled": false
}

Delete Subscription

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

Messages

Send Message

POST /applications/{appId}/messages

Body:

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

Response:

{
  "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:

{
  "expiresIn": 3600
}

Response:

{
  "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
PreviousPortal API Reference

On this page

AuthenticationResponse FormatApplicationsList ApplicationsGet ApplicationGet Application by UIDCreate ApplicationUpdate ApplicationDelete ApplicationEndpointsList EndpointsGet EndpointCreate EndpointUpdate EndpointDelete EndpointRotate SecretGet StatisticsRecover CircuitEvent TypesList Event TypesGet Event TypeGet Event Type by NameCreate Event TypeUpdate Event TypeDelete Event TypeSubscriptionsList SubscriptionsGet SubscriptionCreate SubscriptionUpdate SubscriptionDelete SubscriptionMessagesSend MessageList MessagesGet MessageResend MessageList Outbound MessagesGet Outbound MessageList AttemptsRetry Outbound MessagePortal TokensCreate Portal TokenRevoke Portal TokenPortal APIGet Application InfoEndpointsEvent TypesSubscriptionsMessagesWebhook Signature VerificationStatus CodesRate Limits