All CRUD methods accept an optionalDocumentation Index
Fetch the complete documentation index at: https://docs.usehasp.com/llms.txt
Use this file to discover all available pages before exploring further.
AbortSignal as their last parameter. See Cancellation & Cleanup for cancellation patterns.
listRecords(entityKey, options?, signal?)
Fetches a page of records with optional filtering and sorting.| Option | Type | Default | Description |
|---|---|---|---|
filter | Filter object | — | See Filtering |
sort | string | — | "fieldKey:asc" or "fieldKey:desc" |
pageSize | number | 25 | Records per page (max 100) |
cursor | string | — | Pagination cursor from previous response |
getRecord(entityKey, id, signal?)
Fetches a single record by ID.createRecord(entityKey, data, signal?)
Creates a new record. Returns the created record including its assignedid and system timestamps.
- Do not include system fields (
id,created_by,updated_by,created_at,updated_at) — they are set automatically. - Required fields must be present. Missing required fields throw
ErrorCode.ValidationFailed.
updateRecord(entityKey, id, data, signal?)
Partially updates a record. Only the fields you include are changed — omitted fields are untouched.null:
deleteRecord(entityKey, id, signal?)
Deletes a record. Returnsvoid (no response body).
Record Shape
Every record includes these system fields in addition to your schema fields:| Field | Type | Description |
|---|---|---|
id | string (ULID) | Unique record ID |
created_by | string (ULID) | User who created the record |
updated_by | string (ULID) | User who last updated the record |
created_at | ISO 8601 string | Creation timestamp |
updated_at | ISO 8601 string | Last update timestamp |