Overview
Theendpoint-api delivers conversation events to external HTTP endpoints. When a call starts, ends, or a message is exchanged, assistant-api emits events to endpoint-api via gRPC. This service handles fan-out to all registered webhooks, retry with exponential backoff, and delivery tracking.
Port
9005 — HTTP · gRPC (cmux)Language
Go 1.25
Gin (REST) + gRPC
Storage
PostgreSQL
endpoint_db
Redis (job queue)Components
Webhook Registry
Webhook Registry
Stores webhook configurations scoped to a project. Each webhook targets one URL and subscribes to one or more event types.
| Field | Type | Description |
|---|---|---|
name | string | Human-readable label |
url | string | Destination HTTPS endpoint |
events | string[] | Subscribed event types |
is_active | bool | Enable / disable without deleting |
secret | string | HMAC signing secret |
max_retries | int | Default: 5 |
timeout_ms | int | Default: 30000 |
headers | JSON | Custom headers sent with each delivery |
Event Routing
Event Routing
When
assistant-api calls endpoint-api with an event, the service:- Resolves all active webhooks for the project that subscribe to the event type.
- Creates a delivery record per webhook.
- Signs the payload with HMAC-SHA256 using the webhook’s
secret. - Attempts delivery with the configured timeout.
- On failure: re-queues via Redis with exponential backoff.
Retry Strategy
Retry Strategy
| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | 5 seconds |
| 3 | 25 seconds |
| 4 | 2 minutes |
| 5 | 10 minutes |
408, 429, and 5xx. Status codes 2xx are treated as success. Status codes 4xx (except 408, 429) are treated as non-retriable failures.Payload Signing
Payload Signing
Every delivery includes an Verification example (Node.js)
X-Rapida-Signature header:Event Reference
| Event | Trigger | Key Payload Fields |
|---|---|---|
conversation.started | Call begins | conversation_id, assistant_id, timestamp |
conversation.ended | Call terminates | conversation_id, duration_ms, messages_count, end_reason |
message.sent | Assistant speaks | conversation_id, message_id, content, role |
message.received | User speaks | conversation_id, message_id, content, role |
assistant.updated | Config changed | assistant_id, changes |
assistant.deleted | Assistant removed | assistant_id, timestamp |
error.occurred | Pipeline error | conversation_id, error_code, error_message |
conversation.ended
API Endpoints
| Method | Path | Description |
|---|---|---|
GET | /readiness/ | Readiness probe |
GET | /healthz/ | Liveness probe |
POST | /api/v1/endpoint/webhooks | Create webhook |
GET | /api/v1/endpoint/webhooks | List webhooks |
GET | /api/v1/endpoint/webhooks/{id} | Get webhook |
PUT | /api/v1/endpoint/webhooks/{id} | Update webhook |
DELETE | /api/v1/endpoint/webhooks/{id} | Delete webhook |
POST | /api/v1/endpoint/webhooks/{id}/test | Send test event |
GET | /api/v1/endpoint/webhooks/{id}/deliveries | List delivery history |
POST | /api/v1/endpoint/webhooks/{id}/replay | Replay a specific event |
Configuration
Editdocker/endpoint-api/.endpoint.env before starting the service.
Required variables
| Variable | Required | Default | Description |
|---|---|---|---|
SECRET | ✅ Yes | rpd_pks | JWT signing secret — must match all services |
POSTGRES__HOST | ✅ Yes | postgres | PostgreSQL host |
POSTGRES__DB_NAME | ✅ Yes | endpoint_db | Database name |
POSTGRES__AUTH__USER | ✅ Yes | rapida_user | Database user |
POSTGRES__AUTH__PASSWORD | ✅ Yes | — | Database password |
REDIS__HOST | ✅ Yes | redis | Redis host (job queue for retries) |
Tuning variables
| Variable | Default | Description |
|---|---|---|
LOG_LEVEL | debug | debug · info · warn · error |
WEBHOOK_MAX_RETRIES | 5 | Maximum delivery attempts per event |
WEBHOOK_RETRY_DELAY | 5000 | Initial retry delay in milliseconds |
WEBHOOK_TIMEOUT | 30000 | HTTP call timeout in milliseconds |
Full environment file
Running
- Docker Compose
- From Source
Health & Observability
| Endpoint | Purpose |
|---|---|
GET /readiness/ | Reports whether the service is ready |
GET /healthz/ | Liveness probe |
Troubleshooting
Webhook not receiving events
Webhook not receiving events
- Check the webhook is active:
GET /api/v1/endpoint/webhooks/{id} - Verify the event type is in the webhook’s
eventslist. - Review delivery history:
GET /api/v1/endpoint/webhooks/{id}/deliveries - Send a test event:
POST /api/v1/endpoint/webhooks/{id}/test
All deliveries failing with connection error
All deliveries failing with connection error
- Verify the destination URL is publicly reachable (not
localhostor a private IP). - Confirm the TLS certificate on the destination is valid.
- Check for firewall rules blocking outbound HTTP from the
endpoint-apicontainer.
Replay a failed event
Replay a failed event