Records (CRUD)
All CRUD methods accept an optional 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.
1const result = await sdk.listRecords('tasks', {2 filter: { status: { eq: 'open' } },3 sort: 'due_date:asc',4 pageSize: 25,5 cursor: undefined, // omit on first page; pass meta.cursor for subsequent pages6});78// result.data — RecordData[]9// result.meta — { hasMore: boolean, cursor: string|null, total?: number }
Options:
| 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 |
See Pagination for cursor-based pagination patterns.
getRecord(entityKey, id, signal?)
Fetches a single record by ID.
1const result = await sdk.getRecord('tasks', '01JA...'); // record id (ULID) — from result.data.id2// result.data — RecordData (with id, timestamps, and all field values)
createRecord(entityKey, data, signal?)
Creates a new record. Returns the created record including its assigned id and system timestamps.
1const result = await sdk.createRecord('tasks', {2 title: 'Buy milk',3 status: 'open',4 due_date: '2026-04-01',5});6// result.data — RecordData (includes id, created_at, etc.)
Rules:
- 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.
1const result = await sdk.updateRecord('tasks', '01JA...', {2 status: 'done',3});4// result.data — full updated RecordData
To clear an optional field, send null:
1await sdk.updateRecord('tasks', '01JA...', {2 due_date: null, // clears the field3});
deleteRecord(entityKey, id, signal?)
Deletes a record. Returns void (no response body).
Permanent: Deleted records are permanently removed from all API responses — they cannot be retrieved, listed, or restored via the SDK.
1await sdk.deleteRecord('tasks', '01JA...');
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 |
Never include system fields in create or update payloads.