Endpoints API
Create and manage webhook endpoints
The Endpoints API allows you to create, list, update, and delete webhook endpoints.
Authentication
All endpoints in this section require JWT Bearer authentication:
Authorization: Bearer <JWT_TOKEN>
Endpoint Object
{ "id": "cm1a2b3c4d5e6f7g8h9i0j1k", "name": "My Webhook", "slug": "my-webhook", "description": "Receives Stripe payment events", "isActive": true, "userId": "user_abc123", "createdAt": "2024-01-15T10:30:00.000Z", "updatedAt": "2024-01-15T10:30:00.000Z", "url": "https://hooksdash.ibadsiddiqui.dev/api/h/my-webhook" }
Attributes
| Attribute | Type | Description |
|---|---|---|
| id | string | Unique identifier for the endpoint |
| name | string | Human-readable name for the endpoint |
| slug | string | URL-safe identifier (unique across all endpoints) |
| description | string | Optional description of the endpoint's purpose |
| isActive | boolean | Whether the endpoint is actively receiving webhooks |
| userId | string | ID of the user who owns this endpoint |
| createdAt | string | ISO 8601 timestamp of creation |
| updatedAt | string | ISO 8601 timestamp of last update |
| url | string | Full webhook URL |
API Endpoints
Create Endpoint
Creates a new webhook endpoint.
POST /api/endpoints
Headers:
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json
Request Body:
{ "name": "My Webhook", "slug": "my-webhook", "description": "Receives Stripe payment events" }
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Endpoint name (1-100 characters) |
| slug | string | No | Custom slug (auto-generated if not provided) |
| description | string | No | Description (max 500 characters) |
Slug Requirements:
- 3-50 characters
- Lowercase letters, numbers, and hyphens only
- Cannot start or end with a hyphen
- Must be unique across all endpoints
Response:
{ "id": "cm1a2b3c4d5e6f7g8h9i0j1k", "name": "My Webhook", "slug": "my-webhook", "description": "Receives Stripe payment events", "isActive": true, "userId": "user_abc123", "createdAt": "2024-01-15T10:30:00.000Z", "updatedAt": "2024-01-15T10:30:00.000Z" }
Status Codes:
201 Created- Endpoint created successfully400 Bad Request- Validation error403 Forbidden- Endpoint limit reached for your tier409 Conflict- Slug already in use401 Unauthorized- Invalid or missing authentication
Example:
curl -X POST https://hooksdash-api.ibadsiddiqui.dev/api/endpoints \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "My Webhook", "description": "Receives Stripe payment events" }'
Validation Errors:
{ "statusCode": 400, "message": [ "name must be longer than or equal to 1 characters", "slug must match the required pattern" ], "error": "Bad Request" }
List Endpoints
Retrieves a paginated list of your endpoints with statistics.
GET /api/endpoints
Headers:
Authorization: Bearer <JWT_TOKEN>
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
| page | number | 1 | Page number |
| limit | number | 20 | Items per page (max 100) |
Response:
{ "data": [ { "id": "cm1a2b3c4d5e6f7g8h9i0j1k", "name": "My Webhook", "slug": "my-webhook", "description": "Receives Stripe payment events", "isActive": true, "userId": "user_abc123", "createdAt": "2024-01-15T10:30:00.000Z", "updatedAt": "2024-01-15T10:30:00.000Z", "_count": { "requests": 42 }, "lastRequest": { "id": "req_xyz789", "createdAt": "2024-01-15T14:25:00.000Z" } } ], "meta": { "total": 3, "page": 1, "limit": 20, "totalPages": 1 } }
Status Codes:
200 OK- Endpoints returned401 Unauthorized- Invalid or missing authentication
Example:
curl -X GET "https://hooksdash-api.ibadsiddiqui.dev/api/endpoints?page=1&limit=20" \ -H "Authorization: Bearer YOUR_JWT_TOKEN"
Get Endpoint
Retrieves a specific endpoint by ID with detailed statistics.
GET /api/endpoints/:id
Headers:
Authorization: Bearer <JWT_TOKEN>
Parameters:
id(path) - The endpoint ID
Response:
{ "id": "cm1a2b3c4d5e6f7g8h9i0j1k", "name": "My Webhook", "slug": "my-webhook", "description": "Receives Stripe payment events", "isActive": true, "userId": "user_abc123", "createdAt": "2024-01-15T10:30:00.000Z", "updatedAt": "2024-01-15T10:30:00.000Z", "_count": { "requests": 42 }, "lastRequest": { "id": "req_xyz789", "method": "POST", "path": "/webhook", "createdAt": "2024-01-15T14:25:00.000Z" } }
Status Codes:
200 OK- Endpoint returned404 Not Found- Endpoint not found or not owned by user401 Unauthorized- Invalid or missing authentication
Example:
curl -X GET https://hooksdash-api.ibadsiddiqui.dev/api/endpoints/cm1a2b3c4d5e6f7g8h9i0j1k \ -H "Authorization: Bearer YOUR_JWT_TOKEN"
Update Endpoint
Updates an existing endpoint. Only provided fields will be updated.
PUT /api/endpoints/:id
Headers:
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json
Parameters:
id(path) - The endpoint ID
Request Body:
{ "name": "Updated Webhook Name", "description": "Updated description", "isActive": false }
Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | No | New endpoint name |
| description | string | No | New description (or null) |
| isActive | boolean | No | Enable or disable the endpoint |
Note: The slug cannot be updated after creation.
Response:
{ "id": "cm1a2b3c4d5e6f7g8h9i0j1k", "name": "Updated Webhook Name", "slug": "my-webhook", "description": "Updated description", "isActive": false, "userId": "user_abc123", "createdAt": "2024-01-15T10:30:00.000Z", "updatedAt": "2024-01-15T15:45:00.000Z" }
Status Codes:
200 OK- Endpoint updated400 Bad Request- Validation error404 Not Found- Endpoint not found or not owned by user401 Unauthorized- Invalid or missing authentication
Example:
curl -X PUT https://hooksdash-api.ibadsiddiqui.dev/api/endpoints/cm1a2b3c4d5e6f7g8h9i0j1k \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "isActive": false }'
Delete Endpoint
Deletes an endpoint and all associated requests.
⚠️ Warning: This action is irreversible. All requests for this endpoint will be permanently deleted.
DELETE /api/endpoints/:id
Headers:
Authorization: Bearer <JWT_TOKEN>
Parameters:
id(path) - The endpoint ID
Response:
{ "deleted": true }
Status Codes:
200 OK- Endpoint deleted404 Not Found- Endpoint not found or not owned by user401 Unauthorized- Invalid or missing authentication
Example:
curl -X DELETE https://hooksdash-api.ibadsiddiqui.dev/api/endpoints/cm1a2b3c4d5e6f7g8h9i0j1k \ -H "Authorization: Bearer YOUR_JWT_TOKEN"
Endpoint States
Active vs Inactive
Endpoints can be active or inactive:
- Active (
isActive: true): Receives and stores webhook requests - Inactive (
isActive: false): Rejects webhook requests with 403 Forbidden
You can toggle this state using the Update Endpoint endpoint.
Automatic Deactivation
Endpoints are automatically deactivated when:
- Rate limit is consistently exceeded
- Endpoint hasn't received requests in 90 days (Pro and below)
Enterprise accounts have no automatic deactivation.
Tier Limits
Maximum number of endpoints by tier:
| Tier | Max Endpoints |
|---|---|
| Free | 3 |
| Starter | 20 |
| Pro | 50 |
| Enterprise | Unlimited |
When you reach your tier limit, you'll receive a 403 Forbidden error when trying to create new endpoints:
{ "statusCode": 403, "message": "Endpoint limit reached for your tier. Please upgrade to create more endpoints.", "error": "Forbidden" }
Slug Generation
If you don't provide a custom slug, one will be auto-generated from the endpoint name:
- Convert to lowercase
- Replace spaces and special characters with hyphens
- Remove consecutive hyphens
- Add a random suffix if needed to ensure uniqueness
Examples:
- "My Webhook" →
my-webhook - "Stripe Payment Events" →
stripe-payment-events - "GitHub PR Notifications" →
github-pr-notifications-a1b2
Use Cases
Development & Testing
# Create a test endpoint curl -X POST https://hooksdash-api.ibadsiddiqui.dev/api/endpoints \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Development Test", "slug": "dev-test" }' # Use the webhook URL in your tests # POST https://hooksdash.ibadsiddiqui.dev/api/h/dev-test
Production Webhooks
# Create a production endpoint curl -X POST https://hooksdash-api.ibadsiddiqui.dev/api/endpoints \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Stripe Production", "slug": "stripe-prod", "description": "Receives Stripe webhooks for production environment" }' # Configure in Stripe dashboard: # https://hooksdash.ibadsiddiqui.dev/api/h/stripe-prod
Temporary Endpoints
# Create endpoint ENDPOINT_ID=$(curl -X POST https://hooksdash-api.ibadsiddiqui.dev/api/endpoints \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "Temp Test"}' | jq -r '.id') # Use endpoint... # Delete when done curl -X DELETE https://hooksdash-api.ibadsiddiqui.dev/api/endpoints/$ENDPOINT_ID \ -H "Authorization: Bearer YOUR_JWT_TOKEN"
Best Practices
-
Use descriptive names: Include the service name and environment (e.g., "Stripe Production", "GitHub Staging")
-
Set descriptions: Document what each endpoint receives for future reference
-
Use custom slugs: For production endpoints, use meaningful slugs instead of auto-generated ones
-
Deactivate unused endpoints: Set
isActive: falseinstead of deleting if you might need them later -
Monitor request counts: Use the list endpoint to check which endpoints are actively receiving requests
-
Clean up old endpoints: Delete endpoints you no longer need to stay within tier limits