Skip to content

API Reference

Hookbase provides a RESTful API for managing all aspects of your webhook infrastructure.

Postman Collection

Download the Postman Collection for quick API exploration.

OpenAPI Specification

Download the OpenAPI 3.0 Spec for SDK generation, API testing tools, and automated documentation.

Compatible with tools like Swagger UI, Redocly, and any OpenAPI code generator.

Base URL

https://api.hookbase.app

Authentication

All API requests require authentication. See Authentication for details.

URL Patterns

Hookbase supports two URL patterns for API requests:

When using an API key, the organization is inferred automatically from the key — no need to include an organization ID in the URL:

bash
curl https://api.hookbase.app/api/sources \
  -H "Authorization: Bearer whr_your_api_key"
javascript
const response = await fetch('https://api.hookbase.app/api/sources', {
  headers: {
    'Authorization': 'Bearer whr_your_api_key'
  }
});
const data = await response.json();
python
import requests

response = requests.get(
    'https://api.hookbase.app/api/sources',
    headers={'Authorization': 'Bearer whr_your_api_key'}
)
data = response.json()

JWT Authentication

When using JWT tokens (e.g. from the dashboard), you must include the organization ID in the path:

bash
curl https://api.hookbase.app/api/organizations/{orgId}/sources \
  -H "Authorization: Bearer your_jwt_token"
javascript
const response = await fetch('https://api.hookbase.app/api/organizations/{orgId}/sources', {
  headers: {
    'Authorization': 'Bearer your_jwt_token'
  }
});
const data = await response.json();
python
import requests

response = requests.get(
    'https://api.hookbase.app/api/organizations/{orgId}/sources',
    headers={'Authorization': 'Bearer your_jwt_token'}
)
data = response.json()

TIP

All examples in this documentation use the simplified API key pattern. If you're using JWT authentication, prefix the resource path with /api/organizations/{orgId}.

Request Format

  • All requests should use Content-Type: application/json
  • Request bodies should be JSON-encoded
  • URL parameters should be URL-encoded

Response Format

All responses are JSON-encoded with the following structure:

Success Response

json
{
  "id": "src_abc123",
  "name": "My Source",
  "createdAt": "2024-01-15T10:30:00Z"
}

Or for lists:

json
{
  "data": [...],
  "pagination": {
    "total": 100,
    "page": 1,
    "pageSize": 20
  }
}

Error Response

json
{
  "error": "Not found",
  "message": "Source with ID src_xyz not found",
  "code": "RESOURCE_NOT_FOUND"
}

HTTP Status Codes

CodeDescription
200Success
201Created
204No Content (successful deletion)
400Bad Request (invalid input)
401Unauthorized (missing or invalid auth)
403Forbidden (insufficient permissions)
404Not Found
409Conflict (duplicate resource)
422Unprocessable Entity (validation error)
429Too Many Requests (rate limited)
500Internal Server Error

Rate Limits

Rate limits vary by plan:

PlanRequests/minute
Free60
Starter300
Pro1,000
Business3,000

Rate limit headers are included in every response:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1705312800

Pagination

List endpoints support pagination:

bash
GET /api/sources?page=1&pageSize=20
ParameterDefaultMax
page1-
pageSize20100

Filtering

Many list endpoints support filtering:

bash
GET /api/events?status=delivered&sourceId=src_abc

Sorting

Sort results using the sort parameter:

bash
GET /api/events?sort=-createdAt

Prefix with - for descending order.

API Endpoints

Core Resources

ResourceDescription
SourcesWebhook receive endpoints
DestinationsDelivery targets
RoutesSource to destination mappings
EventsReceived webhook events
DeliveriesDelivery attempts and status

Webhook Ingest

EndpointDescription
Webhook IngestPublic endpoint for receiving webhooks

Authentication & Access

ResourceDescription
AuthenticationJWT tokens and session management
API KeysProgrammatic access tokens

Development Tools

ResourceDescription
TunnelsLocal development tunnels

Advanced Features

ResourceDescription
TransformsPayload transformation functions
FiltersConditional routing rules
SchemasPayload validation schemas
Cron JobsScheduled webhook triggers

SDKs

Official SDKs are available for:

  • JavaScript/TypeScript: npm install @webhookrelay/sdk
  • Python: pip install webhookrelay
  • Go: go get github.com/webhookrelay/go-sdk

Quick Examples

Create a Source

bash
curl -X POST https://api.hookbase.app/api/sources \
  -H "Authorization: Bearer whr_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "GitHub", "slug": "github"}'
javascript
const response = await fetch('https://api.hookbase.app/api/sources', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer whr_your_api_key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'GitHub',
    slug: 'github'
  })
});
const data = await response.json();
python
import requests

response = requests.post(
    'https://api.hookbase.app/api/sources',
    headers={
        'Authorization': 'Bearer whr_your_api_key',
        'Content-Type': 'application/json'
    },
    json={
        'name': 'GitHub',
        'slug': 'github'
    }
)
data = response.json()

List Events

bash
curl https://api.hookbase.app/api/events \
  -H "Authorization: Bearer whr_your_api_key"
javascript
const response = await fetch('https://api.hookbase.app/api/events', {
  headers: {
    'Authorization': 'Bearer whr_your_api_key'
  }
});
const data = await response.json();
python
import requests

response = requests.get(
    'https://api.hookbase.app/api/events',
    headers={'Authorization': 'Bearer whr_your_api_key'}
)
data = response.json()

Replay an Event

bash
curl -X POST https://api.hookbase.app/api/events/{eventId}/replay \
  -H "Authorization: Bearer whr_your_api_key"
javascript
const response = await fetch('https://api.hookbase.app/api/events/{eventId}/replay', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer whr_your_api_key'
  }
});
const data = await response.json();
python
import requests

response = requests.post(
    'https://api.hookbase.app/api/events/{eventId}/replay',
    headers={'Authorization': 'Bearer whr_your_api_key'}
)
data = response.json()

Released under the MIT License.