Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.usehasp.com/llms.txt

Use this file to discover all available pages before exploring further.

Inbound webhooks let external services create records in a Hasp app by POSTing JSON to a unique token-authenticated URL.
Inbound webhooks are the one place you call the Data API directly — no SDK is needed because the caller is an external service, not your app’s JavaScript.

Endpoint

POST /api/hasp/v1/incoming/{token}
The {token} is the full plaintext token shown in the Hasp dashboard when you create the webhook. No X-Hasp-AppId header or session cookie is needed — the token identifies both the app and the target entity. Max body size: 256 KB.

Idempotency

Include an X-Idempotency-Key header (max 255 characters) to prevent duplicate records from replayed or retried requests. Hasp caches the response for 24 hours — repeat requests with the same key return the original response without creating a second record.

Request

POST /api/hasp/v1/incoming/wh_01JA...
Content-Type: application/json
X-Idempotency-Key: my-unique-key-123

{
  "name": "Alice",
  "email": "[email protected]",
  "source": "contact-form"
}
Keys are mapped to entity field keys according to the webhook’s field mapping (if configured). Unmapped keys are passed through directly. Keys that do not match any entity field are silently dropped.

Response

201 Created:
{
  "data": {
    "record_id": "01JQRECORD00000000000000"
  }
}

Error Responses

HTTPCodeWhen
404NOT_FOUNDToken not found or webhook is inactive
413PAYLOAD_TOO_LARGEBody exceeds 256 KB
422VALIDATION_FAILEDPayload fails entity schema validation
422ERRORQuota exceeded or processing error

Loop Prevention

If the request contains an X-Hasp-Webhook-Id header (set automatically on all outbound webhook deliveries), the record.created event is not re-dispatched. This prevents outbound → inbound → outbound infinite loops.

Field Mapping

When creating an inbound webhook in the dashboard, you can configure a field mapping to translate incoming key names to your entity’s field keys. Unmapped keys are passed through as-is.