Complete reference for RelayHQ Management API
All management API endpoints require authentication using an API key.
Authorization: Bearer YOUR_API_KEY
API keys can be configured via environment variables or through the management interface.
The API base URL depends on your deployment:
https://api-staging.relayhq.devhttps://api.relayhq.devhttp://localhost:3000Receive and store webhook events.
POST /api/in/my-project
Content-Type: application/json
X-Idempotency-Key: optional-unique-key
{
"event": "data",
"timestamp": "2024-01-01T00:00:00Z"
}
{
"event_id": "evt_abc123"
}
List events for a project.
GET /api/events?project_id=my-project&status=delivered&limit=100&offset=0
Authorization: Bearer YOUR_API_KEY
project_id (required) - Project identifierstatus (optional) - Filter by status: pending, delivered, failedlimit (optional, default: 100) - Number of resultsoffset (optional, default: 0) - Pagination offsetGet event details including delivery attempts.
GET /api/events/evt_abc123
Authorization: Bearer YOUR_API_KEY
Retrieve the original webhook payload.
GET /api/events/evt_abc123/payload
Authorization: Bearer YOUR_API_KEY
Replay an event (re-deliver to configured or custom endpoint).
POST /api/events/evt_abc123/replay
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"target_url": "https://custom-endpoint.com/webhook",
"headers": {
"X-Custom-Header": "value"
}
}
Create a forwarding rule for a project.
POST /api/projects/my-project/forwarding
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"target_url": "https://customer.com/webhook",
"method": "POST",
"headers": {
"X-Custom-Header": "value"
},
"retry_policy": {
"max_attempts": 5,
"backoff": "exponential",
"initial_delay_ms": 1000,
"max_delay_ms": 600000
}
}
max_attempts - Maximum retry attempts (default: 5)backoff - Strategy: exponential, linear, or fixedinitial_delay_ms - Initial delay in milliseconds (default: 1000)max_delay_ms - Maximum delay in milliseconds (default: 600000)List all forwarding rules for a project.
GET /api/projects/my-project/forwarding
Authorization: Bearer YOUR_API_KEY
Update a forwarding rule.
PATCH /api/forwarding/rule_xyz
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"active": false,
"retry_policy": {
"max_attempts": 10
}
}
200 - Success201 - Created202 - Accepted (webhook ingestion)400 - Bad Request401 - Unauthorized (missing/invalid API key)404 - Not Found500 - Internal Server Error{
"error": "Error message description"
}
# Ingest a webhook
curl -X POST https://api-staging.relayhq.dev/api/in/my-project \
-H "Content-Type: application/json" \
-d '{"event": "user.created", "user_id": "123"}'
# List events
curl -X GET "https://api-staging.relayhq.dev/api/events?project_id=my-project" \
-H "Authorization: Bearer YOUR_API_KEY"
# Create forwarding rule
curl -X POST https://api-staging.relayhq.dev/api/projects/my-project/forwarding \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"target_url": "https://myapp.com/webhook",
"retry_policy": {
"max_attempts": 5,
"backoff": "exponential"
}
}'