Skip to content

API reference

https://api.valtrix.com/v1

The table examples on this page use sample data. Sign in to see this reference generated from your own published tables.

Getting started

You can create an API key in the console under Developers. The SDK generates a typed client from your published tables, and a findMany call on one of them makes a good first read. The same read works over plain REST with the key in the Authorization header.

$ export VALTRIX_API_KEY=vlt_...
$ curl https://api.valtrix.com/v1/tables/customers_clean/rows \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-G -d "limit=5"
{ "rows": [...], "next_cursor": null, "schema_version": "v1" }

Overview

Valtrix turns the raw data living in the third-party systems your organizations use into clean tables you query like a database. Ingestion and modeling happen upstream, so by the time data reaches this API it is already in your schema, the same shape for every organization and every connector.

The Valtrix data lifecycle
1

Records

Organizations connect their third-party systems through Connect. Valtrix syncs their data continuously and stores it as Records.

2

Transformations

Your Transformation rules clean, map, and validate those Records into a data model you design once. Steps run separately within each organization's data; rows never mix across organizations.

3

Tables

Publishing a Transformation produces typed, versioned Tables where data from every organization shares one shape.

4

Ready for consumption

Read rows from tables with filters, query records directly for ad hoc reads, follow change feeds to stay in sync, and write records back through the endpoints below.

Authentication

Every request carries an API key in the Authorization header; a request without a valid key gets a 401. Keys come in two kinds. Platform-wide keys, created in the console under Developers, reach every organization granted to you. Organization-scoped keys, created through POST /v1/keys, are pinned to one organization: reads and writes default to it, the org parameter becomes optional, and naming any other organization returns 403 org_not_scoped. For your first key, sign in to the console, open Developers, and choose Create API key. Give it a name, keep the scope on Entire platform (all organizations), and pick an access level. The full key is shown once, when it is created; a key that goes missing can be revoked and replaced but not recovered. Each key has an access level: read, write, or manage. A read-only key can call every read endpoint except key management (GET /v1/keys needs manage); writing or deleting records and creating connect sessions return 403 key_access_denied on it. Write is the default and covers records and connect sessions. Manage exists only on platform-wide keys and also covers transformation deploys, key management, and webhook endpoints. The prefix tells you which kind of key you are holding: scoped keys start with vlt_org_ instead of vlt_, and read-only keys with vlt_read_ or vlt_org_read_, so a key that turns up in a log is recognizable at a glance. A common split is a scoped key for each app or environment that acts for a single organization, a read-only key for anything that only consumes data, and platform-wide keys kept on your own servers. The SDK and the valtrix CLI pick up the key from VALTRIX_API_KEY and the API base URL from VALTRIX_API_URL (the production API when unset), from the shell or from a .env.local or .env file in the project directory, so neither value has to appear in code.

$ export VALTRIX_API_KEY=vlt_...
$ curl https://api.valtrix.com/v1/tables \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Build with AI

There are two ways to build with AI on Valtrix, split by when the model is involved. Through the MCP server, Claude and ChatGPT query and write the data live during a session, with the model in the request path at runtime. In Embedded coding agents, a coding agent writes an app against the SDK and the generated client, and the model's involvement ends when the code ships.

MCP server

The MCP server gives Claude, ChatGPT, and any other MCP client live access to the same tables and records as the REST API, for writes as well as reads. It speaks the Model Context Protocol over streamable HTTP at /mcp and follows the same semantics as the REST endpoints: organization-scoped keys pin every call to their organization, platform-wide keys accept an org argument, and write access follows the key. Thirty-nine tools mirror the REST surface, one per endpoint: - Tables: get_schema, list_tables, query_table - Records: query_records, aggregate_records, upsert_record, get_record, delete_record, get_attachment_url (mirroring GET /v1/attachments/:attachmentId/url) - Write intents: list_write_intents, get_write_intent, retry_write_intent - Connect: create_connect_link - Connectors: list_connectors (mirroring GET /v1/connectors), request_connector (add a connector that is not in the catalog yet by provider name and homepage URL, mirroring POST /v1/connector-requests; write access), list_connector_requests (mirroring GET /v1/connector-requests), request_connector_expansion (mirroring POST /v1/connectors/:slug/expansions) - Organizations: list_orgs (platform-wide keys only; resolve a connected organization by name and pass its id as the org argument) - Connections: list_connections, get_connection (mirroring GET /v1/connections/:id), update_connection (widen history_from or set the sync policy, mirroring PATCH /v1/connections/:id; write access), sync_connection (start a full sync, mirroring POST /v1/connections/:id/runs; write access), get_sync_run (mirroring GET /v1/connections/:id/runs/:runId), pause_connection (mirroring POST /v1/connections/:id/pause; write access), resume_connection (mirroring POST /v1/connections/:id/resume; write access) - Transformations: list_transformations (platform-wide keys only; mirroring GET /v1/transformations), get_transformation (platform-wide keys only; mirroring GET /v1/transformations/:table), get_transformation_definition_format (platform-wide keys only; mirroring GET /v1/transformations/definition-format), plan_transformations (platform-wide keys only; mirroring POST /v1/transformations/plan), apply_transformations (platform-wide keys only; mirroring POST /v1/transformations/apply; manage access) - Applets: list_applets (mirroring GET /v1/applets), get_applet (mirroring GET /v1/applets/:id), get_applet_definition_format (mirroring GET /v1/applets/definition-format), create_applet (mirroring POST /v1/applets; write access), update_applet (mirroring PATCH /v1/applets/:id; write access), run_applet (mirroring POST /v1/applets/:id/actions/:action; write access), start_applet_run (mirroring POST /v1/applets/:id/runs; write access), list_applet_runs (mirroring GET /v1/applets/:id/runs), get_applet_run (mirroring GET /v1/applets/:id/runs/:runId) Which tools a key gets depends on its kind. Organization-scoped keys do not get list_orgs. list_connections mirrors GET /v1/connections on both key kinds, narrowed to the organization on an organization-scoped key and taking an optional org on a platform-wide one, and carries each connection's writes and write_guidance. get_schema and list_tables take an optional org on platform-wide keys to narrow to what one organization granted. list_connectors mirrors GET /v1/connectors: the connectors the platform offers on a platform-wide key, with the entity types each supplies, which is the list to read before create_connect_link or request_connector. get_attachment_url mirrors GET /v1/attachments/:attachmentId/url: a record or row whose _attachment_id is set has a stored file, get_record lists every attachment of a record, and this tool turns an attachment id into the short lived link to show it. The write tools take the same arguments as the REST writes. upsert_record and delete_record take an org argument on platform-wide keys (omitting it returns org_required) and the same propagate, connection, and idempotency_key arguments as POST /v1/records/:entityType. delete_record removes only records written through the API, never connector-synced ones. The write intent tools mirror GET /v1/write-intents, GET /v1/write-intents/:id, and POST /v1/write-intents/:id/retry. The connection tools mirror GET /v1/connections/:id, PATCH /v1/connections/:id, POST /v1/connections/:id/runs, GET /v1/connections/:id/runs/:runId, and the pause and resume endpoints on both key kinds. The transformation tools are platform-wide only: list_transformations and get_transformation return each transformation's canonical YAML definition, plan_transformations validates definitions and returns the diff on any key, and apply_transformations publishes them on a manage key, marking each transformation managed by code exactly as valtrix deploy does. The applet tools mirror the Applets endpoints, taking org on platform-wide keys where the endpoints do. get_applet_definition_format and get_transformation_definition_format return the definition formats this reference documents, the text to read before writing a definition, and the server serves the same two documents as the resources valtrix://docs/applet-definition and valtrix://docs/transformation-definition for clients that read resources. To connect a client, in claude.ai or chatgpt.com add the /mcp URL as a custom MCP server, click Connect, and paste your API key on the Valtrix authorization page. Claude Code, Cursor, VS Code, Codex, and Grok authenticate through the same OAuth flow. Clients without OAuth support can send the key as a bearer header instead. The MCP setup guide has step-by-step instructions for every client. Where the Embedded coding agents path produces an app that queries the API on its own, with no model at runtime, the MCP server keeps the model itself in the conversation, reading live data and writing records back.

Server URL
https://api.valtrix.com/mcp
Authorization header
Authorization: Bearer YOUR_API_KEY

Embedded coding agents

For embedded apps a coding agent writes (the vibe-coded tools your users spin up inside your product). These apps run on organization-scoped keys and the SDK. For example, a builder on your platform asks the agent for a tool that flags unpaid vendor bills, and the app it gets back queries the bills table with a key pinned to that builder's organization and nothing else. With the key and the generated client in the app template, the agent opens a project with the schema already in its editor and the ground rules already in the repository. The rules ship as the AGENTS.md file inside @valtrix/sdk: live table queries over mirrors, the generated client for every call, and no key handling in the app.

Mint a key per appyour backend

When a user creates an app, mint an organization-scoped key named after it with POST /v1/keys and set it in the app's environment as VALTRIX_API_KEY, so it stays out of the source and the agent's conversation. Revoke it when the app is deleted.

Generate the clientyour app template

Add @valtrix/sdk as a dependency and run npx valtrix generate while scaffolding, so valtrix/client.ts is already in the tree with the full schema when the agent first opens the project.

Copy in AGENTS.mdyour app template

The instructions file ships at node_modules/@valtrix/sdk/AGENTS.md and versions with the SDK, with a CLAUDE.md beside it whose only line is @AGENTS.md. Copy both to the project root so every coding agent that opens the repository reads the same rules: Codex, Cursor, and Copilot read AGENTS.md on their own, and Claude Code reads it through the CLAUDE.md import.

Guard the schema in CIyour app template

Run npx valtrix generate --check next to the typecheck, so a published schema change surfaces as a failing build the agent knows how to fix.

$ curl -X POST https://api.valtrix.com/v1/keys \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-d '{ "org": "org_2d9x4v", "name": "snag-tracker" }'
$ npm install @valtrix/sdk
$ npx valtrix generate
$ cp node_modules/@valtrix/sdk/AGENTS.md node_modules/@valtrix/sdk/CLAUDE.md .

Errors

A failed request returns a readable error message and a stable code. The code is the part to branch on, since the message can change. The SDK throws the same shape as a ValtrixError, with code and status on the error.

invalid_source_fields400

source_fields must be an object and the connection the write propagates to must take native SDK fields; sending it without propagate: true is invalid_propagation.

connection_not_found404

No connection with that id belongs to an organization that has connected to you, or the key is scoped to a different organization.

run_not_found404

No sync run with that id exists on the connection.

invalid_history_from400

history_from is not an ISO 8601 date, is in the future, or would narrow the connection's existing history depth. History only widens.

invalid_sync_policy400

sync is not a policy object: an entity type GET /v1/schema does not list, a field the entity does not have, both fields and exclude on one entity, an attempt to exclude an identity, kind, or reference field, or an entity the same request's scope asks to read turned off.

sync_policy_conflicts_with_grant409

Another platform's active grant on the organization covers an entity the sync policy would store less of. A policy never takes data away from a platform the organization granted it to; the organization revokes that grant first.

invalid_until400

until is not an ISO 8601 timestamp in the future, or is more than a year away. Omit it to pause with no expiry.

invalid_mode400

mode is not full. Incremental syncs run on the connection's own schedule and cannot be requested.

sync_in_progress409

A sync is already queued or running for the connection. Wait for it to finish, then request another.

connection_paused409

The connection is paused. Resume it before requesting a sync.

sync_cooldown409

A requested sync of the connection finished less than one of its sync intervals ago. Retry after the seconds in the Retry-After header; scheduled syncs keep running in the meantime.

invalid_entity_types400

entity_types is not a non-empty array of entity types the connection syncs and the key may read.

connection_not_syncable409

The connection's connector is still being built or does not sync, so no run can be queued.

connection_shared409

Another platform also reads this connection, so only the organization can pause it. The message says how many other platforms read it, not which.

connection_not_pausable409

The connection is pending, disconnected, or already paused, so there is nothing to pause.

connection_not_paused409

The connection is not paused, so there is nothing to resume.

invalid_filter400

A row filter is not in <op>.<value> form, or its value does not match the column type.

invalid_order400

order is not in <column>.<asc|desc> form, or order_by on an aggregate is not value or group.

invalid_limit400

limit is not a positive integer.

invalid_cursor400

The cursor is malformed. Always pass next_cursor back verbatim.

invalid_metric400

A metrics entry of an aggregate is not count or <function>.<field>, names a field that is not a number, or the list is empty, repeats an entry, or is too long.

invalid_group400

The grouping of an aggregate cannot be applied: bucket or series_bucket on a field that is not a date, an unknown bucket, or bucket or series_by without group_by.

unknown_column400

A filter, select, or order, or the metrics, group_by, or series_by of an aggregate, names a column that is not in the table or entity schema.

unknown_connector400

No connector with that slug. GET /v1/connectors lists the valid ones.

connector_required400

A sign-in link is for one system, so POST /v1/connect/sessions and create_connect_link need a connector when link is sign_in and always on an organization-scoped key, which only mints sign-in links. They also need one whenever login_identity is sent, since the choice is made per system.

invalid_link400

link on a connect session is not connect or sign_in.

grant_required403

A sign-in link (link: "sign_in" on POST /v1/connect/sessions and create_connect_link) needs an organization that has confirmed your access with a grant covering every entity the connector supplies. Send a connect link instead and let the organization approve.

org_required400

Record writes on a platform-wide key (POST /v1/records/:entityType and DELETE /v1/records/:entityType/:externalId) need an org parameter, while reads do not (GET /v1/records/:entityType without org reads across every granted organization); POST /v1/keys needs an org in the body, a sign-in link on POST /v1/connect/sessions needs org, and the MCP upsert_record, delete_record, and create_connect_link (with link: "sign_in") tools need an org argument on platform-wide keys.

invalid_name400

An API key name is empty or longer than 100 characters.

invalid_external_id400

external_id is missing or longer than 255 characters.

invalid_idempotency_key400

The Idempotency-Key header is longer than 255 characters.

invalid_fields400

Record data failed validation. The response includes a fields array naming each issue.

invalid_attachments400

The attachments on a record write failed validation: not an array, more than 10 entries, a missing filename, a media_type outside the supported set, content that is not base64, a kind that is not a short lowercase token, or more than 25 MB together. The response includes a fields array naming each issue.

invalid_scope400

scope is not a valid list of entity types or data categories, or its entityTypes and categories disagree.

invalid_credential_sections400

credential_sections must be login or api.

invalid_login_identity400

login_identity must be existing or valtrix_user.

login_identity_unsupported400

The connector named on POST /v1/connect/sessions or create_connect_link cannot be signed in to the way login_identity asks. The connector object lists the values it takes as login_identities.

invalid_status400

status must be active, revoked, or expired on GET /v1/orgs; pending, applied, or failed on GET /v1/write-intents; or pending, delivered, or dead on GET /v1/webhooks/:id/events.

invalid_url400

The webhook endpoint url is missing or not an https URL on a public host.

invalid_subscriptions400

The event_types or tables on a webhook endpoint are not valid: an unknown event type, no event types at all, a table that is not published, a column the table does not have, or table.row_changed without any table.

invalid_payload_template400

The payload_template on a webhook endpoint is not usable: not a JSON string, not valid JSON, over 16 KB, a malformed placeholder, or a placeholder naming an event field or table column the endpoint's subscriptions do not carry. Also returned when a subscription change would orphan a placeholder in the stored template.

invalid_access400

access must be read or write. Keys minted through POST /v1/keys never carry manage.

invalid_disposition400

disposition on GET /v1/attachments/:attachmentId/url must be inline or attachment.

invalid_definitions400

The definitions payload on POST /v1/transformations/plan or /v1/transformations/apply failed validation. The response includes the failing items.

scope_not_granted403

The grant for this organization does not cover that entity type.

org_not_scoped403

The request names an organization other than the one this organization-scoped key is pinned to.

key_access_denied403

The key's access level does not allow this action. Read-only keys cannot write or delete records, create connect sessions, or request connectors; the response names the missing capability.

member_scope403

The key was authorized by a team member whose data access, the systems and objects an owner or admin gave them in the organization console, does not cover this. Such a key reads and writes only those objects, runs only the applets shared with that member, and cannot manage connections, applets, connectors, or keys. A write to a system the member's access holds read only is refused with this code too. Records outside the member's access are not found rather than forbidden.

manage_required403

This endpoint needs a platform-wide key with manage access. Manage governs applying transformation deploys, minting, listing, or revoking organization-scoped API keys, managing webhook endpoints, and requesting connectors from a platform-wide key.

platform_not_granted403

The platform named on POST /v1/connector-requests does not have an active grant to the organization the key is scoped to. Omit platform to request through the organization's own Valtrix access.

invalid_request400

The request body is missing a required field or a field has the wrong shape. The error message names the problem.

product_choice_required409

The provider sells more than one product, so the request is ambiguous. Repeat it with product_choice set to one of the returned candidates.

table_not_found404

No published table with that name. The message lists the published tables, and says so when the name is an entity type to read as records.

unknown_entity_type404

No entity type with that slug. GET /v1/schema lists the valid ones; the message of a records list names the entity types that hold records the key can read, and says when the name is a published table.

invalid_include400

include names something other than source, the only value GET /v1/records/:recordId takes.

source_read_budget429

The key has read source payloads 2000 times this UTC day. The response carries Retry-After with the seconds until the budget resets. Source reads are for inspecting a record and bridging to a column being mapped, never for mirroring a connector; ask for the fields with POST /v1/connectors/:slug/expansions.

connector_not_found404

No connector with that slug exists. GET /v1/connectors lists the valid ones.

resource_not_found404

The connector has no source resource with that name. A record's source carries its resource_type, and the connector's entity cards list the resources under sources.

invalid_expansion400

Neither resource with fields nor a description was sent, fields was sent without resource or names more than 50 paths, description is shorter than 12 characters or longer than 4000, entity is not an entity type, or the request could not be filed; the message says which.

expansion_request_budget429

The key has filed 10 expansion requests this UTC day. The response carries Retry-After with the seconds until the budget resets. Several asks for one connector belong in one request.

record_not_found404

No record matches. For external_id lookups, nothing with that id was written through this API. For record ID lookups, the id is unknown or is a syn_ prefixed synthetic row id, which has no single record behind it.

org_not_granted404 or 403

No active grant for that organization: 404 when the organization has never granted you access, 403 when the grant exists but is revoked or expired.

org_not_found404

No organization with that id has connected to you.

key_not_found404

No API key with that id exists.

webhook_not_found404

No webhook endpoint with that id exists, or it was deleted.

attachment_not_found404

No attachment with that id exists, or its record is outside your granted organizations.

transformation_not_found404

No transformation publishes a table with that name.

external_id_conflict409

The external_id on a connect session already identifies a different organization. Omit org to reuse it, or send the matching org id.

cursor_expired410

The changes cursor is older than the 30 day retention window. Restart from a full rows read.

payload_too_large413

Record data must be under 100KB, and a request body with attachments under 40 MB.

poll_too_frequent429

This change feed read found no changes, and the same read with the same cursor found none less than 60 seconds ago; the feed only moves when a sync finishes or a record is written. It means you are caught up; the Retry-After header says when a retry is worthwhile, and a webhook saying the feed moved is the better cue.

rate_limited429

Over 300 requests per minute on this API key. Retry after the seconds in the Retry-After header.

internal_error500

Something went wrong handling the request. Safe to retry after a short wait. Valtrix is alerted to persistent failures automatically.

query_timeout422

A list read was stopped at the database time limit before it finished: its filters or its order are ones no index serves on a data set this large, so the same request is stopped again. Narrow it instead: name a connector, add synced_since, filter on a reference column or _record_id, or order by _synced_at or _changed_at in place of a data column. Valtrix is alerted when a read keeps timing out.

storage_unavailable503

Attachment storage is temporarily unavailable. Safe to retry after a short wait.

invalid_propagation400

connection was passed without propagate: true. The connection field only addresses a propagated write.

invalid_op400

A write intent op filter is not one of create, update, or delete.

unknown_connection404

The connection id passed for propagation does not belong to this organization.

write_not_supported409

propagate: true was requested but no connected system for the organization declares that create, update, or delete on that entity type.

write_ambiguous409

More than one connection can take the write. Pass connection to choose which one propagates.

write_fields_unsupported409

propagate: true was requested but the connection sends none of the fields in data on that operation (and the write carries no lines or document it takes), so nothing would reach the source. The message names the fields the operation sends; nothing was written.

write_intent_not_found404

No write intent with that id exists.

write_intent_not_retryable409

Only failed write intents can be retried.

applets_not_enabled403

Applets are not enabled for the organization. Valtrix turns them on per organization; nothing in this API can.

applet_not_found404

No applet with that id belongs to an organization this key can reach, or it was deleted.

invalid_definition400

definition is missing or is not a JSON object.

invalid_expected_version400

expected_version is missing or is not a positive integer.

invalid_note400

note is not a string of at most 500 characters.

definition_rejected422

The definition does not validate against the organization's data, or one of its sources does not run: a block, column, entity type, source, expression, or write the vocabulary or the organization's connections do not allow. issues lists each problem with the path into the definition and what is wrong; nothing was written.

applet_version_conflict409

The applet's current version is not the expected_version sent, so someone published since the definition was read. The response carries version; read the applet again and reapply the change.

applet_draft_exists409

The applet has unpublished draft changes made in the organization console. Send replace_draft: true to discard them and publish the definition sent instead.

applet_limit_reached409

The organization already holds as many applets as it can. One has to be deleted in the console before another is created.

invalid_state400

state is not an object, names an input the applet does not have, or holds a value an input refuses (a required field left empty, a number that is not one, a row id that was not submitted). fields lists each input with what is wrong.

invalid_result400

result is not an object. Send the result object an earlier run of the same applet returned, as it was returned.

applet_action_not_found404

The applet's published definition has no action with that key. The message lists the keys it has.

applet_action_not_runnable400

The action is a reset, which clears inputs in the browser and does nothing on the server, or a read_speech, which fills the form in the console from what a person said. Send the values in state instead.

applet_not_published409

The applet has no published version to run: it was created in the console and never published, or its published definition no longer parses.

applet_rows_limit400

More rows were submitted than one call runs. The message names the cap; send fewer rows or let the applet's automation work through them.

confirmation_required409

The action declares confirm and the call did not send confirm: true. Nothing ran. The response carries the rendered sentence in confirmation, to read back before running again with confirm: true.

applet_run_not_found404

No automation run with that id belongs to the applet.

applet_no_automation409

The applet's published version has no auto action, so there is nothing to queue. Add an auto clause to an upsert_each action and publish first.

$ curl "https://api.valtrix.com/v1/records/customer/customer_8f2?org=org_2d9x4v" \
-H "Authorization: Bearer $VALTRIX_API_KEY"
HTTP/2 404
{
"error": "No active grant for that organization.",
"code": "org_not_granted"
}

Rate limits

Each API key can make 300 requests per minute, counted across all endpoints; a request with no valid key is limited the same way per client address. Past the limit, requests return 429 with code rate_limited and a Retry-After header giving the seconds until the window resets. The SDK handles this for you: it waits out Retry-After and retries automatically, and throws a ValtrixRateLimitError, with retryAfterSeconds on the error, only once its retries are exhausted. If you find yourself near the ceiling while reading tables, bigger pages help more than more calls: limit goes up to 200, and cursors page through the rest. The change feed has one limit of its own. A read that finds no changes, repeated with the same cursor less than 60 seconds after the first empty one, returns 429 with code poll_too_frequent and a Retry-After header instead of an empty list, since the feed only moves when a sync finishes or a record is written. A read that finds changes is always served, and the SDK's changes() treats this 429 as caught up and ends without an error. A table.changed webhook is the usual cue to read the feed.

$ curl https://api.valtrix.com/v1/tables/customers_clean/rows \
-H "Authorization: Bearer $VALTRIX_API_KEY"
HTTP/2 429
Retry-After: 12
{
"error": "Rate limit exceeded.",
"code": "rate_limited"
}

Filtering

Rows filter server side with query parameters of the form <column>=<op>.<value>. Repeated parameters combine, and a row has to match all of them. Values are checked against the column type in your schema, so number columns compare numerically, and a column that is not in the schema returns unknown_column. The same grammar filters canonical records on GET /v1/records/:entityType, against the entity's fields instead of table columns. The SDK expresses the same grammar as a where object. Ids are the handle worth keeping: your own external_id for records you write, and the _record_id from rows you read, either of which fetches the current state again later. One id appears under three names: a row's _record_id, a record object's id, and a change event's record_id are the same rec_ prefixed record ID, and reference columns hold that same value.

eq, neqoperators

Equals and not equals.

gt, gte, lt, lteoperators

Range comparisons, typed per column: number columns compare numerically, date columns compare in ISO order.

in.(a,b)operator

Matches any value in a comma separated list.

is.null, not.nulloperators

Whether the column has a value.

_record_idmeta column

Point lookup by row id with eq.<id> or in.(a,b); other operators are rejected. Every row carries its id in _record_id, and within a table an id matches at most one row, so it fetches the same row again. rec_ prefixed ids resolve to a record through GET /v1/records/:recordId; syn_ prefixed ids from aggregating or reshaping steps filter the same way but resolve to no record.

_external_idmeta column

On GET /v1/records/:entityType only: point lookup by the record's id in its source system with eq.<id> or in.(a,b); other operators are rejected. Every record carries it as _external_id: a connected system's own key for the row (an invoice's CFDI UUID, a vendor code) or the external_id an API write supplied. Rows do not carry _external_id; the records endpoint resolves a source id to its _record_id.

_frozenmeta column

Whether the row's record is outside its connector's sync window and no longer refreshed, with eq.true or eq.false (neq also works); other operators are rejected. _frozen=eq.false reads only the rows the sync still maintains. Rows from aggregating or reshaping steps have no record and count as not frozen.

_attachment_idmeta column

The id of the newest stored attachment of the row's record (a synced document, a rendered PDF, a report screenshot), null when it has none or the row has no record. Filterable with eq.<id>, neq.<id>, in.(a,b), is.null, and not.null, so _attachment_id=not.null reads only the rows that have a file. Resolve the id to a file through the record's attachments endpoint, never through a stored URL.

reference columnstyped

Columns typed reference hold record ids and filter like ids: eq, neq, in.(a,b), is.null, not.null. Range operators are rejected. To cross-reference, collect the reference values from one read and pass them to the target table as _record_id=in.(a,b). A reference that can point at more than one entity type pairs with a sibling type column naming the linked entity, so a cost row carries payee_id plus payee_type set to vendor or employee.

$ curl https://api.valtrix.com/v1/tables/customers_clean/rows \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-G -d "email=not.null" -d "order=created_at.desc"
$ curl https://api.valtrix.com/v1/tables/customers_clean/rows \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-G -d "_record_id=eq.rec_9d4f2c81a7b3e650d21c4f8a"

Pagination

List endpoints return up to limit items and a next_cursor. Sending it back as cursor fetches the next page. On row and record pages, a null next_cursor means you have everything. On the change feed, a null next_cursor means you are caught up for now, and the last non-null cursor is the one to keep and poll with again later. A cursor is an opaque bookmark minted by the server, and it works the same everywhere in the API, on row pages and on the change feed alike: it goes back exactly as it arrived, it is not an id, and it has no shape to build or edit. In the SDK, page() exposes the same cursor round-trip when you want explicit control, and iterate() and changes() thread it for you until the feed is drained. A row or record page is a position in the list's order, not a snapshot: each cursor continues from the last item of the page before it, and the data keeps moving underneath. In the default id order a walk never returns the same item twice, and an item that lands behind the cursor is simply not seen by that walk. Ordered by _synced_at or _changed_at, a record re-read while you walk moves ahead of the cursor and can come back once more or not at all. For a backfill, read in the default order, drain GET /v1/tables/:name/changes to its end before the first page and keep the last cursor it returned, and replay the feed from that cursor once the walk is done, so anything that moved during the walk is picked up; the change feed itself is ordered by commit and never skips or repeats.

limitnumber

Defaults to 50. Values above 200 are clamped to 200.

cursorstring

The next_cursor from the previous page, sent back exactly as you received it. Omit on the first call.

next_cursorresponse

Send back as cursor to fetch the next page. null means the last page.

$ curl https://api.valtrix.com/v1/tables/customers_clean/rows \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-G -d "limit=200" -d "cursor=eyJpIjoiMDFo..."

Tables

The table object

One published table and its column contract, as GET /v1/schema and GET /v1/tables return it. Columns are the only part that varies between tables; the meta fields every row carries are listed on the row object below. The shape is the same for every organization, since a table is defined once per platform and filled per organization. A table is created by publishing a transformation that outputs it, never directly; see Transformations.

Fields
namestring

The table name: the path segment in GET /v1/tables/:name/rows, and the property the generated SDK client exposes the table under.

entity_typestring

The record entity type the table is derived from, the same slug GET /v1/records/:entityType takes. Rows with a rec_ id resolve to records of this type.

statusstring

building until the table's first build finishes, live while it serves rows and is rebuilt after every sync, paused when the table is stopped and keeps its last rows without rebuilding.

row_countnumber

The number of rows the table currently holds across every organization you hold an active grant for.

row_identitystring or null

How the table's row ids relate to records: record when every row keeps its source record id, synthetic when the table aggregates or reshapes so row ids are generated, or mixed when both occur. null until the first build.

last_built_atstring or null

When the table's rows were last rebuilt, as an ISO 8601 timestamp. null while the first build is still running.

schema_versionstring or null

The version of the table's published column contract, as v1, v2, and so on. It moves only when the transformation is republished with different columns; every rows and changes response repeats it, so compare it against the value your client was generated from to detect a drift. table.schema_updated fires when it changes. null until the table has been published once.

columnsarray

The column contract, one object per column: - key: the property name on every row, and the name a filter or order parameter takes - type: one of string, number, boolean, date, json, or reference. date values are ISO 8601 strings, json values are nested objects or arrays, and a reference holds the _record_id of a related record - nullable: true when a row may carry null in the column - description: the column's documentation, written by the table's author or carried from the entity field - writable: true when the column maps straight back to a field of the source entity type, so a value you write to that field through POST /v1/records/:entityType lands in this column on the next build. Computed, aggregated, or split columns are not writable

{
"name": "customers_clean",
"entity_type": "customer",
"status": "live",
"row_count": 1204,
"row_identity": "record",
"last_built_at": "2026-07-08T09:30:00Z",
"schema_version": "v1",
"columns": [
{ "key": "email", "type": "string", "nullable": true, "description": "...", "writable": true },
{ "key": "customer_id", "type": "reference", "nullable": true, "description": "...", "writable": true }
]
}

The row object

Every row a table returns is your columns plus five meta fields. The shape is identical for every organization and every connector; GET /v1/schema is the contract for the column part.

Fields
<column>per schema

One property per column in the table schema, named by the column key and typed string, number, boolean, date, json, or reference. A reference column holds the _record_id of a related record, so it joins without name matching: filter the target table with _record_id=eq.<value>, or resolve it directly with GET /v1/records/:recordId. Nullable columns can be null.

_record_idstring

The id of the row. Within a table an id matches at most one row, so it fetches the same row again through a _record_id filter. rec_ prefixed ids resolve to a record through GET /v1/records/:recordId; ids starting with syn_ belong to derived rows from aggregating or reshaping steps and resolve to no record. A syn_ id survives a republish of the transformation only when the SQL step that generates the row declares a key; otherwise the id is a hash of every value in the row, and a republish that changes the query replaces every row under a new id.

_org_idstring

The organization the row belongs to. Reads span every organization you hold an active grant for, so use it to attribute rows when you serve more than one.

_connectorstring or null

The slug of the connector the row's record was synced from, so you can attribute the row to its origin system. GET /v1/connectors resolves slugs to display names. Rows derived from records you wrote through this API carry the API source. null on syn_ rows, which aggregate or reshape many records and have no single origin.

_synced_atstring

When a sync last confirmed the row's record against its source, as an ISO 8601 timestamp. It moves when a sync finds the record changed, and on every full sync and periodic sweep that reaches the record whether or not anything changed; a sync between sweeps that reads the record again and finds it unchanged leaves the value where it was. So it says how recently the row was confirmed, not when it changed; a frozen row keeps the value from the last run that reached it. Orderable, so order=_synced_at.desc reads the most recently confirmed rows first, and filterable by range, so _synced_at=lt.<timestamp> finds rows not confirmed since then.

_changed_atstring

When the row's record last actually changed, as an ISO 8601 timestamp. It moves when a sync or a write finds different data, not when the record is merely looked at. Valtrix linking a reference once its target record arrives, or filling a connector constant, is logged as a change but does not move it. A row whose _synced_at keeps moving while _changed_at stays put has been stable since then. Orderable: order=_changed_at.desc reads the most recently changed rows first. Filterable by range: _changed_at=gte.<timestamp> reads the rows that changed since a cutoff. Rows that aggregate many records carry the newest of their records' values. Counts from when Valtrix first synced the record, so it never predates the organization's connection.

_frozenboolean

true when the row's record is outside the connector's sync window and no longer refreshed. The row keeps the values last fetched inside the window and stays in the table. false on rows whose record still syncs. Filterable, so _frozen=eq.false reads only the rows the sync maintains. A row freezing or thawing appears in the change feed and in table.row_changed as an update whose changed_columns is ["_frozen"].

_attachment_idstring or null

The id of the newest stored attachment of the row's record: a document the connector synced with it, a PDF Valtrix rendered for it, or a screenshot of the source's own report page taken after the figures were read. null when the record has no stored file, and always null on syn_ rows, which aggregate or reshape many records and keep no single record; a table that groups records keeps a file through its own SQL step instead (max(_attachment_id) over the group, since attachment ids sort by creation time). Resolve the id to a file through GET /v1/attachments/:attachmentId/url (a short-lived display link, requested fresh each time) or GET /v1/attachments/:attachmentId/download, never through a stored URL; GET /v1/records/:recordId/attachments lists every attachment of the record. Filterable: _attachment_id=not.null reads only the rows that have a file. A newer attachment on an otherwise unchanged record arrives in the change feed and in table.row_changed as an update whose changed_columns is ["_attachment_id"] and whose previous holds the old id, so a subscription with that column filter hears about every new file and nothing else.

{
"email": "...",
"created_at": "2026-07-01",
"_record_id": "rec_9d4f2c81a7b3e650d21c4f8a",
"_org_id": "org_7f3k2m",
"_connector": "procore",
"_synced_at": "2026-07-08T09:30:00Z",
"_changed_at": "2026-07-06T15:12:00Z",
"_frozen": false,
"_attachment_id": "cmv8g9nb9008rieyimucedeq4"
}

The change object

One entry in a table's change feed, describing a row that was created, updated, or removed.

Fields
typestring

upsert when the row was created or updated, delete when it was removed.

cursorstring

A bookmark for this change's position in the feed; resuming from the last one you processed picks up where you left off.

occurred_atstring

When the change happened, as an ISO 8601 timestamp.

record_idstring

The id of the affected row, the same value the row carries as _record_id. For deletes it identifies which row to drop.

org_idstring

The organization the row belongs to.

changed_columnsarray or null

The columns whose values differ from the row's previous version, for an update. null when the row is new to the table, and null for deletes. It is what tells the change you care about from an edit to an unrelated column. A row whose record froze or thawed arrives with changed_columns ["_frozen"] and previous holding the old _frozen value; the row itself carries the new one. A row whose record gained a newer attachment, with nothing else different, arrives with changed_columns ["_attachment_id"] the same way.

previousobject or null

The values the changed columns held before this change, keyed by column, and only those columns. An empty object for an update whose changed_columns is empty, null whenever changed_columns is null.

rowobject or null

The full row after the change for upserts, in the row object shape. null for deletes.

{
"type": "upsert",
"cursor": "eyJjIjoiODIzMiJ9",
"occurred_at": "2026-07-08T09:30:00Z",
"record_id": "rec_9d4f2c81a7b3e650d21c4f8a",
"org_id": "org_7f3k2m",
"changed_columns": ["status"],
"previous": { "status": "under_review" },
"row": { ... }
}

The data category object

One business-function group of the record entity types, as GET /v1/schema lists them under categories. A Connect session's scope may name categories instead of entity types, which is the form to use before the organization's system is known: each category expands to the entity types listed here before the link is minted, and line items follow the documents that carry them. The list is fixed and the same for every platform; a new connector lands inside it rather than adding to it.

Fields
slugstring

The category's identifier, the value scope.categories takes on POST /v1/connect/sessions.

labelstring

The category's display name, as the console shows it when a connect link is minted without a connector.

descriptionstring

One sentence on what the category holds, in business terms.

sensitivityarray

The kinds of sensitive data the category carries: personal, health, financial, employment, or content (files and free text). Empty for a category that carries none.

entity_typesarray

The record entity types the category expands to, in registry order, line_item included when the category holds a document that carries lines.

{
"slug": "payables",
"label": "Payables",
"description": "What the business owes and what went out: bills, expenses, card transactions, issued payments, and vendor compliance.",
"sensitivity": ["financial"],
"entity_types": ["cost", "compliance_document", "payment", "payment_allocation", "line_item"]
}

Retrieve the schema

GET/v1/schema

Your full API contract: every published table with its columns, and every writable entity type. Compare schema_version between reads to detect published changes.

Parameters
orgstring

Narrow to the tables and entity types one organization granted, by id. Omit to see everything published for the platform.

Returns
tablesarray

One table object per published table, with its columns.

recordsarray

One entry per entity type, with its fields and its own schema_version. Entity schemas only gain fields, so a version bump never removes or retypes one.

categoriesarray

One data category object per category, in a fixed order: the business-function groups a Connect session's scope may name, each with the entity types it expands to.

$ curl https://api.valtrix.com/v1/schema \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{
"tables": [{ "name": "customers_clean", "entity_type": "customer", "status": "live", "row_count": 1204, "row_identity": "record", "last_built_at": "2026-07-08T09:30:00Z", "schema_version": "v1", "columns": [{ "key": "email", "type": "string", "nullable": true, "writable": true, "description": "..." }] }],
"records": [{ "entity_type": "customer", "label": "Customer", "description": "...", "title_key": "name", "schema_version": "v1", "columns": [...] }],
"categories": [{ "slug": "payables", "label": "Payables", "description": "...", "sensitivity": ["financial"], "entity_types": ["cost", ...] }]
}

List tables

GET/v1/tables

Lists your published tables in the same shape as /v1/schema. GET /v1/tables/:name returns a single table, or 404 table_not_found. Each table reports row_identity: "record" when every row keeps its source record id, synthetic when the transformation aggregates or reshapes so row ids are generated, or mixed when both occur; null until the first build. A synthetic id is stable across republishes of the transformation only when its SQL step declares a key; without one the id is a hash of every value in the row, so a republish that adds a column replaces every row, and the change feed reports each as a delete of the old id followed by an insert of the new one.

Parameters
orgstring

Narrow to the tables and entity types one organization granted, by id. Omit to see everything published for the platform.

Returns
tablesarray

Table objects in the same shape as /v1/schema.

The single table form returns one table object, or 404 table_not_found.

$ curl https://api.valtrix.com/v1/tables \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "tables": [{ "name": "customers_clean", "entity_type": "customer", "status": "live", "row_count": 1204, "row_identity": "record", "last_built_at": "2026-07-08T09:30:00Z", "schema_version": "v1", "columns": [...] }] }

List rows

GET/v1/tables/:name/rows

Reads rows across every organization you hold an active grant for. Filtering, ordering, projection, and pagination run server side.

Parameters
namepath

The table name, as listed by /v1/tables.

<column>string, repeatable

Filter as <op>.<value> with eq, neq, gt, gte, lt, lte, plus in.(a,b), is.null, and not.null. Repeat with different columns; all must match.

_record_idstring

Point lookup by row id, as eq.<id> or in.(a,b). Every row carries its id in _record_id, so store it to fetch the same row again. Ids come in two forms, and both filter the same way: rec_ prefixed ids are record ids that resolve through GET /v1/records/:recordId, while syn_ prefixed ids belong to rows generated by aggregating or reshaping steps and resolve to no record. The table's row_identity field tells you which form to expect. Supports eq and in only.

_changed_atstring, repeatable

Range filter on when the row last actually changed, as gt., gte., lt., or lte. followed by an ISO 8601 timestamp. Combine two for a window. A cutoff, not a change feed: rows deleted since the cutoff never appear here, so the table's change feed is the way to stay in sync, and this filter suits one-off reads such as a backfill.

_synced_atstring, repeatable

Range filter on when a sync last confirmed the row's record against its source, with the same gt., gte., lt., and lte. forms as _changed_at. A frozen row's record is never re-read, so its _synced_at stays where the last run that reached it left it.

_frozenstring

eq.true keeps only rows whose record is outside the connector's sync window and no longer refreshed; eq.false keeps only rows the sync still maintains. Supports eq and neq with true or false only.

orderstring

One column as <column>.<asc|desc>. _synced_at and _changed_at are also orderable, and filterable by range.

selectstring

Comma separated column keys to return. The row's underscore fields (_record_id, _org_id, _connector, _synced_at, _changed_at, _frozen) are always returned whatever you select, and naming one of them here is allowed.

limitnumber

Defaults to 50. Values above 200 are clamped to 200.

cursorstring

The next_cursor from the previous page, sent back exactly as you received it.

orgstring

Narrow to one organization by id.

Returns
rowsarray

Row objects matching the query.

next_cursorstring or null

The bookmark for the next page. null means the last page.

schema_versionstring

The table's current schema version.

$ curl https://api.valtrix.com/v1/tables/customers_clean/rows \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-G -d "email=not.null" -d "order=created_at.desc" -d "limit=50"
{
"rows": [{ "email": "...", "created_at": "2026-07-01", "_record_id": "rec_9d4f2c81a7b3e650d21c4f8a", "_org_id": "org_7f3k2m", "_connector": "procore", "_synced_at": "2026-07-08T09:30:00Z", "_changed_at": "2026-07-06T15:12:00Z", "_frozen": false, "_attachment_id": null }],
"next_cursor": "eyJpIjoiMDFo...",
"schema_version": "v1"
}

The change feed

GET/v1/tables/:name/changes

An ordered, resumable feed of row changes, deletes included. Each change carries a cursor, a bookmark for its position in the feed rather than a record id. Read from the last cursor you processed until the list comes back empty, and you are up to date. The feed only moves when a sync of the organization's connections finishes or a record is written, so it rewards being read when something has changed. A webhook endpoint subscribed to table.changed can drain the feed from your stored cursor each time it fires, with a reconcile from the same cursor every 15 to 60 minutes to cover a delivery that went missing. Without webhooks, a poll every 15 minutes is plenty. A read that finds no changes, repeated with the same cursor less than 60 seconds after the first empty one, returns 429 poll_too_frequent with a Retry-After header instead of an empty list. A read that finds changes is always served, so a webhook that fires right after an empty read, or a backlog being drained, is never held back. A change appears in the feed only once its write has committed, so a stored cursor never skips a change that was still being written when you read. Changes are retained 30 days, after which a stale cursor returns 410 cursor_expired. One removal never reaches the feed: when an organization revokes your access, its rows are removed from every table at once with no delete changes and no table.row_changed deliveries, and grant.revoked is the only signal. A consumer that keeps a copy clears that organization's rows by _org_id on that event.

Parameters
namepath

The table name, as listed by /v1/tables.

cursorstring

The cursor of the last change you processed, or the last next_cursor. Omit on the first call to read from the start.

limitnumber

Defaults to 50. Values above 200 are clamped to 200.

orgstring

Narrow to one organization by id.

Returns
changesarray

Change objects in feed order. Empty means you are caught up.

next_cursorstring or null

The bookmark to resume from on your next poll. null when this poll returned no changes: keep the last non-null cursor you received and poll with it again later, never store the null.

schema_versionstring

The table's current schema version.

$ curl https://api.valtrix.com/v1/tables/customers_clean/changes \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-G -d "cursor=eyJjIjoiODIzMSJ9" -d "limit=200"
{
"changes": [{ "type": "upsert", "cursor": "eyJjIjoiODIzMiJ9", "occurred_at": "2026-07-08T09:30:00Z", "record_id": "rec_9d4f2c81a7b3e650d21c4f8a", "org_id": "org_7f3k2m", "changed_columns": ["status"], "previous": { "status": "under_review" }, "row": { ... } }],
"next_cursor": "eyJjIjoiODIzMiJ9",
"schema_version": "v1"
}

Records

Records are the canonical store: every entity Valtrix syncs from an organization's connected systems, in the same shape for every connector, plus the records you write back through this API. Query them directly with GET /v1/records/:entityType when you want the canonical data as-is; your tables remain the curated layer on top, with your own column shapes, quality gates, and change feeds. Writes create records, not rows: each write flows through your published transformation, and the response reports the outcome per table as applied, removed, quarantined, filtered, or pending. Fields typed reference in the schema hold record ids and link entities without name matching: a project's customer_id is the id of a customer record, so resolve it with GET /v1/records/:recordId, filter the entity list with customer_id=eq.<id>, or batch the values into a _record_id=in.(a,b) filter on a customer table.

The record object

A record as Valtrix stores it, before transformation. Records synced from connected systems and records you write through this API share this shape.

Fields
idstring

The rec_ prefixed record ID. Table rows derived from this record carry it as their _record_id, and reference fields on other records hold it as their value, so either resolves back to this record through GET /v1/records/:recordId.

entity_typestring

The entity type slug. GET /v1/schema lists them.

external_idstring

The identifier the record was written under: yours for records written through this API, the source system's for synced records.

org_idstring

The organization the record belongs to.

connectorstring

The slug of the connector the record was synced from, so you can attribute it to its origin system. GET /v1/connectors resolves slugs to display names. Records you wrote through this API carry the API source.

dataobject

The record's fields as written or synced, before your transformation runs. The fields each entity type carries are listed under Record entity types below.

connection_idstring or null

The id of the connection the record lives in, matching an entry in the organization object's connections. Pass it as connection on a propagated write to address that system explicitly. null for records that exist only in Valtrix.

source_idstring or null

The id the source system assigned to the record. For synced records it is the source's own id; for records you propagated it is filled once the write intent is applied, and null before then.

last_write_intentobject or null

The most recent write intent on this record, as { id, status }, or null when nothing has been propagated. Fetch it with GET /v1/write-intents/:id to see the outcome and any source error.

created_byobject

Who created the record, as { kind, id, name }. kind is connector for a synced record (id the connection, name the connector slug), key for a write through this API (id and name of the API key), applet for a write from one of the organization's applets (id and name of the applet), or user for an edit made in the console. The name is the one the writer had at the time.

updated_byobject

Who last changed the record's data, in the same shape as created_by. A sync that changes a record written through this API moves it back to the connector. Unchanged re-reads and no-op writes leave it alone.

synced_atstring

When the record was last written or confirmed against its source, as an ISO 8601 timestamp. It moves when a sync finds the record changed, and on every full sync and periodic sweep that reaches the record whether or not the data changed; a sync between sweeps that reads the record again and finds it unchanged leaves the value where it was; a frozen record keeps the value from the last run that reached it.

changed_atstring

When the record's data last actually changed, as an ISO 8601 timestamp: the last sync or write that found different values. Stays put while synced_at moves on the sweeps that confirm an unchanged record. Counts from when Valtrix first synced the record.

frozenboolean

true when the record is outside the connector's sync window and no longer refreshed. The data holds the values last fetched inside the window, and the record stays readable here and in your tables. Filterable, so _frozen=eq.false reads only the records the sync maintains; a record freezing or thawing reaches your tables' change feeds as an update whose changed_columns is ["_frozen"].

sourceobject or null

Only on GET /v1/records/:recordId with include=source or source_paths: the record's stored source payload as { resource_type, paths, data }. resource_type names the connector's source listing the record came from (the resource_type to pass to POST /v1/connectors/:slug/expansions), paths echoes the source_paths asked for or is null for the whole payload, and data holds the provider's own fields, nested as the provider nests them, minus any fields turned off for the connector. null for a record written through this API, which has no source payload. The shape is the provider's and changes without notice: read it for a field the entity does not carry yet, then ask for the column rather than building on it.

{
"id": "rec_9d4f2c81a7b3e650d21c4f8a",
"entity_type": "customer",
"external_id": "customer_8f2",
"org_id": "org_7f3k2m",
"connector": "procore",
"connection_id": "conn_7f3k2m",
"source_id": "CR-88213",
"last_write_intent": null,
"created_by": { "kind": "connector", "id": "conn_7f3k2m", "name": "procore" },
"updated_by": { "kind": "connector", "id": "conn_7f3k2m", "name": "procore" },
"data": { "name": "...", "email": "..." },
"synced_at": "2026-07-08T09:30:00Z",
"changed_at": "2026-07-06T15:12:00Z",
"frozen": false
}

The sync window object

One entry of a connector's resources: how one synced resource relates to time. A connector loads holds_months of history on a connection's first sync and keeps everything from then on, so the span held grows forward from that day. Every later sync re-reads only the last refreshes_days, and the scheduled full sync, which runs every full_sync_every_hours, re-reads the last full_sync_days; a record inside the span being re-read is refreshed, gains its files, and is deleted when the source no longer lists it, a record between the two spans keeps its values until the next full sync reaches it, and a record older than both is kept with its last values and reads frozen true (its synced_at stops moving). Either span is null when the whole held span is re-read. Documents are fetched for records inside files_months and every stored file is kept. A connection widens its held span once, with history_from; the backfilled records freeze on the next sync like any other record outside the full-sync span. The entry is read-only and the same for every connection of the connector.

Fields
resource_typestring

The connector's own name for what it reads, such as invoices or bill_history.

entity_typestring

The entity type the resource maps to, as GET /v1/schema describes it.

holds_monthsnumber or null

How many months back the first sync loads. null for a resource with no date to bound it, such as a short reference list, which is read whole.

refreshes_daysnumber or null

How many days back every later sync re-reads. null when every later sync re-reads the whole held span, or when the resource tracks changes through a watermark instead.

full_sync_daysnumber or null

How many days back the scheduled full sync re-reads, every full_sync_every_hours of the connector. null when it re-reads the whole held span, which is the default; a number when the connector narrows its full sync to that many days, never fewer than refreshes_days.

files_monthsnumber or null

How many months back documents are fetched for the resource's records. null when the resource carries no files.

{
"resource_type": "invoices",
"entity_type": "invoice",
"holds_months": 3,
"refreshes_days": 30,
"full_sync_days": null,
"files_months": 3
}

The attachment object

A source document Valtrix captured alongside a record while syncing, such as the scanned vendor bill behind a cost record. Documents arrive as the source system holds them, and many sources hold per-page image scans, so a multi-page upload can arrive as one attachment per page with the page number in the filename. Valtrix stores the document itself, so downloads keep working even when the source system is slow or unreachable. Every stored file is kept: a document is fetched for records inside the resource's files_months span, and once stored it stays available however old its record grows.

Fields
idstring

The attachment ID. The display link endpoint turns it into a link for showing the document in your app, and the download endpoint into the bytes.

filenamestring or null

The document filename when the source provided one. It names the original upload, so a filename ending in .pdf can belong to an image scan of one of its pages.

media_typestring

The MIME type of the stored document, such as application/pdf or image/jpeg. It is the authoritative format of the bytes, and the right basis for a file extension when saving.

bytesnumber

The stored size in bytes.

content_hashstring

SHA-256 hash of the document bytes. Two attachments with the same hash hold the same document, so a matching hash means a download you already have.

created_atstring

When Valtrix first stored the document, as an ISO 8601 timestamp.

{
"id": "clx1a2b3c4d5e6f7g8h9i0j1k",
"filename": "invoice-4417.pdf (page 1)",
"media_type": "image/jpeg",
"bytes": 58369,
"content_hash": "f3a91c0e7b2d...",
"created_at": "2026-07-10T04:00:00Z"
}

List records

GET/v1/records/:entityType

Queries the canonical records of one entity type across every organization you hold an active grant for, synced and API-written alike. The same filter, order, select, and cursor grammar as table rows, applied to the entity's fields from GET /v1/schema. Each result is the entity's fields flat on the object plus meta fields, so a record here and a row from an untransformed table read the same way. Reference fields filter like ids, so following a reference is one query: collect customer_id values from one read and pass them as _record_id=in.(a,b) here, or filter this list by the reference column directly.

Parameters
entityTypepath

The entity type slug. GET /v1/schema lists the valid ones.

<field>string, repeatable

Filter as <op>.<value> with eq, neq, gt, gte, lt, lte, in.(a,b), is.null, and not.null, validated against the entity's field types.

_record_idstring

Point lookup by record ID, as eq.<id> or in.(a,b). Every id here is a rec_ prefixed record ID; there are no synthetic ids at the record layer.

_external_idstring

Point lookup by the record's id in its source system, as eq.<id> or in.(a,b). Every record carries it as _external_id: a connected system's own key for the row (an invoice's CFDI UUID, a vendor code) or the external_id an API write supplied. Exact match. The way to find the record behind an id you hold from the source system, since GET /v1/records/:entityType/:externalId covers API-written records only.

_changed_atstring, repeatable

Range filter on when the record's data last actually changed, as gt., gte., lt., or lte. followed by an ISO 8601 timestamp. Combine two for a window. Deleted records never appear here, so this is a cutoff for one-off reads, not a way to stay in sync.

_synced_atstring, repeatable

Range filter on when a sync last confirmed the record against its source, with the same gt., gte., lt., and lte. forms as _changed_at. _synced_at=gte.<timestamp> is the same window as synced_since. A frozen record is never re-read, so its _synced_at stays where the last run that reached it left it.

_frozenstring

eq.true keeps only records outside the connector's sync window and no longer refreshed; eq.false keeps only records the sync still maintains. Supports eq and neq with true or false only.

_attachment_idstring

Filter on the record's newest stored attachment: not.null keeps only the records that have a file (an email synced with its attachment, a bill with its invoice PDF), is.null the ones without, and eq.<id>, neq.<id>, and in.(a,b) match the id itself. Supports those five forms only.

orderstring

One field as <field>.<asc|desc>. _synced_at and _changed_at are also orderable, and filterable by range.

selectstring

Comma separated field keys to return. The record's underscore envelope (_record_id, _external_id, _org_id, _connector, _connection_id, _source_id, _last_write_intent, _created_by, _updated_by, _synced_at, _changed_at, _frozen, _attachment_id) is always returned whatever you select, and naming one of those fields here is allowed.

limitnumber

Defaults to 50. Values above 200 are clamped to 200.

cursorstring

The next_cursor from the previous page, sent back exactly as you received it.

orgstring

Narrow to one organization by id.

connectorstring

Narrow to records synced from one connector, by slug. GET /v1/connectors lists the valid ones. Records you wrote through this API carry the API source.

synced_sincestring

Only records written or synced at or after this ISO 8601 timestamp. A freshness window, not a change feed: deletions never appear here, so stay in sync through a table's change feed.

Returns
recordsarray

One object per record: the entity's fields, plus _record_id, _external_id, _org_id, _connector, _connection_id, _source_id, _last_write_intent, _created_by, _updated_by, _synced_at, _changed_at, _frozen, and _attachment_id. The underscore fields are the record object's envelope, prefixed so they never collide with entity fields.

next_cursorstring or null

The bookmark for the next page. null means the last page.

schema_versionstring

The entity schema version, as reported by GET /v1/schema.

$ curl https://api.valtrix.com/v1/records/customer \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-G -d "name=not.null" -d "order=_synced_at.desc" -d "connector=procore" -d "limit=50"
{
"records": [{ "name": "...", "email": "...", "_record_id": "rec_9d4f2c81a7b3e650d21c4f8a", "_external_id": "customer_8f2", "_org_id": "org_7f3k2m", "_connector": "procore", "_connection_id": "conn_7f3k2m", "_source_id": "CR-88213", "_last_write_intent": null, "_created_by": { "kind": "connector", "id": "conn_7f3k2m", "name": "procore" }, "_updated_by": { "kind": "connector", "id": "conn_7f3k2m", "name": "procore" }, "_synced_at": "2026-07-08T09:30:00Z", "_changed_at": "2026-07-06T15:12:00Z", "_frozen": false, "_attachment_id": null }],
"next_cursor": "eyJpIjoiMDFo...",
"schema_version": "v1"
}

Aggregate records

GET/v1/aggregates/:entityType

Totals the records of one entity type on the server, across every organization you hold an active grant for: a count, or the sum, avg, min, max of a number field, over the records the filters keep, optionally grouped by one field and split by a second. Use it when the answer is a figure per group, such as cost to date per project or invoices per month, instead of paging every record and adding them up yourself. It takes the same filters as the records list and returns no records, no cursor, and no change feed.

Parameters
entityTypepath

The entity type slug. GET /v1/schema lists the valid ones.

<field>string, repeatable

Filter as <op>.<value>, the same grammar and the same fields as the records list, the _record_id, _external_id, _synced_at, _changed_at, _frozen, and _attachment_id filters included. Only the records the filters keep are totalled.

metricsstring

Comma separated list of one to 5 metrics: count for the number of records, or <function>.<field> with sum, avg, min, max over a number field, such as sum.amount,count.

group_bystring

One field to group by: one group per distinct value. A reference field groups by record ID, a date field by day unless bucket is set, and _synced_at and _changed_at group by day too. Omit it for a single total.

bucketstring

Groups a date group_by field by calendar period: day, week, month, quarter, year. The group key is the first day of the period, as YYYY-MM-DD; a week starts on Monday.

series_bystring

A second field that splits every group, so each entry is one key and series pair, such as cost per project per month. Needs group_by. At most 31 distinct series values are returned; past that the response is truncated.

series_bucketstring

Groups a date series_by field by calendar period, with the same values as bucket.

order_bystring

value, the default, returns the groups with the largest first metric first; group sorts by the group key ascending, which suits dates.

limitnumber

Groups to return. Defaults to 100; values above 1000 are clamped to 1000. There is no cursor: when more groups exist the response is truncated, and a narrower filter reads the rest.

orgstring

Narrow to one organization by id.

connectorstring

Narrow to records synced from one connector, by slug. GET /v1/connectors lists the valid ones.

Returns
groupsarray

One object per group: key, the group's value as text (null for records with no value, and for the single group of a request with no group_by), series when series_by was sent, and values, an object with one number per metric keyed by the metric as you wrote it ("sum.amount", "count"), null when no record in the group carries a number.

truncatedboolean

true when more groups or series exist than were returned.

schema_versionstring

The entity schema version, as reported by GET /v1/schema.

$ curl https://api.valtrix.com/v1/aggregates/cost \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-G -d "metrics=sum.amount,count" -d "group_by=project_id" -d "series_by=issued_at" -d "series_bucket=month" -d "status=eq.posted"
{
"groups": [{ "key": "rec_9d4f2c81a7b3e650d21c4f8a", "series": "2026-10-01", "values": { "sum.amount": 48210.5, "count": 37 } }],
"truncated": false,
"schema_version": "v1"
}

Upsert a record

POST/v1/records/:entityType

Creates or updates a record, keyed by your external_id within the organization. Returns 201 on create and 200 on update, with the derived table rows. In tables that keep one row per record, the record id in the response is the same _record_id carried on that row. Aggregated tables report pending instead of a row: the write lands there through a rebuild, as changes to the bucket rows it feeds, under their own row ids. By default the write stays in Valtrix. Pass propagate: true to also push it into the organization's connected system. The record is still written immediately, the status becomes 202, and the response carries a write intent that tracks the push. How propagation works explains the lifecycle. Before the first propagated write to a system, read what it takes. The organization object's connections list which entity types and operations each connection can take. Each connection's write_guidance lists the fields per operation with their meaning, the values a command field accepts and what each does, the documents an operation carries, and the connector's rules on refusals. An Idempotency-Key makes any write you might retry safe to repeat.

Parameters
entityTypepath

The entity type slug. GET /v1/schema lists the valid ones.

Idempotency-Keyheader, optional

Any unique string, up to 255 characters. A repeat of the same key on this API key within 24 hours replays the original status and body instead of writing again, so a retried request never creates a second record or a second write intent. After 24 hours the key is forgotten and the same call writes again.

orgstring, required

The organization the record belongs to. The grant must cover this entity type.

external_idstring, required

Your identifier, up to 255 characters. Same external_id updates the same record.

dataobject, required

An object of entity fields, under 100KB. Unknown fields are rejected. GET /v1/schema lists the writable fields. Updates merge: fields you omit keep their stored values, and sending null clears a field. A date field takes an ISO 8601 value; one with a time of day must carry its timezone offset (2026-10-27T15:00:00Z), since a wall-clock time with no offset is ambiguous and is refused as invalid_fields. Connectors that write to a system in its own local time convert from the instant you send.

linesarray of line_item objects, optional

The record's line items, written with it in the same call. Each entry is an object of line_item fields and becomes an ordinary line_item record, the same entity you read back from GET /v1/records/line_item. GET /v1/schema lists its writable fields. Accepted on contract, estimate, invoice, order, cost, and journal_entry records only. Any other entity, or an unknown line field, returns 400 invalid_fields. Sending lines replaces the record's previous lines. With propagate: true the header and its lines reach the source system in one write intent. The link to the parent record is stamped for you: - document_entity: the parent's entity (contract, cost, and so on) - document_type: the parent's kind (purchase_order, bill, and so on) - document_id: the parent's record id - position: defaults to the line's index - external id: <external_id>/line/<position>

attachmentsarray of attachment inputs, optional

Files written with the record, at most 10, each { "filename", "media_type", "content" } with content the file as a base64 string and an optional kind, a short lowercase token (invoice, purchase_order) saying what the file is, for a connector whose write puts different files through different steps; a file with no kind is the default one, and the connection's write_guidance names the kinds its connector reads. media_type is one of application/pdf, application/xml, text/xml, image/png, image/jpeg, image/gif, image/webp, and the files must decode to at most 25 MB together (400 invalid_attachments otherwise, with fields naming each issue; 503 storage_unavailable when attachment storage is down). Each file becomes a record attachment, listed by GET /v1/records/:recordId/attachments and downloadable like a synced document; the same content sent again is stored once. With propagate: true the files reach the source system in the same write intent when the connector's write takes them, the way an invoice's XML and PDF are uploaded into a supplier portal, and a second PDF tagged kind: "purchase_order" is uploaded beside the invoice PDF.

propagateboolean

Defaults to false. When true, the write is also propagated to the organization's connected system and the response is 202 with a write intent. Whether the propagated write creates or updates at the source depends on the external_id. An external_id a connected system already synced (its own id for the row, the _external_id of that synced record) updates that row on its connection. Any other external_id creates the row at the source. That includes a synced record's id sent with connection naming a different connection, which creates the row there. A repeat of an external_id whose create is still pending on that connection updates the record in Valtrix and returns the pending write intent instead of queuing a second create. Refused with: - 409 write_not_supported: no connected system declares create or update for this entity type - 409 write_ambiguous: more than one does and connection is not given - 409 write_fields_unsupported: the connection sends none of the fields in data on that operation, so the write would reach the source as nothing Fields the connection does not send are stored in Valtrix and listed under warnings.

connectionstring

The id of the connection to propagate to, from the organization object's connections or a record's connection_id. Only valid with propagate: true (400 invalid_propagation otherwise); 404 unknown_connection when it does not belong to the organization.

source_fieldsobject

Connector-specific SDK fields and operations, up to 100KB. Requires propagate: true and an SDK write connector. Sage Estimating accepts fields, references, estimate_id, phase_code, item_code, catalog_item_id, copy_from, collections, and lines. Options are stored on the write intent and do not become canonical columns. Unsupported connectors return 400 invalid_source_fields.

Returns
createdboolean

true with status 201 on create, false with status 200 on update. With propagate: true the status is 202 either way.

recordobject

The record object as stored.

warningsarray

Present only when a field with a closed vocabulary received a value outside it, as [{ field, message }]. The write still lands, but filters written from the schema will not match that value, so switch to the canonical value the message names.

write_intentobject

The queued write intent, present only with propagate: true, as { id, status, connection_id } with status pending. Poll GET /v1/write-intents/:id or listen for write_intent.applied and write_intent.failed to learn the outcome.

linesarray of record objects

Present only when lines were sent: the line_item records written with this record, as full record objects in position order, each with document_entity, document_type, document_id, and position filled in. They are ordinary records from here on; read them back with GET /v1/records/line_item.

attachmentsarray of attachment objects

Present only when attachments were sent: the stored attachment objects, in the order sent, each with its id, filename, media_type, bytes, and content_hash. Download them like any synced document.

tablesarray

The write outcome per table: applied, quarantined, filtered, or pending, with the derived row where one exists.

$ curl -X POST https://api.valtrix.com/v1/records/customer \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "customer_8f2", "data": { "name": "...", "email": "..." } }'
{
"created": true,
"record": { "id": "rec_9d4f2c81a7b3e650d21c4f8a", "entity_type": "customer", "external_id": "customer_8f2", "org_id": "org_7f3k2m", "connector": "valtrix-api", "connection_id": null, "source_id": null, "last_write_intent": null, "created_by": { "kind": "key", "id": "key_7f3k2m", "name": "Production" }, "updated_by": { "kind": "key", "id": "key_7f3k2m", "name": "Production" }, "data": { ... }, "synced_at": "2026-07-08T09:30:00Z", "changed_at": "2026-07-08T09:30:00Z", "frozen": false },
"tables": [{ "table": "customers_clean", "status": "applied", "row": { ... }, "quarantined_by": [] }]
}

Retrieve a record

GET/v1/records/:recordId

Fetches any record by its record ID, synced and API-written alike, with the current row it produces in each of your tables. The record ID is the rec_ prefixed id you see everywhere: the _record_id on a table row, a reference field's value, or the id of a record object. Rows from aggregating or reshaping transformations carry syn_ prefixed synthetic row ids with no single record behind them; those return 404 record_not_found. A table's row_identity field tells you upfront whether its rows resolve.

Parameters
recordIdpath

The rec_ prefixed record ID, from a row's _record_id, a reference field, or a record object's id.

includestring

Pass source to also return the record's stored source payload under source on the record object: the provider's own fields for this one record, as the sync kept them, minus any fields you turned off for the connector. The shape is the provider's and changes without notice, so read it for a field the entity does not carry yet and ask for that field to be mapped with POST /v1/connectors/:slug/expansions rather than building on it. Source is never on the list, the change feed, or tables, and a key may read it 2000 times per UTC day (429 source_read_budget after that, with Retry-After).

source_pathsstring

Comma separated dot paths into the source payload, Contact.Phone.Value,Urgency, to return only those fields instead of the whole payload. Implies include=source. A path the payload lacks is left out of source.data; source.paths echoes what was asked.

Returns
recordobject

The record object. Its entity_type tells you what kind of record the ID resolved to, so you can follow a reference field without knowing its target type upfront. With include=source or source_paths it also carries source.

tablesarray

The current row it produces in each of your tables.

attachmentsarray

The source documents Valtrix captured alongside the record, as attachment objects. Empty for most records.

$ curl https://api.valtrix.com/v1/records/rec_9d4f2c81a7b3e650d21c4f8a \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "record": { "id": "rec_9d4f2c81a7b3e650d21c4f8a", "entity_type": "customer", "external_id": "customer_8f2", "org_id": "org_7f3k2m", "connector": "procore", "connection_id": "conn_7f3k2m", "source_id": "CR-88213", "last_write_intent": null, "created_by": { "kind": "connector", "id": "conn_7f3k2m", "name": "procore" }, "updated_by": { "kind": "connector", "id": "conn_7f3k2m", "name": "procore" }, "data": { ... }, "synced_at": "2026-07-08T09:30:00Z", "changed_at": "2026-07-06T15:12:00Z", "frozen": false }, "tables": [{ "table": "customers_clean", "row": { ... } }], "attachments": [] }

Retrieve a record you wrote

GET/v1/records/:entityType/:externalId

Fetches a record by the external_id you supplied when writing it, with the current row it produced in each table. Covers records written through this API only; synced records are fetched by record ID. A null row means it was filtered out or quarantined.

Parameters
entityTypepath

The entity type slug. GET /v1/schema lists the valid ones.

externalIdpath

The external_id you supplied when writing the record.

orgstring, required

The organization the record belongs to.

Returns
recordobject

The record object.

tablesarray

The current row the record produces in each table. A null row means it was filtered out or quarantined.

attachmentsarray

The record's attachment objects, oldest first: the files sent with the write through attachments. Empty when the record was written without files.

$ curl "https://api.valtrix.com/v1/records/customer/customer_8f2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "record": { "id": "rec_9d4f2c81a7b3e650d21c4f8a", "entity_type": "customer", "external_id": "customer_8f2", "org_id": "org_7f3k2m", "connector": "valtrix-api", "connection_id": null, "source_id": null, "last_write_intent": null, "created_by": { "kind": "key", "id": "key_7f3k2m", "name": "Production" }, "updated_by": { "kind": "key", "id": "key_7f3k2m", "name": "Production" }, "data": { ... }, "synced_at": "2026-07-08T09:30:00Z", "changed_at": "2026-07-08T09:30:00Z", "frozen": false }, "tables": [{ "table": "customers_clean", "row": { ... } }], "attachments": [] }

Delete a record

DELETE/v1/records/:entityType/:externalId

Deletes a record you wrote and removes its derived rows. The removals also appear in each change feed. Pass propagate=true as a query parameter to also delete it from the organization's connected system: the Valtrix record is removed immediately, the status becomes 202, and the response carries a write intent. How propagation works explains the lifecycle.

Parameters
entityTypepath

The entity type slug. GET /v1/schema lists the valid ones.

externalIdpath

The external_id you supplied when writing the record.

Idempotency-Keyheader, optional

Any unique string, up to 255 characters. A repeat of the same key on this API key within 24 hours replays the original status and body instead of deleting again. After 24 hours the key is forgotten and the same call deletes again.

orgstring, required

The organization the record belongs to.

propagatequery, optional

Defaults to false. When true, the delete is also propagated to the organization's connected system and the response is 202 with a write intent. Returns 409 write_not_supported when no connected system declares delete for this entity type, and 409 write_ambiguous when more than one does and connection is not given.

connectionquery, optional

The id of the connection to propagate to, from the organization object's connections or the record's connection_id. Only valid with propagate=true (400 invalid_propagation otherwise); 404 unknown_connection when it does not belong to the organization.

Returns
deletedboolean

true when the record and its derived rows were removed. With propagate=true the status is 202.

write_intentobject

The queued write intent, present only with propagate=true, as { id, status, connection_id } with status pending. Poll GET /v1/write-intents/:id or listen for write_intent.applied and write_intent.failed to learn the outcome.

tablesarray

The removal outcome per table.

$ curl -X DELETE "https://api.valtrix.com/v1/records/customer/customer_8f2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "deleted": true, "tables": [{ "table": "customers_clean", "status": "removed", "row": null, "quarantined_by": [] }] }

List a record's attachments

GET/v1/records/:recordId/attachments

Lists the source documents Valtrix captured alongside a record, such as the scanned vendor bill behind a cost record. Attachments exist where the source system exposes documents and the connector syncs them; most records have none and return an empty list. The list mirrors what is attached in the source system, including repeat uploads of the same document, and a multi-page document can appear as one attachment per page. The record ID is the rec_ prefixed id from a row's _record_id, a reference field, or a record object's id. The response carries metadata only; show the document through the display link endpoint or fetch its bytes through the download endpoint.

Parameters
recordIdpath

The rec_ prefixed record ID.

Returns
attachmentsarray

The record's attachment objects, oldest first.

$ curl https://api.valtrix.com/v1/records/rec_9d4f2c81a7b3e650d21c4f8a/attachments \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "attachments": [{ "id": "clx1a2b3c4d5e6f7g8h9i0j1k", "filename": "invoice-4417.pdf (page 1)", "media_type": "image/jpeg", "bytes": 58369, "content_hash": "f3a91c...", "created_at": "2026-07-10T04:00:00Z" }, { "id": "clx9z8y7x6w5v4u3t2s1r0q9p", "filename": "invoice-4417.pdf (page 2)", "media_type": "image/jpeg", "bytes": 61204, "content_hash": "7e167d...", "created_at": "2026-07-10T04:00:01Z" }] }

Get a display link for an attachment

GET/v1/attachments/:attachmentId/url

Returns a short lived link to the document behind an attachment, for showing it inside your app. By default the link serves the document inline with its media type, so it works as the source of an image tag, an iframe, or a PDF viewer. The usual shape is your backend requesting the link and handing it to your frontend, which keeps the API key off the browser. Each link expires within minutes, so a fresh one per view works better than a stored one. The link is an opaque value: the storage host and URL format are not part of the API contract and can change, so it is best embedded exactly as returned.

Parameters
attachmentIdpath

The attachment ID, from the record's attachment list.

dispositionstring

inline (default) serves the document for viewing in the browser; attachment serves it as a file download with the original filename.

Returns
urlstring

The short lived link to the document. Requires no authentication, so it can be embedded directly. Opaque, its host and format can change between requests.

expires_innumber

Seconds until the link stops working.

$ curl https://api.valtrix.com/v1/attachments/clx1a2b3c4d5e6f7g8h9i0j1k/url \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "url": "https://valtrix-attachments.s3.amazonaws.com/...&X-Amz-Signature=...", "expires_in": 300 }

Download an attachment

GET/v1/attachments/:attachmentId/download

Fetches the document behind an attachment. The endpoint responds 302 with a short lived download link, and standard HTTP clients follow it automatically and receive the bytes. Each link expires within minutes, so a fresh download per fetch works better than a stored link. The content_hash from the attachment list tells you whether you already hold a document. For showing a document inside your app rather than fetching its bytes, the display link endpoint is the alternative.

Parameters
attachmentIdpath

The attachment ID, from the record's attachment list.

Returns

A 302 redirect to a short lived download link for the document. Following it returns the raw bytes with the attachment's media type.

$ curl -L https://api.valtrix.com/v1/attachments/clx1a2b3c4d5e6f7g8h9i0j1k/download \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-o invoice-4417-page-1.jpg

Record entity types

The entity types accepted by the record endpoints, with the fields each one takes. These fields make up a record's data object; every record additionally carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at), so no entity declares an id field. The envelope id is the record ID that table rows expose as _record_id and that reference fields on other entities point at. GET /v1/schema returns these same definitions, so your integration can read them at runtime.

Account balance

account_balance

The balance an accounting source keeps for one ledger account, or one subaccount under it, in one fiscal period: the figure a trial balance, a period close, or a migration reads, as distinct from the postings that moved it (journal_entry and its line_item rows). Discriminated by kind: account rows cover the whole account, subaccount rows one subaccount under it. basis says how to read balance: running is the cumulative balance at the end of the period, which balance-sheet accounts carry; period is the activity inside the period alone, which income and expense accounts carry, so a year-to-date figure is the sum of the periods. Opening-balance rows a source keeps under period 0 have no period dates.

Writable through POST /v1/records/account_balance. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/account_balance/:externalId for records you wrote. The title key is gl_account_name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

gl_account_numberstring

Number of the ledger account the balance belongs to, as the chart of accounts prints it

gl_account_namestring

Name of the ledger account the balance belongs to

gl_account_idreference

Valtrix record ID of the ledger account the balance belongs to

kindstring

One of: account, subaccount. Whether the row is the whole account's balance or one subaccount's share of it

subaccount_numberstring

Number of the subaccount under the account, for subaccount rows; null on account rows

subaccountstring

Name of the subaccount as the source prints it, the number when it has no name, for subaccount rows; source-defined, pass it through

fiscal_yearnumber

The fiscal year the period belongs to, named by the calendar year it ends in

periodnumber

The accounting period within the fiscal year, 1 to 12 for the months and 0 for an opening balance the source keeps as a row of its own

period_startdate

First day of the period, null for an opening-balance row

period_enddate

Last day of the period, null for an opening-balance row

balancenumber

The balance as the source keeps it, in currency, signed the way the source signs it (a credit-normal account is still positive when in credit); read it through basis

budgetnumber

The budget the source keeps for the account in the period, in currency, null when the source budgets nothing

basisstring

One of: running, period. running when balance is the cumulative balance at the end of the period, period when it is the activity inside the period alone

currencystring

ISO currency code, null when the source books everything in one implicit currency

$ curl -X POST https://api.valtrix.com/v1/records/account_balance \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "gl_account_name": "...", "gl_account_number": "...", "gl_account_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/account_balance/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Activity

activity

A logged interaction or note on a record: calls, meetings, notes, and stage moves all map here. An email, chat, or text message with its own sender, recipients, and body maps to message; an entry that only logs that one was sent stays here as kind email. What it was logged on is polymorphic (subject_id/subject_type: opportunity, customer, contact, or project; reviewer comments and status changes on a permit or job log against the project). Construction document control logs against the project too: requests for information, submittals, transmittals, and correspondence, each with its own kind and the log number in code. Scheduled future work maps to schedule_task; time worked maps to time_entry.

Writable through POST /v1/records/activity. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/activity/:externalId for records you wrote. The title key is note.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

notestring

What happened

kindstring

One of: call, email, meeting, note, task, stage_change, rfi, submittal, transmittal, correspondence, medication_administration, other. Map the source activity types onto these (a construction document-control entry keeps its own kind: a request for information is rfi, a submittal package is submittal, a transmittal is transmittal, a logged letter is correspondence; a charted, refused, or still-pending medication dose from a medication administration record is medication_administration, never other, because a facility charts thousands of doses a day and a table over the catch-all kind must not absorb them); anything else is other with the raw label in source data

subject_idreference

Valtrix record ID of the record the activity was logged on

subject_typestring

Entity type of the linked subject record: opportunity, customer, contact, or project

customer_idreference

Valtrix record ID of the customer the entry concerns when the subject is something of theirs (a project, an opportunity, an admission); a clinical entry charted on an admission links the admission as subject and the patient here. Sources whose subject is the customer itself leave it empty

occurred_atdate

When the activity happened

created_atdate

When the activity was logged in the source

categorystring

The source's own type or form name for the entry (a note type, an assessment tool, a problem list, a vitals reading), as it labels it; source-defined, pass it through

codestring

A coded value the entry carries, as the source prints it (an ICD-10 diagnosis code, a procedure code), for clinical and coded sources

scorenumber

The numeric result the entry records, for scored assessments and measurements

outcomestring

The source's own status or interpretation of the entry (a problem status, an assessment interpretation, an allergy status), as it labels it; source-defined, pass it through

authorstring

Name of the person who recorded or signed the entry, for sources that keep one on it

subjectstring

The title of a meeting or the heading of a logged entry, as the source shows it, for calendar and notes sources

employee_idreference

Valtrix record ID of the employee the entry was filed by or for (the foreman or supervisor named on a daily field report), for sources that name an employee record rather than print a name

weatherstring

Weather conditions noted on the entry, as written, for daily field reports and site logs

temperaturestring

Temperature noted on the entry, as written (92, High of 82), for daily field reports and site logs; text, since sources take it as typed

$ curl -X POST https://api.valtrix.com/v1/records/activity \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "note": "...", "kind": "...", "subject_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/activity/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Booking

booking

A customer's reservation of an event spot, a staff member's time, or a resource: class registrations, appointments, court hires, and desk bookings all map here. Group occurrences link via event_id; the purchase paying for it maps to order and a consumed pack credit to entitlement.

Writable through POST /v1/records/booking. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/booking/:externalId for records you wrote. The title key is customer_name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

customer_namestring

Customer the booking is for

customer_idreference

Valtrix record ID of the customer the booking is for

event_idreference

Valtrix record ID of the event the booking reserves a spot in, for group occurrences

resource_idreference

Valtrix record ID of the resource the booking reserves, such as a court, room, or desk

employee_idreference

Valtrix record ID of the staff member the booking is with, such as the practitioner or stylist

item_idreference

Valtrix record ID of the catalog item for the booked service

location_idreference

Valtrix record ID of the location the booking takes place at

order_idreference

Valtrix record ID of the order that paid for the booking

entitlement_idreference

Valtrix record ID of the entitlement the booking consumed a credit from

statusstring

One of: booked, confirmed, attended, completed, no_show, cancelled, waitlisted. Map the source booking states onto these (an unconfirmed booking is booked)

start_atdate

When the booking starts

end_atdate

When the booking ends

created_atdate

When the booking was made in the source

$ curl -X POST https://api.valtrix.com/v1/records/booking \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "customer_name": "...", "status": "...", "customer_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/booking/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Budget change

budget_change

An internal budget adjustment or transfer that moves budget between lines without a client-facing change order. Contractual changes map to change_order.

Writable through POST /v1/records/budget_change. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/budget_change/:externalId for records you wrote. The title key is description.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

numberstring

Budget change number

titlestring

Budget change title

descriptionstring

What the budget change covers

statusstring

One of: draft, pending, approved, rejected, void. Map the source approval states onto these; the raw label stays in source data

amountnumber

Net amount of the change

project_idreference

Valtrix record ID of the project the budget change belongs to

created_atdate

When the budget change was created in the source

$ curl -X POST https://api.valtrix.com/v1/records/budget_change \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "description": "...", "number": "...", "project_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/budget_change/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Budget detail

budget_detail

A computed budget report row per cost code: original, changes, committed, costs to date, projected, and over/under. Read-side rollup only; the budget's raw composition maps to budget_line.

Writable through POST /v1/records/budget_detail. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/budget_detail/:externalId for records you wrote. The title key is cost_code.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

cost_codestring

Cost code the row is budgeted against

cost_code_idreference

Valtrix record ID of the cost code the row is budgeted against

categorystring

Cost category or division as the source names it; source-defined, pass it through

project_idreference

Valtrix record ID of the project the row is budgeted against

original_amountnumber

Original budgeted amount

budget_changesnumber

Approved budget changes

approved_cosnumber

Approved change orders

pending_cosnumber

Pending change orders

revised_amountnumber

Budget after approved changes

committed_costsnumber

Committed costs

direct_costsnumber

Direct costs to date

jtd_costsnumber

Job-to-date costs

projected_costsnumber

Projected total costs

estimated_finalnumber

Estimated cost at completion

over_undernumber

Projected over or under budget

$ curl -X POST https://api.valtrix.com/v1/records/budget_detail \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "cost_code": "...", "category": "...", "cost_code_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/budget_detail/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Budget line

budget_line

A single budgeted row of a project budget: cost code plus original and revised amounts. This is the budget's composition; computed report rollups with committed, to-date, and projected columns map to budget_detail.

Writable through POST /v1/records/budget_line. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/budget_line/:externalId for records you wrote. The title key is description.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

project_namestring

Project or job the line is budgeted against

project_idreference

Valtrix record ID of the project the line is budgeted against

cost_codestring

Cost code the line is budgeted against

cost_code_idreference

Valtrix record ID of the cost code the line is budgeted against

descriptionstring

What the budget line covers

categorystring

Cost category or division as the source names it; source-defined, pass it through

cost_typestring

Cost type as the source names it (labor, material, subcontractor); source-defined, pass it through

quantitynumber

Budgeted quantity

unit_costnumber

Budgeted cost per unit

original_amountnumber

Original budgeted amount

revised_amountnumber

Revised budget after approved changes

document_typestring

One of: bill, credit, expense, payroll, card_transaction, invoice, order, estimate, bid_request, prime_contract, subcontract, purchase_order, work_order, requisition, change_order, journal_entry, claim, treatment_plan, other. The canonical kind of the document the line belongs to

document_statusstring

One of: draft, pending, approved, rejected, void. Approval status of the source document the line belongs to, mapped the same way as that document

created_atdate

When the budget line was created in the source

budgeted_hoursnumber

Labor hours budgeted on the line, for sources that budget hours beside amounts

material_amountnumber

The material share of original_amount, for sources that budget one line in several cost types at once; the five cost type amounts add up to original_amount

labor_amountnumber

The labor share of original_amount, for sources that budget one line in several cost types at once

equipment_amountnumber

The equipment share of original_amount, for sources that budget one line in several cost types at once

subcontract_amountnumber

The subcontract share of original_amount, for sources that budget one line in several cost types at once

other_amountnumber

The share of original_amount outside material, labor, equipment, and subcontract, for sources that budget one line in several cost types at once

approved_changesnumber

Budget changes of approved change orders on the line, the difference between revised_amount and original_amount, for sources that keep the changes apart from the budget

material_changesnumber

The material share of approved_changes; the five cost type changes add up to approved_changes

labor_changesnumber

The labor share of approved_changes

equipment_changesnumber

The equipment share of approved_changes

subcontract_changesnumber

The subcontract share of approved_changes

other_changesnumber

The share of approved_changes outside material, labor, equipment, and subcontract

approved_change_hoursnumber

Labor hours that approved change orders add to or take off the line, beside budgeted_hours

$ curl -X POST https://api.valtrix.com/v1/records/budget_line \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "description": "...", "project_name": "...", "project_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/budget_line/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Change event

change_event

An early-stage record that something changed on a project, captured before or without a priced change order. Once priced and contractual it maps to change_order or commitment_change_order.

Writable through POST /v1/records/change_event. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/change_event/:externalId for records you wrote. The title key is title.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

numberstring

Change event number

titlestring

Change event title

descriptionstring

What changed and why

scopestring

One of: in_scope, out_of_scope, tbd. Whether the change is in or out of the contracted scope

statusstring

One of: open, pending, closed, void. Map the source change event states onto these (awaiting pricing or sent to client is pending)

change_typestring

Kind of change as the source names it (owner change, design change, weather); source-defined, pass it through

change_reasonstring

Reason for the change as the source names it; source-defined, pass it through

change_order_idreference

Valtrix record ID of the change order the event became once priced

change_order_typestring

Entity type of the linked change order record: change_order or commitment_change_order

project_idreference

Valtrix record ID of the project the change event belongs to

created_atdate

When the change event was created in the source

$ curl -X POST https://api.valtrix.com/v1/records/change_event \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "title": "...", "number": "...", "change_order_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/change_event/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Change order

change_order

A priced amendment to a client-facing contract, at the header level: construction prime contract change orders, scope or SOW amendments, and lease amendments all land here. Changes against a purchase order or subcontract map to commitment_change_order; unpriced early-stage changes map to change_event.

Writable through POST /v1/records/change_order. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/change_order/:externalId for records you wrote. The title key is title.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

numberstring

Change order number

kindstring

One of: prime, request, package, other. A change order on the owner or prime contract is prime; a change order request or proposed change not yet approved is request; a package that bundles requests for approval is package

titlestring

Change order title

statusstring

One of: draft, pending, approved, rejected, void. Map the source approval states onto these (pricing and review states are pending); the raw label stays in source data

totalnumber

Total value of the change

contract_idreference

Valtrix record ID of the client-facing contract the change order belongs to

project_idreference

Valtrix record ID of the project the change order belongs to

executedboolean

Whether the change order is executed

created_atdate

When the change order was created in the source

requested_amountnumber

Amount asked for on the change order, before approval, as the source keeps it beside the approved amount. Filled by sources that keep both figures; others leave it empty and total is the only amount

approved_amountnumber

Amount approved on the change order, zero or empty until it is approved, as the source keeps it beside the requested amount. Filled by sources that keep both figures; others leave it empty

issued_atdate

The date on the change order itself, as the source prints it

submitted_atdate

When the change order was submitted to the client for approval; empty until it is

approved_atdate

When the change order was approved; empty until it is

invoiced_atdate

When the change order was billed to the client, for sources that record it on the change order

reasonstring

Why the change was made, as typed on the change order in the source

categorystring

Type of change as the source names it (a Sage 100 Contractor change order type such as Field Engineering or Internal Request); source-defined, pass it through

$ curl -X POST https://api.valtrix.com/v1/records/change_order \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "title": "...", "number": "...", "contract_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/change_order/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Classification

classification

An entry in a pick-list the source keeps and other records name by it: a vendor type, a customer type, a job type, a cost type, an item type, a sales tax district with its rate. Structural reference data; a write that takes the name of such an entry (a vendor's trade) is matched against these records, so the list says which names the source accepts. Project coding maps to cost_code and the chart of accounts to gl_account instead.

Writable through POST /v1/records/classification. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/classification/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

kindstring

One of: vendor_type, customer_type, job_type, cost_type, item_type, payroll_calculation, pay_type, subaccount, pay_group, job_pay_group, pay_group_benefit, bid_item, position, tax_district, other. Which pick-list the entry belongs to: pay_type is the way hours are paid (regular, overtime, vacation), subaccount a department or other subdivision listed under one ledger account, pay_group a wage class a time line is paid as (a journeyman carpenter on a prevailing wage scale), job_pay_group the rule that on one project the employees of one position are paid as a pay group, position the role an employee is hired into (general laborer, foreman, office staff), which an employee carries as position_code, pay_group_benefit one fringe benefit or other payroll calculation a pay group carries with its rate (parent_id names the pay group), bid_item an item of one project's bid schedule, tax_district a sales tax district or tax code a job, a client, or an invoice is taxed under (rate carries its combined rate)

namestring

The entry as the source prints it, the value other records carry

codestring

The number or code the source keys the entry by

descriptionstring

Notes the source keeps on the entry

statusstring

One of: active, inactive

gl_account_idreference

Valtrix record ID of the ledger account the entry is listed under, for a subaccount: the entries with the same account are the choices a line coded to that account can take

project_idreference

Valtrix record ID of the project the entry is set up for, for a list the source keeps per project (a job's bid items, a job's pay group rules): the entries with the same project are the choices a record of that project can take

replaces_idreference

On a job_pay_group entry, Valtrix record ID of the entry an employee normally carries that the project pays differently: the employee position (kind position) in Sage 100 Contractor

replacement_idreference

On a job_pay_group entry, Valtrix record ID of the pay group the project pays instead, the one a time line on that project carries as classification_id

parent_idreference

Valtrix record ID of the entry this one is set up under: on a pay_group_benefit entry the pay group that carries the benefit, so the benefits of a pay group are the entries whose parent_id names it

calculation_idreference

On a pay_group_benefit entry, Valtrix record ID of the payroll calculation (a classification of kind payroll_calculation) the rate is for

ratenumber

On a pay_group_benefit entry, the rate the pay group carries for the calculation, in the unit the calculation is set up with (an amount per hour or a percentage); the fringe rate of a pay group. On a tax_district entry, the combined sales tax rate of the district as a percentage of the taxable amount (7.5 for 7.5 percent), every taxing body in it added up

regular_ratenumber

On a pay_group entry, the regular hourly pay rate of the group, its base rate

overtime_ratenumber

On a pay_group entry, the overtime hourly pay rate of the group

premium_ratenumber

On a pay_group entry, the premium (double time) hourly pay rate of the group

calculation_typestring

On a payroll_calculation entry, how the calculation acts on the pay. One of: deduction, addition, employer_cost, add_and_deduct, accrual. deduction is withheld from the employee's pay (taxes, a 401k contribution, a loan repayment), addition is paid to the employee on top of wages (per diem, a reimbursement, a cash fringe), employer_cost is paid by the employer and never touches the employee's pay (employer taxes, workers compensation, an employer match), add_and_deduct is added to gross and withheld again, accrual builds a vacation or sick balance

shown_on_checkboolean

On a payroll_calculation entry, whether the source prints the calculation on the employee's check stub

quantitynumber

On a bid_item entry, the quantity the item was bid at, in the unit of uom

uomstring

On a bid_item entry, the unit the item is bid and billed in, as the source spells it (LS, LF, EA)

$ curl -X POST https://api.valtrix.com/v1/records/classification \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "kind": "...", "gl_account_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/classification/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Commitment change order

commitment_change_order

A priced amendment to a money-out commitment, linked to its parent via contract_id: subcontract change orders and post-issue purchase order revisions land here. Client-facing changes map to change_order.

Writable through POST /v1/records/commitment_change_order. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/commitment_change_order/:externalId for records you wrote. The title key is title.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

numberstring

Change order number

titlestring

Change order title

statusstring

One of: draft, pending, approved, rejected, void. Map the source approval states onto these; the raw label stays in source data

totalnumber

Total value of the change

contract_idreference

Valtrix record ID of the commitment contract the change order belongs to

project_idreference

Valtrix record ID of the project the change order belongs to

executedboolean

Whether the change order is executed

created_atdate

When the change order was created in the source

$ curl -X POST https://api.valtrix.com/v1/records/commitment_change_order \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "title": "...", "number": "...", "contract_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/commitment_change_order/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Compliance document

compliance_document

A signed instrument a party must provide before something else may proceed: lien waivers, insurance certificates, tax forms, liability and consent waivers, and staff certifications all collapse here, discriminated by kind. This is the tracked obligation, with its own signature lifecycle, validity window, and signatory; the rendered file rides along as a record attachment. What it gates is identified by subject_type and subject_id, so one shape covers a waiver blocking payment of a vendor invoice (cost), a certificate held against a subcontract or membership (contract), and a liability or consent form a customer signs before a booking. A standing credential belonging to the signing party rather than to any one document leaves subject_id null and is reached through counterparty_id.

Writable through POST /v1/records/compliance_document. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/compliance_document/:externalId for records you wrote. The title key is title.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

titlestring

Name of the form or template the document was raised from

kindstring

One of: lien_waiver, insurance_certificate, tax_form, liability_waiver, consent_form, certification, other. Map the source document types onto these

statusstring

One of: pending, signed, declined, expired, released. Where the document sits in its signature lifecycle

subject_typestring

Entity type of the record the document gates: cost, contract, or booking

subject_idreference

Valtrix record ID of the record this signature gates, null for a standing credential held against the counterparty itself

counterpartystring

Vendor, customer, or employee required to sign

counterparty_idreference

Valtrix record ID of the party required to sign

counterparty_typestring

Entity type of the linked counterparty record: vendor, customer, or employee

project_idreference

Valtrix record ID of the project the document belongs to

location_idreference

Valtrix record ID of the location the document belongs to, for sources that hold compliance against a venue or site rather than a project

amountnumber

Amount the document covers, which may be a partial release against the gated record total

effective_atdate

Date the document takes effect from

expires_atdate

Date the document lapses and must be renewed, for coverage and certifications that expire

signed_atdate

When the counterparty signed, null while the document is unsigned

signed_by_namestring

Name of the individual who signed on the counterparty side

signed_by_titlestring

Role or title of the individual who signed

$ curl -X POST https://api.valtrix.com/v1/records/compliance_document \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "title": "...", "kind": "...", "subject_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/compliance_document/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Contact

contact

An individual person at a customer, vendor, or other external party, with their own name and contact details. Not the account itself (customer, vendor) and not the org's own workforce (employee).

Writable through POST /v1/records/contact. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/contact/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Contact name

titlestring

Role or title

party_idreference

Valtrix record ID of the customer or vendor the contact belongs to

party_typestring

Entity type of the linked party record: customer or vendor

emailstring

Primary email address

phonestring

Primary phone number

created_atdate

When the contact was created in the source

tagsstring

Tags the source keeps on the record, comma separated, as the source spells them; source-defined, pass them through

$ curl -X POST https://api.valtrix.com/v1/records/contact \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "title": "...", "party_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/contact/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Contract

contract

An agreement with money attached, with either side of the business: prime contracts, subcontracts, purchase orders, work orders, memberships, subscriptions, and leases all collapse here, discriminated by kind. Their lines map to line_item and their changes to change_order or commitment_change_order.

Writable through POST /v1/records/contract. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/contract/:externalId for records you wrote. The title key is title.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

numberstring

Contract number

titlestring

Contract title

kindstring

One of: prime, subcontract, purchase_order, bid_request, service_contract, membership, subscription, lease, other. Map the source agreement types onto these; a priced request for proposal sent to a vendor before any order exists is bid_request, and a recurring service or maintenance agreement with a customer is service_contract

counterpartystring

Customer or vendor the agreement is with

counterparty_idreference

Valtrix record ID of the customer or vendor the agreement is with

counterparty_typestring

Entity type of the linked counterparty record: customer or vendor

project_idreference

Valtrix record ID of the project the contract belongs to

ordered_by_idreference

Valtrix record ID of the employee who placed the order, for purchase orders whose source prints an Ordered By line

statusstring

One of: draft, pending, sent, approved, rejected, fulfilled, completed, void. Map the source contract and purchase order states onto these (out for signature or awaiting approval is pending, issued to the counterparty is sent, executed is approved, received in full is fulfilled); the raw label stays in source data

totalnumber

Total contract value

retainage_percentnumber

Retainage percentage withheld

executedboolean

Whether the contract is executed

contract_atdate

Date of the agreement

starts_atdate

When the agreement takes effect (a membership start, a lease commencement, a subscription start)

ends_atdate

When the agreement ends or expires

originstring

One of: new, renewal, reactivation, upgrade, transfer, other. How the agreement came about, for recurring client agreements whose source labels a first sale, a renewal, or a win-back

categorystring

The plan, product line, or agreement category the source files it under; source-defined, pass it through

sold_bystring

Name of the staff member who made the sale

commission_agentstring

Name of the staff member credited with the commission when the source tracks one separately from the seller

resource_idreference

Valtrix record ID of the piece of equipment the agreement is for, such as the machine a parts order or rental agreement was raised against

maintenance_order_idreference

Valtrix record ID of the maintenance work order or request a parts order was raised under

needed_bydate

When the goods or work ordered are needed by

$ curl -X POST https://api.valtrix.com/v1/records/contract \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "title": "...", "number": "...", "counterparty_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/contract/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Cost

cost

A money-out document at the header level: vendor invoices, expenses, payroll, and other direct costs all collapse here, discriminated by kind. Its lines map to line_item; the transaction settling it maps to payment, and when one payment settles several costs each share is a payment_allocation. Payroll costs carry their detail as line_item rows with document_type payroll and document_id the payroll cost. What a line is depends on the payroll source: one line per department the pay is allocated to, with the department column filled, or one line per calculation on the record, every tax, deduction, benefit, and employer cost with its amount and calculation_type filled, which is what a pay stub lists under the gross pay in total and above the net pay in net_total.

Writable through POST /v1/records/cost. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/cost/:externalId for records you wrote. The title key is description.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

descriptionstring

What the cost covers

kindstring

One of: bill, credit, expense, payroll, card_transaction, other. A credit is a vendor credit or credit note that reduces what is owed (total stays positive); a vendor invoice is a bill

statusstring

One of: draft, pending, approved, rejected, paid, void. Map the source approval and payment states onto these (under review is pending, denied is rejected, cancelled is void, payment sent is paid); the raw label stays in source data

invoice_numberstring

Vendor invoice reference

payee_namestring

Vendor or employee paid

payee_idreference

Valtrix record ID of the vendor or employee paid

payee_typestring

Entity type of the linked payee record: vendor or employee

project_idreference

Valtrix record ID of the project the cost belongs to

location_idreference

Valtrix record ID of the location the cost belongs to, for sources that book costs against a venue or site rather than a project

totalnumber

Total amount, in currency

currencystring

ISO currency code the total is denominated in, null when the source books everything in one implicit currency

issued_atdate

The bill or invoice date stated by the vendor on the document

due_atdate

When payment is due

received_atdate

When the cost was received

paid_atdate

When the cost was paid

posted_atdate

When the source pushed the cost to the accounting ledger it feeds (the moment a Craftable bill was synced to QuickBooks), for sources that export bills to an accounting system; a bill entered late for an old invoice carries an old received date and a recent posting date

po_numberstring

Purchase order number the cost was raised against, as the source prints it, for sources that match bills to purchase orders

receipt_numberstring

Number of the goods or service receipt on the purchase order the cost is matched against, as the source prints it, for sources that match a bill to a received PO line rather than to the whole order

contract_idreference

Valtrix record ID of the purchase order or contract the cost was raised against, for sources that sync their purchase orders as records; po_number keeps the number as the source prints it

subtotalnumber

Amount before tax, in currency, for sources that print it separately from the total

taxnumber

Tax charged on the document, in currency, for sources that print it separately from the total

tax_withheldnumber

Tax the payer withholds from the payee and remits itself (the income tax and VAT retentions of a Mexican CFDI), in currency, for sources that print it; not part of tax

payment_termsstring

Payment terms as the source states them (Net 30; on a Mexican CFDI the payment method, PUE for one payment or PPD for instalments or deferred payment); source-defined, pass it through

cost_centerstring

Cost center, business unit, or organization the cost is booked to, as the source names it; source-defined, pass it through

review_statusstring

The source's own review or audit state of the supporting document (audited, awaiting upload, rejected, cancelled), as it labels it; source-defined, pass it through. Distinct from status, which is the normalized lifecycle

match_statusstring

The source's purchase-order match result for the bill (matched, invalid, unmatched), as it labels it; source-defined, pass it through

resource_idreference

Valtrix record ID of the piece of equipment the cost was incurred on, for repair and service costs booked against a unit

maintenance_order_idreference

Valtrix record ID of the maintenance work order the cost was booked under

financial_account_idreference

Valtrix record ID of the card or bank instrument the cost was paid with at the moment it was incurred, for card transactions and other expenses settled on an instrument rather than through a later payment

employee_idreference

Valtrix record ID of the employee who incurred or submitted the cost: the cardholder of a card transaction, the submitter of an expense, for spend and expense sources that track who spent. Distinct from payee_id, which is who gets paid

gl_account_idreference

Valtrix record ID of the expense account the whole document is coded to, for sources that code a cost as one unit (a card charge coded to one account) rather than per line; a document with lines carries the account on each line_item instead

cost_code_idreference

Valtrix record ID of the cost code the whole document is coded to, for sources that code a cost as one unit; a document with lines carries the cost code on each line_item instead

cost_typestring

Cost type the whole document is coded to, as the source names it (material, labor, equipment, subcontract, other), for sources that code a cost as one unit; source-defined, pass it through

journal_entry_idreference

Valtrix record ID of the general ledger journal entry that posting the cost produced, for accounting sources that sync both; null while the cost is unposted

net_totalnumber

Amount actually paid out after deductions and withholdings, in currency, for payroll records and reimbursed expenses; total stays the gross amount of the document

posting_yearnumber

Fiscal year of the books the bill was posted to, as the accounting source keeps it (a Sage 100 Contractor posting year, named by the calendar year the fiscal year ends in). Filled by accounting sources that post each entry to a period of their own, separate from its date; others leave it empty

posting_periodnumber

Accounting period within posting_year the bill was posted to, as the accounting source numbers it (1 to 12 in Sage 100 Contractor, 0 for an opening entry). It can differ from the period the document date falls in, which is what a cutoff check compares. Filled by accounting sources that post each entry to a period; others leave it empty

period_startdate

On a payroll cost, the first day of the pay period the record pays

period_enddate

On a payroll cost, the last day of the pay period the record pays

regular_hoursnumber

On a payroll cost, the hours paid at the regular rate in the pay period

overtime_hoursnumber

On a payroll cost, the hours paid at the overtime rate in the pay period

vacation_hoursnumber

On a payroll cost, the vacation hours paid in the pay period, the paid time off used

total_hoursnumber

On a payroll cost, every hour paid in the pay period, all pay types together

overtime_paynumber

On a payroll cost, the pay for the overtime hours of the pay period, part of total

work_regionstring

On a payroll cost, the state or region the pay was taxed in, as the source names it (WI, MN)

premium_hoursnumber

On a payroll cost, the hours paid at the premium rate in the pay period, double time in most payroll setups

sick_hoursnumber

On a payroll cost, the sick hours paid in the pay period

holiday_hoursnumber

On a payroll cost, the holiday hours paid in the pay period

regular_paynumber

On a payroll cost, the pay for the regular hours of the pay period, part of total

premium_paynumber

On a payroll cost, the pay for the premium hours of the pay period, part of total

sick_paynumber

On a payroll cost, the pay for the sick hours of the pay period, part of total

vacation_paynumber

On a payroll cost, the pay for the vacation hours of the pay period, part of total

holiday_paynumber

On a payroll cost, the pay for the holiday hours of the pay period, part of total

piece_paynumber

On a payroll cost, the pay for piece work in the pay period, part of total

misc_paynumber

On a payroll cost, miscellaneous pay of the pay period that fits no other pay type, part of total

salary_paynumber

On a payroll cost, the salary paid on the record to a salaried employee, part of total; 0 on a record paid by the hour

advance_paynumber

On a payroll cost, an advance paid out on the record, part of total; 0 on an ordinary record

per_diemnumber

On a payroll cost, the per diem paid with the record. It is an addition to the pay, counted in additions_total and in net_total, not in total

regular_ratenumber

On a payroll cost, the hourly rate the record carries for regular hours, the employee's own rate when the record was made. Hours worked under a pay group are paid at the group's rate, which is on the time entry, so regular_pay is not always regular_hours times this

overtime_ratenumber

On a payroll cost, the hourly rate the record carries for overtime hours

premium_ratenumber

On a payroll cost, the hourly rate the record carries for premium hours

deductions_totalnumber

On a payroll cost, everything withheld from the employee on the record, taxes included. total less deductions_total plus additions_total is net_total

additions_totalnumber

On a payroll cost, everything paid to the employee on top of total (per diem, reimbursements, cash fringes)

check_numberstring

On a payroll cost, the number of the check or deposit advice the pay went out on, as the source prints it; empty until one is issued

$ curl -X POST https://api.valtrix.com/v1/records/cost \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "description": "...", "kind": "...", "payee_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/cost/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Cost code

cost_code

An entry in the org's cost code structure used to code budgets, costs, and time. Structural reference data, not a money document.

Writable through POST /v1/records/cost_code. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/cost_code/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

codestring

Full cost code

namestring

Cost code name

statusstring

One of: active, inactive

departmentstring

The department the cost code belongs to in the books, as the source names it; source-defined, pass it through. Filled by accounting sources that keep a department on each cost code; others leave it empty

workers_comp_codestring

The workers compensation class code that work coded to this cost code is rated under, as the source numbers it. Filled by accounting sources that keep one on each cost code; others leave it empty

$ curl -X POST https://api.valtrix.com/v1/records/cost_code \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "code": "..." } }'
$ curl "https://api.valtrix.com/v1/records/cost_code/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Cost transaction

cost_transaction

One actual cost posted to a project's job cost ledger: the line a bill, payroll run, equipment allocation, inventory issue, or journal entry books against a cost code and cost type, with the amount and hours. This is the ledger every job cost report is built from. The documents that produce postings stay where they are (cost, journal_entry) and are linked via document_type and document_id when synced; budget_detail is the per-cost-code rollup of these postings, and budget_line is what they are measured against.

Writable through POST /v1/records/cost_transaction. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/cost_transaction/:externalId for records you wrote. The title key is description.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

descriptionstring

What the posting covers, as the source shows it

numberstring

Source transaction or reference number the posting came from: the invoice, check, timecard, or journal number

source_kindstring

One of: bill, card_transaction, payroll, equipment, inventory, invoice, direct, journal, other. What produced the posting: invoice is a sale that posted its own cost (the parts relieved and labor on a service or receivable invoice), direct a cost entered on the job with no source document; map the source screen or transaction type onto these and keep the raw label in source data

statusstring

One of: posted, void. A voided posting stays in the ledger with status void and no longer counts toward job cost; filter status eq posted to total a job the way the source's own job cost reports do

document_typestring

Entity type of the synced document that produced the posting: cost or journal_entry

document_idreference

Valtrix record ID of the cost or journal entry that produced the posting, typed by document_type; null when the producing document is not synced

project_namestring

Project or job the cost was posted to

project_idreference

Valtrix record ID of the project the cost was posted to

cost_codestring

Cost code the posting is coded against

cost_code_idreference

Valtrix record ID of the cost code the posting is coded against

cost_typestring

Cost type as the source names it (material, labor, equipment, subcontract, other); source-defined, pass it through

vendor_namestring

Vendor the cost was incurred with, for postings that came from a bill, card charge, or inventory receipt

vendor_idreference

Valtrix record ID of the vendor the cost was incurred with

employee_namestring

Employee whose labor the posting records, for postings that came from payroll or a timecard

employee_idreference

Valtrix record ID of the employee whose labor the posting records

location_idreference

Valtrix record ID of the location the cost was posted to, for sources that book costs against a venue or site rather than a project

resource_idreference

Valtrix record ID of the piece of equipment the posting is charged to or came from, for sources that cost equipment

amountnumber

Cost amount posted, negative for a credit or reversal

hoursnumber

Labor or equipment hours the posting records, zero when the source posts none

quantitynumber

Units the posting records where the source counts them (pieces, equipment units); null otherwise

billableboolean

Whether the posting can be billed to the customer; false for non-billable postings and write-offs

currencystring

ISO currency code the amount is denominated in, null when the source books everything in one implicit currency

transaction_atdate

Accounting date of the posting as the source books it

created_atdate

When the posting was created in the source

departmentstring

The department, division, or trade the posting is booked under, as the source names it on the posting itself, for payroll earnings and labor costs a source allocates by department; source-defined, pass it through. Empty when the source books the posting to no department

posting_yearnumber

Fiscal year of the books the cost was posted to, as the accounting source keeps it (a Sage 100 Contractor posting year, named by the calendar year the fiscal year ends in). Filled by accounting sources that post each entry to a period of their own, separate from its date; others leave it empty

posting_periodnumber

Accounting period within posting_year the cost was posted to, as the accounting source numbers it (1 to 12 in Sage 100 Contractor, 0 for an opening entry). It can differ from the period the document date falls in, which is what a cutoff check compares. Filled by accounting sources that post each entry to a period; others leave it empty

$ curl -X POST https://api.valtrix.com/v1/records/cost_transaction \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "description": "...", "number": "...", "document_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/cost_transaction/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Coverage

coverage

One insurance policy a customer holds with a payer: the member and group numbers, its rank among the customer's policies, and who holds it. The carrier itself maps to payer; a claim filed under the policy maps to invoice with its lines as line_item.

Writable through POST /v1/records/coverage. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/coverage/:externalId for records you wrote. The title key is payer_name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

customer_idreference

Valtrix record ID of the customer the policy covers

payer_namestring

Carrier or plan the policy is with

payer_idreference

Valtrix record ID of the carrier or plan the policy is with

rankstring

One of: primary, secondary, tertiary, other. The order the policy is billed in; map the source positions onto these

member_numberstring

Member, subscriber, or policy number

group_numberstring

Group or plan number

policy_holderstring

Who holds the policy, as the source records it: a name, or Self when the customer is the holder

policy_holder_birthdaydate

Date of birth of the policy holder, for sources that keep one on the policy

copaynumber

Copay due per visit under the policy, in currency

authorization_codestring

Authorization or pre-approval code on file for the policy

statusstring

One of: active, inactive. A terminated, replaced, or hidden policy is inactive

starts_atdate

When the policy takes effect

ends_atdate

When the policy ends

created_atdate

When the policy was recorded in the source

$ curl -X POST https://api.valtrix.com/v1/records/coverage \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "payer_name": "...", "rank": "...", "customer_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/coverage/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Customer

customer

A person or company the org sells to or performs work for, at the account level. Individual people at that account map to contact; parties the org buys from map to vendor.

Writable through POST /v1/records/customer. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/customer/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Full customer name

emailstring

Primary email address

phonestring

Primary phone number

countrystring

Country code or name

statusstring

One of: prospect, active, inactive. Map the source lifecycle (archived, disabled, deleted, lead) onto these; the raw label stays in source data

created_atdate

When the customer was created in the source

birthdaydate

Date of birth, for sources that keep one on the customer (a member, a patient, a client)

genderstring

One of: female, male, other. Map the source labels onto these; the raw label stays in source data

addressstring

Street address as one line

citystring

City, town, or district of the address

regionstring

State, province, or region of the address, as the source names it

postal_codestring

ZIP or postal code of the address, as the source prints it

marital_statusstring

Marital or civil status as the source labels it; source-defined, pass it through

emergency_contactstring

Emergency contact as one line (name and phone), for sources that keep one on the customer

ownerstring

Name of the staff member who owns the relationship: the assigned account executive, sales representative, or coach

email_opt_inboolean

Whether the customer accepts marketing email, as the source records the consent

visit_countnumber

Number of visits the source has counted for the customer, for sources that keep a running total on the guest or member (a point of sale guest book, a loyalty profile); the source's own count, not one derived from orders or bookings

first_visit_atdate

When the source recorded the customer's first visit

last_visit_atdate

When the source recorded the customer's most recent visit

total_spendnumber

Lifetime amount the customer has spent across those visits as the source totals it, tax included and tips excluded, in the currency of the location

parent_idreference

Valtrix record ID of the account this one sits under, for sources that nest accounts: a unit under a property manager, a site under a corporate customer. The nested account is still its own customer

tagsstring

Tags the source keeps on the record, comma separated, as the source spells them; source-defined, pass them through

$ curl -X POST https://api.valtrix.com/v1/records/customer \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "email": "...", "parent_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/customer/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Document

document

A file kept in a source's document library or project folder and managed as a record in its own right: drawings, specifications, supplier quotes, submittals, photos, and correspondence filed under a project or the org itself, and the statements, schedules, and issued instruments a portal publishes to the org, discriminated by kind. The file rides along as a record attachment; this record carries its name, folder path, type, size, uploader, and dates. A file attached to another record (an invoice PDF, a receipt image, a signed waiver) stays an attachment on that record and does not map here.

Writable through POST /v1/records/document. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/document/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

File name as the source shows it, with its extension

kindstring

One of: file, statement, agreement, policy, other. What the document is: a file kept in a library, folder, or recording archive is file; a periodic statement or report a portal issues to the org (a payout or commission statement, a monitoring report) is statement; a contract, schedule, or appointment instrument between the org and the source (a commission schedule, an agency agreement, a rate card) is agreement; an issued insurance policy document is policy; anything else is other with the source label in file_type. Two resources of one connector that land here stamp different kinds so a consumer can tell them apart

pathstring

Folder path the file sits under in the source, from the library root down to the file name

file_typestring

File type or category as the source labels it (PDF, Drawing, Commission Schedule); source-defined, pass it through. What the document is lives in kind

descriptionstring

Description or notes the source holds for the file

bytesnumber

Size of the current version in bytes

versionnumber

Number of the current version, for sources that keep file versions

uploaded_bystring

Name of the person who added the file

project_idreference

Valtrix record ID of the project the file is filed under, null for a file kept at the company level

folder_idreference

Valtrix record ID of the folder the file sits in, for sources that manage folders as records; null at the library root

updated_atdate

When the file or its current version last changed in the source

created_atdate

When the file was first added to the source

$ curl -X POST https://api.valtrix.com/v1/records/document \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "kind": "...", "project_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/document/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Employee

employee

A member of the org's own workforce, at the company level. A person's membership on a specific project maps to project_user, and their logged time maps to time_entry.

Writable through POST /v1/records/employee. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/employee/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Full name

emailstring

Work email address

phonestring

Primary phone number

job_titlestring

Role within the company

departmentstring

Department, team, or division the employee belongs to, as the source names it; source-defined, pass it through

position_codestring

The source's own number or code of the position the employee holds, where the source keeps positions as a list of their own: it equals the code of the classification of kind position, and job_title carries its name

annual_salarynumber

Annual base salary or salary-equivalent compensation, in the source currency

employee_idstring

Internal employee number

start_datedate

When the employee started at the company, the hire date in the source system

statusstring

One of: active, inactive. Map terminated, archived, or disabled employees to inactive

created_atdate

When the employee was created in the source

skillsstring

Skills or certifications the source keeps on the person, comma separated, as the source spells them (a dispatch system's skill tags); source-defined, pass them through

working_hoursstring

The person's regular working hours as JSON text keyed by weekday (mon to sun), each { "from": "08:00", "to": "17:00", "on_call": false } in the source's local time, 24-hour clock; a day the person does not work is absent. Scheduling sources only

vacation_hours_availablenumber

Paid vacation hours the employee has accrued and not yet taken, the balance the source keeps on the employee record; negative when more was taken than accrued. Filled by payroll sources that track the balance; others leave it empty

vacation_accrual_ratenumber

The rate the source accrues vacation at for this employee, in the unit its accrual method uses (hours of vacation per hour worked on an hourly method); the method itself stays in source data

genderstring

One of: male, female, other. Sent on a write to a payroll source that will not save an employee without one; connectors do not read it back

workers_comp_codestring

The workers compensation class code the employee is rated under, as the source numbers it

addressstring

Home street address as one line. Sent on a write to a payroll source; connectors do not read it back

citystring

City of the home address. Sent on a write to a payroll source; connectors do not read it back

regionstring

State, province, or region of the home address, as the source names it. Sent on a write to a payroll source; connectors do not read it back

postal_codestring

ZIP or postal code of the home address. Sent on a write to a payroll source; connectors do not read it back

birthdaydate

Date of birth, read where the source keeps it on the employee and sent on a write to a payroll source

tax_filing_statusstring

One of: single, married_joint, head_of_household. The federal withholding filing status of the employee's Form W-4, Step 1(c): single also covers married filing separately, married_joint also covers a qualifying surviving spouse. Sent on a write to a payroll source; connectors do not read it back

tax_multiple_jobsboolean

Whether the multiple jobs box of Form W-4, Step 2(c), is checked. Sent on a write to a payroll source; connectors do not read it back

tax_dependents_amountnumber

The dependents credit claimed on Form W-4, Step 3, in dollars. Sent on a write to a payroll source; connectors do not read it back

tax_other_incomenumber

Other income not from jobs, Form W-4, Step 4(a), in dollars a year. Sent on a write to a payroll source; connectors do not read it back

tax_deductionsnumber

Deductions beyond the standard deduction, Form W-4, Step 4(b), in dollars a year. Sent on a write to a payroll source; connectors do not read it back

tax_extra_withholdingnumber

Extra federal withholding each pay period, Form W-4, Step 4(c), in dollars. Sent on a write to a payroll source; connectors do not read it back

state_tax_filing_statusstring

One of: single, married, head_of_household, married_separate, married_joint. The marital status the employee claims for state income tax withholding. Sent on a write to a payroll source; connectors do not read it back

state_tax_allowancesnumber

The number of exemptions or allowances the employee claims for state income tax withholding. Sent on a write to a payroll source; connectors do not read it back

state_tax_extra_withholdingnumber

Extra state income tax withheld each pay period, in dollars. Sent on a write to a payroll source; connectors do not read it back

emergency_contact_namestring

Name of the person to reach in an emergency. Sent on a write to a payroll source; connectors do not read it back

emergency_contact_relationshipstring

How the emergency contact is related to the employee (spouse, parent), free text. Sent on a write to a payroll source; connectors do not read it back

emergency_contact_phonestring

Phone number of the emergency contact. Sent on a write to a payroll source; connectors do not read it back

regular_ratenumber

The regular hourly pay rate the source keeps on the employee record, in the source currency; empty or 0 on an employee paid a salary. Filled by payroll sources that keep the rate on the employee

overtime_ratenumber

The overtime hourly pay rate the source keeps on the employee record

premium_ratenumber

The premium (double time) hourly pay rate the source keeps on the employee record

period_salarynumber

The salary the employee is paid each pay period, as the source keeps it on the employee record; 0 on an hourly employee. The length of the pay period stays in source data, so this is not annual_salary

end_datedate

When the employee left or went inactive, the termination or inactive date in the source system; empty on a current employee

status_detailstring

The employment status as the source names it (Current, Quit, Laid Off, Terminated), beside the canonical status; source-defined, pass it through

employment_typestring

The employee type as the source names it (Regular Full-Time, Regular Part-Time); source-defined, pass it through

direct_depositboolean

Whether the employee is paid by direct deposit, as the payroll source records it; false when paid by check

direct_deposit_accountsstring

The bank accounts the employee's pay is deposited to as JSON text, one entry per account in the source's order, each { "slot": 1, "routing_number": "091000019", "account_type": "Checking", "deposit": 0, "prenote": false, "account_on_file": true }: the account type as the source names it, the deposit figure as the source keeps it, prenote true while a test entry is still to be sent to the bank, and account_on_file whether the source holds an account number. The account number itself is never carried. Empty when the employee has none. Filled by payroll sources that keep direct deposit on the employee

$ curl -X POST https://api.valtrix.com/v1/records/employee \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "email": "..." } }'
$ curl "https://api.valtrix.com/v1/records/employee/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Entitlement

entitlement

A customer's prepaid or granted balance of visits, credits, or time: class packs, punch cards, session credits, and membership allowances all map here. The purchase creating it maps to order, the agreement granting it maps to contract, and each redemption is a booking holding entitlement_id.

Writable through POST /v1/records/entitlement. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/entitlement/:externalId for records you wrote. The title key is item_name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

item_namestring

Catalog item the entitlement was granted from

item_idreference

Valtrix record ID of the item the entitlement was granted from

customer_idreference

Valtrix record ID of the customer holding the entitlement

contract_idreference

Valtrix record ID of the membership or subscription agreement granting the entitlement

order_idreference

Valtrix record ID of the order that purchased the entitlement

kindstring

One of: visits, credits, minutes, currency. What the balance counts

quantitynumber

Quantity granted

remainingnumber

Quantity remaining

statusstring

One of: active, expired, exhausted, inactive. Map the source entitlement states onto these

starts_atdate

When the entitlement becomes usable

expires_atdate

When the entitlement expires

created_atdate

When the entitlement was created in the source

$ curl -X POST https://api.valtrix.com/v1/records/entitlement \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "item_name": "...", "kind": "...", "item_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/entitlement/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Estimate

estimate

A priced proposal issued before any agreement exists: quotes, bids, estimates, and proposals all map here. Its lines map to line_item; once accepted, the resulting agreement maps to contract (linked back via contract_id) and the resulting bill maps to invoice.

Writable through POST /v1/records/estimate. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/estimate/:externalId for records you wrote. The title key is number.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

numberstring

Estimate or quote number

kindstring

One of: estimate, proposal, takeoff, other. A priced quote or estimate offered to the customer, including a treatment plan, is estimate; a formal bid or proposal document is proposal; the internal quantity and cost takeoff behind a bid is takeoff

titlestring

Estimate title

customer_namestring

Customer the estimate was issued to

customer_idreference

Valtrix record ID of the customer the estimate was issued to

project_idreference

Valtrix record ID of the project the estimate belongs to

contract_idreference

Valtrix record ID of the contract the estimate became once accepted

statusstring

One of: draft, sent, pending, approved, rejected, expired, void. Map the source estimate and proposal states onto these; the raw label stays in source data

totalnumber

Total proposed amount

currencystring

ISO currency code

issued_atdate

When the estimate was issued

expires_atdate

When the estimate expires

created_atdate

When the estimate was created in the source

$ curl -X POST https://api.valtrix.com/v1/records/estimate \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "number": "...", "kind": "...", "customer_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/estimate/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Event

event

A scheduled occurrence customers book into: group classes, courses, workshops, and open sessions, with capacity and start and end times. Each attendee's spot maps to booking; one-on-one reservations map straight to booking without an event; project schedule rows map to schedule_task.

Writable through POST /v1/records/event. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/event/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Event name

kindstring

One of: class, course, workshop, other. Map the source occurrence types onto these

item_idreference

Valtrix record ID of the catalog item for the service the event delivers

employee_idreference

Valtrix record ID of the employee leading the event, such as the instructor or teacher

resource_idreference

Valtrix record ID of the resource the event occupies, such as a room or court

location_idreference

Valtrix record ID of the location the event takes place at

capacitynumber

Maximum number of bookings

booked_countnumber

Number of spots taken

statusstring

One of: scheduled, cancelled, completed. Map the source event states onto these

start_atdate

When the event starts

end_atdate

When the event ends

created_atdate

When the event was created in the source

$ curl -X POST https://api.valtrix.com/v1/records/event \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "kind": "...", "item_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/event/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Financial account

financial_account

A bank, card, or cash account the org moves money through, discriminated by kind: the payment instrument a payment is released from or received into, not the ledger account it posts to. gl_account_id, with gl_account_number and gl_account_name, carries the chart-of-accounts account the source maps the instrument to, so a payment can be traced from the account that released it to the ledger balance it reduces. Chart-of-accounts entries themselves map to gl_account.

Writable through POST /v1/records/financial_account. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/financial_account/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Account name as the source labels it

kindstring

One of: bank, card, cash, other. Instrument classification

subtypestring

Finer-grained account type as the source names it (checking, savings, business); source-defined, pass it through

maskstring

Last digits of the account number, never the full number

statusstring

One of: active, inactive

location_idreference

Valtrix record ID of the location the account is set up for, for sources that bank per venue or site

gl_account_numberstring

Number of the chart-of-accounts account the source maps the instrument to, as the source records the mapping

gl_account_namestring

Name of the chart-of-accounts account the source maps the instrument to

gl_account_idreference

Valtrix record ID of the mapped chart-of-accounts account, when that account is synced

$ curl -X POST https://api.valtrix.com/v1/records/financial_account \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "kind": "...", "location_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/financial_account/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Folder

folder

A folder in a source's document library, kept as a record so a document write can name where a file lands: the folders of a construction project's Documents tree, a shared drive folder. The files inside it map to document via folder_id; the folder itself carries no file.

Writable through POST /v1/records/folder. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/folder/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Folder name as the source shows it

pathstring

Folder path below the library root, from the first folder down to this one, joined with slashes and without the root folder's own name (Internal Documents/Purchase Orders); null for the root folder itself

parent_idreference

Valtrix record ID of the folder this one sits in, null for the root folder

project_idreference

Valtrix record ID of the project the folder belongs to, null for a folder kept at the company level

updated_atdate

When the folder last changed in the source

created_atdate

When the folder was created in the source

$ curl -X POST https://api.valtrix.com/v1/records/folder \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "path": "...", "parent_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/folder/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

GL account

gl_account

An entry in the org's chart of accounts used to code money movements in accounting sources. Structural reference data, not a money document; project-coding structures map to cost_code instead.

Writable through POST /v1/records/gl_account. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/gl_account/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

numberstring

Account number in the chart of accounts

namestring

Account name

kindstring

One of: asset, liability, equity, income, expense. Account classification

subtypestring

Finer-grained account type as the source names it (accounts receivable, fixed asset, cost of goods sold); source-defined, pass it through

currencystring

ISO currency code

statusstring

One of: active, inactive

$ curl -X POST https://api.valtrix.com/v1/records/gl_account \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "number": "..." } }'
$ curl "https://api.valtrix.com/v1/records/gl_account/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Inspection

inspection

A filed inspection of one piece of equipment against a checklist form, or one that was due and never filed: driver vehicle inspection reports, pre-use and daily walkarounds, and mechanic inspections all collapse here, discriminated by kind. The equipment maps to resource (linked via resource_id); a defect that becomes work maps to maintenance_order. A government building or permit inspection is not this: it stays on the project as schedule_task or activity.

Writable through POST /v1/records/inspection. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/inspection/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Name of the inspection form or checklist that was filed

kindstring

One of: dvir, inspection. A driver vehicle inspection report filed for regulatory compliance is dvir; every other checklist is inspection

statusstring

One of: completed, missed. A filed inspection is completed; one the source reports as due and not filed is missed

outcomestring

One of: pass, fail, other. The overall result of a filed inspection; a pass with noted defects is other. Null on a missed inspection

resource_namestring

Name of the piece of equipment inspected

resource_idreference

Valtrix record ID of the piece of equipment inspected

location_idreference

Valtrix record ID of the site or yard the equipment was at

inspector_namestring

Who filed the inspection, or who it was assigned to when missed

inspector_idreference

Valtrix record ID of the employee who filed the inspection or was assigned it

meter_hoursnumber

Engine or run hours recorded on the inspection

odometer_milesnumber

Odometer reading in miles recorded on the inspection; convert a source that reports kilometres

latitudenumber

Latitude where the inspection was filed

longitudenumber

Longitude where the inspection was filed

commentsstring

The inspector's overall comments

due_atdate

When the inspection was due, for sources that schedule them

started_atdate

When the inspector started the checklist

completed_atdate

When the inspection was filed

created_atdate

When the record was created in the source

$ curl -X POST https://api.valtrix.com/v1/records/inspection \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "kind": "...", "resource_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/inspection/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Inventory level

inventory_level

The stock position of one item at one location: quantity on hand as of the source's latest count or running balance. A point-in-time read model; the movements that produce it map to inventory_movement. A source that reports stock by category rather than by item (Craftable's inventory summary) maps one level per category and date, with category, department, and value filled and item_id empty.

Writable through POST /v1/records/inventory_level. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/inventory_level/:externalId for records you wrote. The title key is item_name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

item_namestring

Item the level is for

item_idreference

Valtrix record ID of the item the level is for

location_idreference

Valtrix record ID of the location holding the stock

quantitynumber

Quantity on hand

uomstring

Unit of measure as the source names it; source-defined, pass it through

unit_costnumber

Cost per unit used to value the stock

as_ofdate

When the level was measured or last updated

departmentstring

The operating department the stock belongs to, as the source names it, for a source that keeps bar and kitchen inventories apart (Craftable's Bevager and Foodager)

categorystring

Inventory category the source files the stock under; on a category rollup, the category the level is for

valuenumber

Value of the stock at cost on the as-of date, the figure an inventory balance sheet account is posted from

reorder_pointnumber

Quantity at or below which the org reorders the item at this location

min_quantitynumber

Lowest quantity the org wants on hand at this location

max_quantitynumber

Highest quantity the org wants on hand at this location

$ curl -X POST https://api.valtrix.com/v1/records/inventory_level \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "item_name": "...", "quantity": 42, "item_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/inventory_level/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Inventory movement

inventory_movement

A single change to stock: receipts, transfers, adjustments, counts, waste, and sales depletion all map here, discriminated by kind. Transfers carry both locations; the resulting position maps to inventory_level.

Writable through POST /v1/records/inventory_movement. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/inventory_movement/:externalId for records you wrote. The title key is item_name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

kindstring

One of: receipt, transfer, adjustment, count, waste, sale. Map the source movement types onto these

item_namestring

Item the movement is for

item_idreference

Valtrix record ID of the item the movement is for

from_location_idreference

Valtrix record ID of the location the stock moved out of

to_location_idreference

Valtrix record ID of the location the stock moved into

quantitynumber

Quantity moved, negative when stock decreases

uomstring

Unit of measure as the source names it; source-defined, pass it through

unit_costnumber

Cost per unit of the moved stock

occurred_atdate

When the movement happened

created_atdate

When the movement was recorded in the source

$ curl -X POST https://api.valtrix.com/v1/records/inventory_movement \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "item_name": "...", "kind": "...", "item_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/inventory_movement/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Invoice

invoice

A bill the org issues to a customer for money owed to the org. Receivables only: bills the org has to pay map to cost, and the transactions settling either side map to payment.

Writable through POST /v1/records/invoice. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/invoice/:externalId for records you wrote. The title key is number.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

numberstring

Invoice number

kindstring

One of: invoice, service, progress_billing, loan_draw, claim, credit, other. What the document is: a plain bill for goods or services is invoice; a field-service or work-order invoice is service; an application for payment under a contract (a progress or unitary billing, a payment application) is progress_billing; a draw against a construction loan is loan_draw; a claim filed with an insurer is claim; a credit memo that reduces what the customer owes is credit. A source that keeps both an application and the invoice it posted stamps each with its own kind and links them through origin_id

customer_namestring

Billed customer name

customer_idreference

Valtrix record ID of the billed customer

project_idreference

Valtrix record ID of the project the invoice bills against

location_idreference

Valtrix record ID of the location the invoice belongs to, for sources that bill per venue or site rather than a project

amountnumber

Total amount due

currencystring

ISO currency code

statusstring

One of: draft, pending, approved, rejected, sent, partially_paid, paid, void. Map the source approval and payment states onto these; the raw label stays in source data

issued_atdate

Issue date

due_atdate

Due date

scheduled_atdate

When the work the invoice bills was scheduled, for field-service sources whose invoice or work order carries the appointment; other sources leave it empty

employee_idreference

Valtrix record ID of the employee the invoice is credited to: the technician who performed the work on a service invoice, the salesperson on a sales invoice

categorystring

Invoice type or category as the source names it (a Sage 11-2 service type such as HVAC or Plumbing); source-defined, pass it through

departmentstring

Department, division, or subaccount the whole invoice is booked under, for accounting sources that class an invoice as one unit (the 1-7 subaccount every line of a Sage 11-2 service invoice posts under); source-defined, pass it through

patient_balancenumber

Part of the open balance the customer owes personally, for sources that split a bill between the customer and an insurer

insurance_balancenumber

Part of the open balance billed to the customer's insurance, for sources that split a bill between the customer and an insurer

descriptionstring

The short title the source prints on the invoice (the job or service it bills), for sources that carry one beside the number

notesstring

Free-text notes on the invoice as the source keeps them: the summary of work performed, the memo printed for the customer

journal_entry_idreference

Valtrix record ID of the general ledger journal entry that posting the invoice produced, for accounting sources that sync both; null while the invoice is unposted

origin_idreference

Valtrix record ID of the document this one was posted from, for sources that keep both an application and the receivable invoice posting it created (a Sage 100 Contractor 3-7 progress billing and its 3-2 invoice); a table that totals receivables keeps the rows whose origin is null

subtotalnumber

Amount before tax, for sources that print it

taxnumber

Tax charged on the invoice, in currency

balancenumber

Amount still owed as the source reports it, zero once paid

paid_amountnumber

Amount the customer has paid against the invoice so far

retainagenumber

Part of the invoice the customer holds back until the work is accepted (retention), in currency, as the source keeps it on the invoice; it is still inside balance until it is paid. Filled by construction sources that track retention per invoice; others leave it empty

net_duenumber

Amount the customer owes now: balance less the retainage still held, as the source reports it. Filled by sources that hold retainage on the invoice; others leave it empty, and balance is what is due

ready_to_invoiceboolean

Whether the work order or unbilled invoice has been marked ready to bill, for sources where the company keeps such a flag on the document (a Sage 100 Contractor user-defined checkbox named Ready to Invoice on 11-2 work orders). Empty where the source or the company has no such flag

posting_yearnumber

Fiscal year of the books the invoice was posted to, as the accounting source keeps it (a Sage 100 Contractor posting year, named by the calendar year the fiscal year ends in). Filled by accounting sources that post each entry to a period of their own, separate from its date; others leave it empty

posting_periodnumber

Accounting period within posting_year the invoice was posted to, as the accounting source numbers it (1 to 12 in Sage 100 Contractor, 0 for an opening entry). It can differ from the period the document date falls in, which is what a cutoff check compares. Filled by accounting sources that post each entry to a period; others leave it empty

$ curl -X POST https://api.valtrix.com/v1/records/invoice \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "number": "...", "kind": "...", "customer_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/invoice/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Item

item

A catalog master record for a good or service the org sells, stocks, or buys: products, SKUs, menu items, materials, and rate-card services all map here. Usages of an item on a document map to line_item via item_id; stock on hand maps to inventory_level.

Writable through POST /v1/records/item. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/item/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Item name

skustring

SKU or item code in the source system

categorystring

Catalog category or family as the source names it; source-defined, pass it through

uomstring

Default unit of measure as the source names it; source-defined, pass it through

pricenumber

Standard selling price per unit

costnumber

Standard acquisition or production cost per unit

currencystring

ISO currency code

statusstring

One of: active, inactive. Map archived, draft, or discontinued items to inactive

created_atdate

When the item was created in the source

manufacturerstring

Who makes the item, for parts and materials catalogs

manufacturer_part_numberstring

The manufacturer's own part number, when it differs from the sku the org files the item under

vendor_idreference

Valtrix record ID of the vendor the org prefers to buy the item from

vendor_skustring

The preferred vendor's own number for the item

kindstring

One of: product, material, service, assembly, bundle, tax, discount, other. What the catalog entry is: a stocked or sold good is product, a part or consumable priced for a job is material, labor or a flat-rate task is service, a kit priced as one line with its own parts is assembly, a bundle of items sold together is bundle, a tax code or tax item is tax, a discount line is discount. Filled by sources whose catalog mixes these; a source with one flavor may leave it empty

tagsstring

Tags the source keeps on the record, comma separated, as the source spells them; source-defined, pass them through

$ curl -X POST https://api.valtrix.com/v1/records/item \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "sku": "...", "vendor_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/item/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Journal entry

journal_entry

A general ledger journal entry at the header level, the most general money record an accounting source exposes. Its debit and credit lines map to line_item coded by gl_account_id; documents with business meaning map to invoice, cost, or payment instead.

Writable through POST /v1/records/journal_entry. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/journal_entry/:externalId for records you wrote. The title key is number.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

numberstring

Journal entry number

descriptionstring

What the entry records

statusstring

One of: draft, posted, adjusted, void. Map the source posting states onto these

location_idreference

Valtrix record ID of the location the entry books for, for sources that journal per venue or site

posted_atdate

When the entry was posted to the ledger

created_atdate

When the entry was created in the source

posting_yearnumber

Fiscal year of the books the entry was posted to, as the accounting source keeps it (a Sage 100 Contractor posting year, named by the calendar year the fiscal year ends in). Filled by accounting sources that post each entry to a period of their own, separate from its date; others leave it empty

posting_periodnumber

Accounting period within posting_year the entry was posted to, as the accounting source numbers it (1 to 12 in Sage 100 Contractor, 0 for an opening entry). It can differ from the period the document date falls in, which is what a cutoff check compares. Filled by accounting sources that post each entry to a period; others leave it empty

$ curl -X POST https://api.valtrix.com/v1/records/journal_entry \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "number": "...", "description": "...", "location_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/journal_entry/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Line item

line_item

A single line on any financial document: contracts, purchase orders, invoices, orders, costs, estimates, and journal entries. The parent is identified by three columns: document_entity names the entity the parent record lives under (a bill line has document_entity cost), document_type carries the parent's kind (that same line has document_type bill), and document_id holds its record id. Every per-document line flavor lands here; budget rows are the one exception (budget_line).

Writable through POST /v1/records/line_item. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/line_item/:externalId for records you wrote. The title key is description.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

descriptionstring

What the line covers

document_entitystring

Entity type of the document the line belongs to: contract, cost, invoice, order, estimate, or journal_entry. Read document_id from this entity; filter on it to select the lines of every cost, every contract, and so on

document_typestring

One of: bill, credit, expense, payroll, card_transaction, invoice, order, estimate, bid_request, prime_contract, subcontract, purchase_order, work_order, requisition, change_order, journal_entry, claim, treatment_plan, other. The kind of the document the line belongs to, matching the parent record's kind rather than its entity (a line on a cost of kind bill has document_type bill and document_entity cost)

document_idreference

Valtrix record ID of the document the line belongs to, in the entity document_entity names

positionnumber

1-based order of the line on its document as the source shows it; sort by this to render lines the way the source does

project_idreference

Valtrix record ID of the project the line belongs to

item_idreference

Valtrix record ID of the catalog item the line sells or consumes

cost_codestring

Cost code the line is coded against

cost_code_idreference

Valtrix record ID of the cost code the line is coded against

gl_account_idreference

Valtrix record ID of the general ledger account the line is coded to, for accounting sources

gl_accountstring

Ledger or charge account the line is coded to, as the source prints it, for sources that give the account as text rather than as a synced record; source-defined, pass it through

cost_typestring

Cost type as the source names it (labor, materials, subcontract); source-defined, pass it through

classstring

Accounting class or tracking category the line is coded to (QuickBooks class, location or department class), as the source names it; source-defined, pass it through

departmentstring

Department, team, or division the line amount is allocated to, for payroll and labor costs, as the source names it; source-defined, pass it through

resource_idreference

Valtrix record ID of the piece of equipment the line is a cost of, for a bill line that pays for a repair, parts, or fuel for one unit (the equipment of a Sage equipment cost)

wbsstring

Work breakdown structure codes the line is coded to, as JSON text keyed by the code slot name the document defines ({"Bid Item":"1","Locations":"20-WLLFRMG"}), one key per slot the document names and the line fills, for estimating sources with several coding dimensions beside the cost code; source-defined, pass the names and codes through. A keyed column: a filter, order, or group names one key as wbs.Locations

quantitynumber

Quantity on the line

uomstring

Unit of measure as the source names it; source-defined, pass it through

unit_costnumber

Cost per unit

amountnumber

Line amount

totalnumber

Extended line total

created_atdate

When the line was created in the source

unit_pricenumber

Selling price per unit on a sales line (an invoice, quote, or order line), beside unit_cost, which stays the cost basis; empty on a purchase line

discountnumber

Discount applied to the line, in currency, as a positive number

discount_codestring

The coupon or discount code the discount came from; source-defined, pass it through

taxnumber

Tax charged on the line, in currency

categorystring

Catalog category of what the line sells, as the source names it on the line (a menu group, a product family), written the way item.category is so the two can be compared; source-defined, pass it through

statusstring

One of: active, void. A line the source voided or removed after it was entered stays on its document with status void and no longer counts toward the document total; sources with no such state leave it empty

entry_sidestring

One of: debit, credit. The side of its journal entry the line posts to, for sources that state the amount as one figure and name the side apart from it; amount keeps the sign the source gives, so a negative amount on a debit line is a reversal shown in the debit column. Empty on lines that are not journal postings and on sources whose amount already carries the side as its sign

material_amountnumber

The material share of the line, in currency, for estimating sources that price one line in several cost categories at once; total is the sum of the category amounts

labor_amountnumber

The labor share of the line, in currency, for estimating sources that price one line in several cost categories at once

subcontract_amountnumber

The subcontract share of the line, in currency, for estimating sources that price one line in several cost categories at once; a line whose only amount is here is subcontract work

equipment_amountnumber

The equipment share of the line, in currency, for estimating sources that price one line in several cost categories at once

other_amountnumber

The share of the line outside material, labor, subcontract, and equipment, in currency, for estimating sources that price one line in several cost categories at once

calculation_typestring

On a payroll line, how the calculation behind it acts on the pay. One of: deduction, addition, employer_cost, add_and_deduct, accrual. deduction is withheld from the employee's pay (taxes, a 401k contribution, a loan repayment), addition is paid to the employee on top of wages (per diem, a reimbursement, a cash fringe), employer_cost is paid by the employer and never touches the employee's pay (employer taxes, workers compensation, an employer match), add_and_deduct is added to gross and withheld again, accrual builds a vacation or sick balance. A pay stub groups its lines by it; empty on every other line

shown_on_checkboolean

On a payroll line, whether the source prints the calculation on the employee's check stub, as the payroll setup flags it: a pay stub lists the lines where it is true. Empty on every other line

ytd_amountnumber

On a payroll line, the amount of the calculation for the employee in the year so far, this record included, as the payroll source keeps it on the line. Empty on every other line

$ curl -X POST https://api.valtrix.com/v1/records/line_item \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "description": "...", "document_entity": "...", "document_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/line_item/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Location

location

A standalone physical place record, such as a store, site, or warehouse. Only sources that model places as their own records produce these; address fields on another entity stay on that entity.

Writable through POST /v1/records/location. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/location/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Location name

kindstring

One of: site, venue, warehouse, service_address, parcel, other. A job site, project location, or property is site; a store, branch, clinic, restaurant, or other place the org trades from is venue; an inventory or parts location is warehouse; a customer address work is performed at is service_address; a land parcel from a permit portal is parcel

addressstring

Street address

postal_codestring

ZIP or postal code of the address, as the source prints it

created_atdate

When the location was created in the source

parent_idreference

Valtrix record ID of the location this one sits under, for sources that keep a hierarchy of places: a branch under a region under the company, a room under a site

$ curl -X POST https://api.valtrix.com/v1/records/location \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "kind": "...", "parent_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/location/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Maintenance order

maintenance_order

A unit of maintenance work on one piece of equipment: a maintenance or repair request, the work order that performs it, and a preventive service coming due all collapse here, discriminated by kind. The equipment maps to resource (linked via resource_id); labor booked to it maps to time_entry and outside service or parts costs to cost, both linked back via maintenance_order_id. A purchase order or subcontract with a vendor stays contract, and a project schedule row stays schedule_task.

Writable through POST /v1/records/maintenance_order. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/maintenance_order/:externalId for records you wrote. The title key is title.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

titlestring

What the work is, as the source titles it: the complaint, the work order title, or the service coming due

numberstring

Work order or request number as the source prints it

kindstring

One of: request, work_order, preventive. A reported problem or request for work is request; the job that carries out the work is work_order; a scheduled service coming due on a usage or time trigger, before any work order exists, is preventive

statusstring

One of: open, scheduled, in_progress, on_hold, completed, cancelled. Map the source states onto these: new, pending, requested, or due is open; approved, planned, or assigned with dates is scheduled; started is in_progress; waiting on parts or paused is on_hold; resolved, closed, or done is completed; denied, rejected, or voided is cancelled. The raw label stays in source data

prioritystring

One of: low, medium, high, urgent. Critical or emergency is urgent

maintenance_typestring

The org's own classification of the work (Repair, Preventative Maintenance, Damage, Warranty); source-defined, pass it through

descriptionstring

The problem reported or the work to perform, as plain text

resource_namestring

Name of the piece of equipment the work is on

resource_idreference

Valtrix record ID of the piece of equipment the work is on

location_idreference

Valtrix record ID of the site, yard, or shop the work was requested from or is performed at

work_order_idreference

Valtrix record ID of the work order a request or preventive service was rolled into; null on a work order itself

requested_by_namestring

Who asked for the work

requested_by_idreference

Valtrix record ID of the employee who asked for the work

assigned_to_namestring

The mechanic or technician the work is assigned to; several names joined with a comma when the source assigns more than one

assigned_to_idreference

Valtrix record ID of the first mechanic or technician assigned

out_of_serviceboolean

Whether the equipment is down until the work is done

meter_hoursnumber

Engine or run hours on the equipment when the work was raised

odometer_milesnumber

Odometer reading in miles when the work was raised; convert a source that reports kilometres

due_atdate

When the work is needed by, or when a time-triggered preventive service comes due

due_meternumber

The meter reading a usage-triggered preventive service comes due at, in meter_unit

meter_unitstring

Unit due_meter counts in, as the source names it (Hours, Miles, Kilometers); source-defined, pass it through

scheduled_start_atdate

When the work is planned to start

scheduled_end_atdate

When the work is planned to finish

completed_atdate

When the work was completed or the request resolved

labor_costnumber

Labor cost booked to the work, in currency

parts_costnumber

Parts cost booked to the work, in currency

total_costnumber

Total cost of the work including labor, parts, outside services, and markups, in currency

created_atdate

When the record was created in the source

$ curl -X POST https://api.valtrix.com/v1/records/maintenance_order \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "title": "...", "number": "...", "resource_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/maintenance_order/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Message

message

One email, chat, or text message kept in a mailbox or messaging source, with its own sender, recipients, and body: every message of a mail folder, a chat thread, or a text-message log maps here, discriminated by kind. The folder it sits in maps to folder (linked via folder_id), its files ride along as record attachments, and the deal, customer, contact, or project it was filed against is subject_id. A calendar item maps to activity of kind meeting, and an entry that only logs that a message was sent, with no body of its own, stays an activity of kind email.

Writable through POST /v1/records/message. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/message/:externalId for records you wrote. The title key is subject.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

subjectstring

Subject line as the source shows it; a chat or text message with no subject leaves it empty

kindstring

One of: email, chat, sms, other. An email, including a meeting request or response delivered to a mail folder, is email; a chat or instant message is chat; a text message is sms

directionstring

One of: inbound, outbound. inbound when the account the connection signs in with received the message, outbound when that account sent it

senderstring

Who sent the message, as name <address>, a bare address, or the handle the source shows

recipientsstring

Who the message was addressed to, the To line as the source prints it: one address or several separated by semicolons, each as name <address> or a bare address

ccstring

The Cc line, in the same form as recipients, for sources that carry one

bodystring

The message text as plain text, with any markup stripped and capped by the connector

readboolean

Whether the message has been read in the source, for mailbox sources that track it

thread_idstring

The source's own conversation or thread identifier, so replies group together; source-defined, pass it through

folderstring

Name of the folder the message sits in as the source shows it (Inbox, Sent Items, Vendor Quotes); source-defined, pass it through. folder_id is the folder record

folder_idreference

Valtrix record ID of the folder the message sits in, for a mailbox source that keeps its folders as folder records; writing it on a synced message moves the message into that folder

subject_idreference

Valtrix record ID of the record the message was filed against, for sources that log messages on a deal, customer, contact, or project

subject_typestring

Entity type of the linked subject record: opportunity, customer, contact, or project

has_attachmentsboolean

Whether the source shows files on the message, for mailbox sources that flag it; the files themselves ride along as record attachments

sent_atdate

When the message was sent

received_atdate

When the message was received, for inbound messages

created_atdate

When the message was created in the source

$ curl -X POST https://api.valtrix.com/v1/records/message \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "subject": "...", "kind": "...", "folder_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/message/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Opportunity

opportunity

A potential sale the org is pursuing through the stages of a sales pipeline: deals, opportunities, and qualified pipeline leads all map here. The account being pursued maps to customer (linked via customer_id); a priced proposal issued along the way maps to estimate, and the agreement once won maps to contract.

Writable through POST /v1/records/opportunity. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/opportunity/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Opportunity or deal name, commonly the prospect account name

pipelinestring

Sales pipeline the opportunity is tracked in, as the source names it

stagestring

Pipeline stage as the source names it; this is a source-defined label, not a vocabulary, so pass it through

statusstring

One of: open, won, lost. Map closed-won and closed-lost stages onto won and lost; everything still in play is open

customer_namestring

Prospect account name

customer_idreference

Valtrix record ID of the prospect account

contact_namestring

Primary contact name on the deal

contact_idreference

Valtrix record ID of the primary contact on the deal

emailstring

Primary contact email address

phonestring

Primary contact phone number

websitestring

Prospect website URL

amountnumber

Expected deal value

currencystring

ISO currency code

notesstring

Free-form notes on the opportunity

closed_atdate

When the opportunity was won or lost

created_atdate

When the opportunity was created in the source

$ curl -X POST https://api.valtrix.com/v1/records/opportunity \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "pipeline": "...", "customer_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/opportunity/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Order

order

A customer order for goods or services with a total and fulfilment status, such as a sales, e-commerce, or point-of-sale order. A signed agreement of any kind maps to contract, and the resulting bill maps to invoice.

Writable through POST /v1/records/order. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/order/:externalId for records you wrote. The title key is number.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

numberstring

Order number

customer_namestring

Ordering customer name

customer_idreference

Valtrix record ID of the ordering customer

project_idreference

Valtrix record ID of the project the order belongs to or kicked off

location_idreference

Valtrix record ID of the location the order was placed at, for sources that scope orders to a store or venue

totalnumber

Order total

currencystring

ISO currency code

statusstring

One of: draft, pending, approved, rejected, unfulfilled, partially_fulfilled, fulfilled, cancelled. Map the source approval and fulfilment states onto these; the raw label stays in source data

items_countnumber

Number of line items

placed_atdate

When the order was placed

subtotalnumber

Order amount before tax and tips, after discounts, for sources that break the total down

taxnumber

Tax charged on the order

tipnumber

Tips and gratuity the customer added to the order, for point-of-sale and delivery sources

discountnumber

Discounts applied to the order, in currency, as a positive number

channelstring

Where the order was placed, as the source names it (in store, online, a third-party marketplace); source-defined, pass it through

revenue_centerstring

Revenue center or sales area the order is booked under, as a point of sale names it (Dining Room, Bar, Uber Eats, DoorDash), for sources that attribute each order to one; source-defined, pass it through

employee_namestring

Staff member who took or owns the order (a server, cashier, or sales representative), for sources that record one

employee_idreference

Valtrix record ID of the staff member who took or owns the order

$ curl -X POST https://api.valtrix.com/v1/records/order \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "number": "...", "customer_name": "...", "customer_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/order/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Payer

payer

An insurance carrier or plan the org bills on behalf of its customers: vision, medical, and dental insurers and the plans they offer all map here, discriminated by kind. A customer's own policy with the payer maps to coverage; the money the payer sends maps to payment.

Writable through POST /v1/records/payer. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/payer/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Carrier or plan name as the org lists it

kindstring

One of: medical, vision, dental, other. The line of insurance the payer covers; map the source's insurance types onto these

payer_codestring

Electronic payer id the org files claims under (the clearinghouse payer id), as the source prints it

statusstring

One of: active, inactive. Map hidden, archived, or disabled payers to inactive

created_atdate

When the payer was created in the source

$ curl -X POST https://api.valtrix.com/v1/records/payer \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "kind": "..." } }'
$ curl "https://api.valtrix.com/v1/records/payer/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Payment

payment

A payment transaction, issued to a vendor or received from a client, discriminated by kind, typically settling an invoice or cost. invoice_id and cost_id name the primary document; when one payment settles several documents, every share lives in payment_allocation and those rows are authoritative. The document being settled is not a payment.

Writable through POST /v1/records/payment. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/payment/:externalId for records you wrote. The title key is number.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

numberstring

Payment number

kindstring

One of: issued, received, settlement. Issued to a vendor or received from a client; settlement is a payment processor depositing the card payments it collected into the org's bank account, which is not new income, so a total of money received leaves it out

counterpartystring

Customer or vendor the payment settles with

counterparty_idreference

Valtrix record ID of the customer or vendor the payment settles with

counterparty_typestring

Entity type of the linked counterparty record: customer or vendor

invoice_numberstring

Invoice the payment settles

invoice_idreference

Valtrix record ID of the invoice the payment settles

check_numberstring

Check or reference number

cost_idreference

Valtrix record ID of the primary cost the payment settles; a payment covering several costs lists each share in payment_allocation

project_idreference

Valtrix record ID of the project the payment belongs to

location_idreference

Valtrix record ID of the location the payment belongs to, for sources that settle money per venue or site rather than a project

financial_account_idreference

Valtrix record ID of the bank, card, or cash account the payment was released from or received into, for sources that record the settling instrument

amountnumber

Amount paid

statusstring

One of: pending, sent, paid, failed, void. Map the source payment states onto these (authorized or in a check run is pending, cancelled is void); the raw label stays in source data

paid_atdate

Date of the payment

created_atdate

When the payment was recorded in the source

methodstring

One of: cash, credit_card, debit_card, card, transfer, check, other. How the payment was made; use card when the source does not say credit or debit

installmentsnumber

Number of card installments the payment was split into, for sources that record one

currencystring

ISO currency code the amount is denominated in, for sources that pay in more than one currency

journal_entry_idreference

Valtrix record ID of the general ledger journal entry that posting the payment produced, for accounting sources that sync both

order_idreference

Valtrix record ID of the order the payment settles, for point-of-sale and e-commerce sources where a customer pays an order rather than an invoice

tipnumber

Tips and gratuity included in the amount, for point-of-sale sources that record them on the payment

feenumber

Processing fee the payment processor charged on the payment, as a positive number

refunded_amountnumber

Amount of the payment returned to the payer, as a positive number; null when nothing was refunded

refunded_atdate

When the payment was refunded

card_brandstring

Card network as the source names it (Visa, Mastercard, Amex); source-defined, pass it through

card_last4string

Last four digits of the card, never the full number

employee_idreference

Valtrix record ID of the staff member who took or recorded the payment, for sources that attribute payments to a technician or cashier

descriptionstring

Text the payer or the processor attached to the payment: a card charge description, a check memo, a payout statement descriptor, for sources that carry one

settlement_idreference

Valtrix record ID of the payout (a payment of kind settlement) that carried this received or issued payment to the org's bank account, for processors that batch collected card payments into payouts; null until the payout exists, so a table that reconciles payouts groups received payments by it

contract_idreference

Valtrix record ID of the agreement the payment settles or is earned on, for sources that pay against a policy, membership, or contract rather than an invoice: a carrier commission line names the policy it was paid on

$ curl -X POST https://api.valtrix.com/v1/records/payment \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "number": "...", "kind": "...", "counterparty_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/payment/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Payment allocation

payment_allocation

One share of a payment applied to one document: the row that links a payment to each cost or invoice it settles, with the amount applied. A payment settling a single document still gets one allocation; a check covering several bills gets one per bill, and vendor credits applied against the payment carry negative amounts. The allocations of a payment sum to its amount.

Writable through POST /v1/records/payment_allocation. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/payment_allocation/:externalId for records you wrote. The title key is invoice_number.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

payment_idreference

Valtrix record ID of the payment this share belongs to

document_typestring

Entity type of the settled document: cost or invoice

document_idreference

Valtrix record ID of the cost or invoice this share settles, typed by document_type

invoice_numberstring

Source document number of the settled cost or invoice

amountnumber

Amount of the payment applied to the document; negative for a credit applied against the payment

positionnumber

1-based order of the share within its payment as the source shows it

$ curl -X POST https://api.valtrix.com/v1/records/payment_allocation \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "invoice_number": "...", "document_type": "...", "payment_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/payment_allocation/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Prescription

prescription

A prescription written for a customer: spectacle and contact lens prescriptions with their per-eye values, and medication orders, discriminated by kind. The exam or visit it came from maps to activity or booking; the sale that fills it maps to invoice or order.

Writable through POST /v1/records/prescription. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/prescription/:externalId for records you wrote. The title key is summary.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

summarystring

One line naming the prescription as the source lists it (its type and date, or the drug and strength)

kindstring

One of: glasses, contacts, medication, other. Map the source prescription types onto these

customer_idreference

Valtrix record ID of the customer the prescription is for

location_idreference

Valtrix record ID of the location the prescription was written or entered at

prescriberstring

Name of the doctor who wrote the prescription, as the source prints it

issued_atdate

Date of the prescription

expires_atdate

When the prescription expires

notesstring

Free-text notes on the prescription

created_atdate

When the prescription was recorded in the source

right_spherenumber

Sphere power of the right eye, in diopters

right_cylindernumber

Cylinder power of the right eye, in diopters

right_axisnumber

Cylinder axis of the right eye, in degrees

right_addnumber

Near addition of the right eye, in diopters

left_spherenumber

Sphere power of the left eye, in diopters

left_cylindernumber

Cylinder power of the left eye, in diopters

left_axisnumber

Cylinder axis of the left eye, in degrees

left_addnumber

Near addition of the left eye, in diopters

pupillary_distancenumber

Binocular distance pupillary distance, in millimetres

right_lensstring

Contact lens prescribed for the right eye, as the source names the product

right_base_curvenumber

Base curve of the right contact lens, in millimetres

right_diameternumber

Diameter of the right contact lens, in millimetres

right_lens_powernumber

Power of the right contact lens, in diopters

left_lensstring

Contact lens prescribed for the left eye, as the source names the product

left_base_curvenumber

Base curve of the left contact lens, in millimetres

left_diameternumber

Diameter of the left contact lens, in millimetres

left_lens_powernumber

Power of the left contact lens, in diopters

$ curl -X POST https://api.valtrix.com/v1/records/prescription \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "summary": "...", "kind": "...", "customer_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/prescription/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Project

project

A job, project, or engagement that work is performed under, with stage, value, and dates. The scoping parent most project-scoped records hang off; every job or engagement flavor from any source maps here.

Writable through POST /v1/records/project. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/project/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Project name

numberstring

Job or project number

descriptionstring

Free-text description or summary of the work as the source keeps it: a technician's summary of work on a field-service job, a project brief. Filled by sources that carry one; others leave it empty

customer_namestring

Customer the project is for

customer_idreference

Valtrix record ID of the customer the project is for

kindstring

One of: job, work_order, permit, engagement, other. What the source calls the engagement: a job or project account that work orders hang under is job, a dispatched service call or visit is work_order, a permit or plan-review record on a government portal is permit, a client engagement with no site is engagement. Filled by sources that keep more than one of these; a source with one flavor may leave it empty

parent_idreference

Valtrix record ID of the project this one sits under, for sources that nest engagements: a work order under a job, a sub-project under a program. The customer of a nested project is still customer_id, resolved to the account at the root

assigned_to_namestring

The person the job is assigned to as the source names them: the field technician on a service job; several names joined with a comma when the source assigns more than one. Filled by sources that assign work to people; others leave it empty

stagestring

Lifecycle stage as the source names it (estimating, pre-construction, warranty); source-defined, pass it through

lifecycle_stagestring

One of: draft, applied, in_review, corrections, approved, issued, inspections, on_hold, finaled, denied, withdrawn, void, expired, other. Where a permit, plan review, or application sits in its lifecycle, mapped from the portal state so counts combine across portals: unsubmitted or saved is draft; submitted, received, or pending intake is applied; under review, in process, or routing is in_review; resubmit, corrections, or waiting on the applicant is corrections; approved or ready to issue is approved; issued or permitted is issued; a temporary certificate or inspections pending is inspections; hold or stop work is on_hold; finaled, closed, completed, or certificate of occupancy is finaled; denied or rejected is denied; withdrawn is withdrawn; void or cancelled is void; expired or archived is expired; a state that fits none is other. Only permitting and plan-review sources fill it; construction and job sources leave it null and keep their own stage

categorystring

Type or class of the project as the source names it: the permit, record, or application type on a permit portal (Building Commercial, Commercial Electrical), a job type in a construction source; source-defined, pass it through. Filled by sources that class their projects; others leave it empty

subcategorystring

Finer type under the category as the source names it (a permit subtype such as Foundation Repair under Building Residential); source-defined, pass it through. Filled by sources that keep a second level; others leave it empty

addressstring

Street address of the site as one line, for sources that run a job at a service address rather than a named project (a field-service job, a permit)

citystring

Site city

postal_codestring

Site ZIP or postal code, as the source prints it

countrystring

Site country code or name

jurisdictionstring

Permitting authority the project is filed with: the city, county, or agency whose portal it lives in. Set per portal by the connector, not read off the record; sources that are not permit portals leave it empty

valuenumber

Contracted project value

statusstring

One of: active, closed, inactive. Completed or closed projects are closed; archived or disabled ones are inactive

start_atdate

Planned start date

completion_atdate

Planned completion date

certified_payrollboolean

Whether the job requires certified payroll reporting (prevailing wage work), as the source flags it. Filled by construction sources that keep the flag on the job; others leave it empty

supervisor_idreference

Valtrix record ID of the employee who supervises the job, for sources that name one supervisor on the job record

supervisor_namestring

Name of the employee who supervises the job, as the source prints it

departmentstring

The department the job belongs to in the books, as the source names it; source-defined, pass it through. Filled by accounting sources that book a job under one department; others leave it empty

ready_to_invoiceboolean

Whether the job has been marked ready to bill, for sources where the company keeps such a flag on the job (a Sage 100 Contractor user-defined checkbox named Ready to Invoice on 3-5 Jobs). Empty where the source or the company has no such flag

created_atdate

When the project was created in the source

tagsstring

Tags the source keeps on the record, comma separated, as the source spells them; source-defined, pass them through

stage_codestring

The code or number the source keeps for the stage, beside its name in stage, for sources where a company adds statuses of its own (a Sage 100 Contractor job status number such as 26 for a status named Closed in 2026); source-defined, pass it through

approved_changesnumber

Sum of the approved amounts of the approved change orders on the job, in currency. Filled by accounting sources that can total it per job; others leave it empty, and it is as fresh as the last sync

revised_contractnumber

Contract amount including approved change orders: value plus approved_changes. Filled by accounting sources that can total it per job; others leave it empty, and it is as fresh as the last sync

original_budgetnumber

Total of the job budget as first entered, before change orders. Filled by accounting sources that can total it per job; others leave it empty, and it is as fresh as the last sync

current_budgetnumber

Original budget plus the budget changes of approved change orders. Filled by accounting sources that can total it per job; others leave it empty, and it is as fresh as the last sync

cost_to_datenumber

Sum of every cost posted to the job that is not void, in currency; the five cost columns that follow add up to it. Filled by accounting sources that can total it per job; others leave it empty, and it is as fresh as the last sync

material_costnumber

Part of cost_to_date posted as material

labor_costnumber

Part of cost_to_date posted as labor

equipment_costnumber

Part of cost_to_date posted as equipment

subcontract_costnumber

Part of cost_to_date posted as subcontract

other_costnumber

Part of cost_to_date posted under any other cost type, a company-defined one included

billed_to_datenumber

Sum of the totals of the receivable invoices issued on the job that are not void, credits and memos left out. Filled by accounting sources that can total it per job; others leave it empty, and it is as fresh as the last sync

retainagenumber

Retention the client still holds on the job: the sum of the retainage of its receivable invoices that are not void. Filled by accounting sources that can total it per job; others leave it empty, and it is as fresh as the last sync

balancenumber

Open receivable balance of the job, retainage included: the sum of the balance of its receivable invoices and credits that are not void. Filled by accounting sources that can total it per job; others leave it empty, and it is as fresh as the last sync

$ curl -X POST https://api.valtrix.com/v1/records/project \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "number": "...", "customer_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/project/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Project user

project_user

A person's membership in a specific project's directory. The person's company-level record maps to employee (internal) or contact (external).

Writable through POST /v1/records/project_user. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/project_user/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Full name

emailstring

Work email address

phonestring

Primary phone number

job_titlestring

Role within the project

person_idreference

Valtrix record ID of the company-level record for this person, an employee for internal staff or a contact for external members

person_typestring

Entity type of the linked person record: employee or contact

project_idreference

Valtrix record ID of the project the person is a member of

statusstring

One of: active, inactive

$ curl -X POST https://api.valtrix.com/v1/records/project_user \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "email": "...", "person_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/project_user/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Project vendor

project_vendor

A vendor's assignment to a specific project's directory. The vendor's company-level record maps to vendor.

Writable through POST /v1/records/project_vendor. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/project_vendor/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Vendor company name

tradestring

Trade or specialty the vendor operates in, as the source names it; source-defined, pass it through

citystring

City of the primary address

countrystring

Country code or name

vendor_idreference

Valtrix record ID of the company-level vendor record

project_idreference

Valtrix record ID of the project the vendor is assigned to

statusstring

One of: active, inactive

$ curl -X POST https://api.valtrix.com/v1/records/project_vendor \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "trade": "...", "vendor_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/project_vendor/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Resource

resource

A bookable or tracked asset at a location: courts, rooms, desks, chairs, operatories, lanes, and equipment all map here, discriminated by kind. A fleet unit from an equipment management source (a machine, vehicle, trailer, or attachment) is kind equipment and fills the make, model, serial, meter, and position columns. Reservations of it map to booking, work performed on it maps to maintenance_order, inspections of it map to inspection, and the venue itself maps to location.

Writable through POST /v1/records/resource. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/resource/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Resource name

kindstring

One of: court, room, desk, chair, operatory, lane, equipment, other. Map the source resource types onto these

location_idreference

Valtrix record ID of the location the resource belongs to

capacitynumber

How many people the resource accommodates at once

statusstring

One of: active, inactive

created_atdate

When the resource was created in the source

makestring

Manufacturer of the equipment or vehicle (Caterpillar, Ford). Filled by equipment and fleet sources

modelstring

Manufacturer model designation (320 GC, F-550)

yearnumber

Model year

serial_numberstring

Manufacturer serial number or product identification number

vinstring

Vehicle identification number, for on-road vehicles

fleet_numberstring

The number the org itself knows the unit by: fleet, unit, or equipment number

license_platestring

Registration plate, for on-road vehicles

categorystring

Equipment category or class as the source names it (Excavator, Light Truck, Trenchbox); source-defined, pass it through

ownershipstring

One of: owned, rented, leased, other. How the org holds the unit; a rent-to-own unit still on rent is rented

operational_statusstring

What the unit is doing right now as the source names it (available, in use, down, in transit); source-defined, pass it through. Whether the record is still in service is status

meter_hoursnumber

Latest engine or run hours the source holds for the unit

odometer_milesnumber

Latest odometer reading in miles; convert a source that reports kilometres

purchase_pricenumber

What the org paid for the unit

purchase_datedate

When the org acquired the unit

latitudenumber

Latitude of the last known position, for tracked units

longitudenumber

Longitude of the last known position, for tracked units

located_atdate

When the last known position was reported

assigned_to_idreference

Valtrix record ID of the employee the unit is currently assigned to (its operator or driver)

engine_makestring

Manufacturer of the engine, which often differs from the maker of the machine

engine_modelstring

Engine model designation

engine_serial_numberstring

Serial number of the engine, the key parts suppliers look engine parts up by

customer_idreference

Valtrix record ID of the customer the unit belongs to or is installed at, for field-service sources that keep customer equipment on file; empty for the org's own assets

departmentstring

The department the unit belongs to in the books, as the source names it; source-defined, pass it through

operated_cost_ratenumber

What the org costs the unit at per unit of use while it is operated (per hour unless the source meters the unit in something else), the rate an equipment allocation prices its hours at

operated_bill_ratenumber

What the org bills per unit of use while the unit is operated

standby_cost_ratenumber

What the org costs the unit at per unit of use while it stands by on a job

standby_bill_ratenumber

What the org bills per unit of use while the unit stands by on a job

idle_cost_ratenumber

What the org costs the unit at per unit of use while it sits idle

idle_bill_ratenumber

What the org bills per unit of use while the unit sits idle

$ curl -X POST https://api.valtrix.com/v1/records/resource \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "kind": "...", "location_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/resource/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Schedule task

schedule_task

A task or milestone on a project schedule, with WBS position, dates, and percent complete. Any Gantt or schedule row flavor maps here. Each plan-review discipline on a government permit or plan-review portal also maps here, as one non-milestone task per discipline keyed to the project (name is the discipline, description is the review outcome), so reviews read as one uniform set of rows across every portal.

Writable through POST /v1/records/schedule_task. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/schedule_task/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Task name; for a plan-review discipline, the discipline (Electrical, Mechanical, Structural)

kindstring

One of: task, appointment, inspection, plan_review, revision, workflow, other. A schedule or Gantt task is task; a booked visit on a field-service job is appointment; a permit or site inspection is inspection; a plan review step or discipline review is plan_review; a resubmittal cycle of a plan is revision; the whole review workflow a portal runs on a project is workflow

descriptionstring

What the task covers. For a plan-review discipline, carry the review outcome from the shared review vocabulary so counts combine across permit portals: Approved, Not Approved, In Progress, Not Started. Map the portal state onto these (corrections required and resubmit are Not Approved, under review and prescreen are In Progress); the raw portal label stays in source data

wbsstring

Work breakdown structure position

resource_namestring

Assigned resource or crew

project_idreference

Valtrix record ID of the project the task is scheduled on

percent_completenumber

Percentage complete

criticalboolean

Whether the task is on the critical path

milestoneboolean

Whether the task is a milestone

start_atdate

Planned start date

finish_atdate

Planned finish date

created_atdate

When the task was created in the source

employee_idreference

Valtrix record ID of the staff member the task is assigned to, for appointments and dispatched work; resource_name keeps the name as the source prints it

$ curl -X POST https://api.valtrix.com/v1/records/schedule_task \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "kind": "...", "project_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/schedule_task/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Template

template

A reusable document or message template the org authors in a source and fills per customer: contract and agreement templates, email and message templates, and forms, discriminated by kind, with the template body as stored. This is the authored template itself, not a filled copy; a signed instrument produced from one maps to compliance_document, and a file attached to a record rides along as a record attachment.

Writable through POST /v1/records/template. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/template/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Template name as the source labels it

kindstring

One of: contract, email, message, form, other. Map the source template types onto these

codestring

The source's identifier for the template, when it has one apart from the name

subjectstring

Subject line, for email and message templates

bodystring

Template body as stored in the source, with its placeholders intact (HTML or text)

statusstring

One of: active, inactive. Map archived or disabled templates to inactive

updated_atdate

When the template was last edited in the source

created_atdate

When the template was created in the source

$ curl -X POST https://api.valtrix.com/v1/records/template \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "kind": "..." } }'
$ curl "https://api.valtrix.com/v1/records/template/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Time entry

time_entry

A single logged block of labor time: who worked, on what project and cost code, for how many hours or at what cost. Any timesheet or timecard flavor maps here.

Writable through POST /v1/records/time_entry. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/time_entry/:externalId for records you wrote. The title key is employee_name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

employee_namestring

Who logged the time

kindstring

One of: labor, equipment, on_site, other. Hours a person worked (a timecard, timesheet, shift, or clock-in) are labor; hours a machine ran or a vehicle drove are equipment; on_site is the time a tracked unit stayed in one place, from a telematics source, one entry per place per day, and is presence rather than work

employee_idreference

Valtrix record ID of the employee who logged the time

project_namestring

Project or job the time was logged against

project_idreference

Valtrix record ID of the project the time was logged against

cost_codestring

Cost code the time was logged against

cost_code_idreference

Valtrix record ID of the cost code the time was logged against

location_idreference

Valtrix record ID of the location the time was worked at, for sources that schedule labor per venue or site rather than a project

hoursnumber

Hours worked

costnumber

Labor cost of the entry

started_atdate

When the entry started

ended_atdate

When the entry ended

created_atdate

When the entry was created in the source

resource_idreference

Valtrix record ID of the piece of equipment the time was spent on, for mechanic and shop time logged against a unit

maintenance_order_idreference

Valtrix record ID of the maintenance work order the time was logged against

tipsnumber

Tips and gratuity the employee earned on the entry, for restaurant and retail timecards

hourly_ratenumber

Hourly wage the entry was paid at

overtime_hoursnumber

Hours of the entry paid as overtime

break_hoursnumber

Break time taken during the entry, paid and unpaid together, in hours

classification_idreference

Valtrix record ID of the classification entry the entry was worked under, the trade or labor class the line is paid as (a journeyman lineman, a foreman), for sources that class each line of a time card; the source's list of classes maps to classification

pay_type_idreference

Valtrix record ID of the classification entry of kind pay_type or payroll_calculation the line is paid under (regular, overtime, double time, a named premium), for sources that code each line of a time card by pay type; overtime_hours still carries the hours of a line paid as overtime

statusstring

One of: pending, approved, rejected, paid, void. Where the entry stands on its way to payroll: pending is entered and not yet on a payroll record (a daily field entry awaiting transfer to a timecard), approved is on an open or computed payroll record, paid is on a posted one, void is on a voided one. Filled by sources that stage time before payroll; others leave it empty

departmentstring

The department, division, or trade the time is booked under, as the source names it on the entry itself; source-defined, pass it through. Filled by sources that code each timesheet to a department; others leave it empty, and the employee's own department stays on employee

start_latitudenumber

Latitude of where the entry started, for telematics sources that record a trip or a run of a tracked unit

start_longitudenumber

Longitude of where the entry started

start_addressstring

Street address of where the entry started, on one line, as the source resolves the position

start_location_idreference

Valtrix record ID of the location the entry started at, when the source places the start inside a site, yard, or geofence it keeps on file; empty when the start fell outside all of them

end_latitudenumber

Latitude of where the entry ended, the place a tracked unit stayed until its next entry started

end_longitudenumber

Longitude of where the entry ended

end_addressstring

Street address of where the entry ended, on one line, as the source resolves the position

end_location_idreference

Valtrix record ID of the location the entry ended at, when the source places the end inside a site, yard, or geofence it keeps on file; empty when the end fell outside all of them

workers_comp_codestring

The workers compensation class code the hours of the entry are rated under, as the source numbers it. Filled by payroll sources that keep one on each timecard line; others leave it empty

work_regionstring

The state or region the hours of the entry were worked in for workers compensation, as the source names it (WI, MN). Filled by payroll sources whose workers compensation codes carry a state; others leave it empty

$ curl -X POST https://api.valtrix.com/v1/records/time_entry \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "employee_name": "...", "kind": "...", "employee_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/time_entry/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Time off

time_off

One absence of one employee: a vacation day, a sick day, a personal day, a leave, requested or taken. One record per day or per unbroken span of days. Hours worked map to time_entry; the yearly allowance and the remaining balance are computed from these records, not stored on them.

Writable through POST /v1/records/time_off. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/time_off/:externalId for records you wrote. The title key is employee_name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

employee_namestring

Who is off

employee_idreference

Valtrix record ID of the employee who is off

kindstring

One of: vacation, sick, personal, holiday, unpaid, leave, other. Map the source's leave types onto these: a statutory or protected leave (family, medical, military, jury duty) is leave, an unexcused absence or a suspension is unpaid; policy keeps the source's own name

policystring

The type of time off as the source or the organization names it (PTO, FMLA, Military leave, Weather day, Unexcused absence); source-defined, pass it through

statusstring

One of: requested, approved, denied, cancelled, taken. A day entered after the fact is taken; a future day someone has signed off on is approved

starts_ondate

First day of the absence

ends_ondate

Last day of the absence, the same as starts_on for a single day

daysnumber

Working days the absence counts for, 0.5 for a half day

hoursnumber

Hours the absence counts for, for sources that track time off in hours

notestring

Free-text note or reason on the absence

location_idreference

Valtrix record ID of the office or site the employee works from, for sources that keep it on the absence

created_atdate

When the absence was entered in the source

$ curl -X POST https://api.valtrix.com/v1/records/time_off \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "employee_name": "...", "kind": "...", "employee_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/time_off/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Vendor

vendor

A company the org buys from or subcontracts to, at the company-directory level. A vendor's assignment to a specific project maps to project_vendor; the agreement itself maps to contract.

Writable through POST /v1/records/vendor. Retrievable through GET /v1/records/:recordId with any record ID, or GET /v1/records/vendor/:externalId for records you wrote. The title key is name.

The fields below make up the record's data object. Every record also carries the envelope of the record object (id, entity_type, external_id, org_id, connector, synced_at, changed_at); external_idis yours for records written through this API, the source system's id for synced records.

namestring

Vendor company name

tradestring

Trade or specialty the vendor operates in, as the source names it; source-defined, pass it through

emailstring

Primary contact email

phonestring

Primary phone number

citystring

City of the primary address

postal_codestring

ZIP or postal code of the primary address, as the source prints it

countrystring

Country code or name

statusstring

One of: active, inactive. Map archived, disabled, or deleted vendors to inactive

created_atdate

When the vendor was created in the source

tax_idstring

Tax identification number of the vendor (RFC, EIN, VAT number), as the source prints it, for sources that key suppliers by it

default_gl_account_idreference

Valtrix record ID of the ledger account the source codes this vendor's bills to by default, for accounting sources that keep invoice defaults on the vendor

default_cost_code_idreference

Valtrix record ID of the cost code the source codes this vendor's bills to by default, for job-costing sources that keep invoice defaults on the vendor

default_cost_typestring

Cost type the source codes this vendor's bills to by default (Material, Subcontract), as the source names it; source-defined, pass it through

$ curl -X POST https://api.valtrix.com/v1/records/vendor \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "external_id": "crm-9x2", "data": { "name": "...", "trade": "...", "default_gl_account_id": "rec_9d4f2c81a7b3e650d21c4f8a" } }'
$ curl "https://api.valtrix.com/v1/records/vendor/crm-9x2?org=org_7f3k2m" \
-H "Authorization: Bearer $VALTRIX_API_KEY"

Write intents

How propagation works. A write intent is created when you upsert or delete a record with propagate: true and one of the organization's connected systems declares that operation for the entity type. The record is written in Valtrix immediately and the response is 202 with the write intent. There is no endpoint that creates a write intent directly: POST /v1/records/:entityType and DELETE /v1/records/:entityType/:externalId are the ways in, and a write without propagate stays in Valtrix. Its op is create until a propagated write on that record has applied, and update after. A record whose first propagation failed is therefore created at the source on the next attempt rather than updated. A worker then applies the write to the source system, and the write intent moves from pending to applied or failed. On applied, source_external_id is filled and the record's source_id along with it. Where the connector can read the write back, it re-reads it and records the outcome as verification. Where it reads the whole row back, the record is refreshed from it at the same moment, so the record reflects the source as soon as the write intent applies rather than at the next sync. On failed, error says why in plain words: a code, whether a retry can help, the source's own text, the step that failed, and whether anything reached the source. A connector whose write runs in stages also fills steps, one entry per stage with done, unchanged, skipped, or failed and a detail. It is filled on applied and failed write intents alike and kept current while the write intent is pending, so a poll mid-run shows the settled stages and the rest as pending. What a write to a system takes is on the connection. write_guidance lists, per entity type, the fields each operation sends with their meaning, the values a command field accepts with the effect of each, the documents an operation carries, and the connector's own rules on refusals. Beside it, entities says per entity type what the system calls it and, per operation, whether a propagated write is supported, achieved via another write named in route, or unsupported with the reason, which is also the sentence a write_not_supported refusal carries. Both are worth a read before the first propagated write to a system. The organization object's connections list which entity types and operations each connection can take, and GET /v1/connectors shows the same per connector, with whether each operation has been verified by a real write yet. The outcome is available by polling GET /v1/write-intents/:id, reconciling with GET /v1/write-intents, or listening for write_intent.applied and write_intent.failed. A failed write intent can be re-enqueued with POST /v1/write-intents/:id/retry once the input is fixed. An Idempotency-Key on a propagated write means a retry within 24 hours replays the original response instead of queuing a second write intent.

The write intent object

A propagation of one record write to the organization's source system, created by a write with propagate: true. The record it belongs to carries the same write intent as its last_write_intent, and the record's source_id is filled from source_external_id once the write intent is applied.

Fields
idstring

The wi_ prefixed write intent id.

record_idstring

The record this write intent propagates.

entity_typestring

The entity type of the record.

opstring

create, update, or delete.

statusstring

pending, applied, or failed.

connection_idstring

The connection the write propagates to.

source_external_idstring or null

The id the source system assigned once applied. Also filled on a failed or still-retrying write intent when the connector learned the id before a later step failed (an invoice uploaded to a portal whose purchase-order link then failed): the source holds the record under it, the record is bound to that row so the next sync updates it rather than creating a second one, and re-sending the same write finishes the remaining steps. null otherwise.

verificationstring or null

What the source showed after an applied write: confirmed (the connector read the write back and every field it sent came back as sent), unconfirmed (the operation has no read-back, such as a form submission, a document upload, or an API that does not echo the fields), or contradicted (the read-back showed a different value for at least one field). The status is applied in all three cases; contradicted means the source accepted the write and then showed something else, so the record is worth reading back before writing again. null while pending or failed.

errorobject or null

Why the write did not land, when the status is failed; null otherwise. code is one of: - refused: The source system refused this write in its own words. Change what the write sends and retry it; the connector’s write_guidance notes list the rules it applies. - invalid_input: The write is missing something the source needs, carries nothing the operation sends, or addresses a row the way the source cannot resolve. Fix the record and write it again. - precondition_failed: A rule of the connector stopped the write before anything was posted to the source. The message says which rule and what satisfies it. - not_found: The source has no row for this record. Check the external id the record carries and that the source shows the row. - exists: The source already holds a row with this identity, so the create was not repeated. Write it as an update instead. - source_error: The source system failed while handling the write and reported no reason of its own. Retry later; if it persists, the source itself needs attention. - session_refused: The source refused the connector’s sign-in. The connection needs its credentials confirmed before writes can resume. - rate_limited: The source is rate limiting the connector. The write is retried automatically once the source allows it. - unreachable: The source could not be reached. The write is retried automatically; nothing was posted. - reference_pending: This write references a record whose own write has not landed in the source yet. It retries automatically once that record has its source id. - grant_missing: The login the connection signs in with lacks a permission this operation needs at the source. The message names the objects; whoever administers the source grants them (for a bridge connection, by running the grant script linked from the Connect page), then the write is retried. - connector_error: The connector could not express this write. Nothing to change on your side; Valtrix is notified and looks at the connector. - write_failed: The write failed for a reason the connector did not classify. The message holds what is known. message says what went wrong in plain words and what to do. hint explains the code. retryable says whether retrying the same write can change the outcome. source_message is the source system's own text when message was translated from it, else null. step names the connector step that failed, else null. source_changed says whether anything had been posted to the source before the failure, null when the connector cannot tell.

stepsarray or null

The outcome of each stage of a multi-step write as the connector reports it, in the connector's own order, or null when the connector reports no steps. Each entry is { key, label, status, detail }. status is one of: - pending: the write is still running and the stage has not finished; detail is null - done: the stage landed - unchanged: the source already held what the stage would have written - skipped: nothing in the write asked for it, or the source offered no way to do it for that login; detail says which - failed: the stage whose step failed, with the source's own answer as detail While the write intent is pending the list is updated as each stage finishes, so a poll mid-run shows the stages behind the current one settled and the rest pending. Once the intent is applied or failed every entry is settled, and a failed one says which stages landed before the one that did not.

attemptsnumber

How many times propagation has been attempted.

created_atstring

When the write intent was created, as an ISO 8601 timestamp.

applied_atstring or null

When the write landed in the source, or null.

actorobject or null

Who asked for the write, as { kind, id, name }: key for a write through this API, applet for one of the organization's applets. The same value the record carries as updated_by. null on write intents older than this field.

{
"id": "wi_9k2f7c81a7b3e650",
"record_id": "rec_9d4f2c81a7b3e650d21c4f8a",
"entity_type": "vendor",
"op": "create",
"status": "applied",
"connection_id": "conn_7f3k2m",
"source_external_id": "CR-88213",
"verification": "confirmed",
"error": null,
"steps": null,
"attempts": 1,
"created_at": "2026-07-08T09:30:00Z",
"applied_at": "2026-07-08T09:30:04Z",
"actor": { "kind": "key", "id": "key_7f3k2m", "name": "Production" }
}

List write intents

GET/v1/write-intents

Lists write intents across every organization this key can reach, newest first. Filter by record_id, entity_type, op, status, or connection to reconcile what has and has not landed.

Parameters
record_idstring

Only write intents for this record.

entity_typestring

Only write intents for this entity type.

opstring

create, update, or delete.

statusstring

pending, applied, or failed.

connectionstring

Only write intents propagating to this connection.

limitnumber

Defaults to 50. Values above 200 are clamped to 200.

cursorstring

The next_cursor from a previous page.

Returns
write_intentsarray

The write intent objects.

next_cursorstring or null

Pass as cursor to fetch the next page, or null when there are no more.

$ curl https://api.valtrix.com/v1/write-intents?status=failed \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{
"write_intents": [{ "id": "wi_9k2f7c81a7b3e650", "record_id": "rec_9d4f2c81a7b3e650d21c4f8a", "entity_type": "vendor", "op": "create", "status": "failed", "connection_id": "conn_7f3k2m", "source_external_id": null, "verification": null, "error": { "code": "exists", "message": "Vendor code ACME01 already exists with a different name.", "retryable": false, "hint": "The source already holds a row with this identity, so the create was not repeated. Write it as an update instead.", "source_message": "Duplicate key ACME01", "step": null, "source_changed": false }, "steps": null, "attempts": 1, "created_at": "2026-07-08T09:30:00Z", "applied_at": null, "actor": { "kind": "key", "id": "key_7f3k2m", "name": "Production" } }],
"next_cursor": null
}

Retrieve a write intent

GET/v1/write-intents/:id

Fetches one write intent by id, for polling a propagation to completion. The id comes from the write intent in a 202 write response or from a record's last_write_intent.

Parameters
idpath

The wi_ prefixed write intent id.

Returns

The write intent object itself, not wrapped, or 404 write_intent_not_found when no write intent with that id is visible to this key.

$ curl https://api.valtrix.com/v1/write-intents/wi_9k2f7c81a7b3e650 \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{
"id": "wi_9k2f7c81a7b3e650", "status": "applied", "source_external_id": "CR-88213", "applied_at": "2026-07-08T09:30:04Z"
}

Retry a write intent

POST/v1/write-intents/:id/retry

Re-enqueues a failed write intent, moving it back to pending. The usual moment is after fixing the input with POST /v1/records/:entityType, or once a connector is repaired. Returns 409 write_intent_not_retryable for a write intent that is not failed. Requires a key with write access.

Parameters
idpath

The wi_ prefixed write intent id.

Returns

The write intent object itself, not wrapped, now pending with its attempts count carried over.

$ curl -X POST https://api.valtrix.com/v1/write-intents/wi_9k2f7c81a7b3e650/retry \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{
"id": "wi_9k2f7c81a7b3e650", "status": "pending", "attempts": 3
}

Connect

The Connect session object

An invitation for an organization to connect one of its systems through the hosted Connect flow. A connect link stays valid for 45 days. The same object describes a sign-in link for one system (link: "sign_in", which a platform may mint for an organization that has already confirmed access covering that system, and which an organization-scoped key always mints): whoever holds that system's login opens it, no Valtrix account is needed, it grants nothing, and it stays valid for 7 days. Once sign-in details are stored for that system, the organization's other unused sign-in links for it stop working and say the system is already connected; a link that asked for one part through credential_sections ends only the links for the same part.

Fields
idstring

The session id. When the flow completes, org.connected carries it as connect_session_id, so keeping it against your own record of who the link was for ties the connection back to this session without relying on the browser redirect.

org_idstring

The organization the link is bound to. When you omit org, Valtrix creates the organization up front (named from org_display_name) and it stays pending until the person completes Connect; it appears in GET /v1/orgs once access is granted. If the person signs into a different existing organization instead, that organization takes over and org.connected carries its id, so external_id or the connect_session_id are the safer values to correlate on.

linkstring

Which link this is: connect for the hosted Connect link the organization opens and approves, or sign_in for a sign-in link whoever holds the system's login fills in without an account.

connect_urlstring

The single use hosted link. A connect link is for the organization to open; when they finish they land on your redirect_uri. A sign-in link is for whoever holds the system's login, which may be you. The link embeds a secret, so it is for that person alone, and id is the value to correlate on.

connect_mailboxstring or null

The Valtrix mailbox address for this organization and the connector the session names, or null for a session that names no connector. Mail sent to it reaches Valtrix, so a system that emails a sign-in code, a magic link, or an invitation can be signed in to without a person: make this address the email of the system's user, or invite it. It is assigned whether or not the connector reads mail today, it is the same on every session for the same organization and connector, and the connection object carries it as connect_mailbox once the connection exists.

login_identitystring or null

The login_identity the session was minted with, existing or valtrix_user, or null when none was sent and the person who opens the link chooses. The connection object's login_identity says which login the connection ended up holding.

expires_atstring

When the link stops working, as an ISO 8601 timestamp, 45 days after creation for a connect link and 7 days for a sign-in link. A new session replaces an expired one.

{
"id": "cts_8m2kq",
"org_id": "org_3f9k2m",
"link": "connect",
"connect_url": "https://valtrix.com/connect/vct_...",
"connect_mailbox": null,
"login_identity": null,
"expires_at": "2026-07-09T09:30:00Z"
}

Create a Connect session

POST/v1/connect/sessions

Mints a single use hosted Connect link bound to an organization. Pass org to reconnect or extend an existing organization. Omit it and Valtrix creates the organization first, named from org_display_name, and binds the link to it. Send the organization through the link to grant access; your tables build from every connection the organization has. Connections belong to the organization, not to you. If it already syncs the connector you name, the link asks it to approve your access without signing in to that system again. A link with no connector lets it approve access to everything it already syncs, or connect another system first. Pass link: "sign_in" with org and connector to mint a sign-in link instead, for an organization that has already confirmed your access. Whoever holds that system's login opens it and enters the sign-in details, with no Valtrix account and no access to any data. It grants nothing, it expires after 7 days, and the organization's owners are told when it is used. It is refused with 403 grant_required until the organization's grant is active and covers every entity the connector supplies, so it never widens your access; send a connect link in that case. On an organization-scoped key the call always mints the organization's own sign-in link. It names one system (connector is required, 400 connector_required), and org_display_name, external_id, scope, redirect_uri, and link are ignored on such keys.

Parameters
org_display_namestring

The name for the organization Valtrix creates when org is omitted. The person completing Connect can override it, and the organization can rename itself later, so external_id or the id from GET /v1/orgs are the values to recognize the organization by afterwards.

external_idstring

Your own identifier for the organization, such as your customer id, up to 255 characters. Stored on the grant when the flow completes and echoed as external_id on organization responses and org webhooks. Minting another session with a known external_id targets the same organization, so you can always say connect customer 123 without tracking whether they already exist on Valtrix. Sending it alongside an org id that belongs to a different organization returns 409 external_id_conflict.

orgstring

An existing organization id, to reconnect or extend access.

connectorstring

A connector slug to preselect. GET /v1/connectors lists the valid ones. Required for a sign-in link, which is for that one system.

linkstring

Which link to mint. connect (the default) is the hosted Connect link the organization opens, signs in to, and approves. sign_in is a sign-in link for one system, so org and connector are required: whoever holds that system's login opens it and enters the details, no Valtrix account is needed, it grants nothing, and it expires after 7 days. A sign-in link is allowed only for an organization that has already confirmed your access with a grant that covers every entity the connector supplies (403 grant_required otherwise), so it never widens what you can read. Ignored on an organization-scoped key, which always mints a sign-in link.

credential_sectionsstring

Either login or api. Some connectors capture both a product sign-in and API credentials on one Connect page; this restricts the link to one of the two sections. Omit it to request everything the connector captures, which is the recommended default. Ignored by connectors that only capture one kind of credential.

login_identitystring

Either existing or valtrix_user: which login the person who opens the link supplies for the system. With valtrix_user the page tells them to add a new user for Valtrix in the system under the connect_mailbox address, and accepts only a user on that address, either with the password they set or by ticking that they sent the system's invitation to it. With existing the page takes a login they already have and does not offer the Valtrix user. Omit it and the person chooses, which is the behaviour of every link minted without it. connector is required (400 connector_required), and the value must be one the connector lists as login_identities (400 login_identity_unsupported). It shapes the sign-in only: an organization that already syncs the connector is asked to approve access and never sees it.

redirect_uristring

Where the organization lands after finishing.

scopeobject

Limits the requested grant, as { "entityTypes": ["..."] } naming entity types, or as { "categories": ["..."] } naming data categories, the business-function groups the schema lists under categories, each of which expands to its entity types before the link is minted (line items follow the documents that carry them). Use categories when you do not yet know which connector the organization will connect. Sending both is allowed only when they agree. Defaults to full access.

history_fromstring

An ISO 8601 date. A one-time backfill for migrations: the first sync loads date-bounded history (invoices, bills, transactions) from this date. Every sync after it fetches only the connector's default trailing window, so the backfilled records stay in the organization's tables but are not refreshed. Master data such as customers, vendors, and items always loads in full. Set it when a customer needs more history than the connector fetches by default, for example an organization changing systems that needs its full fiscal year in its tables. It widens an existing connection to the same connector and never narrows it, and the connection object shows the value as history_from. A source with its own retention ceiling clamps the start, and the sync run report says provider_limit. Must not be in the future: 400 invalid_history_from.

syncobject

Limits what Valtrix stores from the connection the organization makes through this link, in place before its first sync. { "entities": { ... }, "source_payload": true | false }, where each entity type under entities is true (stored in full), false (not fetched or stored), { "fields": [...] } (only the named schema fields are stored), or { "exclude": [...] } (the named fields are dropped). id, external_id, kind, and reference fields are always stored so records keep linking, and an entity not named is stored in full. source_payload: false stops storing the provider's own document beside each record, which is also the case for any entity with a field policy. An entity the link's scope asks to read cannot be set to false. The policy is read back as sync on the connection object and changed later with PATCH /v1/connections/:id. Ignored on an organization-scoped key.

Returns

The Connect session object, with status 201.

$ curl -X POST https://api.valtrix.com/v1/connect/sessions \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org_display_name": "Acme Inc", "external_id": "cus_123", "redirect_uri": "https://yourapp.com/connected", "scope": { "categories": ["payables", "ledger"] } }'
{ "id": "cts_8m2kq", "org_id": "org_3f9k2m", "link": "connect", "connect_url": "https://valtrix.com/connect/vct_...", "connect_mailbox": null, "login_identity": null, "expires_at": "2026-07-09T09:30:00Z" }

Connectors

The systems your organizations can connect through the hosted Connect flow. Every place the API takes or returns a connector identifies it by slug: the connector parameter on record reads and Connect sessions, the _connector meta field on table rows and records, the connector on a record object, the connections on an organization, and the connector field on webhook events. This endpoint is the source of those slugs and their display names, so a connector picker can be built from it with no catalog to hardcode.

The connector object

A system Valtrix syncs data from, as available to you.

Fields
slugstring

The connector's identifier everywhere in this API. Stable, lowercase, safe to store.

display_namestring

The connector's name, for display.

categorystring

The kind of system the connector covers, such as construction or accounts_payable.

entity_typesarray

The entity type slugs this connector syncs. GET /v1/schema describes the shape of each one.

sync_every_minutesnumber

How often the connector's scheduled syncs run, in minutes. A connection's next_sync_at says when its next one is due.

full_sync_every_hoursnumber

How often the connector's scheduled full sync runs, in hours. The full sync re-reads each resource's full_sync_days, where every other sync re-reads only its refreshes_days.

resourcesarray

One sync window object per resource the connector syncs, with the entity type it maps to and its spans: holds_months, how far back the first sync loads; refreshes_days, how far back every later sync re-reads; full_sync_days, how far back the scheduled full sync re-reads; and files_months, how far back documents are fetched. Records older than the full-sync span are kept and marked frozen, never deleted by age.

writesobject

The entity types this connector can take propagated writes for, each mapped to { create, update, delete, verified }. The three booleans say which operations the connector declares; verified becomes true once a real propagated write has landed and been re-read from the source. An empty object means writes to this connector stay in Valtrix. The organization object's connections carry the same capability per connection.

write_guidanceobject

What to send when writing each entity type into this connector, keyed like writes: fields lists the keys each operation sends under data with their meaning, whether they are required, and, for a field that acts as a command, the values it takes with the effect each has at the source; documents lists the files an operation carries with their media types; notes are the connector's own rules on preconditions, side effects, and refusals. It says what a propagated write takes, so there is nothing to infer from column names; an entity type with nothing declared is absent.

entitiesobject

The connector's entity cards, one per entity type it reads or writes, keyed by entity type: label is what the source calls it (Assignment for schedule_task on FieldEdge), sources the source listings that feed it with their resource_type, label, and description, vocabulary the connector's rules for the entity's columns (which source status means which canonical value), and writes one disposition per operation among create, update, and delete: status is supported (a declared operation; verified says a real write has landed and been read back), via (the source has no direct form of it and route says which write achieves it), or unsupported (reason says why nothing reaches the source). The dictionary that turns a system's own words into the entity type to query and says, before a propagated write, whether it can land and how.

login_identitiesarray of strings

The logins the connector's sign-in can be given, the values login_identity takes on a Connect session for it. existing is a login the organization already has, valtrix_user a new user created for Valtrix under the connect_mailbox address. A connector with a plain sign-in form lists both, one whose sign-in reads the Valtrix mailbox lists only valtrix_user, and one with no typed sign-in, such as OAuth, API credentials, or a bridge, lists none.

{
"slug": "procore",
"display_name": "Procore",
"category": "construction",
"entity_types": ["project", "customer", "invoice"],
"sync_every_minutes": 60,
"full_sync_every_hours": 24,
"resources": [{ "resource_type": "invoices", "entity_type": "invoice", "holds_months": 3, "refreshes_days": 30, "full_sync_days": null, "files_months": 3 }],
"writes": { "vendor": { "create": true, "update": true, "delete": false, "verified": true } },
"write_guidance": { "vendor": { "fields": [{ "op": "create", "column": "name", "description": "Display name", "required": true, "values": [] }], "documents": [], "notes": ["A vendor code the system already holds is reused, never duplicated."] } },
"entities": { "vendor": { "entity_type": "vendor", "label": "Vendor", "sources": [{ "resource_type": "vendors", "label": "Vendors", "description": "The company directory" }], "vocabulary": [], "writes": { "create": { "status": "supported", "verified": true, "reason": null, "route": null }, "update": { "status": "supported", "verified": true, "reason": null, "route": null }, "delete": { "status": "via", "verified": null, "reason": "Procore has no vendor delete.", "route": "Send status inactive on an update of the vendor." } } } },
"login_identities": []
}

The connector request object

Tracks a connector you added for a provider Valtrix had not built support for yet, and where the build stands. The provider is the third-party system your customers use; once support is built, it appears in the catalog as a connector and is identified by its slug everywhere else in the API.

Fields
idstring

The request id.

provider_namestring

The provider name as you submitted it.

product_namestring or null

The specific product Valtrix resolved the request to, when the provider sells more than one.

homepage_urlstring

The provider homepage you submitted.

statusstring

requested when the request is queued, building while Valtrix prepares the connector, live once customers' data syncs, or not_available when the provider cannot be supported. The two terminal transitions also fire the connector_request.live and connector_request.not_available webhooks.

stagestring or null

Where a building request stands, null for any other status: queued until the build starts, signed_in once Valtrix has signed in to the product with the connected organization's details, preview_available once a first sample of data is readable through the records endpoints, and building while the full connector is assembled. The organization's data starts syncing in full when the status reaches live.

connectorstring or null

The connector's slug once there is one, usable everywhere the API takes a connector. Set from the moment preview data is readable, so a building request whose stage is preview_available already carries it.

created_atstring

When you added it, as an ISO 8601 timestamp.

updated_atstring

When the status last changed, as an ISO 8601 timestamp.

{
"id": "creq_9f2k7d",
"provider_name": "Aspire",
"product_name": "Aspire",
"homepage_url": "https://www.youraspire.com",
"status": "building",
"stage": "preview_available",
"connector": "aspire",
"created_at": "2026-08-13T09:00:00Z",
"updated_at": "2026-08-13T09:00:00Z"
}

The expansion request object

An ask for data a connector does not deliver yet, filed with POST /v1/connectors/:slug/expansions: fields it already fetches that should become columns, data it does not read at all, or both. It is attached to the connector's factory request and built additively by an operator for every platform and organization that uses the connector; nothing is removed or renamed by it, and nothing is built automatically.

Fields
idstring

The expansion request id.

request_idstring

The connector's factory request the ask was attached to. Several asks for one connector share it.

connectorstring

The connector slug.

resource_typestring or null

The source listing the fields belong to, as a record's source.resource_type names it, or null for an ask that described new data only.

fieldsarray

The source field paths asked for, as submitted; empty for an ask that described new data only.

descriptionstring or null

The description of data the connector does not read yet, as submitted, or null.

entitystring or null

The entity type given as a hint, or null.

reasonstring or null

The reason given, or null.

created_atstring

When the ask was filed, as an ISO 8601 timestamp.

{
"id": "cexp_4k8w2p",
"request_id": "creq_9f2k7d",
"connector": "fieldedge",
"resource_type": "lead",
"fields": ["Contact.Phone.Value"],
"description": null,
"entity": "opportunity",
"reason": "The dialer needs the phone the lead typed.",
"created_at": "2026-10-27T09:00:00Z"
}

List connectors

GET/v1/connectors

Lists every connector available to you, in display name order. The slugs here are the valid values for the connector parameter on record reads and Connect sessions, and entity_types tells you which connectors can supply the data you care about before you send an organization through Connect.

Returns
connectorsarray

Connector objects, in display name order. Not paginated.

$ curl https://api.valtrix.com/v1/connectors \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{
"connectors": [{ "slug": "procore", "display_name": "Procore", "category": "construction", "entity_types": ["project", "customer", "invoice"], "writes": { "vendor": { "create": true, "update": true, "delete": false, "verified": true } }, "write_guidance": {} }]
}

Add a connector

POST/v1/connector-requests

Adds a connector for a provider your customers use that is not in the catalog yet. The provider is the third-party system itself; what Valtrix builds and ships is the connector. Requires a write key. The add is tracked as a connector request, created the moment the call returns. Valtrix then resolves the product in the background, so product_name fills in a little later, prepares it for connection, and builds the connector, and the request's status tracks progress; a provider that turns out to have no way in moves to not_available after that resolution. The terminal transitions push webhooks: connector_request.live when customers' data starts syncing, connector_request.not_available when the provider cannot be supported. Console members are also emailed on live. As soon as the connector is added it appears in your catalog, so you can include it in connect links and send customers through Connect right away. If the provider is already available, it is added to your catalog and the response returns the existing connector. If another platform already added it, your platform is attached to the open request. Organization-scoped keys minted through POST /v1/keys file the request for your platform on that organization's behalf.

Parameters
provider_namestring

The provider or product name, as your customer says it.

homepage_urlstring

The provider's homepage URL.

product_choicestring

When a previous attempt returned product_choice_required, the product_name you picked from its candidates.

requested_datastring

Optional, up to 2000 characters, in plain words: the data you want synced first, as the product names it (the screens, reports, or objects that matter). Valtrix reads it when it builds the connector and previews those resources first, so the first sample of data in production is the data you asked for. A request for everything is fine; the preview still takes what fits its budget and the full build covers the rest.

Returns

An outcome field: created or attached with the connector request object, already_available with the slug of the existing connector that was added to your catalog, or a 409 product_choice_required with candidate products to choose between (the SDK returns this as an outcome instead of throwing).

$ curl https://api.valtrix.com/v1/connector-requests \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "provider_name": "Aspire", "homepage_url": "https://www.youraspire.com", "requested_data": "Invoices and the customer list first; work orders can wait." }'
{
"outcome": "created",
"request": { "id": "creq_9f2k7d", "provider_name": "Aspire", "product_name": "Aspire", "homepage_url": "https://www.youraspire.com", "status": "building", "stage": "queued", "connector": null, "created_at": "2026-08-13T09:00:00Z", "updated_at": "2026-08-13T09:00:00Z" }
}

List connector requests

GET/v1/connector-requests

Lists your connector requests (one for each connector you added that was not already in the catalog), newest first, including requests where you joined an existing build for the same provider. status is one of requested, building, live, or not_available; stage says where a building request stands (queued, signed_in, preview_available, or building); connector carries the connector's slug once there is one, from the moment preview data is readable. Poll this for the intermediate stages, or subscribe to the connector_request.live and connector_request.not_available webhooks to be pushed the terminal ones. Organization-scoped keys see the requests filed for their organization.

Returns
requestsarray

Connector request objects, newest first. Not paginated.

$ curl https://api.valtrix.com/v1/connector-requests \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{
"requests": [{ "id": "creq_9f2k7d", "provider_name": "Aspire", "product_name": "Aspire", "homepage_url": "https://www.youraspire.com", "status": "live", "stage": null, "connector": "aspire", "created_at": "2026-08-13T09:00:00Z", "updated_at": "2026-08-14T07:30:00Z" }]
}

Request more data from a connector

POST/v1/connectors/:slug/expansions

Asks Valtrix for data a connector does not deliver yet. Two forms, alone or together: name a source resource and the field paths it fetches but does not land on a column, as they appear in a record's source payload from GET /v1/records/:recordId?include=source or on the connector's Synced data tab in the console; or describe data the connector does not read at all, a page, a report, a path in the product, in a sentence or two. Requires a write key. A key may file 10 requests per UTC day (429 expansion_request_budget after that, with Retry-After).

Parameters
slugpath

The connector slug, as GET /v1/connectors lists it and a record's connector carries it.

resourcestring

The source resource the fields belong to: the resource_type of a record's source, or of an entry under sources on the connector's entity cards. Required with fields.

fieldsarray

The dot paths of the source fields to map, Contact.Phone.Value, as they appear in the source payload. Up to 50 per request, and only with resource.

descriptionstring

Data the connector does not read at all, in a sentence or two: the page or report in the product, its path if you know it, and what it should become. At least 12 characters. Required when resource and fields are not given.

entitystring

Optional. The entity type the data belongs to, from GET /v1/schema, as a hint to the operator.

reasonstring

Optional. What the data is needed for, in a sentence or two; it reaches the operator who builds the extension.

orgstring

Optional on platform-wide keys: the organization whose data the ask matters to. Organization-scoped keys pin this automatically and refuse another value.

Returns
expansionobject

The expansion request as stored: id, request_id (the connector's factory request it was attached to), connector, resource_type, fields, description, entity, reason, and created_at.

$ curl https://api.valtrix.com/v1/connectors/fieldedge/expansions \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "resource": "lead", "fields": ["Contact.Phone.Value"], "entity": "opportunity", "reason": "The dialer needs the phone the lead typed." }'
{
"expansion": { "id": "cexp_4k8w2p", "request_id": "creq_9f2k7d", "connector": "fieldedge", "resource_type": "lead", "fields": ["Contact.Phone.Value"], "description": null, "entity": "opportunity", "reason": "The dialer needs the phone the lead typed.", "created_at": "2026-10-27T09:00:00Z" }
}

Organizations

Every organization that has connected to you through Connect, including those that later revoked access. Webhooks like grant.revoked tell you something changed; these endpoints tell you where things stand now, so they are the source of truth to reconcile your own records against. Data itself is not read here: rows carry their organization in _org_id, and the org parameter narrows any table read. Called with an organization-scoped key, these endpoints see only that key's organization.

The organization object

An organization and the state of its grant to you. Organizations stay listed after revocation or expiry so a missed webhook never leaves your records unreconcilable.

Fields
idstring

The organization id. The same value rows carry as _org_id and the org parameter accepts across the API. Stable for the life of the organization, so this is the value to store on your side.

display_namestring

The organization's name. The organization owns this and can change it at any time, so it suits display rather than identification; id is the stable handle for your records.

external_idstring or null

Your identifier for the organization, as sent when minting the Connect session that connected it. Stable and controlled by you, unlike display_name, so it is the field to join organizations back to your own customer records. null when you have never sent one.

statusstring

active while the grant is live, revoked after the organization revokes your access, expired when the grant passed its expiry. Only active organizations are readable through tables and records.

scopeobject

The entity types the grant covers, as { "entity_types": ["..."] }. A single "*" means full access.

connectionsarray

The organization's connected systems, in the same shape as the connection object without org_id. Each carries: - id: the value to pass as connection on a propagated write, and the value records expose as connection_id - connector: the connector slug - status: pending, connected, error, expired, disconnected, or paused - history_from: the date its date-bounded history was backfilled from once, or null for the connector's own sync window; the backfilled records are kept and marked frozen - last_synced_at: when data last synced from it, null before the first sync - next_sync_at: when its next scheduled sync is due, null while paused or not yet connected - initial_sync_completed_at: when its first full load finished - paused_at and paused_until: set while it is paused - connect_mailbox: the Valtrix mailbox address its sign-in reads emailed codes and invitations from - login_identity: valtrix_user when it signs in as a user created for Valtrix, existing when it signs in with a login the organization already had, null when it holds no typed sign-in - sample: the first sample of data taken while the connector was being built, with its outcome and the rows fetched per resource, or null - sync: what Valtrix stores from it, per entity type, when a policy was set, or null when everything is stored - writes: the entity types this connection can take propagated writes for, mapped to the operations among create, update, and delete. An empty object means writes to this connection stay in Valtrix - write_guidance: keyed like writes, what to send. The fields each operation takes with their meaning, the values a command field accepts with the effect of each, the documents an operation carries, and the connector's notes on refusals - entities: one card per entity type the connection holds, keyed by entity type, with the source's own label for it, its sources, its vocabulary, and a write disposition per operation (supported, via with a route, or unsupported with a reason), the same object as entities on the connection object writes says whether a write can carry propagate: true and which connection to address. GET /v1/connectors shows the same per connector, with verification status per operation.

connected_atstring

When the organization granted you access, as an ISO 8601 timestamp.

expires_atstring or null

When the grant expires, or null when it has no expiry.

revoked_atstring or null

When the organization revoked your access, or null while it has not.

{
"id": "org_7f3k2m",
"display_name": "Acme Inc",
"external_id": "cus_123",
"status": "active",
"scope": { "entity_types": ["*"] },
"connections": [{ "id": "conn_7f3k2m", "connector": "procore", "status": "connected", "last_synced_at": "2026-07-08T09:30:00Z", "writes": { "vendor": ["create", "update"] } }],
"connected_at": "2026-06-01T09:00:00Z",
"expires_at": null,
"revoked_at": null
}

List organizations

GET/v1/orgs

Lists every organization that has connected to you, in the order they first connected. Revoked and expired organizations are included so the list is complete for reconciliation; filter by status to narrow.

Parameters
statusstring

Narrow to one status: active, revoked, or expired.

external_idstring

Look up the organization carrying this external_id, exact match. The way to resolve one of your customer ids to its Valtrix organization.

limitnumber

Defaults to 50. Values above 200 are clamped to 200.

cursorstring

The next_cursor from the previous page, sent back exactly as you received it.

Returns
orgsarray

Organization objects, in the order they first connected.

next_cursorstring or null

The bookmark for the next page. null means the last page.

$ curl https://api.valtrix.com/v1/orgs \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-G -d "status=active" -d "limit=50"
{
"orgs": [{ "id": "org_7f3k2m", "display_name": "Acme Inc", "external_id": "cus_123", "status": "active", "scope": { "entity_types": ["*"] }, "connections": [{ "id": "conn_7f3k2m", "connector": "procore", "status": "connected", "last_synced_at": "2026-07-08T09:30:00Z", "writes": { "vendor": ["create", "update"] } }], "connected_at": "2026-06-01T09:00:00Z", "expires_at": null, "revoked_at": null }],
"next_cursor": null
}

Retrieve an organization

GET/v1/orgs/:id

Fetches one organization by id, whatever its status. The place to check where you stand after a grant.revoked or connection.broken webhook, or after any request returns org_not_granted.

Parameters
idpath

The organization id.

Returns

The organization object, or 404 org_not_found when no organization with that id has connected to you.

$ curl https://api.valtrix.com/v1/orgs/org_7f3k2m \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "id": "org_7f3k2m", "display_name": "Acme Inc", "external_id": "cus_123", "status": "revoked", "scope": { "entity_types": ["*"] }, "connections": [{ "id": "conn_7f3k2m", "connector": "procore", "status": "disconnected", "last_synced_at": "2026-07-08T09:30:00Z", "writes": { "vendor": ["create", "update"] } }], "connected_at": "2026-06-01T09:00:00Z", "expires_at": null, "revoked_at": "2026-07-08T09:30:00Z" }

Connections

Every connected system of every organization that has connected to you, as a resource of its own. The organization object nests the same connections; these endpoints are where you act on one: decide how far back its history loads, decide what Valtrix stores from it per entity type and field (sync, set before the first sync on the Connect session or changed here, with a purge of what is no longer allowed), run a full sync on demand and read the run's report, and pause it while its data needs to stand still. They also cover an organization changing systems. The outgoing system can be connected with history_from covering the period the organization needs, and read live while you reconcile. At the switch, a full sync brings it up to date. Once the run settles, GET /v1/tables/:name/changes replayed from the cursors it returns picks up anything that changed afterwards. A pause with no expiry then keeps the connection as a source of the organization's tables for as long as the organization keeps it, so the queries you already run keep serving that era. The new system connects alongside it. Where its connector takes propagated writes, records carried across with propagate: true keep the new system's row and the record you wrote as one record in Valtrix. Throughout, the organization's data stays readable through Valtrix; the cursors are a bookmark for following changes rather than a replication log. Called with an organization-scoped key, these endpoints see only that key's organization.

The connection object

One connected system of one organization. Connections belong to the organization, not to you; a connection stays listed while the organization keeps it, whatever your grant's state.

Fields
idstring

The connection id. The value records expose as connection_id and the value to pass as connection on a propagated write.

org_idstring

The organization the connection belongs to.

connectorstring

The connector slug of the connected system, as listed by GET /v1/connectors.

statusstring

pending before the organization finishes connecting, connected while it syncs, error after a persistent sync failure, expired when the stored credentials stopped working, disconnected after the organization removed it, or paused while syncing is stopped on purpose. A paused connection's data stays readable through every read endpoint; only ingestion stops.

history_fromstring or null

The date its date-bounded history was backfilled from, or null when only the connector's own sync window applies. The backfill runs once, on the first sync after the date is set; later syncs are back on the connector's windows and keep the backfilled records, marked frozen, without refreshing them. Set at connect time or widened later with PATCH; never narrowed.

last_synced_atstring or null

When data last synced from it, null before the first sync.

next_sync_atstring or null

When the next scheduled sync is due, null while the connection is paused, not yet connected, or waiting on its credentials. The cadence is the connector's sync_every_minutes.

initial_sync_completed_atstring or null

When the first full load finished, null until then. The moment the organization's data is complete enough to build on.

paused_atstring or null

When the connection was paused, null while it is not.

sampleobject or null

The first sample of data, taken while the connector was still being built, or null when none ran. sampled_at is when it ran, outcome is sampled (rows landed), empty_account (the product held no data for the sampled resources), no_sample (the budget ran out before any data came back), sign_in_failed, source_error, or cancelled, and resources counts the rows fetched per resource type. A sample is a one-off snapshot of whatever the product returned first within a few seconds per resource: readable through the records endpoints and the tables built on them, never refreshed, and replaced in place by the first full sync, which is when initial_sync_completed_at is set.

paused_untilstring or null

When a pause lifts on its own, null for a pause with no expiry or while not paused.

connect_mailboxstring

The Valtrix mailbox address of this connection: the address its sign-in reads emailed codes, links, and invitations from when the connector uses one. It is the address stored with the connection's sign-in details when there is one, and otherwise the address assigned to the organization and connector, the same value POST /v1/connect/sessions returns as connect_mailbox. Present on every connection, whether or not the connector reads mail today.

login_identitystring or null

Which login the connection holds. valtrix_user: it signs in as a user created for Valtrix, one whose address is on the Valtrix mailbox domain, one the organization confirmed creating, or one whose invitation Valtrix is still waiting for. existing: it signs in with a login the organization already had. null: it holds no typed sign-in, as with OAuth, API credentials, a bridge, or a sign-in a person performed live. It reports what is stored, whatever login_identity the Connect session asked for.

syncobject or null

What Valtrix stores from this connection, or null when no policy was set and everything the connector reads is stored. entities maps each entity type the policy names to stored: all, none (nothing is fetched or kept), or fields with the fields list that is kept, id and external_id first and the kind and reference fields always among them, so records keep linking. An entity turned off whose records a kept entity's sync depends on (the parent a fan-out reads) is shown as fields with only those always-kept fields. An entity not named is stored in full. source_payload is whether the provider's own document is kept beside each record; it is also dropped for any entity stored as fields. updated_at is when the policy was last set. Set it on POST /v1/connect/sessions before the first sync or change it with PATCH /v1/connections/:id.

writesobject

The entity types this connection can take propagated writes for, mapped to the operations among create, update, and delete. Empty when writes to this connection stay in Valtrix.

write_guidanceobject

The connector's write guidance for this connection, keyed by entity type like writes: the fields each operation sends with their meaning and whether they are required, the values a command field takes with the effect of each, the documents an operation carries, and the connector's notes on preconditions, side effects, and refusals. The same object as write_guidance on the connector object, here so a caller holding the organization knows what to send before propagating a write.

entitiesobject

The connector's entity cards, one per entity type it reads or writes, keyed by entity type: label is what the source calls it (Assignment for schedule_task on FieldEdge), sources the source listings that feed it with their resource_type, label, and description, vocabulary the connector's rules for the entity's columns (which source status means which canonical value), and writes one disposition per operation among create, update, and delete: status is supported (a declared operation; verified says a real write has landed and been read back), via (the source has no direct form of it and route says which write achieves it), or unsupported (reason says why nothing reaches the source). The dictionary that turns a system's own words into the entity type to query and says, before a propagated write, whether it can land and how. The same object as entities on the connector object.

{
"id": "conn_7f3k2m",
"org_id": "org_7f3k2m",
"connector": "sage-100-contractor",
"status": "paused",
"history_from": "2022-01-01T00:00:00Z",
"last_synced_at": "2026-09-08T09:30:00Z",
"next_sync_at": null,
"initial_sync_completed_at": "2026-08-01T10:12:00Z",
"paused_at": "2026-09-08T09:31:00Z",
"paused_until": "2026-09-11T09:31:00Z",
"connect_mailbox": "org_7f3k2m-sage-100-contractor@connect.valtrix.com",
"login_identity": null,
"sample": null,
"sync": { "entities": { "customer": { "stored": "fields", "fields": ["id", "external_id", "name", "kind"] }, "document": { "stored": "none" } }, "source_payload": false, "updated_at": "2026-09-08T09:00:00Z" },
"writes": { "vendor": ["create", "update"] },
"write_guidance": { "vendor": { "fields": [{ "op": "create", "column": "name", "description": "Display name", "required": true, "values": [] }], "documents": [], "notes": [] } },
"entities": { "vendor": { "entity_type": "vendor", "label": "Vendor", "sources": [{ "resource_type": "vendors", "label": "Vendors", "description": "The vendor list" }], "vocabulary": ["`vendor.status`: Active to active; Inactive to inactive."], "writes": { "create": { "status": "supported", "verified": true, "reason": null, "route": null }, "update": { "status": "supported", "verified": true, "reason": null, "route": null }, "delete": { "status": "unsupported", "verified": null, "reason": "Sage 100 Contractor keeps vendor history; a vendor is never deleted.", "route": null } } } }
}

The sync run object

One sync of a connection, returned when you start a sync and when you read a run back. Once it finishes, report says what was fetched per resource and how far back, and once the organization's tables have rebuilt from it, tables gives the change-feed position to replay later deltas from.

Fields
idstring

The run id.

connection_idstring

The connection the run belongs to.

triggerstring

What started it: initial for the first load, scheduled, manual for a requested sync, webhook when the source pushed a change, or field_selection after a field change.

modestring

full, incremental, or sample. A sample run is the first taste of data taken while the connector was still being built: a few seconds per resource, whatever the product returned first, no watermark, replaced in place by the first full sync.

statusstring

queued, running, succeeded, partial when some resources failed, failed, or cancelled.

started_atstring or null

When the run started, null while queued.

finished_atstring or null

When the run finished, null until then.

errorstring or null

The failure summary of a partial or failed run.

reportobject or null

The completeness report, null until the run finishes. resources maps each resource type to fetched, created, updated, attachments, failed_scopes, skipped_scopes, denied_scopes, error, error_code, effective_window_start (the date the fetch started from), window_reason, and sample, which is null on every run but a sample run and otherwise says what the sample did with the resource: sampled (rows landed), empty (the product answered with no rows), not_reached (the budget ran out before the first page), failed, or skipped (a child whose parent sample produced nothing). window_reason is one of: - template_window: the connector's default window applied - history_from: the connection's history date widened it - provider_limit: the source's own ceiling clamped it - watermark: an incremental run resumed from the last sync deleted_by_entity_type counts records the run swept as deleted per entity type. bounded is true when any resource fetch was bounded by a date. Items dated before that start that are still open in the source, such as an old unpaid invoice, are then not guaranteed to be present; treat them as opening balances. error and error_code are null when the resource synced. Otherwise error says in plain words what stopped the fetch and error_code is the value to branch on: - auth_rejected: the source rejected the stored credentials - permission_denied: the credentials work but this resource is not permitted - shape_drift: the source answered in a shape the connector no longer recognizes, or a full fetch came back empty where records were expected - session_ended: the source ended the session twice in one run, before and after a fresh login - provider_error: the source answered with a server error - timeout: the source did not answer in time - not_found: the source has no such resource - scopes_failed: some scopes of a fan-out could not be fetched and are retried next run Every code except auth_rejected and permission_denied is retried on the next run without action on your side.

derivationstring or null

pending while the organization's tables are still rebuilding from this run, settled once they have, null while the run itself has not finished.

tablesarray or null

One { table, cursor } per published table once derivation is settled, null before. cursor is the current position of that table's change feed for this organization, the same opaque string GET /v1/tables/:name/changes accepts, or null for a table with no changes yet. Reading the tables and then replaying the change feed from these cursors picks up everything that changed after this run.

{
"id": "run_3c2b1a",
"connection_id": "conn_7f3k2m",
"trigger": "manual",
"mode": "full",
"status": "succeeded",
"started_at": "2026-09-08T09:00:00Z",
"finished_at": "2026-09-08T09:24:00Z",
"error": null,
"report": {
"resources": { "invoices": { "fetched": 4120, "created": 12, "updated": 40, "attachments": 0, "failed_scopes": 0, "skipped_scopes": 0, "denied_scopes": 0, "error": null, "error_code": null, "sample": null, "effective_window_start": "2022-01-01T00:00:00.000Z", "window_reason": "history_from" } },
"deleted_by_entity_type": {},
"bounded": true
},
"derivation": "settled",
"tables": [{ "table": "invoices_clean", "cursor": "eyJjIjoiODIzMiJ9" }]
}

List connections

GET/v1/connections

Lists every connection of every organization that has connected to you, oldest first. Filter by org, connector, or status to narrow.

Parameters
orgstring

Only this organization's connections. 404 org_not_granted when it has not connected to you.

connectorstring

Only connections of this connector slug.

statusstring

Only connections in this status: pending, connected, error, expired, disconnected, or paused.

limitnumber

Defaults to 50. Values above 200 are clamped to 200.

cursorstring

The next_cursor from the previous page, sent back exactly as you received it.

Returns
connectionsarray

Connection objects.

next_cursorstring or null

The bookmark for the next page. null means the last page.

$ curl https://api.valtrix.com/v1/connections \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-G -d "status=connected" -d "limit=50"
{
"connections": [{ "id": "conn_7f3k2m", "org_id": "org_7f3k2m", "connector": "sage-100-contractor", "status": "connected", "history_from": "2022-01-01T00:00:00Z", "last_synced_at": "2026-09-08T09:30:00Z", "next_sync_at": "2026-09-08T10:30:00Z", "initial_sync_completed_at": "2026-08-01T10:12:00Z", "paused_at": null, "paused_until": null, "sync": null, "writes": { "vendor": ["create", "update"] }, "write_guidance": {} }],
"next_cursor": null
}

Retrieve a connection

GET/v1/connections/:id

Fetches one connection by id.

Parameters
idpath

The connection id.

Returns

The connection object, or 404 connection_not_found when no organization that connected to you owns it.

$ curl https://api.valtrix.com/v1/connections/conn_7f3k2m \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "id": "conn_7f3k2m", "org_id": "org_7f3k2m", "connector": "sage-100-contractor", "status": "connected", "history_from": null, "last_synced_at": "2026-09-08T09:30:00Z", "initial_sync_completed_at": "2026-08-01T10:12:00Z", "paused_at": null, "paused_until": null, "sync": null, "writes": {}, "write_guidance": {} }

Update a connection

PATCH/v1/connections/:id

Updates the settings of a connection: history_from, how far back its history loads, and sync, what Valtrix stores from it. Setting history_from to an earlier date queues one full sync that backfills the added history. That backfill runs once per resource; every sync after it is back on the connector's own sync windows, so the added records are kept and marked frozen rather than refreshed. The date can only move earlier; a later date returns 400 invalid_history_from, because narrowing would sweep records the organization already relies on. Pausing and resuming are state changes and have their own endpoints.

Parameters
idpath

The connection id.

history_fromstring

An ISO 8601 date, earlier than the current history_from and not in the future.

syncobject

What Valtrix stores from this connection, replacing the current policy. { "entities": { ... }, "source_payload": true | false }, where each entity type under entities is true (stored in full), false (not fetched or stored), { "fields": [...] } (only the named schema fields), or { "exclude": [...] } (every field but the named ones); id, external_id, kind, and reference fields are always stored, and an entity not named is stored in full. Storing less than before takes effect at once for every later sync, and the records already stored are rewritten in the background: an entity turned off is retired with its files, a dropped field is removed with a record_changes entry so tables rebuild and the change feed carries it. Storing more than before queues one full sync of the widened entities. The effective policy is read back as sync.

Returns

The updated connection object.

$ curl -X PATCH https://api.valtrix.com/v1/connections/conn_7f3k2m \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "history_from": "2022-01-01", "sync": { "entities": { "customer": { "fields": ["name"] }, "document": false }, "source_payload": false } }'
{ "id": "conn_7f3k2m", "history_from": "2022-01-01T00:00:00.000Z", "sync": { "entities": { "customer": { "stored": "fields", "fields": ["id", "external_id", "name", "kind"] }, "document": { "stored": "none" } }, "source_payload": false, "updated_at": "2026-09-08T09:00:00Z" }, ... }

Start a sync

POST/v1/connections/:id/runs

Starts a full sync of the connection and returns the run with status 202. Send entity_types to re-read only some kinds of data: every resource that feeds those entity types is fetched in full and nothing else is touched, which is the quick way to refresh one kind of record without re-reading the whole system. Poll GET /v1/connections/:id/runs/:runId, or subscribe to the connection.sync_completed webhook event, for the report and the per-table cursors. 409 sync_in_progress while a sync is already queued or running, 409 connection_paused while the connection is paused, and 409 sync_cooldown with a Retry-After header when a requested sync of the connection finished less than one of its sync intervals ago; scheduled syncs keep running throughout.

Parameters
idpath

The connection id.

modestring

Only full is accepted; omit it. Incremental syncs run on the connection's own schedule.

entity_typesarray

Entity types to re-read, such as ["activity"], from the ones the connection's connector lists in entity_types. Omit it to sync everything. A scoped run re-reads those entity types for the records already synced; it does not look for new records of other types, so a child entity is refreshed under the parents the last sync found.

Returns

The sync run object, with status 202.

$ curl -X POST https://api.valtrix.com/v1/connections/conn_7f3k2m/runs \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
{ "id": "run_3c2b1a", "connection_id": "conn_7f3k2m", "trigger": "manual", "mode": "full", "status": "queued", "started_at": null, "finished_at": null, "error": null, "report": null, "derivation": null, "tables": null }

Retrieve a sync run

GET/v1/connections/:id/runs/:runId

Fetches one sync run of the connection. While it runs, report and tables are null. Once it finishes, report is filled; once the organization's tables have rebuilt from it, derivation is settled and tables carries the cursor per table. Reading the tables and then replaying the change feed from those cursors picks up anything that changed afterwards.

Parameters
idpath

The connection id.

runIdpath

The run id, as returned by POST /v1/connections/:id/runs or the connection.sync_completed event.

Returns

The sync run object, or 404 run_not_found.

$ curl https://api.valtrix.com/v1/connections/conn_7f3k2m/runs/run_3c2b1a \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "id": "run_3c2b1a", "status": "succeeded", "report": { "resources": { "invoices": { "fetched": 4120, ... } }, "deleted_by_entity_type": {}, "bounded": true }, "derivation": "settled", "tables": [{ "table": "invoices_clean", "cursor": "eyJjIjoiODIzMiJ9" }], ... }

Pause a connection

POST/v1/connections/:id/pause

Stops syncing the connection while keeping every record, table row, change, and attachment readable and the organization's credentials stored. Queued and running syncs are cancelled, nothing is scheduled, and source webhooks are ignored. The connection stays billable, since its data is still served. It suits holding the organization's data still while you reconcile a point-in-time read. It also suits a source the organization has switched off, whose data stays part of its tables for as long as the organization keeps the connection. A platform may pause only a connection it is the sole reader of. When another platform also reads it, 409 connection_shared says how many, and the organization pauses it from its console. Resume with POST /v1/connections/:id/resume, or let a pause with until lift on its own.

Parameters
idpath

The connection id.

untilstring

An ISO 8601 timestamp at which the pause lifts and syncing resumes from where it stopped, at most a year away. Omit it to pause with no expiry.

Returns

The paused connection object. 409 connection_not_pausable when the connection is pending, disconnected, or already paused.

$ curl -X POST https://api.valtrix.com/v1/connections/conn_7f3k2m/pause \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "until": "2026-09-11T09:31:00Z" }'
{ "id": "conn_7f3k2m", "status": "paused", "paused_at": "2026-09-08T09:31:00Z", "paused_until": "2026-09-11T09:31:00Z", ... }

Resume a connection

POST/v1/connections/:id/resume

Lifts a pause. The connection returns to connected and its next sync runs at once, incrementally from the watermark it stopped at, so nothing that changed in the source during the pause is lost.

Parameters
idpath

The connection id.

Returns

The connection object. 409 connection_not_paused when it is not paused.

$ curl -X POST https://api.valtrix.com/v1/connections/conn_7f3k2m/resume \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
{ "id": "conn_7f3k2m", "status": "connected", "paused_at": null, "paused_until": null, ... }

API keys

Mint and revoke organization-scoped API keys, so each app or environment that acts for one organization holds a credential that can only reach that organization's data. These endpoints require a platform-wide key with manage access, the same level that governs transformation deploys and webhook endpoints: scoped keys cannot mint, list, or revoke keys, and keys minted here are always scoped and carry read or write access, never manage. Read-only keys suit dashboards, analytics tools, and anything else that only consumes data. Platform-wide keys are minted only in the console, under Developers. Revoking the grant for an organization also cuts off its scoped keys, because every request re-checks the grant; revoking a single key retires one credential without touching the grant. Handing scoped keys to agent-built apps is covered in Embedded coding agents.

The API key object

An API key's metadata. The secret itself appears once, in the key field of the create response, and never again; only the prefix is kept for display.

Fields
idstring

The key id. Pass it to DELETE /v1/keys/:id to revoke the key.

namestring

The label the key was created with. A name after the app or environment that holds it makes the key easy to place later.

prefixstring

The first characters of the secret, for display and log correlation. Organization-scoped secrets start with vlt_org_; platform-wide secrets start with vlt_; read-only secrets with vlt_read_ or vlt_org_read_.

orgstring or null

The organization the key is scoped to, or null for a platform-wide key.

accessstring

The key's access level: read, write, or manage. Read-only keys cannot write or delete records or create connect sessions. Organization-scoped keys are never manage.

manageboolean

Whether access is manage. Kept for backwards compatibility; read access instead.

created_atstring

When the key was created, as an ISO 8601 timestamp.

last_used_atstring or null

When the key last authenticated a request, or null if it never has.

revoked_atstring or null

When the key was revoked, or null while it is live. A revoked key fails authentication immediately.

{
"id": "key_8m2kf4",
"name": "Acme production app",
"prefix": "vlt_org_a1b2c3d4",
"org": "org_7f3k2m",
"access": "write",
"manage": false,
"created_at": "2026-07-10T08:00:00Z",
"last_used_at": null,
"revoked_at": null
}

Create an organization-scoped key

POST/v1/keys

Mints a new API key pinned to one organization. The organization must hold an active grant. The full secret is returned once, in the key field, and is not shown again.

Parameters
orgstring, required

The organization id to scope the key to, as listed by GET /v1/orgs and carried on every organization object. Required: keys created through the API are always organization-scoped.

namestring, required

A label for the key, non-empty and at most 100 characters. Name it after the app or environment that will hold it.

accessstring

read or write. Defaults to write. Read-only keys can read everything the grant covers but cannot write or delete records or create connect sessions.

Returns

The API key object plus a key field carrying the full secret, shown only in this response. 404 org_not_granted when the organization has no active grant.

$ curl https://api.valtrix.com/v1/keys \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "name": "Acme production app" }'
{
"id": "key_8m2kf4",
"name": "Acme production app",
"prefix": "vlt_org_a1b2c3d4",
"org": "org_7f3k2m",
"access": "write",
"manage": false,
"created_at": "2026-07-10T08:00:00Z",
"last_used_at": null,
"revoked_at": null,
"key": "vlt_org_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}

List API keys

GET/v1/keys

Lists every API key, including revoked ones, newest first. Not paginated. Filter by org to see the keys scoped to one organization, for example when offboarding it.

Parameters
orgstring

Narrow to keys scoped to one organization, by organization id.

Returns
keysarray

API key objects, newest first.

$ curl https://api.valtrix.com/v1/keys \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-G -d "org=org_7f3k2m"
{
"keys": [{ "id": "key_8m2kf4", "name": "Acme production app", "prefix": "vlt_org_a1b2c3d4", "org": "org_7f3k2m", "access": "write", "manage": false, "created_at": "2026-07-10T08:00:00Z", "last_used_at": "2026-07-12T14:00:00Z", "revoked_at": null }]
}

Revoke an API key

DELETE/v1/keys/:id

Revokes a key immediately: any request made with it fails authentication from this point on. Revoking an already-revoked key is a no-op, so retries are safe.

Parameters
idpath

The key id.

Returns

The API key object with revoked_at set, or 404 key_not_found when no key with that id exists.

$ curl -X DELETE https://api.valtrix.com/v1/keys/key_8m2kf4 \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "id": "key_8m2kf4", "name": "Acme production app", "prefix": "vlt_org_a1b2c3d4", "org": "org_7f3k2m", "access": "write", "manage": false, "created_at": "2026-07-10T08:00:00Z", "last_used_at": "2026-07-12T14:00:00Z", "revoked_at": "2026-07-14T09:00:00Z" }

Transformations

The management surface for transformations as code: read every transformation as a canonical YAML definition and apply definitions through the same draft-then-publish pipeline the dashboard uses. This section is the contract: the full definition file format (the file envelope, every step type, the expression functions, condition groups, and quality rules), followed by the endpoints. The step-by-step workflow around them (repo layout, pull requests, CI wiring, ownership and adoption) lives in the Transformations as code guide, in the console under Developers. Every table at GET /v1/tables/:name is the output of one transformation, and creating a transformation is the only way to create a table: there is no create-table endpoint. To add a table, write a definition file whose table field is the name you want, validate it with POST /v1/transformations/plan until the plan is clean, and publish it with POST /v1/transformations/apply (npx valtrix deploy --yes does both); the table then appears in GET /v1/schema, at GET /v1/tables/:name/rows, and in the regenerated client. Reads and plans work with any API key; apply requires a key with manage access, the same level that governs API key management under Keys.

The transformation object

A transformation and its canonical definition. The table name is the identity: definitions match remote transformations by the table they publish.

Fields
tablestring

The output table the transformation publishes. The same name you query at /v1/tables/:name, and the identity a definition file matches on.

namestring

The display name.

managed_bystring

ui while the dashboard editor owns the steps, code once a deploy has adopted it. Code-managed transformations are read-only in the dashboard editor.

statusstring

draft before the first publish, published after.

published_versionnumber or null

The current published version number, or null before the first publish.

has_draftboolean

Whether an unpublished dashboard draft exists.

definitionstring

The canonical YAML definition. Re-applying it unchanged plans as a noop.

{
"table": "vendors_enriched",
"name": "Vendors enriched",
"managed_by": "code",
"status": "published",
"published_version": 3,
"has_draft": false,
"definition": "version: 1\ntable: vendors_enriched\n..."
}

The definition file

The canonical YAML shape of a transformation, one file per output table. Steps and quality rules are the same validated shapes the dashboard editor produces; the file adds only this envelope. Step types, expression functions, condition groups, and quality rules are each documented below.

Fields
versionnumber, default 1

The definition format version. The only current version is 1.

tablestring

The output table name and the definition's identity: lowercase letters, digits, and underscores, starting with a letter, at most 63 characters. Renaming a table is a delete plus a create, not a rename.

namestring

The display name shown in the console.

source{ entity: string } or { table: string }

The input rows. { entity } reads the canonical records of an entity type (slugs listed by GET /v1/schema); { table } reads another published table, so transformations chain. Applying a definition whose source differs from the published one changes it in place: the table is rebuilt from the new source under the same name, and a row that keeps its id is not deleted and re-created.

schedulenone | hourly | daily | weekly, default "none"

A timed rebuild cadence, on top of the rebuild that runs whenever new synced data arrives.

org_scopeall | selected, default "all"

all runs for every granted organization; selected runs only for organizations picked in the dashboard. Deploys never change which organizations are selected.

stepslist of steps

Applied in order; every step type is documented under Step types.

qualitylist of quality rules, optional

Documented under Quality rules.

version: 1
table: vendors_enriched
name: Vendors enriched
source:
entity: vendor
schedule: daily
org_scope: all
steps:
- type: standardize
column: email
format: lowercase
onUnparseable: keep
- type: filter_rows
where:
logic: and
conditions:
- { column: status, operator: eq, value: active }
- type: derived_column
column: region_label
expression:
fn: case
cases:
- when:
logic: and
conditions:
- { column: region, operator: not_null }
then: { column: region }
else: { literal: unknown }
quality:
- type: not_null
column: email
severity: warn
- type: accepted_values
column: status
severity: error
config:
values: [active]

Definition file format

Every step type, expression function, condition, and quality rule a definition file can use. Open a part to read it; the file envelope is under The definition file above.

Step types22

Steps run in order within each organization's rows; rows never mix across organizations. Every step also accepts an optional id (string), a stable identifier used in deploy diffs; ids like step_1 are minted when omitted. No step can produce the reserved row-metadata columns _record_id, _external_id, _org_id, _connector, _synced_at, _changed_at, _attachment_id, _attachment_ids: a step passes them through unchanged (a SQL step keeps them with select input.*), but none may mint, rename, cast, or overwrite one.

rename_columns

Rename columns; mapping is {"old_name": "new_name"}.

mappingobject

drop_columns

Remove the listed columns.

columnslist of strings

keep_columns

Keep only the listed columns and remove every other column.

columnslist of strings

cast

Convert a column to the given type; onError controls values that cannot be converted. "json" parses JSON text (an object or array) into structured data, so SQL step output built with json_object or json_group_array is served as real nested objects instead of a string.

columnstring

tostring | number | boolean | date | json

onErrorkeep | null

standardize

Normalize the format of a column. defaultRegion is a 2-letter country code used by phone_e164.

columnstring

formattrim | lowercase | uppercase | title_case | phone_e164 | date_iso | currency_code

defaultRegionstring, optional

onUnparseablekeep | null

map_values

Replace observed values with canonical ones; fallback controls values missing from the mapping. With "when", only the rows matching the condition group are changed and every other row is left as it is.

columnstring

mappingobject

fallbackkeep | null | value

fallbackValuestring, optional

whencondition group, optional

Documented under Conditions. Only rows matching it are mapped.

replace_text

Find and replace every occurrence inside a column's text; mode "regex" treats find as a regular expression. With "when", only the rows matching the condition group are changed and every other row is left as it is.

columnstring

findstring

replaceWithstring

modeplain | regex

whencondition group, optional

Documented under Conditions. Only rows matching it are changed.

split_column

Split a column on a separator into the listed new columns, in order. The original column is removed unless keepOriginal is true.

columnstring

separatorstring

intolist of strings

keepOriginalboolean, optional

extract_json

Extract a nested value from a JSON object or array column into a new column. path uses dots and [n] indexes, e.g. "address.city" or "items[0].sku".

columnstring

pathstring

targetstring

bin

Label numeric ranges: the first bin whose exclusive upper bound "upTo" exceeds the value wins; a bin without upTo catches everything above. Non-numeric values get fallbackLabel or null.

columnstring

targetstring

binslist of objects

Each item: upTo (number, optional), label (string).

fallbackLabelstring, optional

filter_rows

Keep only rows matching the condition group.

wherecondition group

Documented under Conditions.

set_default

Fill empty values in a column with a default. With "when", only the rows matching the condition group get the default and every other row keeps its empty value, which is how a default that holds for one source system (a connector that only operates in one currency) is kept off the rows of every other system: a condition on _connector.

columnstring

valuestring

whencondition group, optional

Documented under Conditions. Only rows matching it get the default; a condition on _connector keeps a default to one source system.

derived_column

Create a new column from an expression over existing columns.

columnstring

expressionexpression

One of the functions documented under Expression functions.

dedupe

Remove duplicate rows sharing the key columns. With orderBy, rows are ranked by that column and the first survives; otherwise keep decides: "latest" keeps the most recently synced row, "first" the oldest record.

keyslist of strings

keeplatest | first

orderByobject, optional

Fields: column (string), direction (asc | desc).

lookup

Join columns from another relation by matching localKey to remoteKey. With source "table" (the default), tableName names a published table; with source "entity", tableName is the slug of another entity type and the join runs against its canonical records. Rows join within the same org only. A lookup never multiplies rows: when several relation rows share the key, keep decides which one supplies the columns, "first" (the default) the oldest record and "latest" the most recently synced; an unmatched row gets null. Every relation and the input rows carry "_record_id", each record's own id; a reference column (like document_id or customer_id) holds the _record_id of the record it points at, so a child-to-parent join uses the reference column as localKey and "_record_id" as remoteKey.

sourcetable | entity, optional

tableNamestring

localKeystring

remoteKeystring

takelist of strings

prefixstring, optional

keepfirst | latest, optional

rollup

Aggregate the matching rows of another relation into one new column per row, e.g. the number of orders per customer. Matches localKey to remoteKey within the same org; fn runs over the matches' "column" ("count" may omit it). For per-parent child aggregates, use "_record_id" as localKey and the child's reference column (like document_id) as remoteKey.

sourcetable | entity, optional

tableNamestring

localKeystring

remoteKeystring

fncount | sum | avg | min | max

columnstring, optional

targetstring

aggregate

Group rows by the groupBy columns (within each org) and replace them with one row per group holding the groupBy columns plus the aggregation targets. An empty groupBy produces one row per org.

groupBylist of strings

aggregationslist of objects

One output column: fn over the group's rows. "count" without a column counts rows; every other fn needs a source column. Each item: target (string), fn (count | count_distinct | sum | avg | min | max | first), column (string, optional).

union

Append the rows of another relation (a published table, or an entity type with source "entity") below the current rows. mapping optionally renames source columns, {"source_column": "target_column"}; unmapped columns keep their names. Rows are appended for every org the table is built for, so an org with no rows in the current input still gets the rows the relation holds for it; rows never cross orgs. An appended row keeps its identity: a row that comes from a synced record keeps that record's id, attachment, connector, and frozen flag, and a computed row (a syn_ id) gets an id derived from the relation's name and its id there. Once a definition has a union step, the computed rows of a source table are identified the same way, so the output is the same whichever table is the source and whichever is unioned. A row whose id is already present, the same record reaching the table twice, is appended under a derived id.

sourcetable | entity, optional

tableNamestring

mappingobject, optional

pivot

Reshape long to wide: group by the groupBy columns and create one column per listed headerValue, filled with agg over valueColumn of the rows whose headerColumn equals it. headerValues must list the expected values explicitly.

groupBylist of strings

headerColumnstring

valueColumnstring

aggcount | count_distinct | sum | avg | min | max | first

headerValueslist of strings

unpivot

Reshape wide to long: each row becomes one row per listed column, with the column name in keyColumn and its value in valueColumn. dropEmpty skips empty values.

columnslist of strings

keyColumnstring

valueColumnstring

dropEmptyboolean, optional

explode

Fan out a JSON-array column into one row per element. mode "value" puts each element in the column; mode "flatten" spreads object elements into columns (optionally prefixed). Rows without an array are dropped unless keepEmpty is true.

columnstring

modevalue | flatten

prefixstring, optional

keepEmptyboolean, optional

sql

Run a single SQLite SELECT (or WITH) over the current rows, separately per org. Use it only when the other step types cannot express the logic. The table is named "input" and has the data columns plus: - _record_id, _external_id, _org_id, _connector - _synced_at: when a sync last confirmed the record against its source - _changed_at: when its data last actually differed; use it for "last updated" columns - _attachment_id: the id of the newest stored attachment of the record (a synced document, a rendered PDF, a report screenshot), null when none; in a GROUP BY, max(_attachment_id) keeps the newest of the group, since attachment ids sort by creation time - _attachment_ids: a JSON array of all of them, oldest first Keep _record_id (select input.*) when the query preserves rows. A query that groups or reshapes may omit _record_id, and row ids are then generated. Set key to the output columns that identify such a row (an invoice id plus a payment id, a status plus a month) so the generated id stays the same when the other columns change. Without key the id is derived from every value in the row, so any edit to the query or to a value replaces the row with a new one, and consumers of the change feed see a delete and an insert. Published tables can be joined by their name, and entity types by their slug when no table shares that name. A joined relation has ONLY _record_id and _org_id plus its data columns (no _synced_at or _changed_at) and already contains only rows from the same org, so no org filtering is needed.

querystring

keylist of strings, optional

Expression functions18

The functions a derived_column step's expression field accepts, selected by fn. Column arguments name existing columns.

concat
partslist of { column: string } or { literal: string }

coalesce
columnslist of strings

arithmetic

Arithmetic over columns and numbers; left/right are a column name, a number, or a nested arithmetic expression.

leftcolumn name, number, or nested arithmetic expression

operator+ | - | * | /

rightcolumn name, number, or nested arithmetic expression

year_of
columnstring

case

If/else over conditions: the first matching case wins; "then"/"else" are a column reference or a literal. Without a matching case and no "else", the value is null.

caseslist of objects

Each item: when (condition group), then ({ column: string } or { literal: string or number }).

else{ column: string } or { literal: string or number }, optional

substring

Slice of the text; start is 1-based, length optional (to the end when omitted).

columnstring

startnumber

lengthnumber, optional

replace
columnstring

findstring

replaceWithstring

regexboolean, optional

regex_extract

First regex match; group defaults to capture group 1 when the pattern has one, else the whole match.

columnstring

patternstring

groupnumber, optional

split_part

Split the text on the separator and take the 1-based part.

columnstring

separatorstring

indexnumber

length
columnstring

date_part
columnstring

partyear | month | day

date_trunc
columnstring

unitday | week | month | year

date_diff

Difference "to" minus "from" in the unit; both are date columns, "to" defaults to now.

unitdays | months | years

fromstring

tostring, optional

date_add
columnstring

amountnumber

unitdays | months | years

round
columnstring

digitsnumber, optional

abs
columnstring

floor
columnstring

ceil
columnstring

Conditions2

Condition groups appear in filter_rows steps, in the optional when of set_default, map_values, and replace_text steps, in case expressions, and in expression quality rules. Text comparisons ignore case. A step condition may read _connector, the slug of the source system the row was synced from, beside the data columns.

condition group

A group of column conditions combined with "and" or "or". Operators "in"/"not_in" read the "values" list; "not_null"/"is_null" need no value and treat blank strings, empty lists, and empty objects as empty; "contains"/"not_contains" check list elements when the column holds a list; "gt"/"gte"/"lt"/"lte" compare numerically, or as dates when the column holds a date rather than a number; "before"/"after" compare as dates against a fixed "value"; a date bound written without a time ("2026-02-08") compares against the calendar day of the column value, so "lte" keeps every timestamp on that day and "lt" none of them; "within_last_days"/"within_next_days" take a number of days measured back or forward from the time the step runs, and "after_now"/"before_now" need no value and compare the column date against that time, so these four never go stale; every other operator compares against "value" as text, ignoring case ("Paid" matches "paid"), and "regex" is case-sensitive unless the pattern says otherwise. Beside the data columns, a condition may test "_connector", the slug of the source system the row was synced from (null on rows that no longer map to one source record), which is how a step keeps or changes only the rows of one connector.

logicand | or

conditionslist of conditions

condition

One column check inside a condition group.

columnstring

The column the condition reads, or _connector, the slug of the source system the row was synced from.

operatorenum

One of: eq (equals), neq (does not equal), contains (contains), not_contains (does not contain), starts_with (starts with), ends_with (ends with), regex (matches regex), in (is one of), not_in (is not one of), gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal), before (is before), after (is after), within_last_days (within last N days), within_next_days (within next N days), after_now (is in the future), before_now (is in the past), not_null (is not empty), is_null (is empty).

valuestring, optional

The comparison value; unused by not_null, is_null, in, and not_in.

valueslist of strings, optional

The list read by in and not_in.

Quality rules8

Rules evaluate separately within each organization's rows after every rebuild. With severity error, not_null, unique, accepted_values, regex, relationship, expression rules quarantine failing rows, removing them from the table until they pass; freshness and volume report without quarantining. With severity warn, every rule reports without quarantining.

not_null

Fails rows where the column is empty. Blank strings, empty lists, and empty objects count as empty.

columnstring

The column the rule checks.

severityerror | warn, default "error"

namestring, optional

The display name shown in the console.

unique

Fails every row whose column value appears more than once within the organization's rows.

columnstring

The column the rule checks.

severityerror | warn, default "error"

namestring, optional

The display name shown in the console.

accepted_values

Fails rows whose column value is not in the accepted list, ignoring case.

columnstring

The column the rule checks.

severityerror | warn, default "error"

namestring, optional

The display name shown in the console.

config.valueslist of strings

The accepted values, compared as text.

regex

Fails rows whose column value does not match the pattern.

columnstring

The column the rule checks.

severityerror | warn, default "error"

namestring, optional

The display name shown in the console.

config.patternstring

A JavaScript regular expression source, without slashes.

freshness

Fails rows whose last sync is older than the age limit. Takes no column.

severityerror | warn, default "error"

namestring, optional

The display name shown in the console.

config.maxAgeHoursnumber, default 24

The maximum age in hours.

volume

Fails when an organization has fewer rows than the minimum. Takes no column.

severityerror | warn, default "error"

namestring, optional

The display name shown in the console.

config.minRowsnumber, default 1

The minimum expected row count per organization.

relationship

Fails rows whose column value does not exist as a key in the related table or entity type, checked within the same organization.

columnstring

The column the rule checks.

severityerror | warn, default "error"

namestring, optional

The display name shown in the console.

config.relationobject

Fields: name (string, the related published table, or an entity type slug), remoteKey (string, the key column in the relation), source (table | entity, optional, resolved automatically when omitted).

expression

Fails rows that do not match the condition group.

severityerror | warn, default "error"

namestring, optional

The display name shown in the console.

config.wherecondition group

Documented under Conditions.

List transformations

GET/v1/transformations

Lists every transformation with its canonical definition. The starting point for exporting existing transformations into files.

Returns
transformationsarray

Transformation objects, oldest first.

$ curl https://api.valtrix.com/v1/transformations \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{
"transformations": [{ "table": "vendors_enriched", "name": "Vendors enriched", "managed_by": "code", "status": "published", "published_version": 3, "has_draft": false, "definition": "version: 1\n..." }]
}

Retrieve a transformation

GET/v1/transformations/:table

Fetches one transformation by the table it publishes.

Parameters
tablepath

The output table name.

Returns

The transformation object, or 404 transformation_not_found when no transformation publishes that table.

$ curl https://api.valtrix.com/v1/transformations/vendors_enriched \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "table": "vendors_enriched", "name": "Vendors enriched", "managed_by": "code", "status": "published", "published_version": 3, "has_draft": false, "definition": "version: 1\n..." }

Retrieve the definition file format

GET/v1/transformations/definition-format

Returns the definition file format as one Markdown document: the file envelope and every step type, expression function, condition, and quality rule. It is the content this reference documents under The definition file, rendered from the catalog the running API validates against, so it is the text to hand a model or a coding agent before it writes a definition. Works with any key.

Returns
titlestring

The document's title.

markdownstring

The whole format as Markdown text.

$ curl https://api.valtrix.com/v1/transformations/definition-format \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "title": "The transformation definition file", "markdown": "# The transformation definition file\n\n..." }

Plan a deploy

POST/v1/transformations/plan

Validates definitions server-side and returns the structured diff a deploy would apply, without writing anything. Works with any API key, so it runs in CI on pull requests; the CLI exits non-zero while changes are pending. Plan is also how a definition is iterated on before publishing: each item's error says what to fix, and apply follows once every item is clean.

Parameters
definitionsarray, required

An array of { "file", "content" } entries, one per definition file. At most 100 per call.

adoptboolean

When true, the plan treats dashboard-managed transformations as adoptable instead of reporting them blocked. Defaults to false.

Returns
itemsarray

One item per definition, in dependency order. Each carries the action (create, update, noop, missing_remote, or error), setting, step, and quality-rule changes, the schema impact (output columns added or removed), and warnings. missing_remote means the definition reads a source table that neither exists nor is defined in the same call. Items blocked by dashboard ownership carry blocked: "managed_by_ui"; invalid definitions carry the validation message in error.

$ curl https://api.valtrix.com/v1/transformations/plan \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "definitions": [{ "file": "vendors_enriched.yaml", "content": "version: 1\n..." }] }'
{
"items": [{ "file": "vendors_enriched.yaml", "table": "vendors_enriched", "action": "update", "managed_by": "code", "blocked": null, "settings": [], "steps": { "added": [], "removed": [], "modified": ["standardize (s1)"] }, "quality": null, "schema_impact": { "added": [], "removed": [], "dynamic": false }, "warnings": [], "error": null }]
}

Apply a deploy

POST/v1/transformations/apply

Writes definitions into drafts and publishes each changed transformation through the standard publish pipeline, stamping the publish with the API key's identity. Transformations apply in dependency order and the deploy stops at the first failure; later items report skipped. An unchanged definition is a noop and creates no new version. POST /v1/transformations/plan previews the diff beforehand. Requires a platform-wide key with manage access (the level that also governs API key management); applying marks each transformation managed_by: "code". The CLI has no bare apply command: valtrix deploy always plans first, shows the diff, and only applies with --yes.

Parameters
definitionsarray, required

An array of { "file", "content" } entries, one per definition file. At most 100 per call.

adoptboolean

When true, dashboard-managed transformations are adopted into code management instead of skipped. Defaults to false.

Returns
itemsarray

One item per definition, in dependency order. Each carries the action (create, update, noop, missing_remote, or error), setting, step, and quality-rule changes, the schema impact (output columns added or removed), a status (applied, noop, skipped, or failed), and the new version number and publish run_id for applied items. Items blocked by dashboard ownership carry blocked: "managed_by_ui". run_id names the publish run that rebuilds the table's rows in the background; apply returns as soon as the version is published, before those rows exist. The run has no endpoint of its own. GET /v1/transformations/:table reports the new published_version at once; a table's first publish sends table.published and a later one that changes columns sends table.schema_updated; and once the rebuild lands, which is one transaction per table, the change feed carries every row it inserted, updated, or deleted and table.changed fires, so a consumer that drains the feed from its stored cursor needs nothing else. A run that fails leaves the previous rows in place and the version published, and Valtrix is alerted to it. A failed item stops the deploy: items before it are published, items after it report skipped. Sending the same definitions again is the recovery, since every published item plans as noop and only the rest apply.

$ curl https://api.valtrix.com/v1/transformations/apply \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "definitions": [{ "file": "vendors_enriched.yaml", "content": "version: 1\n..." }] }'
{
"items": [{ "file": "vendors_enriched.yaml", "table": "vendors_enriched", "action": "update", "status": "applied", "version": 4, "run_id": "run_9", "managed_by": "code", "blocked": null, "settings": [], "steps": { "added": [], "removed": [], "modified": ["standardize (s1)"] }, "quality": null, "schema_impact": { "added": [], "removed": [], "dynamic": false }, "warnings": [], "error": null }]
}

Webhooks

Webhooks push notifications to your server, so nothing has to poll on a timer. An endpoint is registered with POST /v1/webhooks, or under Developers, Webhooks in the console, with the event types it receives. Its signing secret comes back once, on creation. Two paths cover data changes. table.changed is the thin one: it carries ids rather than row data, and the change feed, drained from your own stored cursor, carries the rest. table.row_changed is the fat one, opt-in per endpoint and per table: one delivery per changed row with the row, the columns that changed, and their previous values, optionally narrowed to changes touching the columns you name. Webhooks are the wake-up and the change feed is the record. The reliable shape is a table.changed subscription, a drain of GET /v1/tables/:name/changes from your stored cursor each time it fires, and a reconcile from the same cursor every 15 to 60 minutes to cover a delivery that went missing. Deliveries retry with backoff for about 3 days and can repeat. Any 2xx within 5 seconds acknowledges one, and the event id is the key to deduplicate on. Events arrive as fast as the data changes, and a sync often surfaces a whole day of changes at once, so bursts of hundreds of deliveries within seconds are normal. Receivers do best acknowledging first and processing asynchronously. An event still undelivered after about 3 days is marked dead and kept for 14 days; GET /v1/webhooks/:id/events lists the queue and POST /v1/webhooks/:id/replay re-queues the dead ones. Every delivery posts the event object unless the endpoint has a payload_template, in which case the receiver gets your JSON with placeholders filled in from the event. The template is the exact body the receiver expects, such as a chat tool's incoming-webhook message, with event fields referenced as {{data.row.status}} or {{data.previous.status | default 'none'}}. A string that is exactly one placeholder takes the value's own JSON type, so a number stays a number and an object stays an object. Placeholders inside text are interpolated, with objects and arrays as compact JSON. A delivery whose every placeholder resolves to nothing is skipped instead of sent. POST /v1/webhooks/preview renders a template against a sample event before you save it, and the placeholders it returns are the paths available to you.

The webhook endpoint object

A URL you registered to receive events, with the event types it subscribes to and its delivery health. Managing endpoints needs a platform-wide key with manage access; the signing secret is returned only by the create and rotate-secret calls.

Fields
idstring

The endpoint id.

urlstring

Where events are posted. https on a public host in production. Changed with PATCH /v1/webhooks/:id, which keeps the endpoint's queue, secret, and subscriptions and sends every waiting event to the new URL.

descriptionstring or null

A label for your own reference.

statusstring

active while deliveries succeed, failing once 20 deliveries in a row have failed (deliveries continue), disabled when you turned it off; a disabled endpoint receives nothing, and events keep queuing for it until you re-enable it or delete it, for up to 90 days; an event still waiting after that is dropped.

event_typesarray

The event types the endpoint receives, sorted. Any of the names under Event types except endpoint.test, which every endpoint accepts.

payload_templatestring or null

null when deliveries post the event object as is. Otherwise a JSON document, as a string, that is rendered per event and posted instead. - {{path}}: replaced with the value at that path of the event object (id, type, occurred_at, or data and its fields, down to data.row.column and data.previous.column for table.row_changed) - {{path | default 'text'}}: supplies a value when the path is missing - {{path | escape}}: writes the value with &, <, and > replaced by &amp;, &lt;, and &gt;, the escaping a chat tool such as Slack asks for so a value is never read as its markup. It combines with default in either order - A string that is exactly one placeholder is replaced by the raw value rather than text A Slack incoming webhook URL takes a template of the form { "text": "..." } and nothing else: Slack requires text and answers 200 with the body ok. Deliveries whose placeholders all resolve to nothing are recorded as skipped and not sent. The signature covers the rendered body.

stale_after_secondsnumber or null

The age past which a queued event is discarded instead of delivered, in seconds, or null to retry every event for the full three-day window. On an endpoint that drives alerts, it means a receiver that comes back after a day gets the last day of changes rather than everything that queued while it was down. Discarded events are listed with status discarded and can be replayed.

tablesarray

The table.row_changed subscriptions as { table, columns, change_types, resync_required_at }. Empty unless event_types includes table.row_changed. - table: the published table by name - columns: when non-empty, the columns an update must touch to be delivered - change_types: when non-empty, the kinds of change delivered, any of insert (a new row), update, and delete. Empty delivers all three - resync_required_at: null unless the subscription fell so far behind that changes it had not received were pruned (an endpoint left disabled for over 90 days). It then marks when that happened. The gap is closed by a full read of the table, after which sending the table again in PATCH /v1/webhooks/:id clears it columns never holds back a new row or a delete, so an endpoint that should hear about one column changing and nothing else sets both.

consecutive_failuresnumber

Failed deliveries since the last success. Resets to zero on a successful delivery or when you re-enable the endpoint.

last_success_atstring or null

When a delivery last got a 2xx, as an ISO 8601 timestamp.

last_failure_atstring or null

When a delivery last failed, as an ISO 8601 timestamp.

pending_eventsnumber

Events queued for the endpoint and not yet delivered, including those waiting out a retry backoff.

dead_eventsnumber

Events that exhausted their retries and can be re-queued with POST /v1/webhooks/:id/replay. Kept for 14 days.

discarded_eventsnumber

Events dropped without delivery, by queued_events: discard on PATCH /v1/webhooks/:id or by the endpoint's stale_after_seconds. Replayable like dead events, kept for 14 days.

oldest_pending_atstring or null

When the oldest event still waiting was queued, as an ISO 8601 timestamp; null when nothing is pending. Together with pending_events it says how far behind a receiver is.

created_atstring

When the endpoint was registered, as an ISO 8601 timestamp.

{
"id": "whe_4k2m9p",
"url": "https://yourapp.com/webhooks/valtrix",
"description": "Production app",
"status": "active",
"event_types": ["connection.broken", "table.row_changed", "write_intent.applied", "write_intent.failed"],
"payload_template": null,
"stale_after_seconds": null,
"tables": [{ "table": "customers_clean", "columns": ["email"], "change_types": ["update"], "resync_required_at": null }],
"consecutive_failures": 0,
"last_success_at": "2026-07-10T08:05:00Z",
"last_failure_at": null,
"pending_events": 0,
"dead_events": 0,
"discarded_events": 0,
"oldest_pending_at": null,
"created_at": "2026-07-10T08:00:00Z"
}

The queued event object

An event in an endpoint's queue: pending while waiting to be delivered, delivered, dead after exhausting its retries, or discarded without delivery. Read them from GET /v1/webhooks/:id/events to see what an endpoint has not received yet, and re-queue dead or discarded ones with POST /v1/webhooks/:id/replay. Delivered, dead, and discarded events are kept for 14 days.

Fields
idstring

The event id, the same value your endpoint receives in the Valtrix-Event-Id header and the envelope.

typestring

The event type, like table.row_changed. Event types lists every one.

statusstring

pending while delivery is still being attempted, delivered once your endpoint answered 2xx, dead once every retry failed, discarded when it was dropped without delivery, either by queued_events: discard or because it aged past the endpoint's stale_after_seconds (the delivery log records which).

attemptsnumber

How many deliveries have been tried. A replay resets it to zero.

next_attempt_atstring or null

When the next delivery is due for a pending event, as an ISO 8601 timestamp; null once delivered, dead, or discarded.

delivered_atstring or null

When your endpoint accepted the event, as an ISO 8601 timestamp; null until then.

created_atstring

When the event was queued, as an ISO 8601 timestamp; the envelope's occurred_at.

dataobject

The event payload exactly as the envelope carries it. Event types lists the fields per event.

{
"id": "evt_01h9x...",
"type": "table.row_changed",
"status": "dead",
"attempts": 19,
"next_attempt_at": null,
"delivered_at": null,
"created_at": "2026-07-10T08:05:00Z",
"data": { "table": "customers_clean", "record_id": "rec_9d4f2c81a7b3e650d21c4f8a", "change_type": "upsert" }
}

The delivery object

One attempt to post an event to an endpoint, kept for 14 days, with the body that was sent and the start of the receiver's reply. Read them from GET /v1/webhooks/:id/deliveries to see why an endpoint is failing.

Fields
idstring

The delivery id.

event_idstring or null

The queued event this delivery attempted, as listed by GET /v1/webhooks/:id/events; null for table.changed pings and test events, which are not queued.

event_typestring

The event type that was posted, like table.row_changed or endpoint.test.

statusstring

succeeded when your endpoint answered 2xx within 5 seconds, failed otherwise, skipped when the endpoint's payload_template resolved no placeholder for this event so nothing was sent. A 429 is recorded as failed but retried after the Retry-After header without counting toward the endpoint's failure count or the event's attempts, so a rate-limited event waits as long as the endpoint keeps asking.

http_statusnumber or null

The HTTP status your endpoint returned, or null when the request never completed.

errorstring or null

What went wrong on a failed delivery: the non-2xx status, a timeout, or a connection error.

request_bodystring or null

The exact body that was posted: the event object, or the rendered payload_template when the endpoint has one. Truncated past 128 KB. null when nothing was sent, as on a skipped delivery.

response_bodystring or null

The first 2 KB of what your endpoint answered, or null when it sent nothing or never answered. The place to read a receiver's own error message. Always null on a test delivery, whose reply is not stored.

duration_msnumber or null

How long the request took.

created_atstring

When the attempt was made, as an ISO 8601 timestamp.

{
"id": "whd_9s2ph1",
"event_id": "evt_01h9x...",
"event_type": "table.row_changed",
"status": "failed",
"http_status": 500,
"error": "Endpoint responded 500",
"request_body": "{\"id\":\"evt_01h9x...\",\"type\":\"table.row_changed\",\"occurred_at\":\"2026-07-10T08:05:00Z\",\"data\":{...}}",
"response_body": "internal error",
"duration_ms": 212,
"created_at": "2026-07-10T08:05:00Z"
}

The event object

The envelope every webhook delivery posts to your endpoint. The same shape for every event type; only data varies. An endpoint with a payload_template posts the rendered template instead, with this object as the source of its placeholder values.

Fields
idstring

Unique per event. Deliveries can repeat, so an id you have already seen is one you have already handled.

typestring

The event name, like table.changed. Event types lists every one.

occurred_atstring

When the event happened, as an ISO 8601 timestamp.

dataobject

The event payload. Carries ids and names; only table.row_changed carries row data. Event types lists the fields per event.

{
"id": "evt_01h9x...",
"type": "table.changed",
"occurred_at": "2026-07-08T09:30:00Z",
"data": { "table": "customers_clean", "latest_cursor": "eyJjIjoiODIzMiJ9" }
}

Event types

Every event the type field can name, with the fields each one puts in data.

connection.broken

An organization's connection stopped syncing. Rows already synced stay in your tables but stop updating until it recovers.

data.org_idstring

The organization the connection belongs to.

data.external_idstring or null

Your identifier for the organization, or null when you have never sent one.

data.connectorstring

The connector slug of the affected system.

data.reasonstring

reauthorization_required when the organization must reconnect through a new Connect session, sync_failed when syncing hit a persistent error, bridge_offline when the Valtrix Bridge on the organization's machine stopped reporting in, bridge_revoked when the organization's bridge pairing was revoked.

connection.paused

A connection was paused, by you, by the organization, or by an admin. Its data stays readable but stops updating until it resumes. Not in an endpoint's default subscriptions; opt in.

data.org_idstring

The organization the connection belongs to.

data.external_idstring or null

Your identifier for the organization, or null when you have never sent one.

data.connection_idstring

The paused connection.

data.connectorstring

The connector slug of the paused system.

data.paused_untilstring or null

When the pause lifts on its own, or null for a pause with no expiry.

connection.resumed

A paused connection resumed, by request or because its pause expired. Its next sync runs at once. Not in an endpoint's default subscriptions; opt in.

data.org_idstring

The organization the connection belongs to.

data.external_idstring or null

Your identifier for the organization, or null when you have never sent one.

data.connection_idstring

The resumed connection.

data.connectorstring

The connector slug of the resumed system.

connection.sync_completed

A sync run of a connection finished with data: succeeded, or partial when some resources failed. Carries the same report GET /v1/connections/:id/runs/:runId returns: on a partial run each failed resource carries error, a sentence for a person, and error_code, the value to branch on. Read the run for the per-table cursors once the organization's tables have rebuilt. Fires for every run, scheduled ones included, so filter on trigger and mode. Not in an endpoint's default subscriptions; opt in.

data.org_idstring

The organization the connection belongs to.

data.external_idstring or null

Your identifier for the organization, or null when you have never sent one.

data.connection_idstring

The connection that synced.

data.connectorstring

The connector slug of the synced system.

data.run_idstring

The run id, to read back with GET /v1/connections/:id/runs/:runId.

data.triggerstring

initial, scheduled, manual, webhook, or field_selection.

data.modestring

full, incremental, or sample, the one-off first taste of data taken while the connector was still being built.

data.statusstring

succeeded or partial.

data.reportobject

The completeness report of the sync run object.

connector.schema_updated

A new version of a connector went live and changed what it delivers. Sent once per version to every platform whose grant covers an organization connected through that connector and includes one of the entity types touched.

data.connectorstring

The connector slug, as GET /v1/connectors lists it.

data.versionnumber

The connector version that went live.

data.entity_typesarray

Every entity type an added or removed resource, column, or write op touches, sorted. The quick check against the entities your transformations read.

data.addedobject

What the new version delivers that the previous one did not: resources, each { resource, entity_type }; columns, each { resource, entity_type, columns } naming the entity columns that resource now fills; and write_ops, each { entity_type, op }. Every list may be empty.

data.removedobject

What the previous version delivered that the new one does not, in the same shape as added. Empty on an ordinary rebuild, since a live connector may only add; filled when Valtrix allowed a breaking rebuild, in which case the named columns go empty on the next sync.

connector_request.live

A connector you added through POST /v1/connector-requests went live: the connector is in the catalog and requesters' customer data is syncing. Sent to every platform on the request, including ones that joined an existing build.

data.request_idstring

The connector request id, matching the id in GET /v1/connector-requests.

data.provider_namestring

The provider name as the request submitted it.

data.product_namestring or null

The specific product the request resolved to, when the provider sells more than one.

data.statusstring

Always live for this event.

data.connectorstring

The new connector's slug, valid everywhere the API takes a connector, so you can start minting Connect sessions with it.

connector_request.not_available

A connector request ended without a connector: the provider cannot be supported. The request stays visible in GET /v1/connector-requests with status not_available.

data.request_idstring

The connector request id, matching the id in GET /v1/connector-requests.

data.provider_namestring

The provider name as the request submitted it.

data.product_namestring or null

The specific product the request resolved to, when the provider sells more than one.

data.statusstring

Always not_available for this event.

data.connectornull

Always null for this event.

endpoint.test

A test delivery triggered from the console, for verifying your handler end to end. data is empty.

grant.revoked

An organization revoked your access. Its rows are removed from every table and its records stop being readable at once, with no delete changes in the change feed and no table.row_changed deliveries, so a consumer that keeps a copy clears that organization's rows by _org_id on this event. GET /v1/orgs/:id reports the organization as revoked from then on.

data.org_idstring

The organization that revoked access.

data.external_idstring or null

Your identifier for the organization, or null when you have never sent one.

org.connected

An organization granted you access, through a new connection or by extending an existing grant.

data.org_idstring

The organization that granted access. Use it with the org parameter across the API.

data.external_idstring or null

Your identifier for the organization, as sent on the Connect session. Null when you have never sent one.

data.connect_session_idstring or null

The id of the Connect session the organization completed, matching the id returned when you minted the link. The reliable way to attribute the event to the customer you minted the link for, even if the browser never reached your redirect_uri. Null when access was granted outside a Connect session.

org.initial_sync.completed

The first sync of a new connection finished and its data is ready to query.

data.org_idstring

The organization the connection belongs to.

data.external_idstring or null

Your identifier for the organization, or null when you have never sent one.

data.connectorstring

The connector slug of the system that synced.

table.changed

A table has new changes. Fetch GET /v1/tables/:name/changes from your own stored cursor. Coalesced, at most one delivery per table every 30 seconds.

data.tablestring

The name of the table that changed, as used in /v1/tables/:name paths.

data.latest_cursorstring

The bookmark of the newest change at send time. Use it only to compare against your own stored cursor: if they match you are already caught up and can skip the drain. Never fetch the change feed starting from this value; that starts at the end of the feed and skips everything between your last drain and now. Always drain from your own stored cursor.

table.published

A table was published for the first time and now appears in GET /v1/schema.

data.tablestring

The name of the new table.

data.schema_versionstring

The version it published at, like "v1". The same form GET /v1/schema reports.

table.row_changed

One row of a subscribed table changed. Opt in per endpoint with the tables field on POST /v1/webhooks or under Developers, Webhooks, choosing the tables and optionally the columns and the change types. With columns set, an update is delivered only when one of them changed. With change_types set, only those kinds of change (insert, update, delete) are delivered. Columns alone never hold back a new row or a delete; leave insert and delete out of change_types for that. An insert arrives as change_type: "upsert" with changed_columns null, an update as upsert with the columns that changed. Events are delivered in feed order per table, one event per change, starting from when the subscription was created. A table's initial load after a new connection is skipped, so you only hear about changes to data that was already there. Republishing the table's transformation is not skipped: every row the new version changes is delivered. A row whose id changed arrives as a delete of the old id followed by an insert of the new one, deletes first. Rows from an aggregating or reshaping SQL step keep their syn_ id across republishes only when the step declares a key, so a step without one re-emits the whole table when a column is added. Rows larger than 64 KB arrive without the row, with row_omitted set, so fetch by record_id in that case. A row whose record leaves or re-enters the connector's sync window arrives as an update whose changed_columns is ["_frozen"], so a columns filter that does not name _frozen never delivers it.

data.tablestring

The name of the table the row belongs to, as used in /v1/tables/:name paths.

data.org_idstring

The organization the row belongs to.

data.external_idstring or null

Your identifier for the organization, as sent on the Connect session. Null when you have never sent one.

data.record_idstring

The id of the affected row, the same value the row carries as _record_id. For deletes it identifies which row to drop.

data.change_typestring

upsert when the row was created or updated, delete when it was removed.

data.cursorstring

This change's position in the table's change feed, the same value GET /v1/tables/:name/changes returns for it. Store it if you also drain the feed, so the two paths never double-process a change.

data.changed_columnsarray or null

The columns whose values differ from the row's previous version. null when the row is new to the table, and null for deletes.

data.previousobject or null

The values the changed columns held before this change, keyed by column. null whenever changed_columns is null.

data.rowobject or null

The full row after the change, in the row object shape. null for deletes, and null when the row was too large to deliver.

data.row_omittedboolean

true when row is null because the row exceeded 64 KB. Read it with GET /v1/records/:recordId or the table's rows endpoint.

data.schema_versionstring or null

The table's schema version at the time of the change, like "v3". Compare it with the version your client was generated from before reading columns.

table.schema_updated

A published table's schema changed. Compare against GET /v1/schema and regenerate your SDK types.

data.tablestring

The name of the table whose schema changed.

data.schema_versionstring

The new schema version, like "v3". The same form GET /v1/schema reports.

write_intent.applied

A propagated write landed in the organization's connected system. Where the connector can read the write back, verification says whether the source showed the values as sent. Fetch GET /v1/write-intents/:id for the full write intent, or the record for its updated source_id.

data.org_idstring

The organization the write belongs to.

data.external_idstring or null

Your identifier for the organization, as sent when minting its Connect session.

data.write_intentobject

The write intent summary: id, status (always applied), op, entity_type, record_id, source_external_id, the id the source system assigned, verification (confirmed, unconfirmed, or contradicted), and steps, the per-stage outcomes a multi-step write reports, or null.

write_intent.failed

A propagated write could not be applied after its retries. Inspect error, fix the input with POST /v1/records/:entityType if needed, then POST /v1/write-intents/:id/retry.

data.org_idstring

The organization the write belongs to.

data.external_idstring or null

Your identifier for the organization, as sent when minting its Connect session.

data.write_intentobject

The write intent summary: id, status (always failed), op, entity_type, record_id, source_external_id (the id the source assigned when the write landed the record before a later step failed, so the source holds it and re-sending finishes the rest; null otherwise), error, why the write did not land, as { code, message, retryable, hint, source_message, step, source_changed }; the same error the write intent object carries, and steps, the per-stage outcomes a multi-step write reports up to the stage that failed, or null.

Create a webhook endpoint

POST/v1/webhooks

Registers a URL to receive events and returns the signing secret once, in the secret field; it is not shown again, only rotated. With no event_types, the endpoint receives every event type except table.row_changed; pass tables to receive table.row_changed for those tables (it is added to event_types for you). Requires a platform-wide key with manage access.

Parameters
urlstring, required

Where to post events. Must be https on a public host in production; localhost and private addresses are rejected.

descriptionstring

A label for your own reference.

event_typesarray

The event types to receive, from the names under Event types. Omit for every type except table.row_changed. At least one is required when sent.

tablesarray

table.row_changed subscriptions as { table, columns, change_types }: the published table by name, as listed by GET /v1/tables, optionally the columns an update must touch to be delivered (omit or send [] for every update), and optionally the kinds of change to deliver, any of insert, update, and delete (omit or send [] for all three). columns narrows updates only, so new rows and deletes still arrive unless change_types leaves them out: { columns: ["status"], change_types: ["update"] } delivers a row only when its status changes. Each subscription starts at the table's current position, so only changes after this call are delivered.

payload_templatestring

A JSON document, as a string, to post instead of the event object, with {{path}} placeholders filled in from each event; see payload_template on the webhook endpoint object for the rules. Placeholders are checked against the event types and tables subscribed here, so a template naming a column no subscribed table has is rejected. Omit or send null to post the event object.

stale_after_secondsnumber

How old a queued event may get before it is discarded instead of delivered, in seconds (60 to 2592000, thirty days). Set it on an endpoint that drives alerts so a receiver that was down for a while catches up on recent changes only, not on everything since it went down. Omit or send null to keep retrying every event for the full retry window.

Returns

The webhook endpoint object plus a secret field carrying the signing secret, shown only in this response. 400 invalid_url when the URL is rejected, 400 invalid_subscriptions when an event type, table, column, or change type is unknown, 400 invalid_payload_template when the template does not parse or names a field the subscriptions do not carry, 400 invalid_request when stale_after_seconds is out of range.

$ curl https://api.valtrix.com/v1/webhooks \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://yourapp.com/webhooks/valtrix", "event_types": ["table.row_changed", "connection.broken"], "tables": [{ "table": "customers_clean", "columns": ["email"], "change_types": ["update"] }] }'
{
"id": "whe_4k2m9p",
"url": "https://yourapp.com/webhooks/valtrix",
"description": null,
"status": "active",
"event_types": ["connection.broken", "table.row_changed"],
"tables": [{ "table": "customers_clean", "columns": ["email"], "change_types": ["update"] }],
"consecutive_failures": 0,
"last_success_at": null,
"last_failure_at": null,
"created_at": "2026-07-10T08:00:00Z",
"secret": "whsec_7c1f0b2e9a4d5f6a8b9c0d1e2f3a4b5c"
}

List webhook endpoints

GET/v1/webhooks

Lists every endpoint that has not been deleted, newest first, with its subscriptions and delivery health. Not paginated. Requires a platform-wide key with manage access.

Returns
webhooksarray

Webhook endpoint objects, newest first.

$ curl https://api.valtrix.com/v1/webhooks \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{
"webhooks": [{ "id": "whe_4k2m9p", "url": "https://yourapp.com/webhooks/valtrix", "description": null, "status": "active", "event_types": ["connection.broken", "table.row_changed"], "tables": [{ "table": "customers_clean", "columns": ["email"], "change_types": ["update"] }], "consecutive_failures": 0, "last_success_at": "2026-07-10T08:05:00Z", "last_failure_at": null, "created_at": "2026-07-10T08:00:00Z" }]
}

Get a webhook endpoint

GET/v1/webhooks/:id

Fetches one endpoint by id. Requires a platform-wide key with manage access.

Parameters
idpath

The endpoint id.

Returns

The webhook endpoint object, or 404 webhook_not_found.

$ curl https://api.valtrix.com/v1/webhooks/whe_4k2m9p \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "id": "whe_4k2m9p", "url": "https://yourapp.com/webhooks/valtrix", "description": null, "status": "active", "event_types": ["connection.broken", "table.row_changed"], "tables": [{ "table": "customers_clean", "columns": ["email"], "change_types": ["update"] }], "consecutive_failures": 0, "last_success_at": "2026-07-10T08:05:00Z", "last_failure_at": null, "created_at": "2026-07-10T08:00:00Z" }

Update a webhook endpoint

PATCH/v1/webhooks/:id

Changes where an endpoint posts, what it receives, what it posts, how long it keeps trying, or turns it off and on. Send only the fields to change. Requires a platform-wide key with manage access. - url: moves the endpoint. Its queue, secret, and subscriptions stay, its failure count resets, and every waiting event is sent to the new URL straight away - description: relabels it - event_types: replaces the event list - tables: replaces the table.row_changed subscriptions. A table already subscribed keeps its position and has its resync_required_at cleared; a new one starts from now. Sending tables without event_types adds table.row_changed to the current event list - payload_template: replaces or clears the custom payload - stale_after_seconds: sets or clears the age past which a queued event is discarded instead of delivered - enabled: pauses or resumes delivery - queued_events: sends or discards what is waiting

Parameters
idpath

The endpoint id.

urlstring

The new https URL to post to. Fixing a wrong URL this way keeps everything the endpoint has queued: pending events go to the new URL at once instead of waiting out their backoff, and dead events stay replayable.

descriptionstring or null

A new label for the endpoint, or null to clear it.

event_typesarray

The full list of event types to receive from now on. At least one.

tablesarray

The full list of table.row_changed subscriptions as { table, columns, change_types }, with the same meaning as on POST /v1/webhooks: change_types is any of insert, update, and delete, and an entry sent without it goes back to all three. Send [] to drop them all, together with an event_types list that omits table.row_changed.

enabledboolean

false pauses the endpoint: nothing is sent, but events keep queuing for it. true resumes it, clears its failure count, and sends the queue straight away unless queued_events says discard.

queued_eventsstring

What to do with every pending event on the endpoint. send clears the failure count and delivers them all straight away instead of waiting out their backoff, the move after a receiver that was down is back; discard marks them discarded so they are never sent, the move when the receiver should start from now, for example an alerting endpoint that would otherwise post days of stale notifications. Discarded events stay listed and can be re-queued with POST /v1/webhooks/:id/replay for 14 days. Combine with enabled: true to choose what a resumed endpoint does with its queue; on its own it acts on an active or failing endpoint, and send is refused on a disabled one.

payload_templatestring or null

Replaces the payload template: a JSON string with {{path}} placeholders to render per event, or null to go back to posting the event object. Checked against the subscriptions as they stand after this call. Queued events not yet delivered are rendered with the new template.

stale_after_secondsnumber

The age past which a queued event is discarded instead of delivered, in seconds (60 to 2592000), or null to retry every event for the full retry window. Applies to events already waiting as well as new ones.

Returns

The updated webhook endpoint object. 404 webhook_not_found, 400 invalid_url when the URL is rejected, 400 invalid_subscriptions when an event type, table, or column is unknown, 400 invalid_payload_template when the template does not fit, or when new subscriptions would orphan a placeholder in the stored template (change the template in the same call, or first), 400 invalid_request when stale_after_seconds is out of range or queued_events is send on a disabled endpoint.

$ curl -X PATCH https://api.valtrix.com/v1/webhooks/whe_4k2m9p \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "tables": [{ "table": "customers_clean", "columns": [], "change_types": [] }] }'
{ "id": "whe_4k2m9p", "url": "https://yourapp.com/webhooks/valtrix", "description": null, "status": "active", "event_types": ["connection.broken", "table.row_changed"], "tables": [{ "table": "customers_clean", "columns": [], "change_types": [] }], "consecutive_failures": 0, "last_success_at": "2026-07-10T08:05:00Z", "last_failure_at": null, "created_at": "2026-07-10T08:00:00Z" }

Preview a payload template

POST/v1/webhooks/preview

Renders a payload template against a sample event and returns what an endpoint with that template would post, without registering or changing anything. The sample is the most recent change on a subscribed table when there is one, so the preview shows real values; otherwise a synthetic event with plausible values. Pass the event_types and tables the endpoint will have so placeholders are checked against the same subscriptions the endpoint will be saved with; with neither, the template is checked against every event type and every published table. Requires a platform-wide key with manage access.

Parameters
payload_templatestring, required

The template to render, a JSON document as a string with {{path}} placeholders.

event_typesarray

The event types the endpoint will receive. Omit for every type.

tablesarray

The table.row_changed subscriptions the endpoint will have, as { table, columns, change_types } (change_types any of insert, update, and delete). Omit for every published table.

Returns
eventobject

The sample event object the template was rendered against.

bodyobject or null

The rendered payload, exactly what would be posted; null when the delivery would be skipped.

skippedboolean

true when every placeholder resolved to nothing against the sample, so this event would not be sent.

samplestring

recent_change when the sample is a real change from a subscribed table, synthetic when it was made up.

placeholdersarray

Every path the template may reference for these subscriptions: id, type, occurred_at, data.<field> for each field the subscribed event types carry, and data.row.<column> and data.previous.<column> for each column of the subscribed tables.

400 invalid_payload_template when the template does not parse or names a path the subscriptions do not carry, 400 invalid_subscriptions when event_types or tables are not valid.

$ curl https://api.valtrix.com/v1/webhooks/preview \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "payload_template": "{ \"text\": \"{{data.table}} row {{data.record_id}} changed {{data.changed_columns}}\" }", "tables": [{ "table": "customers_clean", "columns": ["email"] }] }'
{
"event": { "id": "evt_01h9x...", "type": "table.row_changed", "occurred_at": "2026-07-10T08:05:00Z", "data": { "table": "customers_clean", "record_id": "rec_9d4f2c81a7b3e650d21c4f8a", "changed_columns": ["email"], "...": "..." } },
"body": { "text": "customers_clean row rec_9d4f2c81a7b3e650d21c4f8a changed [\"email\"]" },
"skipped": false,
"sample": "recent_change",
"placeholders": ["id", "type", "occurred_at", "data.table", "..."]
}

Rotate the signing secret

POST/v1/webhooks/:id/rotate-secret

Issues a new signing secret and returns it once. Deliveries are signed with the new secret from this moment, so a server updated beforehand avoids a brief window of failed verifications. Requires a platform-wide key with manage access.

Parameters
idpath

The endpoint id.

Returns

The webhook endpoint object plus a secret field carrying the new signing secret, or 404 webhook_not_found.

$ curl -X POST https://api.valtrix.com/v1/webhooks/whe_4k2m9p/rotate-secret \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "id": "whe_4k2m9p", "url": "https://yourapp.com/webhooks/valtrix", "description": null, "status": "active", "event_types": ["connection.broken", "table.row_changed"], "tables": [{ "table": "customers_clean", "columns": [], "change_types": [] }], "consecutive_failures": 0, "last_success_at": "2026-07-10T08:05:00Z", "last_failure_at": null, "created_at": "2026-07-10T08:00:00Z", "secret": "whsec_0d3e5f7a9b1c2d4e6f8a0b1c2d3e4f5a" }

Send a test event

POST/v1/webhooks/:id/test

Posts an endpoint.test event to the endpoint right away, signed like any other delivery, and reports how your server answered, which proves the receiver and the stored secret before real events flow. An endpoint with a payload_template instead posts the template rendered against the same sample event POST /v1/webhooks/preview uses, so the receiver sees a realistic message; the delivery is still logged as endpoint.test. The attempt is recorded in the delivery log and counts toward the endpoint's failure count. Requires a platform-wide key with manage access.

Parameters
idpath

The endpoint id.

Returns
deliveredboolean

true when your endpoint answered 2xx within 5 seconds, or when the delivery was skipped.

skippedboolean

true when the endpoint's payload_template resolved no placeholder against the sample event, so nothing was posted.

http_statusnumber or null

The status your endpoint returned, or null when the request never completed.

duration_msnumber or null

How long the request took.

errorstring or null

Why the delivery failed, or null when it was delivered.

200 with the outcome either way; the endpoint's own failure is reported in the body, not as an API error. 404 webhook_not_found when the endpoint does not exist.

$ curl -X POST https://api.valtrix.com/v1/webhooks/whe_4k2m9p/test \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "delivered": true, "skipped": false, "http_status": 200, "duration_ms": 143, "error": null }

List recent deliveries

GET/v1/webhooks/:id/deliveries

The endpoint's delivery log, newest first, kept for 14 days. Page with limit and offset. Requires a platform-wide key with manage access.

Parameters
idpath

The endpoint id.

limitnumber

Deliveries per page, 1 to 200. Defaults to 50.

offsetnumber

How many deliveries to skip. Defaults to 0.

Returns
deliveriesarray

Delivery objects, newest first.

totalnumber

How many deliveries the log holds for this endpoint.

404 webhook_not_found when the endpoint does not exist.

$ curl "https://api.valtrix.com/v1/webhooks/whe_4k2m9p/deliveries?limit=20" \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{
"deliveries": [{ "id": "whd_9s2ph1", "event_id": "evt_01h9x...", "event_type": "table.row_changed", "status": "failed", "http_status": 500, "error": "Endpoint responded 500", "request_body": "{...}", "response_body": "internal error", "duration_ms": 212, "created_at": "2026-07-10T08:05:00Z" }],
"total": 1
}

List queued events

GET/v1/webhooks/:id/events

The endpoint's event queue, newest first: what is waiting to be delivered, what was delivered, what died after exhausting its retries, and what was discarded, by you or by the endpoint's stale limit. Filter with status to see just the dead or discarded ones before a replay. Page with limit and offset. Requires a platform-wide key with manage access.

Parameters
idpath

The endpoint id.

statusstring

pending, delivered, dead, or discarded. Omit for every event.

limitnumber

Events per page, 1 to 200. Defaults to 50.

offsetnumber

How many events to skip. Defaults to 0.

Returns
eventsarray

Queued event objects, newest first.

totalnumber

How many events match, across pages.

404 webhook_not_found when the endpoint does not exist, 400 invalid_status for a status outside the four.

$ curl "https://api.valtrix.com/v1/webhooks/whe_4k2m9p/events?status=dead" \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{
"events": [{ "id": "evt_01h9x...", "type": "table.row_changed", "status": "dead", "attempts": 19, "next_attempt_at": null, "delivered_at": null, "created_at": "2026-07-10T08:05:00Z", "data": { "table": "customers_clean", "record_id": "rec_9d4f2c81a7b3e650d21c4f8a", "change_type": "upsert" } }],
"total": 1
}

Replay dead or discarded events

POST/v1/webhooks/:id/replay

Re-queues events that died after exhausting their retries or were discarded, so they are delivered again from the next tick with a fresh attempt budget. Send event_ids to replay specific ones, or an empty body to replay every dead and discarded event on the endpoint. delivered and pending events are never touched. Requires a platform-wide key with manage access.

Parameters
idpath

The endpoint id.

event_idsarray

The dead or discarded events to replay, by id. Omit to replay all of them.

Returns
replayednumber

How many events were re-queued.

404 webhook_not_found when the endpoint does not exist, 400 invalid_request when event_ids is sent empty.

$ curl -X POST https://api.valtrix.com/v1/webhooks/whe_4k2m9p/replay \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
{ "replayed": 3 }

Delete a webhook endpoint

DELETE/v1/webhooks/:id

Removes the endpoint. Queued events are dropped and nothing more is sent to it; its delivery log stays readable in the console until it expires. Deleting again returns 404, so on a retry webhook_not_found means the endpoint is already gone. Requires a platform-wide key with manage access.

Parameters
idpath

The endpoint id.

Returns
deletedboolean

Always true.

404 webhook_not_found when no endpoint with that id exists.

$ curl -X DELETE https://api.valtrix.com/v1/webhooks/whe_4k2m9p \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "deleted": true }

Receive events

POST(your endpoint URL)

Every event is a JSON POST with the event object as the body. The signature is how you know the payload came from Valtrix: HMAC-SHA256 over <t>.<raw body> with your signing secret should equal v1, and a timestamp older than 5 minutes is stale. Any 2xx within 5 seconds acknowledges the event; anything else is retried with backoff, and an endpoint that keeps failing shows status failing on GET /v1/webhooks/:id and in the console.

Parameters
Valtrix-Signatureheader

Formatted as t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>" keyed with your signing secret>.

Valtrix-Event-Idheader

Unique per event. Deliveries may repeat, so a seen id means an event you have already handled.

Returns

Any 2xx within 5 seconds acknowledges the event, and the response body is ignored. The delivery itself carries the event object as its body.

POST https://yourapp.com/webhooks/valtrix
Valtrix-Signature: t=1783686600,v1=5f3a...
Valtrix-Event-Id: evt_01h9x...
{ "id": "evt_01h9x...", "type": "table.changed", "occurred_at": "2026-07-08T09:30:00Z", "data": { "table": "customers_clean", "latest_cursor": "eyJjIjoiODIzMiJ9" } }

Applets

Applets are the small interfaces an organization's members open in the Valtrix console to work across their connected systems: an import list with a button, a purchase order form, a queue of invoices to post. Each one is a JSON definition, and these endpoints create applets from definitions and publish new versions of them, so a definition can live in a repository and ship to an organization the way code does. The API takes definitions only. The assistant that writes a definition from a prose description exists in the organization console alone. Here you send the finished JSON. It is validated against the organization's connected systems and data exactly as the console validates it, every source it reads is queried once, and it is refused with the problems listed when anything does not fit. Reads work with any key; creating and updating needs write access. An organization-scoped key acts for its organization; a platform-wide key names the organization with org. Applets have to be enabled for the organization by Valtrix (403 applets_not_enabled otherwise). Nothing in the platform console shows or edits them: the organization sees them in its own console, with the version history naming the key that published each version. An applet is also a reviewed, deterministic skill an agent can run: its manual lists the inputs each action takes and what it writes, POST /v1/applets/:id/actions/:action runs one action with those inputs (confirm: true once the person agrees), and the run endpoints queue and read its automation. The applet object, the definition format (the envelope, every state kind, block type, and action kind, and the guide to sources, bindings, links, lookups, follow-up writes, and automation), the run object, and then the endpoints.

The applet object

An applet with its published definition. version and definition describe what members open now; has_draft says whether the console holds unpublished edits on top of it.

Fields
idstring

The applet id.

org_idstring

The organization the applet belongs to.

slugstring

The URL-safe name derived from the title at creation, unique within the organization. It does not change when the title does.

titlestring

The title of the published definition.

descriptionstring or null

The description of the published definition.

statusstring

live once a version is published, draft for an applet the console created and never published.

versionnumber or null

The published version number, or null before the first publish. Send it back as expected_version when updating.

definitionobject or null

The published definition, in the shape documented under The applet definition, or null before the first publish.

manualobject or null

What the applet does, generated from the published definition so it cannot drift from it, or null before the first publish: purpose (the description, else the title), inputs (one per state entry: key, kind, the label a person sees, required, default, the options of a choice, the entity of a record input, and looked_up when the definition finds that record on its own), actions (one per action: key, kind, its button label, a one-line description, the writes it makes as { entity, propagate, label }, rows_from for an action that works through rows, its guards in plain words, its confirm sentence, and automatic, when it runs on its own), reads (the sources it reads), and never (what it never does). The card to read before POST /v1/applets/:id/actions/:action.

automationobject or null

The state of the applet's automatic action, or null when the published version has none: the action key, its trigger in words, armed, paused, next_run_at, and last_run_at.

published_atstring or null

When the published version was published, as an ISO 8601 timestamp.

published_byobject or null

Who published it: { kind, id, name }, with kind: "key" for a publish through this API (the key's name) or user for one from the console.

notestring or null

The note sent with the published version, or null.

has_draftboolean

Whether the organization console holds unpublished draft changes. An update refuses with applet_draft_exists while it does, unless replace_draft is true.

created_atstring

When the applet was created.

updated_atstring

When the applet or its draft last changed.

{
"id": "app_4k2m9x",
"org_id": "org_7f3k2m",
"slug": "import-housecall-pro-work-orders-into-sage-100",
"title": "Import Housecall Pro work orders into Sage 100",
"description": "Work orders from Housecall Pro that are not in Sage 100 Contractor yet.",
"status": "live",
"version": 3,
"definition": { "version": 1, "title": "Import Housecall Pro work orders into Sage 100", ... },
"manual": {
"purpose": "Work orders from Housecall Pro that are not in Sage 100 Contractor yet.",
"inputs": [{ "key": "rows", "kind": "rows", "label": "the selected rows", "required": false, "default": null, "options": null, "entity": null, "looked_up": false }],
"actions": [{ "key": "import", "kind": "upsert_each", "label": "Import into Sage 100", "description": "Creates or updates one order record per selected row of the selected rows.", "writes": [{ "entity": "order", "propagate": true, "label": null }], "rows_from": "the selected rows", "guards": [], "confirm": "Import {{ count(state.rows) }} work orders totalling {{ money(sum(state.rows, 'total')) }} into Sage 100 Contractor?", "automatic": null }],
"reads": ["order records from housecall-pro"],
"never": ["Skips a row whose _external_id already appears as _external_id on a order from sage-100-contractor record."]
},
"automation": null,
"published_at": "2026-09-30T09:12:00Z",
"published_by": { "kind": "key", "id": "key_8m2kf4", "name": "Deploy" },
"note": "Adds the placed date column",
"has_draft": false,
"created_at": "2026-09-12T14:00:00Z",
"updated_at": "2026-09-30T09:12:00Z"
}

The applet definition

An applet is a JSON document with "version": 1, a "title", an optional "description", an optional "theme" (the look, see Appearance), an optional "types" (record types the organization owns, see Custom types), an optional "inbox" (an email address files can be forwarded to, see Inbox), "state" (the inputs, keyed by name), "blocks" (rendered top to bottom) and "actions" (what buttons do, keyed by name), with an optional "computed" (values worked out per row on the server for charts, totals and filters, see Computed fields). A fixed runtime renders it from shared components; nothing in it is code. Every block except a section may carry "visibleWhen", a binding over state and result that hides the block while falsy (see Showing and hiding blocks).

Fields
versionnumber, required

Always 1.

titlestring, required

What the applet is called, at most 120 characters. It becomes the applet's title and the base of its slug.

descriptionstring

One or two sentences on what the applet does, at most 500 characters, shown on the applet's tile.

themeobject

How the applet looks, a closed set of named choices: accent: a six-digit hex color (#1f6f43) for buttons, focus rings, selected rows and charts; a color too light to read white text on is darkened when shown; background: a six-digit hex color (#0b1f4d) for the page behind the applet, light or dark; text, cards, borders, buttons and status colors follow it so everything stays readable (a dark background gives light text on cards a shade lighter than the page), and a color in between is lightened or darkened when shown. There is no separate text or card color; font: default, system, arial, verdana, tahoma, georgia, times, mono; default is the console font, system is the device font, mono is fixed-width; textSize: normal, large, xlarge; large and xlarge scale every text in the applet, for a shop floor screen or a phone in the field; density: comfortable or compact; compact tightens the spacing so more rows fit; corners: square, rounded, round; rounded is the default; logo: the organization logo shown above the applet; a person sets it from the Appearance menu, it is never shown to you and you never write it. See Appearance under Writing a definition.

typesobject

Record types the organization owns, keyed by slug, each { label, pluralLabel, description, titleKey, columns }. Their records are kept in Valtrix only. See Custom types under Writing a definition.

pagesarray

Splits a large applet into 1 to 6 pages, each { key, title } with the key p1, p2 and so on. The applet then shows a page menu and one page at a time. Every top-level block names its page in page, every key under state, actions, lookups, computed and links starts with the key of its page and an underscore (p2_customer), and a page reads only its own keys. The limits on blocks, tabs and lookups then count for each page.

inboxobject

Gives a published applet an email address of its own: { accept? }, with accept a list of pdf, image, spreadsheet. Files attached to an email forwarded to that address become document records the applet lists. See Inbox under Writing a definition.

stateobject, required

The inputs, keyed by name: each value is one of the state kinds below. A record state is null until picked; a rows state is filled by a selectable table or an entry block.

blocksarray, required

What the page shows, top to bottom, 1 to 40 of the block types below. A section block nests blocks behind a dependsOn, and a panel block inside a section folds some of them away.

actionsobject, required

What buttons do, keyed by the name a button block names in its action: each value is one of the action kinds below.

computedobject

Named values worked out from each row of one entity type or table on the server, each { records, value } or { table, value }, which a chart groups by, a metric totals and a source filter compares, at most 20. See Computed fields under Writing a definition.

lookupsobject

Named maps from one value to another, read with lookup(name, key) in any binding, at most 10. See Lookups under Writing a definition.

linksobject

Remembered matches between a record of one connected system and a record of another, keyed by name. See Links under Writing a definition.

{
"version": 1,
"title": "Import Housecall Pro work orders into Sage 100",
"description": "Work orders from Housecall Pro that are not in Sage 100 Contractor yet. Select the ones to import and press Import.",
"state": {
"rows": {
"kind": "rows"
}
},
"blocks": [
{
"type": "heading",
"text": "Import Housecall Pro work orders into Sage 100"
},
{
"type": "text",
"text": "Work orders from Housecall Pro that are not in Sage 100 Contractor yet. Select the ones to import and press Import."
},
{
"type": "table",
"state": "rows",
"source": {
"records": "order",
"connector": "housecall-pro",
"filters": [
{
"column": "_external_id",
"op": "not_in_entity",
"target": {
"entity": "order",
"column": "_external_id",
"connector": "sage-100-contractor"
}
}
],
"order": {
"column": "_changed_at",
"direction": "desc"
},
"limit": 500
},
"columns": [
{
"key": "number",
"label": "Work order"
},
{
"key": "customer_name",
"label": "Customer"
},
{
"key": "status",
"label": "Status"
},
{
"key": "total",
"label": "Total",
"format": "money"
},
{
"key": "placed_at",
"label": "Placed",
"format": "date"
}
],
"selectable": true,
"empty": "Nothing waiting to be imported."
},
{
"type": "stats",
"items": [
{
"label": "Selected",
"value": "{{ count(state.rows) }}"
},
{
"label": "Total",
"value": "{{ money(sum(state.rows, 'total')) }}"
}
]
},
{
"type": "button",
"action": "import",
"label": "Import into Sage 100",
"enabledWhen": "{{ count(state.rows) > 0 }}"
},
{
"type": "result",
"action": "import"
}
],
"actions": {
"import": {
"kind": "upsert_each",
"from": "rows",
"entity": "order",
"externalId": "{{ row._external_id }}",
"data": {
"number": "{{ row.number }}",
"customer_name": "{{ row.customer_name }}",
"total": "{{ row.total }}",
"currency": "{{ row.currency }}",
"status": "{{ row.status }}",
"placed_at": "{{ row.placed_at }}"
},
"propagate": true,
"confirm": "Import {{ count(state.rows) }} work orders totalling {{ money(sum(state.rows, 'total')) }} into Sage 100 Contractor?"
}
}
}

The applet run object

One run of an applet's automatic action, whether the schedule, a sync, or POST /v1/applets/:id/runs started it. The page's run history is the same list.

Fields
idstring

The run id.

triggerstring

sync after a connector sync, schedule on the interval or daily clock, run_now for a run a person or an API key queued.

statusstring

queued, running, succeeded, failed, or skipped (nothing ran: the automation was off or paused, writes from the previous run were still pending or had failed, or a connection it needs was not connected; reason says which).

reasonstring or null

Why the run was skipped, or what a succeeded run left for the next one.

errorstring or null

The failure, on a failed run.

queued_atstring

When the run was queued.

started_atstring or null

When it started executing.

finished_atstring or null

When it finished.

duration_msnumber or null

How long it ran.

rows_seennumber

Rows the automation's source and row rule selected.

rows_writtennumber

Rows written in this run, up to the per-run cap.

rows_failednumber

Rows whose write failed; a failure stops the run.

write_intent_idsarray

The write intents the run produced, one per propagated row; read them with GET /v1/write-intents/:id.

requested_bystring or null

Who queued a run_now run: a console user's name, or an API key's name followed by (API key).

{
"id": "arun_8h2k1m",
"trigger": "run_now",
"status": "succeeded",
"reason": "3 of 12 rows written, the rest wait for the next run.",
"error": null,
"queued_at": "2026-10-25T07:00:02Z",
"started_at": "2026-10-25T07:00:04Z",
"finished_at": "2026-10-25T07:00:09Z",
"duration_ms": 5120,
"rows_seen": 12,
"rows_written": 3,
"rows_failed": 0,
"write_intent_ids": ["wi_2k9f1a", "wi_2k9f1b", "wi_2k9f1c"],
"requested_by": "Deploy (API key)"
}

Definition format

Every state kind, block type, and action kind a definition can use, and the guide to sources, bindings, links, lookups, follow-up writes, and automation. Open a part to read it; the envelope is under The applet definition above.

State kinds7

The kinds a state entry may declare. Each entry is { "kind": "<name>", ...fields }.

record

One record of an entity type, chosen with a picker block, or looked up on its own through a default (see Defaults).

entity

the entity type slug the picker reads

default

optional { filters?, search?, pick?, source?, note? }. The record is looked up on the server and filled in without a pick. The lookup runs whenever the state and result values it reads change, until the person picks something else. filters are [{ column, op, value }] with bindings over state and result: "number" eq "{{ state.project.number }}" finds the accounting job with the picked project's number. search is a binding whose text is searched across the picker's columns: "{{ result.read_quote.header.issuer }}" finds the vendor a quote names. pick decides what happens when several rows match. By default the record is filled only when exactly one matches; "first" takes the first row in the source's order (the latest purchase order). source is required on a record state with no picker, which is a hidden lookup; it has the same shape as a block source, with order and connector. A record state with a picker looks in that picker's source and must not declare one. note is a short line shown beside the picker while the value came from the default ("From the quote letterhead"). A filter or search whose binding is still empty fills nothing

rows

A list of rows: the rows a person selected in a selectable table block, or the lines a person typed or pasted into an entry block; the block names this state in its "state".

text

A free-text input, edited with a field block.

default

optional binding over state and result, evaluated when the applet opens or resets and again whenever state or a result changes, until the person types into the field: "{{ result.read_quote.header.customer_reference }}" copies the job reference off a read document, "{{ concat(number(before(state.latest_order.number, ' - ')) + 1, ' - ', after(state.job_last_order.number, ' - ')) }}" numbers the next order after the latest one

number

A numeric input, or with "total" a figure the server works out from the records and keeps current.

default

optional binding over state and result

total

optional { records, connector?, fn, column?, filters? }. The state is then not typed by anyone: the server totals the records and fills it, again whenever a state its filters read changes and again when an action runs, so a write and its allowedWhen always see the current figure. fn is one of count, sum, avg, min, max; count takes no column, the others total a number column of records. filters are [{ column, op, value }] with bindings over state: the hours the picked employee already has this week are { "kind": "number", "total": { "records": "time_entry", "fn": "sum", "column": "hours", "filters": [{ "column": "employee_id", "op": "eq", "value": "{{ state.employee._record_id }}" }, { "column": "started_at", "op": "gte", "value": "{{ state.week_start }}" }, { "column": "started_at", "op": "lt", "value": "{{ add_days(state.week_start, 7) }}" }] } }. While a state a filter reads is empty the total is empty; a sum or a count with no matching records is 0. It is read like any state, state.hours_so_far, in a stats or text block, a default, visibleWhen, enabledWhen, allowedWhen, a computed column, and a write. It takes no default and no field block, and its filters cannot read another total (see Totals a form acts on)

date

A date input (YYYY-MM-DD).

default

optional binding over state and result

boolean

A checkbox.

default

optional binding over state and result

choice

A dropdown over a fixed option list, or over the distinct values a source holds in one column.

options

[{ value, label }] for a fixed list, or { source, column } to offer every distinct value of that column among the rows the source's filters admit, each option labelled with the value and how many rows carry it; column may name a key of a keyed column (wbs.Locations), so a dropdown of the location codes on the picked estimate's lines is { "source": { "records": "line_item", "connector": "sage-estimating", "filters": [{ "column": "document_id", "op": "eq", "value": "{{ state.estimate._record_id }}" }] }, "column": "wbs.Locations" }, and a table filtered { "column": "wbs.Locations", "op": "eq", "value": "{{ state.location }}", "optional": true } shows every line until a location is picked and only that location's lines after. The field block that shows a sourced choice lists the state keys its filters read in dependsOn, or sits in a section that does

options may instead be { "members"

true }: the dropdown lists the people who can open this applet (its owners, admins, and the members it is shared with), and the state holds the chosen person's id. member_name(state.assignee) and member_email(state.assignee) give their name and email in any binding. This is how work is assigned to a person (see Work queues). { "members": "organization" } lists every person in the organization instead, whether or not the applet is shared with them: the choice for an applet an owner or admin uses to set people up, such as linking each login to their employee record, where the people listed should not need the applet themselves. Only an owner or admin is shown the whole organization; for a member the same dropdown lists the people who can open the applet, so never use it for a choice a member has to make

default

optional option value, or a binding over state and result that gives one: "{{ state.employee.time_entry_role }}" starts the dropdown on the role saved on the opened employee. A binding is evaluated when the applet opens or resets and again whenever state or a result changes, until the person picks something; a value that is not one of a fixed list's option values leaves the dropdown empty, so the option values must be spelled exactly as the saved values are

multiple

true makes it a list of tick boxes that holds several values at once, up to 50, for a fixed list or a sourced one, never for members; it takes no default and starts with none ticked. The state is then a list: a source filter reads it with op "in" and "values": ["{{ state.statuses }}"] (with "optional": true the list shows every row while nothing is ticked), a write stores it as text with "{{ join(state.statuses, ', ') }}", and a block that lists it in dependsOn waits until at least one is ticked. Use it when a person asks to filter by several statuses, types or people at once, or to tick the options that apply

Blocks22

The block types, rendered top to bottom. Each block is { "type": "<name>", ...fields }.

heading

A section title.

text

binding over state and result

size

optional, small, medium, large; medium when omitted

text

A paragraph of explanatory text.

text

binding over state and result

tone

optional, info, good, warn, bad; the paragraph becomes a tinted note in that tone (a warning before a write, a confirmation); plain text when omitted

picker

A searchable dropdown that fills a record state from a source. Search runs on the server across the source columns used by its display and detail bindings and matching tables; page controls reach further results. The selected record stays selected while searching. A person who reaches a picker with the keyboard and starts typing opens it with what they typed already searched, so no click is needed first.

state

the record state it fills (its entity must match the source)

label

the input label

source

a records or table source (see Sources)

display

binding over row, the option text, e.g. "{{ row.name }}" (a reference column shows the record it names through row._refs, e.g. "{{ row._refs.customer_id._title }}")

detail

optional binding over row shown after the display text, e.g. "{{ row._external_id }}"

search

optional binding over state and result, the text the search box starts with, so the matching options are listed first (a client picker searched by the customer's name on the picked job: "{{ state.job.customer_name }}", a vendor picker searched by the supplier a read quote names: "{{ result.read_quote.header.issuer }}"); the person can clear or change it

remember

optional { link, from }. link names a link declared under "links" whose entity and connector the picker source matches. from is a binding over state and result giving what the pick is remembered for. For an ordinary link, from names the record the pick belongs to, such as the customer of the picked invoice: "{{ state.invoice.customer_id }}". For a link declared with "key": true, from is a piece of text: the supplier name a read quote prints, "{{ result.read_quote.header.issuer }}", or a fixed word such as "{{ 'this applet' }}" to remember one pick for the whole applet. The pick is stored for the organization and pre-selected the next time the same record or text comes up, in this applet or any other that declares the same link. Picking a different record replaces it. Rows and picked records read the remembered record under _links (see Links). A picker with both remember and a default tries the remembered pick first. The default lookup runs only when nothing is remembered

clears

optional list of other state keys emptied when a person changes this input, never when a default or the applet itself fills it: the cost code picked for one job when another job is picked, the two custom dates when a preset period is chosen. It names record, text, number, date, boolean or choice states, never a rows state, and one change clears once: a cleared input does not clear others in turn

check

optional { ok, note? }, like a field's: a tick under the picker while ok is truthy, the note in amber while it is not (a vendor matched from the document: "ok": "{{ state.vendor }}", "note": "No vendor matches the name on the invoice")

dependsOn

every state key the source filters read; the picker re-queries when one changes

table

A table with server-side pagination, column sorting, search and filters. With "selectable" it has a checkbox column and writes the selected rows into a rows state; "editable" columns can be typed into before a write.

source

a records or table source

columns

[{ key, label?, value?, rollup?, format?, align? }]. key is a source column, or any name when "value" is a binding over row (a computed column, also stored on selected rows under that key); a value may only read columns the row carries, so a reference column (employee_id) is shown by the record it names, "value": "{{ row._refs.employee_id._title }}" with "recordLink": "{{ row.employee_id }}", never by a column the entity does not have. rollup: { records, by?, fn, column?, connector?, filters?, order? } makes the column a total the server computes per row over another entity whose rows reference this one: the budget of each job is { "key": "budget_total", "label": "Budget", "format": "money", "rollup": { "records": "budget_line", "fn": "sum", "column": "revised_amount" } }, the posted cost of each job { "rollup": { "records": "cost_transaction", "fn": "sum", "column": "amount", "filters": [{ "column": "status", "op": "eq", "value": "posted" }] } }, the invoices billed to each customer { "rollup": { "records": "invoice", "fn": "count" } }. records is the entity totalled, by the reference column of it that names this table's row (project_id on budget_line), inferred when only one points here, fn one of count, sum, avg, min, max over column (a number column of records), connector narrows to one connection. filters may bind state (the days off taken in the picked year: { "column": "starts_on", "op": "gte", "value": "{{ concat(state.year, '-01-01') }}" }), and the block then lists that state in dependsOn. The total rides on the row under key, so a later computed column may read row.budget_total; a rollup column cannot be sorted, filtered, or edited. fn first or list shows a value of those records instead of a total, which is how a list shows something kept in a separate record that points at each row: the equipment assigned to each pay group is { "key": "equipment", "label": "Equipment", "rollup": { "records": "<the assignment type>", "fn": "list", "column": "equipment_id" } }, the latest note on each job { "rollup": { "records": "<the note type>", "fn": "first", "column": "body", "order": { "column": "_changed_at", "direction": "desc" } } }. column is then any column of records: a text, number, date or yes/no column shows its value, and a reference column shows the name of the record it points at. first gives the value of one record, the first in order ({ column, direction: asc | desc }, allowed only with first and list); list gives the different values separated by commas, at most 10 and then "+N more". A row nothing points at shows nothing. An entry column takes only the totals. A rollup whose filters read the row is matched to each row by those filters instead of by a reference column, which is how a row is placed against a list that does not point at it: a band of numbers, a bracket, a tier, a period of dates, a rule kept per code. It takes no "by". The range an account number falls in is { "key": "range_class", "label": "Expected classification", "rollup": { "records": "<the range type>", "fn": "first", "column": "classification", "filters": [{ "column": "range_from", "op": "lte", "value": "{{ row.number }}" }, { "column": "range_to", "op": "gte", "value": "{{ row.number }}" }] } }: for every account the server keeps the ranges whose from is at or below the account number and whose to is at or above it, and shows the classification of the first. A second column reads another value of the same range (its expected debit or credit balance) with the same filters, and a count with those filters says how many ranges an account falls in. A filter binds row to a column the row carries or to row._refs.<reference column>.<column>, never to a computed or another rollup column; filters that read only state narrow the list as usual, and "any" groups alternatives. Numbers compare as numbers, also when either side keeps them as text, dates as dates, and anything else as text. The cell is empty (a count is 0) when no record matches and while a value a filter reads is empty on that row. Every fn works: first and list show a value, count, sum, avg, min and max total the matching records. The list matched against holds at most 2000 records after its state filters, so match rows against a list of rules, bands or periods, not against every transaction. A later computed column and rowTones then compare the row with what was found: { "key": "check", "label": "Check", "value": "{{ if(not row.range_class, 'No range', if(row.range_class != row.classification, 'Wrong classification', 'OK')) }}" } with "rowTones": [{ "when": "{{ not row.range_class }}", "tone": "warn" }, { "when": "{{ row.range_class != row.classification }}", "tone": "bad" }]. format: text, number, money, date, status. recordLink: optional binding returning a record id to link to its console detail. editor: optional { type: text | number | date | choice | multiline | record, options?: [{ value, label }], entity?, connector?, display?, required?, min?, max?, maxLength? } on editable columns. A record editor ({ type: "record", entity, connector?, display }) adds a searchable picker cell to every row over that entity, filtered to the connector when set, with display a binding over the picked row for the option text; the column takes a key of its own (not a column of the rows), the picked record id rides on the selected row under that key, and a write binds it into a reference column ("cost_code_id": "{{ row.sage_cost_code }}"), which is how lines read from one system get a cost code, job, or account from the system the write lands in, chosen per line. The picked record itself is read under row._refs.<key>, exactly like the record a reference column names: "{{ row._refs.sage_cost_code._title }}" is its display name and "{{ row._refs.sage_cost_code.code }}" any column of it, in a later computed column and in the write. A record editor may carry filters that narrow its options by the other cells of the same row and by state (see Choices that depend on other choices)

a column of a records source may carry "sort"

"number" when it is a text column that holds numbers (a code, a lot number, an item number kept as text). The table then orders by that column as a whole number on the server, 2 before 10 before 100, where a text column otherwise orders character by character (10, 100, 2), both when a person presses the column heading and when the source's own "order" names that column: { "key": "number", "label": "Lot", "sort": "number" } with "order": { "column": "number", "direction": "asc" } on the source. A value that is not a plain number (letters, a dash, several dots) comes after all the numbers. It is not for a number, date or computed column, which already sort by their value or cannot be sorted by, and not for a published table. Never answer that a code kept as text cannot be sorted as a number

pageSize

rows per page, defaults to 25, at most 100; browsing can reach every matching row

recordState

optional record state matching the source entity, set on row click; without it, a read-only table automatically uses the one picker with exactly the same source, if unambiguous

list

optional { title, subtitle?, amount?, tags? } shows each row as a compact two-line item instead of a row of columns, for a work queue a person goes through one item at a time: title and subtitle are bindings over row and state ("{{ concat('#', row.invoice_number, ' ', row._refs.payee_id._title) }}", "{{ date(row.issued_at) }}"), amount a binding shown at the right ("{{ money(row.total, 'USD') }}"), and tags up to 4 of { text, tone?, when? } shown as small chips beside the title, each only while its when binding is truthy ({ "text": "Urgent", "tone": "bad", "when": "{{ days_between(today(), row.due_at) < 3 }}" }, { "text": "{{ row.review_status }}" }). A list needs recordState: clicking an item fills it and the item stays highlighted, and the sections that depend on that state show the opened item, in a pane beside the list (see pane on section) or in a modal. columns are still declared, since search, sort and download use them. A list is neither selectable nor editable

openRuns

optional key of a read_document action that runs each time a row is opened into recordState (the stored reading is served at once after the first time), so the fields that default from the document fill in for the opened item. It may name a load_rows action instead, which then fills its grid each time another row is opened: the lines of the opened order, or one line per day of the opened booking, with no button to press

clears

optional list of other state keys emptied when a row is opened into recordState, so two lists that feed the same work area (new files and saved items) never leave both open at once

openLabel

the text of the row action that opens a row into recordState ("Match client", "Review"), "View details" by default; name it after what the person does in the section that opens

state

the rows state that receives the selection (requires selectable: true)

selectable

adds the checkbox column; select all affects the current page and selections persist across page, search and sort changes

editable

column keys a person may edit in place; editor.type chooses the input (otherwise inferred from format); the edited value rides on the selected row

marks

optional [{ key, label, unlabel?, reason? }], up to 4. Each mark adds a button on every row that stamps the row with that key for this applet ("Skip" on invoices that must never be posted); pressing it again, or the unlabel button on a row already marked, removes the stamp; reason: true asks for a short note (at most 300 characters) when marking. Marks are kept for the applet, so a source filter with op not_marked and the mark key as value hides marked rows for good, and a second table with op marked lists them with "{{ row._marks.<key>.reason }}" for the note; the mark buttons on that table remove the mark

remove

optional { label?, confirm?, allowedWhen?, denied? }. Adds a button on every row that deletes the record behind the row outright, after a confirmation, so it leaves this table and every other applet and list that reads it; it cannot be undone. Use it when a person asks to delete, discard or remove an item for good (a queued time entry entered by mistake, a draft request nobody will send); use a mark instead when the item should only leave one list or be brought back later. Only records kept in Valtrix can be removed: ones written by an applet upsert with no "propagate", of a custom type or a canonical one. The button is not shown on a row that came from a connected system or that has been written into one, and the server refuses those, so a list that mixes both keeps a mark for the rest. The lines saved with the record and its marks go with it. The table must read a records source, without a connector. label is the button text ("Remove" by default, at most 40 characters), confirm the sentence shown in the confirmation, a binding over row and state ("Delete the entry of {{ row.hours }} hours on {{ date(row.work_date) }} for good?"), allowedWhen a binding over row, state and user that must be truthy for the button to show and for the server to remove the row ("{{ user.role != 'member' or row.submitted_by_id == user.id }}"), and denied the message shown when it refuses. Both bindings read the row's own source columns, _refs and _marks, never a computed column of the table

rowActions

optional [{ action, label, visibleWhen?, danger? }], up to 3. Each adds a button on every row that runs an upsert action of the applet on that row without opening it: the row is placed in the table's recordState for that one run, exactly as if the person had opened the row and pressed a button bound to the action, so the action reads the row as state.<recordState> ("externalId": "{{ state.entry._external_id }}") and the table must set recordState. Use it when a person wants one click on a list row to write something: reject, approve, void, reopen, or a Delete that sets a status so the item leaves every list ("status": "rejected"), where a mark would only hide the row in this applet and remove would delete the record. The action's own confirm text is shown first and its allowedWhen and denied decide on the server who may run it; visibleWhen is a binding over row, state and user that only hides the button on rows it does not apply to ("{{ row.status == 'pending' }}"), and danger: true colours it as destructive. A row action with visibleWhen needs allowedWhen on its action, since hiding a button stops nobody on the server. The action must read state.<recordState>, must not write lines, and should read nothing a person types on the opened form, since the form is not open when the button is pressed

rowTones

optional [{ when, tone }], up to 4. Each sets the look of every row whose "when" binding over row, state and user is truthy, and the first rule that holds wins. tone is one of muted, info, good, warn, bad: muted prints the row in lighter text (rows that matter less, such as equipment lines among labor lines), and the others tint its background (info gray, good green, warn amber, bad red). "when" reads the row's own columns, its computed and rollup columns, and _refs: { "when": "{{ row.kind == 'equipment' }}", "tone": "muted" }, { "when": "{{ row.hours > 12 }}", "tone": "warn" }. Use it whenever a person asks for some rows to be shaded, greyed, lighter, highlighted, or colored by a condition; one figure in a totals table is colored with tones on a chart of kind table instead

a column may carry visibleWhen, a binding over state and user

the column, heading and cells alike, is left out of the table and of its download while it is falsy ("visibleWhen": "{{ state.job.certified_payroll }}" shows a column only for a certified job, "{{ user.role != 'member' }}" only to owners and admins). It only takes the column out of view, the rows still reach the browser; an editable column cannot carry it, and at least one column always shows

dependsOn

every state key the source filters read that the enclosing section does not already list; the table re-queries and clears its selection when one changes

empty

text shown when the source was queried and returned no rows (while a dependsOn state is unset the source is not queried and the runtime shows which pick it waits for)

downloadFiles

true, or { name }, adds a Download files link under the table that saves the newest stored file of every row matching the current search and filters as one zip (the invoice images of one vendor or one job for an audit). name is a binding over row and state for each file's name without its extension ("{{ concat(row._refs.payee_id._title, ' ', row.invoice_number) }}"); the stored name is kept when omitted. Set it only on a list of records that carry files and only when the request asks to download, export, or hand over the files

download

true adds a Download link under the table that saves all the rows matching the current search and filters as an Excel file, with the table's columns. Set it only on a list the request asks to export, download, or open in Excel (a report); leave it off every other table

entry

A grid a person fills in by hand: lines that exist in no connected system yet (the lines of a supplier quote, the scope lines of a new subcontract, a list from an email). It has no source. Every column without "value" is an input the person types into; computed columns are evaluated from the typed cells. The lines fill a rows state, which a write reads like selected table rows ("lines" on an upsert, "from" on an upsert_each).

state

the rows state the lines fill

columns

[{ key, label?, value?, rollup?, format?, editor? }]. A column with "rollup" is a total the server works out for each line over records in a connected system: { records, of, by?, fn, column?, connector?, filters? }. of is a binding that gives the record the total is for, the record picked in a cell of the line ("{{ row.employee }}", a record editor column) or a picked record ("{{ state.employee._record_id }}"); by is the reference column of records that holds it (employee_id on time_entry), inferred when only one fits; fn and column are as on a table rollup; filters bind state and the typed cells of the line, so the hours each line's employee already has on that line's date is { "key": "hours_that_day", "rollup": { "records": "time_entry", "of": "{{ row.employee }}", "fn": "sum", "column": "hours", "filters": [{ "column": "started_at", "op": "gte", "value": "{{ row.work_date }}" }, { "column": "started_at", "op": "lt", "value": "{{ add_days(row.work_date, 1) }}" }] } }. The total rides on the line under key, a later computed column reads it as row.hours_that_day, nobody types it, and the server works it out again when an action runs. A sum or count with no matching records is 0, and the cell is empty until the record and every cell a filter reads are filled (see Totals a form acts on). key is any name the applet chooses (it becomes row.<key> in bindings and in the write); a column without "value" is typed by the person, with editor { type: text | number | date | choice | multiline | record, options?, required?, min?, max?, maxLength? } (number inferred from format money or number); a column with "value" is computed over row and state

editor { type

"record", entity, connector?, display } makes the cell a searchable picker over that entity, filtered to the connector when set (a cost code per scope line from the Sage 100 connection); display is a binding over row for the option text ("{{ concat(row.code, ' ', row.name) }}"), the cell holds the picked record id, and the write binds it straight into a reference column ("cost_code_id": "{{ row.cost_code }}"); an id that no longer resolves is dropped before the write and a required cell then fails validation. The picked record is read under row._refs.<key>, whatever its entity: "{{ row._refs.employee._title }}" is its display name and "{{ row._refs.cost_code.code }}" any column of that entity. A later computed column shows it on the line as soon as the person picks ({ "key": "code_name", "value": "{{ row._refs.cost_code.name }}" }), and a write stores it as text beside the id ("employee_id": "{{ row.employee }}", "employee_name": "{{ row._refs.employee._title }}", "cost_code_id": "{{ row.cost_code }}", "cost_code": "{{ concat(row._refs.cost_code.code, ' ', row._refs.cost_code.name) }}"). It is empty while nothing is picked, and the server reads the record again when an action runs, so the browser never supplies it. A rollup and an editor filter read the cell itself (row.employee), not row._refs

a column with "rollup" and fn first is a lookup

for each line the server finds the one record that matches and puts a value of it on the line, which is how a line picks up something kept in another list (the pay group a job pays for the equipment on the line, the rate agreed for a customer and an item, the approver of a cost code). { "key": "equipment_group", "label": "Pay group", "rollup": { "records": "<the rule type>", "of": "{{ state.job._record_id }}", "by": "project_id", "fn": "first", "column": "pay_group_id", "filters": [{ "column": "equipment_id", "op": "eq", "value": "{{ row.equipment }}" }] } } reads, on every line, the pay group of the rule kept for the picked job and the equipment picked on that line. of and by say which records are looked in, exactly as on a total, filters narrow them by state and by the typed cells of the line, and order decides which record is taken when several match. The cell is empty when nothing matches and while a cell a filter reads is empty. column is any column of records: a text, number, date or yes/no column gives its value; a reference column gives the id of the record it names, which a write binds straight into a reference column, while the grid shows that record by its name and row._refs.<key> reads it like a picked record ("{{ row._refs.equipment_group._title }}", "{{ row._refs.equipment_group.regular_rate }}"); and column "_record_id" gives the matching record itself, read with all its columns under row._refs.<key>. A later computed column chooses between several lookups and what the person picked, first match wins: { "key": "pay_group_final", "value": "{{ coalesce(if(row.foreman == 'yes', row.foreman_group, null), row.equipment_group, row.cost_code_group, row.pay_group) }}" }, and the write sends row.pay_group_final. That computed column holds only the id it chose, so row._refs.pay_group_final does not exist: a column of the chosen record (its name, its rate) is chosen the same way from the lookups themselves, { "key": "group_rate", "value": "{{ coalesce(if(row.foreman == 'yes', row._refs.foreman_group.regular_rate, null), row._refs.equipment_group.regular_rate, row._refs.cost_code_group.regular_rate, row._refs.pay_group.regular_rate) }}" }. Nobody types a lookup, and the server looks it up again when an action runs (see Looking a value up)

a column may carry visibleWhen, a binding over state and user

the column is left out of the grid while it is falsy ("visibleWhen": "{{ state.job.certified_payroll }}" shows a Foreman column only once the picked job is a certified payroll job). A hidden cell a person fills in is emptied and stays empty, in the browser and again on the server when an action runs, so nothing typed before the column was hidden is written and its "required" is not asked for. A hidden computed or lookup column is still worked out, so a later column and the write may read it. At least one column a person fills in always shows

a record editor may carry filters, [{ column, op, value | values, optional? }] like a source's, whose bindings read row (the other cells of the line being edited, by their column keys) and state, so the options of one cell follow what the person chose in another cell of the same line or in the header (see Choices that depend on other choices)

a record editor may carry first, { column, target

{ entity, column, connector?, filters? }, format? } as on a records source (see Sources): the options whose column value appears in that column of the other entity are offered first and the rest follow, and the target filters may bind row and state, so a cost code cell offers the codes on the budget of the job picked in the header first; label, restLabel and tone head and color the two groups in the dropdown, as on a picker

selectable

adds a checkbox per line so the person ticks which lines go into the write; without it every line goes

selected

with selectable, whether the lines a read action fills in from a document start ticked: "all" (the default, the person unticks what should not go) or "none" (the person ticks what should go); lines the person types or pastes always start ticked

a column's editor may carry default, a binding over state and result that fills the cell of every new line (typed, pasted, or read from a document) while the cell is empty

the cost code of the vendor's last bill, the picked job. On a record editor the default is a record id and defaultLabel is the text shown for it: "default": "{{ state.last_line.cost_code_id }}", "defaultLabel": "{{ state.last_line._refs.cost_code_id._title }}", where last_line is a hidden record state looked up from what the person coded last time. This is how an applet remembers how a vendor is usually coded

a default fills a cell once, when its line is added. editor.refill, "empty" or "always", applies it again to the lines already in the grid every time the default's value changes, which is when the record it reads is picked or changed

"empty" fills the cells that are still empty, so lines that were read from a document or typed before the customer was picked get that customer's usual value once it is; "always" replaces what every line holds, what a person typed there included, and empties the cell when the default becomes empty, so the cell follows the picked record and what the person types afterwards stays until that record changes again. { "key": "ship_from", "label": "Ship from", "editor": { "type": "record", "entity": "location", "display": "{{ row.name }}", "default": "{{ state.customer.location_id }}", "defaultLabel": "{{ state.customer._refs.location_id._title }}", "refill": "always" } } keeps the Ship from cell of every order line on the picked customer's usual location. The cell stays the person's own editable cell, and the write reads it as row.ship_from. Use refill whenever a person asks for a cell that defaults from, follows, refreshes from or reloads from something picked elsewhere on the form, instead of a computed column beside the cell. On a grid with "load" only "empty" is allowed, since "always" would replace the lines that were saved. Never answer that a default cannot fill lines already in the grid or cannot replace a cell that holds a value

paste

true adds a box the person pastes lines into, one line per row, cells split on tabs, commas, semicolons, or runs of spaces and mapped onto the input columns in order; a trailing price is read into the last column when that column is numeric

addLabel

the text of the add-line button, "Add line" by default

blankLines

optional number from 1 to 20. The grid then opens with that many empty lines ready to type into, and keeps one empty line at the bottom: as soon as a person types into the last line, a fresh one appears under it, so nobody presses Add line. A line nobody typed into is not a line: it is left out of the rows state, of every total, of "required", and of the write. A cell default fills a line when the person starts typing on it. Use it when a person asks for a grid that starts with some blank rows, that adds a row by itself, or that works like a spreadsheet ("blankLines": 5)

load

optional { source, each, labels? } fills the grid with lines that were saved earlier, whenever the record its source filters on changes: source is a records source over line_item filtered to the opened record ("document_id" eq "{{ state.item._record_id }}"), each maps the entry's input columns from bindings over row (the saved line), and labels gives the text shown for a record cell ("cost_code": "{{ row._refs.cost_code_id._title }}" beside each "cost_code": "{{ row.cost_code_id }}"). load takes no dependsOn of its own and the block need not list the state its source reads: the lines are read once that state is set, and until then the grid is open to type into, which is how one grid serves a new record and an opened one. List that state in the dependsOn of the block or its section only when the grid should stay closed until a record is opened. With it, work saved half done comes back as it was left

empty

text shown while no line has been entered

record

One record shown as labelled fields, the first row its source returns. Use it to show a related record beside a pick, such as the Sage 100 job an estimate is linked to, instead of a one-row table.

source

a records or table source, filtered to the one row by a state binding, with limit 1

fields

[{ key, label?, value?, rollup?, format? }] like table columns; value is a binding over row and state. A field with rollup is a total over the records that reference the shown record, or with fn first or list a value of them, exactly as on a table column (the sick days one employee took this year, the equipment assigned to the shown pay group), or, when its filters read the row, a value or total of the records those filters match (the range the shown account falls in), and a later field computes from it: { "key": "sick_left", "label": "Sick days left", "value": "{{ 5 - row.sick_used }}" }

a field may carry visibleWhen, a binding over state and user; the field is left out while it is falsy ("{{ user.role != 'member' }}" keeps a pay rate out of a member's view). At least one field always shows

dependsOn

every state key the source filters read that the enclosing section does not already list

empty

text shown when the source returns no record

field

An input bound to a text, number, date, boolean or choice state.

state

label

placeholder

help

explanatory text

multiline

true for a text area

clears

optional list of other state keys emptied when a person changes this input, never when a default or the applet itself fills it: the cost code picked for one job when another job is picked, the two custom dates when a preset period is chosen. It names record, text, number, date, boolean or choice states, never a rows state, and one change clears once: a cleared input does not clear others in turn

style

"tabs" shows a choice with a fixed option list as a strip of buttons instead of a dropdown (the Inbox, In review, Flagged, Completed filter above a work queue); pressing the active one clears it. Bind the state into the list's source as an optional filter

check

optional { ok, note? }. ok is a binding over state and result; a green tick shows under the input while it is truthy and the note in amber while it is not, so a person sees at a glance which values still need a look: the total read from an invoice against the lines coded, { "ok": "{{ round(state.invoice_total - sum(state.lines, 'amount'), 2) == 0 }}", "note": "The lines do not add up to this total" }

dependsOn

every state key the filters of a sourced choice read that the enclosing section does not already list; the options re-query when one changes

required, min, max, maxLength

input validation, also enforced before a write on the server

earliest, latest

on a date field only, the first and the last date a person may enter, each a date as YYYY-MM-DD or a binding over state and user that gives one; the date picker stops at them and a write is refused on the server outside them, with the date in the message. Time no more than four weeks ahead and no earlier than the start of last week (weeks from Sunday) is "earliest": "{{ add_days(today(), -7 - mod(weekday(today()), 7)) }}", "latest": "{{ add_days(today(), 28) }}". A bound whose binding is empty is not applied. A date typed into a grid line is checked with "require" on the action instead (see Entry windows)

stats

A strip of labelled values computed from state: what a person picked, typed, or ticked. It cannot total a source; for that use metrics.

items

[{ label, value, tone?, tones? }] with value a binding over state and result

tone

optional, good, warn, bad, a fixed color for the figure

tones

optional [{ when, tone }], up to 4, a color that follows a condition instead: each "when" is a binding over state and result, the first rule that holds colors the figure, and it stays plain when none does. A running total that must reach a target is green at the target and red otherwise with { "label": "Allocated", "value": "{{ sum(state.shares, 'percent') }}%", "tones": [{ "when": "{{ sum(state.shares, 'percent') == 100 }}", "tone": "good" }, { "when": "{{ true }}", "tone": "bad" }] }. An item takes tone or tones, never both. Use tones whenever a person asks for a figure to turn green, amber or red depending on its value

metrics

A strip of figures totalled on the server over every row a source returns, whatever page the person is on and whether or not anything is ticked: the number of overdue invoices, the total amount owed, the average bill. The headline numbers a dashboard opens with.

source

a records or table source; its filters decide which rows count

items

[{ label, fn, column?, format? }], up to 8. fn is one of count, sum, avg, min, max; count takes no column, the others total a number column of the source or a computed field that is a number (see Computed fields: hours times rate, hours over forty). format: number (default), money, or hours

dependsOn

every state key the source filters read that the enclosing section does not already list

calendar

A month or week calendar of the rows a source returns, each placed on the day a date column names: who is off on which day, the visits of a week, the inspections of a month. The person moves between periods and switches between month and week; only the rows of the period on screen are read.

source

a records or table source; its filters decide which rows appear at all

date

the date column a row is placed by

end

optional date column for a row that spans several days; the row then shows on every day from date to end

title

binding over row and state, the text of an entry ("{{ row._refs.employee_id._title }}", "{{ concat(row.employee_name, ' (', row.kind, ')') }}")

color

optional source column whose distinct values each get a color and a legend entry (the office, the kind of leave)

view

month or week, the view the calendar opens in; month when omitted

recordState

optional record state matching the source entity, set when a person clicks an entry, so a section that depends on it opens the entry

dependsOn

every state key the source filters read that the enclosing section does not already list

chart

One figure grouped by one column, computed on the server over every row the source returns: amount owed by customer, cost by month, jobs by stage, spend by cost type, budget by job. A bar chart compares groups, a line chart follows a date column over time, a donut shows shares of a whole, and kind table lists one row per group with the figure beside it (the budget total per job as a plain list), for a person who asks for totals "in a table" rather than a picture. A table also takes a second grouping across the top (series) and a total row (totals), which is how employees down the side with the days of the week across the top and a total at the bottom is built.

kind

bar, line, donut, table; table shows the groups as rows (group, figure) instead of drawing them

title

optional heading shown above the chart

source

a records or table source; its filters decide which rows count

group

{ column, bucket?, weekStart?, label? }. column is the source column each row is grouped by (a reference column such as project_id is shown by the name of the record it names), or a computed field for a grouping no column holds (see Computed fields: a two-week pay period, a fiscal quarter, over or under forty hours); bucket is one of day, week, month, quarter, year and is only for a date column (or _synced_at, _changed_at), so cost by month is { "column": "transaction_at", "bucket": "month" }; weekStart is the day a week bucket begins on, one of monday, tuesday, wednesday, thursday, friday, saturday, sunday, monday when left out, and each week is labelled by that day, so hours by a Sunday-to-Saturday pay period is { "column": "work_date", "bucket": "week", "weekStart": "sunday" }; label names the axis

series

optional, a second grouping written like group, { column, bucket?, weekStart?, label? }, only with kind table. The table then has one row per group and one column per series value with the figure where they meet, a cross-table: hours by employee and day is "group": { "column": "employee_id" }, "series": { "column": "work_date", "bucket": "day" }, cost by job and cost type is "group": { "column": "project_id" }, "series": { "column": "cost_type" }. The columns run in order of the series value (dates left to right) and there are at most 31 of them, so filter a date series to the week, pay period or month on screen; the rows are every group up to the limit, 50 unless limit says fewer, largest row total first, or by name with order group

totals

true adds a Total row under a table and, with series, a Total column at its right, for a metric that is sum or count. Use it whenever the person asks for a total at the bottom or the end of a table

metric

{ fn, column?, format?, label? }, one figure per group, as in metrics

limit

how many groups to show, 12 by default and at most 50; the largest groups come first unless order is group

order

value (largest first, the default) or group (by the group key, which a line chart over time always uses)

dependsOn

every state key the source filters read that the enclosing section does not already list

empty

text shown when no row matched

tones

optional [{ when, tone }], up to 4, only with kind table. Each colors the figure of every cell whose "when" binding is truthy, tone one of good, warn, bad; the first rule that holds wins and the Total row and column stay plain. In "when", row is the cell: row.value is its figure, row.group the name of the row it sits on as shown, row.series the heading of its column as shown (empty without series), and row.total the total of its row; state and user read as anywhere. Regular hours over forty in red on a table of hours by employee and pay type is { "when": "{{ row.series == 'Regular' and row.value > 40 }}", "tone": "bad" }, with the series text spelled as the column heading shows it; any figure over a limit a person typed is { "when": "{{ row.value > state.limit }}", "tone": "warn" }

button

Runs an action when pressed.

action

the action key

label

variant

primary (default) or secondary

size

optional, medium or large; large is a taller, wider button for a phone or a touch screen

enabledWhen

optional binding over state; the button is disabled while it is falsy

link

A link that opens another applet of the organization in a new tab, so one applet hands off to another without the person losing what they have entered here (see Applets that work together).

label

applet

the slug of the other applet, from the list of the organization's applets given with the connected systems

open

optional { state, record }. state is a record state of the other applet and record a binding over state and result giving a record id ("{{ state.vendor._record_id }}"); the other applet opens with that record already picked, as if the person had opened it from its list. Without open, or while the binding is empty, the other applet opens as usual

variant

button (the default, a secondary button) or text (an inline link)

result

Shows the outcome of an action: the write intent status polled until applied or failed, the id the connected system assigned, warnings, and per-row progress for upsert_each.

action

document

Shows a stored file on the page: the PDF, image, or spreadsheet a picked record carries (the quote attached to the picked email, beside the lines read from it) or the PDF a render_document action made. A PDF renders in a viewer, an image inline, a spreadsheet as a file card, and the file can be opened in a new tab.

a record can hold many files (every PDF made for it and every file attached to it are kept), and this block shows one of them

the newest, the one a result names, or with "record" and "named" the newest of one kind; to list them all use a files block

attachment

binding over state and result giving the attachment id: "{{ state.quote._attachment_id }}" for the newest file of a picked record, "{{ result.print_po.attachment_id }}" for a printed document. Optional when "record" and "named" are set

record and named

together they show one particular file among the several a record keeps. record is a binding over state and result giving the record id ("{{ state.project._record_id }}"), and named is fixed text, at most 60 characters of letters, digits, spaces and hyphens, never a binding: the block shows the newest file on that record whose file name begins with it, ignoring case, and its "empty" text when the record has none. A project that keeps a signed contract, an insurance certificate and a site photo shows each in its own section with three document blocks over the same record, named "Contract", "Insurance certificate" and "Site photo". When "attachment" is set too it is shown while it has a value and the named file otherwise, so a section shows the PDF just printed and, when the record is opened again later, the copy that was saved: "attachment": "{{ result.print_contract.attachment_id }}", "record": "{{ state.project._record_id }}", "named": "Contract". The files must be kept under names that begin that way: a render_document action's "filename" begins with it ("{{ concat('Contract ', state.project.name) }}") and an upsert keeps each file under a name of its own (see attachments). No name of one viewer may be the beginning of another's over the same record ("Insurance" beside "Insurance certificate"), which the validator refuses

label

optional heading over the viewer

empty

the text shown while the binding is empty ("Pick an email to see its quote.")

files

Lists every file kept on one record, newest first: each PDF a render_document action made for it, each file an upsert attached to it, and each file a connected system holds for it. Pressing a file shows it under the list, as a document block would. Use it wherever a person asks to see all the documents, attachments, forms or uploads of a record, such as every form a new hire filled in beside the proof they uploaded; a document block shows one file, this shows them all. Up to 50 files are listed.

record

binding over state and result giving the record id ("{{ state.item._record_id }}")

label

optional heading

empty

the text shown while the record has no file

latest

true keeps only the newest file of each name, so a form that was printed three times is listed once; without it every stored file is listed, which is the history

remove

optional { allowedWhen?, denied? }. Adds a Remove button on each file that deletes that one file from the record for good, after a confirmation; the record itself stays. Only a file an applet stored on a record kept in Valtrix can be removed: a file that came from a connected system, or that sits on a record written into one, shows no button and the server refuses it. allowedWhen is a binding over state and user that must be truthy for the button to show and for the server to remove the file ("{{ user.role != 'member' or state.item.status == 'draft' }}"), and denied the message shown when it refuses. Use it when a person asks to remove, delete or clear a file that is already saved on a record; a file still waiting in an upload block is removed there

upload

Takes a file from the person's computer (drag and drop or a file dialog) and fills a record state with it, so a read_document action can read it and a document block can show it when no connected system holds the file. The file is kept as a document record of the organization for 30 days and removed after that unless a write attached it to a record of its own (an upsert with "attachments"); the person can remove it at once.

state

a record state declared with "entity": "document", filled by this block alone (no picker on the same state)

label

help

explanatory text under the drop zone

clears

optional list of other state keys emptied when a file is uploaded (the item opened from a list, so the upload starts a new one)

read

optional key of a read_document action that reads this block's file; it runs the moment the file is uploaded, so the person never presses a Read button. Set it whenever the upload exists to be read

accept

optional list of "pdf", "image", "spreadsheet" (a spreadsheet is an .xlsx workbook or a .csv file); all of them when omitted

signature

optional { acknowledgement }. The block then takes a signature instead of a file: the person draws it or types their name, ticks the acknowledgement (the sentence they agree to, at most 600 characters, such as "I agree that this electronic signature is my signature on this form"), and presses Sign. The state is filled with the signed record, which carries who signed (uploaded_by, the signed-in person, never typed), when (created_at), and the acknowledgement they ticked (description); it is the signed-in person who signs, so a form another person must sign is signed by them in their own session. A signing block takes no "accept" and no "read". Print the signature on a PDF by naming the state under "signatures" on a render_document action (see Files)

voice

A microphone button. The person taps it and says what they would otherwise type and pick ("eight hours yesterday on the Elm Street job, cost code 300"); the words appear as they are heard, and when the person stops, a read_speech action fills the form from them: the pickers and fields on the page, and one line of an entry grid for each person or item named ("yesterday on Elm Street, John eight hours framing and Mike six hours steel" fills the job and the date and adds two crew lines). Nothing is written by speaking: the person checks what was filled and presses the applet's own button. The browser recognises the speech (Chrome, Edge, and Safari); in a browser that cannot, the block shows a one-line note and the form is filled by hand.

state

a text state that holds what was heard, filled by this block alone and declared with no default

read

the key of the read_speech action that runs when the person stops speaking; its "text" reads this block's state

label

the words on the button, at most 80 characters ("Say a time entry")

help

optional example of what to say, shown under the button ("Try: 8 hours yesterday on Elm Street, cost code 300")

pause

optional number of seconds of quiet after which listening stops by itself, 1 to 15, 3 when omitted. Raise it when people stop to think in the middle of an entry or dictate a whole crew ("pause": 8); the person can always press Stop sooner, and listening ends after 120 seconds whatever is set

activity

The history of one record in this applet, newest first: who pressed which button on it and when, and who it was sent to. Put it under the fields of an opened work item.

record

binding over state and result giving the record id ("{{ state.item._record_id }}")

label

optional heading

empty

the text shown while nothing has happened to the record yet

row

Lays its blocks out side by side.

blocks

leaf blocks (no nested rows, panels or sections)

visibleWhen

optional binding over state and result; the whole row is left out while it is falsy

panel

A part of a section that folds away on its own: a header a person presses to open and close it, with the rest of the section staying in view. It sits directly inside a section, among that section's other blocks; a whole section that folds is a section with collapsible instead.

title

the text of the header a person presses

collapsed

optional binding over state and result; the panel is folded while it is truthy and open while it is falsy, until the person presses the header, after which it stays as they left it. "{{ true }}" starts it folded, for something needed rarely (a box to say or type an entry beside the form it fills, the optional fields of a form, the notes); "{{ state.vendor }}" folds it once a vendor is picked. Without it the panel starts open

visibleWhen

optional binding over state and result; the whole panel is left out while it is falsy

blocks

leaf blocks and rows, at most 10 (no panels or sections). What is typed inside is kept while the panel is folded, and its blocks wait on the enclosing section's dependsOn like any other block of the section

section

Groups blocks under a title. With dependsOn it stays closed, naming the pick it waits for, until every listed state is set; the blocks inside inherit those keys and none of their sources query before then.

title

tab

optional name of the tab the section shows under (see Tabs)

style

optional, card, plain, tinted; card (the default) is a bordered card, plain has no border, tinted is a card in a light wash of the accent color

dependsOn

state keys the whole section waits for

visibleWhen

optional binding over state and result; the whole section is left out while it is falsy (see Showing and hiding blocks)

pane

optional, left, center, right. Sections that follow one another in "blocks" (same tab and page) and each name a pane are laid out side by side as columns on one screen, each column scrolling on its own, so nothing needs the page to scroll: a work queue in the left pane, the file in the center pane, and the fields and the write button in the right pane. Several sections may share a pane and stack inside it. At least two different panes must be used; with two, the pane holding a document or a list is the wider one. Use panes when a person works through items one after another against a document (coding invoices, reviewing submittals, matching receipts), and put a document block alone in its own pane section with style plain. On a phone the panes stack. A modal section takes no pane

collapsible

true gives the section a header a person presses to fold it away and open it again, keeping everything typed in it; use it for a part of the page that is finished early or needed rarely (the header of an invoice once it is filled in, an "Add a new vendor" form), so the working area stays in view; to fold only some of a section's blocks, put them in a panel inside it

collapsed

with collapsible, an optional binding over state and result; the section folds itself while it is truthy and opens while it is falsy, until the person presses the header, after which it stays as they left it for that item. "{{ state.vendor and state.invoice_number and state.invoice_date }}" folds the header once it is complete; "{{ state.vendor }}" keeps an add-vendor form folded while a vendor is picked and still one press away

modal

true opens the section as a dialog over the page the moment every state in dependsOn is set (a row opened from a table with recordState, a picker pick), instead of as a card in the flow; closing the dialog clears those picks, so the person is back on the list; use it for the work done on one row (match its client, review it) so the list stays where it was, and keep the sections that read the whole selection (stats, the post button) in the flow. The dependsOn states must be record states

blocks

leaf blocks, rows and panels, at most 20. A view with more is several sections one after another, each a card with its own title, and under tabs they share the same "tab" name (Contact, Employment, Emergency contact and Notes are four sections all with "tab": "Details")

Actions7

The action kinds a button can run. Each action is { "kind": "<name>", ...fields }; every upsert and upsert_each carries a confirm text.

upsert

Writes one record, optionally with nested lines from a rows state (a purchase order with its items in one write).

entity

the entity type written

externalId

binding over state, the id the record keeps in Valtrix; the same id updates the same record

data

{ column: binding over state } for the entity columns

lines

{ from: a rows state key, each: { line_item column: binding over row and state } }, one line per selected row

attachments

optional list of bindings over state and result, each an attachment id (the id a render_document action returns as result.<key>.attachment_id); the file is sent with the write and, on a propagated write to a connector with an upload op, uploaded to the source

optionalAttachments

optional list of bindings like attachments, for a file the write may or may not have: an entry whose binding is empty is left out, where an empty entry under attachments stops the write. Use it for a file a person may have uploaded ("{{ state.invoice_file._attachment_id }}" on a bill that can also be typed with no invoice); keep attachments for a file the write is pointless without, such as the PDF a render_document action must have made first

attachmentName

optional binding over state and result naming the files the write carries, without the extension, which is kept from the file ("{{ concat(state.vendor.name, ' ', state.invoice_number) }}" stores an uploaded scan as "Sunbelt Rentals 17097-01.pdf"); several files get -1, -2 after the name. Use it whenever an uploaded or scanned file is kept on the record it belongs to, so the file can be found by what it is rather than by the name the scanner gave it

an entry of attachments or optionalAttachments may be { file, name } in place of the binding alone

file is the same binding and name a binding over state and result that this one file is kept under, without the extension ("name": "{{ concat('Insurance certificate ', state.project.name) }}"). Use it whenever one write keeps several different kinds of file on one record (a signed contract, a certificate, a photo), so each keeps a name that says what it is and a document block with "record" and "named" can show each in its own section; entries written as the binding alone still take attachmentName, numbered among themselves

remember

optional { link, from }, like a picker's. Once the record is written, it is stored as the match for the record the from binding names: a client created in the accounting system from a field-service customer, "from": "{{ state.invoice.customer_id }}", or the text a read document printed, "{{ result.read_quote.header.issuer }}". The picker that remembers the same link then pre-selects it, and rows read it under _links. The link must name this action's entity, and when it names a connector the action must propagate there

allowedWhen

optional binding over state, result and user that must be truthy for the action to run; it is checked on the server, and the button is disabled while it is falsy. denied is the message shown when it refuses. An approval only an admin or the assigned person may give: "allowedWhen": "{{ user.role != 'member' or state.item.assigned_to == user.id }}", "denied": "Only the person this is assigned to can approve it"

mark

optional { key, record }: once the record is written, the record the binding names is stamped with that mark of a table of this applet, as if a person had pressed its button, so a file leaves a not_marked inbox list the moment the item made from it is saved ("key": "filed", "record": "{{ state.inbox_file._record_id }}"); nothing is stamped while the binding is empty

into

optional record state key of this action's entity; once the record is written (and, for a propagated write, once the connected system has it), that state is filled with it as if the person had picked it, so a vendor created from the applet is the picked vendor of the order that follows without a second pick. The picker that fills that state must list records of the connection the write lands in

clears

optional list of state keys set back to their defaults (empty when they have none) the moment the write is accepted, so the form is ready for the next entry while the result of the write stays on the page: the job, the hours and the note of a time entry, never the date or the person a string of entries shares

then

optional follow-up writes and follow-up actions (see Follow-up writes)

propagate

true also writes it into the connected system through its write op

connection

the connection id to write through; required when more than one connection can write the entity

confirm

text for a confirmation modal shown before the write, may use bindings over state

ask

optional [{ state, label, required? }], up to 3. The confirmation asks the person for these values before the write, each into a state of its own that the action's data reads: a reason for a rejection is a text state "reject_reason", "ask": [{ "state": "reject_reason", "label": "Reason", "required": true }] and "reject_reason": "{{ state.reject_reason }}" in data. The state is text, number, date, choice (a choice with a fixed list), it needs no field block, it starts empty each time the confirmation opens, and a required one must be filled before the button in the confirmation works and before the server writes. This is how a row action or a one-press button takes a note, an amount or a date at the moment it is pressed, with no form on the page

upsert_each

Writes one record per selected row (imports, journal entries). The result block shows N of M progress and lets the failed rows be rerun. With "auto" the same action can also run unattended over every row its table currently lists (see Automation).

from

a rows state key

entity

externalId

binding over row and state

data

{ column: binding over row and state }

lines

optional { source?, each } for records that carry lines (an invoice with its items): source is a records source over line_item whose filters read the row being written ("document_id" eq "{{ row._record_id }}") and each maps line_item columns from bindings over row, where row is the line; every matching line is written with the record, and a row with no lines is refused. Without source, each row is written with exactly one line built from the row itself (row is then the row being written): an opening-balance invoice pasted into an entry block with its one balance-forward line, "lines": { "each": { "description": "{{ row.description }}", "amount": "{{ row.amount }}" } }

require

optional { rows, message }: rows is a binding over row that must be truthy for the row to be written, message the plain-words reason shown on a row that is held back ("{{ row._links.sage_client }}" with "Match the Sage 100 client first"); the person fixes the row and reruns the failed rows

order

optional [{ column, direction }], at most 3, direction asc or desc. The rows of a run are put in this order on the server before anything is worked out, whatever order the person ticked them in or the table is sorted by: "order": [{ "column": "employee_id", "direction": "asc" }, { "column": "work_date", "direction": "asc" }]. column is a column the rows carry, not a compute value. Declare it whenever a row's write depends on the rows before it, which is every use of sum_before; a run whose rows are written independently needs none

compute

optional { name: binding over row, rows and state }, at most 12. Values worked out for every row of the run, one row after another in the declared order, before any row is written; each is then read as row.<name> by require, externalId, data, lines and the follow-ups. A value may read the values declared before it on the same row and, through sum_before(rows, '<name>', ...) and sum_where, the values of the rows above, which is how hours are allocated across entries that already exist (see Totals a form acts on). A name is not a column the rows already carry. An automatic action takes none

then

optional follow-up writes run after each row lands (see Follow-up writes)

clears

optional list of state keys set back to their defaults (empty when they have none) once every row of a run has been written, so the pickers and fields above the rows are ready for the next batch; nothing is cleared while a row failed, so it can be corrected and rerun. The selection the rows came from is emptied after a run anyway; list the rows state of an entry grid when its lines should be emptied too

propagate

connection

confirm

auto

optional { trigger, rows?, since?, maxPerRun? }. Runs the action without a person (see Automation). trigger is one of { kind: "sync", connector } (runs after every sync of that connector), { kind: "interval", minutes } (15 to 10080), or { kind: "daily", at: "HH:MM", timeZone? } (an IANA zone, UTC when omitted). rows is an optional binding over row that must be truthy for the row to be written. since is { column }, the row's date column the automation starts from (issued_at, invoice_date, completed_at). When the org turns the automation on it picks a start date, today by default, and only rows dated on or after it are ever written. History is therefore never replayed. Declare it on every automation whose rows carry a date. maxPerRun caps one run (default 200, at most 500); the rest wait for the next run

read_document

Reads a PDF, image, or spreadsheet (xlsx or csv) file kept on a record, such as a supplier quote synced from a document folder or a costing workbook a person uploaded, and fills an entry block with its priced lines; a spreadsheet is read sheet by sheet from its cells, so the formulas it holds are read at their values. The header (who issued it, to whom, its number, dates, and total) is exposed as result.<key>.header for defaults, picker searches, and remembered picks. The lines land in the entry block unticked, so the person checks, edits, and ticks them before a write uses them. Each file is one model call, run on the server while the page keeps checking for the result; a long quote takes a minute or two, and the read survives a reload. A file already read is served from the stored reading. It is the natural first step of an applet that starts from a document: pick the file, read it, and let the record states default from what it says.

document

binding over state naming the record whose file is read ("{{ state.quote._record_id }}"), a record state picked from any records that carry a file: document records from a document folder, emails synced with their attachments (activity records of kind email, whose category is the mail folder they sit in), a bill with its invoice PDF. The connected systems list says which entity types carry files; a picker over them filters _attachment_id not_null so only the records with a file are offered. When a record holds several files the PDF is read, else the newest spreadsheet, else the newest image

into

the rows state of the entry block that receives the lines

each

{ entry column: binding over row } for the entry block's input columns, where row is one line read from the file with the columns section, description, name, part_number, quantity, unit, unit_price, price_per, printed_price, amount, optional, page, check: section is the heading the line sits under (a fixture tag such as "FD-1 FLOOR DRAIN"), description the supplier's own text, name a short plain-words name for the line ("3" Floor Drain"), part_number, quantity, unit, unit_price the price of one unit, so quantity times unit_price is the amount, price_per and printed_price for a price the document prints per hundred or per thousand (wire at "5745.000 M" reads printed_price 5745, price_per 1000, unit_price 5.745; price_per is 1 and printed_price equals unit_price on an ordinary line), amount the extended price as printed, optional true for lines the document offers as options or add-ons, page, and check "ok" or "mismatch" when quantity times unit price does not equal the amount. Map the cost of one unit from row.unit_price; to show the price the way the supplier prints it, give the entry block a price column from row.printed_price and a choice column from row.price_per, and compute the amount as quantity times price divided by the basis

guidance

optional plain-words instructions for the reader, such as the naming style the org uses for its lines

append

optional, true adds the lines under those already in the grid instead of replacing them

once read, result.<key>.header carries title, issuer, issuer_address, recipient, reference, customer_reference, po_number, job, ordered_by, issued_at, expires_at, due_at, total

title is what the document calls itself, issuer the company that issued it (the supplier on a quote or invoice, as its full name when the document prints one anywhere), issuer_address, recipient who it is addressed to, reference its own number, customer_reference the recipient's reference it prints back (a customer PO number or job name) as one text, po_number the recipient's purchase order number alone and job the recipient's job or project name or number alone, each read from the printed fields or from a stamp or handwriting on the document (an order number field defaults from po_number, a job picker searches by job), ordered_by the person on the recipient's side who placed the order, printed or initialled, issued_at and expires_at as YYYY-MM-DD, due_at the payment due date of an invoice, total the grand total; a field the document does not print is null

read_speech

Fills the form from one sentence a person said or typed: the inputs named in "fills", and a line per entry in the entry block named by "into". One sentence may name several entries, and each becomes a line of its own, so the hours of a whole crew are said in one go. Each sentence is one short model call. A date said in words ("yesterday", "last Friday") becomes a date, a number said in words a number, and an option is matched to the field's own list. A record (a job, a cost code, an employee) is matched by searching the same records its picker or grid cell offers, in the order the pickers depend on each other, so a cost code is looked for among the picked job's. One clear match is filled in, and so is a name that was misheard or misspelled when exactly one record is close to it ("Jon Smyth" for John Smith, "north side" for Northside Plaza), with a note telling the person what it was matched to; a number is only ever matched exactly. A name that is close to several records is left empty and the closest few are offered as buttons under the microphone, one press filling the input or the cell. A name nothing is close to is left empty, the person is told which, and the picker opens on what was said. This matching is built in, so nothing is declared for it. What was already on the form and was not mentioned stays as it was. Nothing is written: the person checks the form and presses its button. It is run by a voice block the moment the person stops speaking, or by a button beside a multiline text field for a typed sentence.

text

binding over state giving the words: the text state a voice block fills ("{{ state.spoken }}")

fills

optional list of state keys the words may fill, at most 20: record states that have a picker, and text, number, date, boolean and choice states that have a field block. List every input a person would say aloud

into

optional rows state of an entry block; each entry the person gives becomes a new line under the lines already there (at most 20 a sentence), its typed cells and record cells filled the same way. Use it when the form is a grid of lines

guidance

optional plain-words instructions for the reader, at most 600 characters, such as how the organization says things ("OT means the Overtime pay type", "jobs are named by their four-digit number")

give at least one of fills and into. No result block is needed

the voice block itself shows what was heard, what was filled, and what could not be matched

render_document

Prints a record as a PDF and keeps it as an attachment on the record, so a later write can upload it: a purchase order printed the way the accounting system prints it and sent into a project's document folder, a lien waiver, a submittal cover sheet, a statement. Three layouts: the fixed Sage 6-6-1 purchase order, a custom HTML template written for the request, or an official government form from the form library, filled in on the agency's own PDF.

layout

"purchase_order" (fixed: company block, order number and date, Billed To and Project, Ordered By, the Part # / Description / Unit / Quantity / Price / Amount table, subtotal, sales tax, total, terms) "custom" (the template below), or "form" (an official form from the form library, below)

record

binding over state and result naming the record to print, usually the write that made it ("{{ result.create_po.record_id }}") or a picked record ("{{ state.invoice._record_id }}")

filename

binding over state and result for the PDF name ("{{ concat(state.order_number, '.pdf') }}")

entity

the entity type the document prints (required with a custom or form layout, contract for purchase_order), so the record columns the template or the form fields read are checked

template

with layout custom, the HTML of one printed page, under 24000 characters, with {{ }} bindings in the same expression language as the rest of the applet. A template binds over four roots. record is the printed record's columns plus _title, _external_id, _source (the connector's own fields), and _refs.<reference column>, the referenced record with its columns, _title, and _lines, its postal address lines: "{{ record._refs.counterparty_id._title }}" names the vendor and "{{ join(record._refs.project_id._lines, ', ') }}" prints the job address. lines is the record's line_item rows in position order, each with amount filled in. company is name, lines, license, logo from the action. signatures.<name> is a signature the action names under "signatures", with image, signed_by, signed_at, acknowledgement: <img src="{{ signatures.employee.image }}" style="height: 48px"> prints the signature and "{{ signatures.employee.signed_by }}, {{ date(signatures.employee.signed_at) }}" who signed and when. Repeat an element once per line by giving it data-each="lines" (the collections are lines): <tr data-each="lines"><td>{{ row.description }}</td><td>{{ money(row.amount) }}</td></tr>, where row is the line. sum(lines, 'amount') totals them and date(now()) prints today. Every bound value is HTML-escaped. To print only some of the records of a collection, give the same element data-when, one binding over row and record that must be truthy for a record to be printed: <tr data-each="lines" data-when="{{ row.quantity > 0 and row.kind != 'note' }}"> prints the lines with a quantity and leaves out the notes, and the records it leaves out take no space on the page. It is the one way a printed list is narrowed, the printed twin of the filters on the list a page shows, so write the same condition in both: a filter { "column": "taxable", "op": "eq", "value": "true" } on the page is data-when="{{ row.taxable }}" on the document. It goes only on the element that carries data-each; that element's other attributes are printed as written and cannot read row, so a class that follows the record goes on an element inside it. sum(lines, 'amount') still totals every line, so a total over only the printed ones is read from a column of the record. Never answer that a printed list cannot leave records out by a condition. Write plain HTML with a <style> block (Letter page, Arial, borders with CSS). Validation refuses <script>, event attributes, <link>, <iframe>, forms, and anything loaded from the network; images are data: URLs. A template without <html> is wrapped in a Letter page with sensible defaults

related

with layout custom, optional { <name>: { records, by, order? } }, up to 4 names. Each adds a collection to the template beside lines: the records of another entity that point at the printed record, which is how a printed report lists what is kept in separate records under it (the hours logged against a job, the payments against an invoice, the entries kept under a daily report). records is that entity, by its reference column that names the printed record, and order an optional { column, direction: asc | desc }. Repeat an element once per record with data-each="<name>", where row is the record with its columns and row._refs.<reference column>._title the name of a record it points at: "related": { "labor": { "records": "time_entry", "by": "project_id", "order": { "column": "started_at", "direction": "asc" } } } with <tr data-each="labor"><td>{{ row._refs.employee_id._title }}</td><td>{{ row.hours }}</td></tr>. data-when on that element leaves records out by a condition, as on lines: <tr data-each="labor" data-when="{{ row.hours > 0 and row.billable }}"> prints only the billable entries with hours. A collection reads at most 500 records, before any are left out, and a name is lowercase letters, digits and underscores, never "lines"

form

with layout form, the form to fill, one of "irs-w4", "irs-w9", "uscis-i9", "wi-wt4". The PDF is the agency's own file with its fields filled, the signature drawn on its signature line, and the fields then locked, so it is the official form and not a page styled like it. A form layout takes no template, company, terms, or parties. "irs-w4": Form W-4, Employee's Withholding Certificate, revision 2026, 5 pages, page 1 printed unless "pages" says otherwise. Fields: first_name (Step 1(a) first name and middle initial), last_name (Step 1(a) last name), address (Step 1(a) street address), city_state_zip (Step 1(a) city or town, state, and ZIP code), ssn (Step 1(b) social security number, nine digits), filing_status (Step 1(c) filing status: "single" Single or Married filing separately; "married_jointly" Married filing jointly or Qualifying surviving spouse; "head_of_household" Head of household), two_jobs (Step 2(c) checkbox, two jobs in total, ticked when the value is true), children_amount (Step 3(a) dollar amount for qualifying children), other_dependents_amount (Step 3(b) dollar amount for other dependents), credits_total (Step 3 total of 3(a), 3(b), and other credits), other_income (Step 4(a) other income), deductions (Step 4(b) deductions), extra_withholding (Step 4(c) extra withholding each pay period), exempt (Exempt from withholding checkbox, ticked when the value is true), employer_name_address (Employers only: employer's name and address), first_date_of_employment (Employers only: first date of employment, a date), employer_ein (Employers only: employer identification number). Signatures: employee (Step 5 employee's signature and date). "irs-w9": Form W-9, Request for Taxpayer Identification Number and Certification, revision 2024-03, 6 pages, page 1 printed unless "pages" says otherwise. Fields: name (Line 1 name of entity or individual), business_name (Line 2 business or disregarded entity name), tax_classification (Line 3a federal tax classification: "individual" Individual or sole proprietor; "c_corporation" C corporation; "s_corporation" S corporation; "partnership" Partnership; "trust_estate" Trust or estate; "llc" LLC, with llc_classification; "other" Other, with other_classification), llc_classification (Line 3a LLC tax classification letter: C, S, P), other_classification (Line 3a Other, described), foreign_partners (Line 3b checkbox, foreign partners, owners, or beneficiaries, ticked when the value is true), exempt_payee_code (Line 4 exempt payee code), fatca_code (Line 4 exemption from FATCA reporting code), address (Line 5 street address), city_state_zip (Line 6 city, state, and ZIP code), requester (Requester's name and address), account_numbers (Line 7 account numbers), ssn (Part I social security number, nine digits), ein (Part I employer identification number, nine digits). Signatures: person (Part II signature of U.S. person and date). "uscis-i9": Form I-9, Employment Eligibility Verification, revision 2025-01-20, 4 pages, page 1 printed unless "pages" says otherwise. Fields: last_name (Section 1 last name), first_name (Section 1 first name), middle_initial (Section 1 middle initial), other_last_names (Section 1 other last names used), address (Section 1 street number and name), apartment (Section 1 apartment number), city (Section 1 city or town), state (Section 1 state, two-letter code), zip (Section 1 ZIP code), date_of_birth (Section 1 date of birth, a date), ssn (Section 1 social security number, nine digits), email (Section 1 employee's email address), phone (Section 1 employee's telephone number), citizenship_status (Section 1 citizenship or immigration status: "citizen" A citizen of the United States; "noncitizen_national" A noncitizen national of the United States; "permanent_resident" A lawful permanent resident, with permanent_resident_number; "authorized_alien" An alien authorized to work, with work_authorization_expires and one of the three numbers), permanent_resident_number (Section 1 item 3 USCIS or A-Number), work_authorization_expires (Section 1 item 4 expiration date, a date), uscis_a_number (Section 1 item 4 USCIS A-Number), i94_admission_number (Section 1 item 4 Form I-94 admission number), foreign_passport (Section 1 item 4 foreign passport number and country of issuance), list_a_title (Section 2 List A document title 1), list_a_authority (Section 2 List A issuing authority 1), list_a_number (Section 2 List A document number 1), list_a_expires (Section 2 List A expiration date 1, a date), list_a_title_2 (Section 2 List A document title 2), list_a_authority_2 (Section 2 List A issuing authority 2), list_a_number_2 (Section 2 List A document number 2), list_a_expires_2 (Section 2 List A expiration date 2, a date), list_a_title_3 (Section 2 List A document title 3), list_a_authority_3 (Section 2 List A issuing authority 3), list_a_number_3 (Section 2 List A document number 3), list_a_expires_3 (Section 2 List A expiration date 3, a date), list_b_title (Section 2 List B document title), list_b_authority (Section 2 List B issuing authority), list_b_number (Section 2 List B document number), list_b_expires (Section 2 List B expiration date, a date), list_c_title (Section 2 List C document title), list_c_authority (Section 2 List C issuing authority), list_c_number (Section 2 List C document number), list_c_expires (Section 2 List C expiration date, a date), additional_information (Section 2 additional information), alternative_procedure (Section 2 checkbox, alternative procedure used to examine documents, ticked when the value is true), first_day_of_employment (Section 2 first day of employment, a date), employer_representative (Section 2 last name, first name, and title of the employer or authorized representative), employer_name (Section 2 employer's business or organization name), employer_address (Section 2 employer's address, city or town, state, ZIP code). Signatures: employee (Section 1 signature of employee and date), employer (Section 2 signature of employer or authorized representative and date). "wi-wt4": Form WT-4, Employee's Wisconsin Withholding Exemption Certificate/New Hire Reporting, revision 2023-08, 2 pages, page 1 printed unless "pages" says otherwise. Fields: legal_name (Employee's legal name: first name, middle initial, last name), ssn (Social security number, nine digits), address (Employee's address, number and street), city (City), state (State), zip (Zip code), date_of_birth (Date of birth, a date), date_of_hire (Date of hire, a date), marital_status (Marital status: "single" Single, also when married but legally separated; "married" Married; "married_single_rate" Married, but withhold at higher Single rate), exemption_self (Line 1(a) exemption for yourself, 1 when claimed), exemption_spouse (Line 1(b) exemption for your spouse, 1 when claimed), exemption_dependents (Line 1(c) number of exemptions for dependents), exemptions_total (Line 1(d) total of lines (a) through (c)), additional_withholding (Line 2 additional amount to deduct each pay period), complete_exemption (Line 3 claim of complete exemption from withholding: Exempt, or true), employer_name (Employer's section: employer's name), employer_ein (Employer's section: Federal Employer ID Number), employer_address (Employer's section: payroll address, number and street), employer_city (Employer's section: city), employer_state (Employer's section: state), employer_zip (Employer's section: zip code), completed_by (Employer's section: completed by), completed_by_title (Employer's section: title of the person who completed it), employer_phone (Employer's section: phone number, ten digits), employer_email (Employer's section: email). Signatures: employee (Employee's signature and date signed).

fields

with layout form, { <form field>: binding } for the fields to fill, each a binding over record (the record named by "record", with the same columns, _source, and _refs a custom template reads), state, and result, or a fixed text: "first_name": "{{ record.first_name }}", "filing_status": "{{ state.filing_status }}", "employer_name": "Acme Plumbing". A field left out or evaluating to nothing stays blank on the form. A choice field takes exactly one of its listed values, so give the choice input that collects it the same option values; a checkbox is ticked when the value is true; a date prints as MM/DD/YYYY; a social security or employer identification number takes nine digits with or without dashes. A value the form cannot take (a wrong choice, too few digits, too many characters) stops the action with a message naming the field

pages

optional, with layout form, the page numbers to keep, such as [1] or [1, 2]; the pages that carry the filled fields when omitted, never the instruction pages

signatures

optional, with layout custom, { <name>: binding } of at most 4 entries, each the record a signing block filled ("{{ state.signature._record_id }}", where an upload block with "signature" fills state "signature"); the template prints it as signatures.<name>. The action refuses to print until every signature it names has been signed, so guard its button with enabledWhen "{{ state.signature }}". With layout form the names are the form's own signature names (employee on irs-w4), and each is drawn on that signature line with the date it was signed beside it

company

{ name, lines (address and phone lines), license?, logo? (a data URL of a small PNG or JPEG) } printed top left by the purchase_order layout and read as company.* by a custom template; required for purchase_order

terms

optional text printed beside the totals of the purchase_order layout; the standard purchase order terms when omitted

parties

optional { project?: { record?, lines? }, billed_to?: { record?, lines? } } for the purchase_order layout. record is a binding over state and result naming the record whose name and address fill that block instead of the order's own project or vendor (the project from the project-management system when the accounting job carries no site address: "{{ state.project._record_id }}"). lines are bindings printed under the name in place of the record's address lines whenever any of them evaluates to text (the supplier address a read quote holds when the vendor card has none: ["{{ result.read_quote.header.issuer_address }}"])

the result exposes result.<key>.attachment_id, filename and url; the button needs no confirm

load_rows

Brings records that already exist into an entry block as editable lines, when a person presses its button: the lines of a purchase order into the coding grid of the invoice billed against it, the items of an estimate into the lines of a new order, last month's journal lines into this month's. The person then edits, removes, adds and ticks the lines like any they typed, and a write reads them from the rows state. It reads; it writes nothing and needs no confirm. With "days" in place of "source" it fills the grid with one line for each day between two dates instead.

source

a records or table source whose filters read state: the lines of a record the person picked or that a hidden lookup found ("document_id" eq "{{ state.po._record_id }}"), with order and connector as on any source. While a state it reads is empty nothing is loaded

days

in place of source, { from, to, weekdays? } brings in one line for each calendar day from the first day to the last, both included, with no records read. from and to are each a date as YYYY-MM-DD or a binding over state and result that gives one ("{{ state.booking.started_at }}", "{{ state.period_start }}"); weekdays keeps only the days of the week listed, 1 for Monday through 7 for Sunday, so [1, 2, 3, 4, 5] is Monday to Friday. In each and labels, row is one day: row.date is the day as YYYY-MM-DD and row.weekday its day of the week from 1 to 7. At most 366 days are walked; a longer span is cut there and the result says so. An applet has no calendar of public holidays, so the person removes a line for a day that should not count before saving. A button that charges a rented machine for each weekday it was out is a load_rows with "days": { "from": "{{ state.booking.started_at }}", "to": "{{ state.booking.ended_at }}", "weekdays": [1, 2, 3, 4, 5] } into a grid with a date column and a rate column ("each": { "charge_date": "{{ row.date }}", "rate": "{{ state.booking.daily_rate }}" }), followed by the upsert_each that writes each line. Use it whenever a person asks for a line, an entry or a record for each day, each weekday or each working day between two dates: the days of a leave request, the shifts of a schedule, a daily log, the days of a rental. Never answer that an applet cannot work out the days between two dates

into

the rows state of the entry block that receives the lines

each

{ entry column: binding over row, state and result } for the entry block's input columns, where row is one loaded row with its columns, _record_id and _refs: "description": "{{ row.description }}", "quantity": "{{ row.quantity }}", "cost_code": "{{ row.cost_code_id }}". A column left out starts empty, or takes its editor default. Since each reads state, a loaded line can carry a share of something the person typed, which is how one amount is split across a list. A button that splits a check across the departments by their percentages is a load_rows over the department records (filtered to those with a percentage) into the lines grid, with "department" bound to "{{ row._record_id }}", "amount" to "{{ round(state.check_amount * row.overhead_percent / 100, 2) }}", and the label of "department" to "{{ row.name }}". Use load_rows whenever a person asks for a button that fills, splits, spreads or pre-populates the lines of a grid from a list of records

labels

{ entry column: binding over row } for every record editor column that each fills, giving the text shown in the cell for the loaded id: "cost_code": "{{ row._refs.cost_code_id._title }}"

append

optional, true adds the lines under those already in the grid instead of replacing them

the result block of the action says how many lines were brought in, and result.<key>.row_count is that number, so a text block can say that nothing matched ("visibleWhen"

"{{ result.load_po.status == 'done' and result.load_po.row_count == 0 }}")

give the button "enabledWhen" on the record the source reads ("{{ state.po }}"), and keep the columns a comparison needs as entry columns

an ordered_quantity column filled from the loaded row beside the quantity the person types, and a computed column for the difference

reset

Clears state back to its defaults.

state

optional list of state keys; all when omitted

Writing a definition25

How the parts fit together: what a definition may bind to, how sources are read, and the rules the validator enforces.

Tabs

A top-level block (a section, a row, or a block outside any section) may carry "tab", a short name. The page then shows a tab strip with one tab per distinct name, in the order the names first appear, and only the blocks of the tab a person is on; blocks with no "tab" always show, above or below the strip where they sit in "blocks". Use it when one page holds several views of the same pick, such as an employee's Details, Pay and Attendance: the picker has no tab, and each view is a section named with its tab. - At least two tabs and at most 8; a name is at most 40 characters. - An applet holds at most 40 top-level blocks, so group a tab's content into sections. - "tab" never goes on a block inside a row, a panel or an ordinary section, nor on a modal section itself. - The blocks directly inside a modal section may carry "tab": the dialog then has its own tab strip, by the same rules, so the record a person opens from a list shows its views (a work order's Details, Parts and Notes) without leaving the list. Use this when the request asks for tabs on what opens from a row. - A tab only some people may see (an admin tab hidden from members) is done with visibleWhen on its blocks; see Showing and hiding blocks. - Inputs keep their values across tabs, so a button on one tab may read a field on another. Separate areas of work that share nothing (an employee list, a time-off calendar, recruiting) are separate applets, not tabs.

Custom types

A custom type is a record type the organization owns, for a kind of thing no canonical entity type covers (a job applicant, a pay-rate change, a benefit election), or for facts about a canonical record its columns cannot hold (an employee's designation and emergency contact, in a custom type that carries a reference column to the employee). Its records are kept in Valtrix only. - Declare it under "types", beside "state": { "<slug>": { label, pluralLabel, description, titleKey, columns: [{ key, label, type, description?, references?, values? }] } }. - The slug is the organization's custom type prefix, given with the connected systems, followed by a name in lower case letters, digits and underscores. - type is one of string, number, boolean, date, reference. A reference column names the entity type it points at in "references", canonical or custom: an applicant's office is { "key": "location_id", "label": "Office", "type": "reference", "references": "location" }. values is a closed list of the texts a string column may hold, which a choice state then offers as its options. - titleKey names the string column that titles a record in pickers, links and reference columns. - A declared type is used exactly like a canonical one: a records source, a picker, a table, a record block, a rollup, metrics, a chart, and an upsert. Its upsert never carries "propagate". The externalId of a new record is a binding unique to it, "{{ concat('applicant-', now()) }}"; editing a picked record writes back to "{{ state.applicant._external_id }}". - Declarations only add. Declaring a type the organization already has, under the same slug, with columns it lacks adds those columns for every applet; the columns it already has need not be listed again, a column never changes its type, and nothing is removed. An applet that only reads or writes the columns a type already has does not declare it again. - The columns listed for an existing custom type are what it holds so far, not a limit. When the request needs to keep something that type has no column for (notes on an applicant, a second interview date), declare the type again with the new columns and write to them. Never drop the field, and never tell the person to ask for the column to be added. - Prefer canonical. Use a canonical entity type and its columns whenever they fit, and never declare a custom type or column that repeats one under another name. An applet declares at most 10 custom types, each with at most 80 columns; an organization holds at most 30.

Data from more than one place

An applet reads any mix of what the organization holds: records a connected system syncs, records kept only in Valtrix (canonical or custom), and published tables. Every list, picker, total and field names its own source, so one screen shows a system's records beside the organization's own and computes across them. - A records source without "connector" returns every record of that type the organization holds, whichever system synced it, together with the ones written in Valtrix (those carry _connector "valtrix-api"). Set "connector" only when a list must hold one system's records, as a picker feeding a propagated write does. "{{ row._connector }}" shows where a row came from. - A list or picker reads the type that holds the thing itself. When a connected system syncs the employees, jobs, customers or items the applet is about, the picker and tables read that canonical type, so they are full the moment the applet opens. They never read a custom type that starts empty and would need each one typed again. - Facts the system does not hold about such a record go in a custom type (or another type kept in Valtrix) with a reference column to it, one record per parent, written with an externalId derived from the parent, "{{ concat('profile-', state.employee._external_id) }}", so saving again updates the same record and the first save creates it. Read it back with a hidden record state whose default has a source over that type and a filter on the reference column eq "{{ state.employee._record_id }}"; the form fields default from state.<that key>.<column>, and a record block or text shows them. - Records kept in Valtrix that reference a synced record (days off per employee, notes per job) are listed with a filter on the reference column and totalled with a rollup on the parent's table or record block. A rollup equally totals a synced type against a parent kept in Valtrix. A computed column or field then combines the two: an allowance kept in Valtrix less the hours payroll synced. - A type that holds synced and hand-entered records alike (the employees payroll syncs plus two entered here) is one list. A form that adds one writes the canonical type, with propagate when the connected system declares that write and the request wants the record there, and without it otherwise. - Moving an existing applet's list onto the synced type is a small change, not a rebuild. Suppose state "employee" is picked from the organization's own profile records and every tab reads state.employee. Add a record state for the synced record ("payroll_employee") and point the picker block at it, with a source over the synced type and "connector" set when the request names one system. Turn "employee" into a hidden lookup: give it "default": { "source": { "records": "<the profile type>" }, "filters": [{ "column": "employee_id", "op": "eq", "value": "{{ state.payroll_employee._record_id }}" }] }. Every block, binding and action that reads state.employee keeps working untouched. Replace the form that typed a new one in by hand with a button shown while the lookup is empty ("visibleWhen": "{{ state.payroll_employee and not state.employee }}") whose upsert writes the profile with the reference column bound to the picked synced record, the name copied from it, an externalId derived from it, and "into": "employee". - A table column shows a value of the records that reference each row (the equipment on an assignment kept per pay group, the latest note per job) with a rollup whose fn is first or list, in either direction between a synced type and one kept in Valtrix. - One limit: one list cannot interleave two different types. Show those as two tables.

Appearance

The look of an applet is a closed set of named choices; there is no CSS, no custom HTML and no per-element color. - "theme", optional, beside "title": { accent, background, font, textSize, density, corners, logo }, every key optional. - accent: a six-digit hex color (#1f6f43) for buttons, focus rings, selected rows and charts; a color too light to read white text on is darkened when shown - background: a six-digit hex color (#0b1f4d) for the page behind the applet, light or dark; text, cards, borders, buttons and status colors follow it so everything stays readable (a dark background gives light text on cards a shade lighter than the page), and a color in between is lightened or darkened when shown. There is no separate text or card color - font: default, system, arial, verdana, tahoma, georgia, times, mono; default is the console font, system is the device font, mono is fixed-width - textSize: normal, large, xlarge; large and xlarge scale every text in the applet, for a shop floor screen or a phone in the field - density: comfortable or compact; compact tightens the spacing so more rows fit - corners: square, rounded, round; rounded is the default - logo: the organization logo shown above the applet; a person sets it from the Appearance menu, it is never shown to you and you never write it - Per block: a heading's "size", a text's "tone", a button's "variant" and "size", a section's "style", a stats item's "tone" (good, warn, bad; colors the value), a column's "align" (left, center, right; numbers and money align right on their own), and the "tone" of a source's "first" (colors the dropdown options put first; see Sources). - Leave "theme" out unless the request asks for a look. A new applet starts with the look of the organization's most recently published applet, and a theme you write is laid over it key by key.

Defaults

A state fills itself when the applet can work the value out. A text, number, date, or boolean state with "default" is re-evaluated from state and result whenever either changes, until the person edits the field. A choice state whose "default" is a binding behaves the same way, which is how a dropdown on an edit form starts on the value already saved; a choice default that is a plain option value is set once, when the applet opens or resets. A record state with "default" is looked up on the server through the filters, search, and pick described under State kinds. The lookup runs whenever the state and result values it reads change, and fills the state when the lookup is unambiguous. The person can always pick something else. A picker that also remembers a link tries the remembered pick first. A record state with a default and no picker is a hidden lookup (the latest purchase order, the last order on the picked job). Other defaults and bindings read it like a picked record. Start a document-first applet this way: a picker over document records, a read_document action, and then defaults that take the project from the document's project_id, the job from the project's number, the supplier from result.<read>.header.issuer, and the next number from a hidden lookup over the latest record. The person then confirms instead of typing. Give every default that could be wrong a note naming its source, so a wrong guess is visible.

Lookups

"lookups" at the top level holds named maps from one value to another: { "ledger_job": { "rec_project": "rec_job", ... }, "card_account": { ... } }. Use one when a row's value has to become another system's id and no synced column carries the match. lookup('ledger_job', row.project_id) returns the mapped value, or null when the key is absent or the value is null. A write binding is therefore "{{ lookup('ledger_job', row.project_id) }}" instead of a chain of if() calls. Keys and values are strings; a value may also be a number or null. At most 10 lookups of 1000 entries each, and every lookup an expression names must be declared. Use a lookup when the mapping is a fixed table of ids the person or the builder established (projects to accounting jobs by job number, card programs to card accounts). Use "links" when the match is made by a person at pick time and should be remembered per record.

Computed fields

"computed" at the top level holds named values worked out from each row of one entity type or table on the server, over every row, before anything is grouped, totalled or filtered: { "labor_cost": { "records": "time_entry", "value": "{{ row.hours * row.rate }}" }, "pay_period": { "records": "time_entry", "value": "{{ add_days('2026-01-04', floor(days_between('2026-01-04', row.work_date) / 14) * 14) }}" } }. Each is { records, value } or { table, value }, with value exactly one expression in one placeholder. A computed field is named like a column of that entity type or table in three places, and only there: a chart's group.column, the column of a metric (on a metrics block or a chart), and the column of a source filter. So total labor cost is { "fn": "sum", "column": "labor_cost" }, hours by two-week pay period is a chart with "group": { "column": "pay_period", "bucket": "day" } and "order": "group", and only the rows over forty hours is a filter { "column": "overtime", "op": "eq", "value": "true" } on a field "{{ row.hours > 40 }}". A date field takes a bucket like a date column; bucket day labels each group by its date. - The expression reads row.<column> for the entity type's or table's own columns and nothing else: no state, no user, no _refs, no _links, no keyed values. What a person picked is compared in the filter's value, never inside the field. - It works with numbers, text, true and false, null, + - * /, comparisons, and, or, not, and these functions: number, text, round, abs, floor, mod, min, max, lower, upper, trim, len, concat, before, after, if, coalesce, date, year, month, day, weekday, add_days, days_between, months_between, years_between, lookup. today() and now() are allowed as fixed values. + adds numbers only; join text with concat(). - floor(x) rounds down and mod(a, b) is the remainder, which is how rows fall into repeating periods: a period of 14 days counted from a known first day is add_days(<first day>, floor(days_between(<first day>, row.<date>) / 14) * 14), the first day of the row's period. - The two results of if() and the values of coalesce() are the same kind (both numbers, or both text). - A total needs a number, so a metric over a text column that holds numbers names a field "{{ number(row.<column>) }}". - A computed field is not a column a row carries: a table, a record block, an order, and a binding cannot read it. To show a worked-out value on each row, give the table column a "value" as before; to total or group by the same value, declare it here as well. - At most 20. The name is not the name of a column the entity type or table already has. Reach for a computed field whenever the figure or the grouping a person asks for is not a column: a total of one column times another, a count or sum of only some rows by a condition on two columns, weeks or periods that do not match the calendar buckets, a fiscal year that starts in another month, a band (0 to 30 days, 31 to 60, over 60) from days_between. A plain week that starts on another day needs none: that is group.weekStart.

Links

"links" at the top level declares remembered matches between a record of one connected system and a record of another, keyed by name. { "ledger_client": { "from": "customer_id", "entity": "customer", "connector": "sage-100-contractor" } } says that the record a row's customer_id names (a field-service customer) is matched to a client in the accounting system. A link with "key": true is remembered for a piece of text instead of a record: { "supplier_vendor": { "key": true, "entity": "vendor", "connector": "sage-100-contractor" } } remembers which vendor the supplier named on a quote is. The text is matched ignoring case and spacing. This is how a match a person makes once, between a name read off a document and a record, is kept. Such a link may still name a text column in "from", so rows carrying that text read the match under _links. A picker with "remember": { "link": "ledger_client", "from": "{{ state.invoice.customer_id }}" } stores the person's pick for that record and pre-selects it the next time. Every records row and picked record whose entity carries the from column reads the matched record under _links: - "{{ row._links.ledger_client.name }}" in a column - "{{ if(row._links.ledger_client, row._links.ledger_client.name, 'Needs client') }}" to show what is missing - "{{ row._links.ledger_client._record_id }}" in a propagated write's reference column, which the validator accepts because the link names the connector the write lands in - "{{ row._links.ledger_client }}" in an upsert_each require, so an unmatched row is held back rather than written without its client Links belong to the organization: two applets declaring the same from column, entity, and connector share them. _links is read in value expressions only, never filtered or sorted on. A link that names a connector reads its target through that connector, exactly as a picker over that connector would list it: a record the connection synced, or one whose propagated write to it has applied. A target that no longer exists, or that has not reached the connector yet (a client the applet is still creating, or whose create failed), reads as null. A require on the link therefore holds the row back until the create applies. The remembered match itself stays, and reads again once a retry of the create applies.

Follow-up writes

An upsert or upsert_each action may carry "then": up to 6 writes that run right after the record is written. Each is { label?, when?, source?, entity, externalId, data, propagate?, connection? }. Without source, the follow-up writes one record, with row being the record just written (the parent row of an upsert_each). With source, a records source whose filters read that row ("invoice_id" eq "{{ row._record_id }}"), it writes one record per row the source returns, with row being that row. In externalId and data, result.<action key> is the write before it: record_id (the Valtrix id of the record just written), external_id, intent_id, and status. A receipt written after an invoice binds "invoice_id": "{{ result.post_invoices.record_id }}". The runtime waits for the invoice to land in the connected system before sending the receipt, retrying on its own. when is a binding over the parent row that must be truthy for the step to run at all. Follow-up writes are how one press does everything a bookkeeper does for one document: the invoice, then the payment that settles it. They carry no lines. The result block shows each one under its row with its own status. A follow-up that fails does not undo the record before it. The person sees the failure on the row, and the write is retried from the Writes page. An upsert's "then" may also name other actions of the applet: { "action": "<action key>", label?, when? } runs that action after the write with result.<this action> in its scope, one after the other and in order, stopping at the first that fails. A chained action is an upsert, an upsert_each, or a render_document (never a read, which a person reviews first, and never an action that chains further); its own result block, document block, and result.<key> fill in exactly as if its button had been pressed. A chained upsert_each runs once for every row of its "from" state, the lines a person typed into an entry grid included, and only when it is chained may its externalId, data, and follow-ups read result: "invoice_id": "{{ result.save_invoice.record_id }}" on each line. This is how one Save button writes a record and everything under it, the invoice, then its journal entry, then one line per row of the grid: "then": [{ "action": "post_entry" }, { "action": "save_lines" }], where post_entry is an upsert that binds result.save_invoice.record_id and save_lines is an upsert_each over the grid whose data binds result.save_invoice.record_id and whose follow-up binds result.post_entry.record_id. A record that a later step must reference by its Valtrix id is written by an action of its own in the chain, never by a follow-up write, because only an action's record is in result. Never tell a person that saving a record and its typed lines takes two buttons. A chained upsert_each with no rows writes nothing and the chain goes on; when a row fails, the other rows are still written and the chain stops after that step. This is how one button creates the purchase order, prints it, and sends the PDF on: "then": [{ "action": "print_po" }, { "action": "email_po" }], where email_po is an upsert whose attachments read result.print_po.attachment_id. when is a binding over state and result (not row) that must be truthy for the step to run.

Sources

A source is either { "records": "<entity type>", "connector"?: "<connector slug>", "filters"?, "order"?, "first"?, "limit"? } reading canonical records, or { "table": "<published table name>", "filters"?, "order"?, "limit"? } reading a published table. Prefer a table when one covers the need. A records source may carry "first": { column, target: { entity, column, connector?, filters? }, format? }, the same column, target and format an in_entity filter takes. It hides nothing: the rows whose column value appears in that column of the other entity are listed first, in the source's order, and every other row follows, in the same order. Use it when a person wants the likely choices on top with the rest still pickable ("show the cost codes on the job's budget first"): the cost code picker's source is { "records": "cost_code", "order": { "column": "code", "direction": "asc" }, "first": { "column": "_record_id", "target": { "entity": "budget_line", "column": "cost_code_id", "filters": [{ "column": "project_id", "op": "eq", "value": "{{ state.job._record_id }}" }] } } }. A target filter's value may be a binding over state; while it is empty nothing is put first and the list keeps its plain order, and the block never waits for that state. In the dropdown of a picker or a record editor, a line separates the options put first from the rest, with nothing to declare. Three optional keys of "first" mark the two groups further: "label" is a heading over the options put first and "restLabel" a heading over the others (each up to 60 characters: "label": "On this job's budget", "restLabel": "Other cost codes"), and "tone" (good, warn, bad) colors the text of the options put first. A dropdown lists one page of options at a time, so a heading shows on a page only when that page holds options of its group. A table lists the rows put first at the top with no line, heading or color, so the three keys never go on a table's source. "first" belongs on the source of a picker or a table and on a record editor (below), never on a chart, a metric, a sourced choice, or a table source. "connector" narrows records to those synced from or successfully written to that system, including the nested lines of a successfully written document. A vendor picker for a write into the accounting system must read vendors from that system's connection. Filters are [{ column, op, value | values, optional? }] with op one of eq, neq, gt, gte, lt, lte, in, between, not_between, contains, is_null, not_null, not_in_entity, in_entity, marked, not_marked, written_here, written_in_valtrix. value and values are bindings over state, so "{{ state.estimate._record_id }}" filters child rows to the picked parent. A filter bound to a state the person may leave empty (a dropdown that narrows a list, a search box) carries "optional": true: while that state is empty the filter is skipped and every row shows, and once it is set the rows narrow; the block does not list that state in dependsOn and keeps its selection when it changes. Without "optional" a filter whose binding is empty matches nothing and the block waits for the state. There is no "not in" op: to leave several values out, add one neq filter for each (kind neq "vacation", kind neq "unpaid"). between and not_between take "values" with exactly two entries, the low and the high end, both included, on a text, number, or date column: account numbers 5000 to 5599 are { "column": "number", "op": "between", "values": ["5000", "5599"] }, and everything outside that range is the same with not_between. When both ends are numbers the column is compared as a number even if it is stored as text, so 10000 is not between 5000 and 5599. Sorting and filters operate on source columns, not computed columns. Source filters always apply in addition to interactive search and filters. Every filter must hold, unless filters share an "any" name: those are alternatives, and a row is kept when at least one of them holds. "any" is a short lowercase name ("mine"), at least 2 filters carry the same one, and a source may have several groups, each of which must be satisfied alongside the plain filters. The entries a person submitted or that were entered for them, still pending, are [{ "column": "status", "op": "eq", "value": "pending" }, { "column": "submitted_by_id", "op": "eq", "value": "{{ user.id }}", "any": "mine" }, { "column": "employee_id", "op": "eq", "value": "{{ state.me._record_id }}", "any": "mine" }]. An alternative whose binding is empty matches nothing while the others still apply, so the block never waits for the state it reads, and when every alternative of a group is empty the list is empty; "optional" is not allowed inside a group, and neither are not_in_entity, in_entity, marked, not_marked, or written_here, which always apply. Use a group whenever the request joins two conditions on a list with "or" ("mine or my crew's", "assigned to me or unassigned"); never build two lists, a second applet, or a computed column for it. Five ops do more than compare a column: - contains keeps text values that include the value anywhere, ignoring case. A document picker scoped to one folder tree filters path with contains "/Quotes/". - not_in_entity takes "target": { entity, column, connector? } and keeps only rows whose column value does not appear in that column of that entity. This is how an import list hides rows already imported. For an import that propagates, target.connector is the connector the write lands in, so a row is hidden once that system accepted it and a refused write comes back. Records written through Valtrix and never propagated carry connector "valtrix-api". The filter may also carry "format", a text with one {value} placeholder wrapped around the row's value before it is looked up, and target.filters, filters [{ column, op, value | values }] with op one of eq, neq, in, is_null, not_null over the other entity's rows, each value fixed text or a binding over state. Column number with format "{value} - FS" against accounting invoices filtered status neq void hides a field-service invoice that someone already entered by hand as "3386 - FS", which no external id links, while a voided invoice hides nothing. - in_entity is the opposite of not_in_entity, with the same "target", "format" and target.filters: it keeps only rows whose column value does appear in that column of that entity (the employees who already have a setup record, the invoices already imported). Either of the two may carry "value", a binding that switches the filter on: the filter applies while the binding is true and is skipped otherwise, and the block does not wait for the state it reads. One list that a person switches between finished and unfinished rows is a choice state with style tabs ("show", options incomplete, complete and all, default incomplete) and both filters on the list's source over the same column and target, not_in_entity with "value": "{{ state.show == 'incomplete' }}" and in_entity with "value": "{{ state.show == 'complete' }}"; on all, neither applies and every row shows. A not_in_entity that keeps an import from writing a row twice never carries "value". A target filter whose value is a binding narrows the other entity by what the person picked, which is how one list follows another through a third record type: the cost codes on the picked job's budget are the cost_code rows filtered { "column": "_record_id", "op": "in_entity", "target": { "entity": "budget_line", "column": "cost_code_id", "filters": [{ "column": "project_id", "op": "eq", "value": "{{ state.job._record_id }}" }] } }. While that binding is empty the whole filter is skipped and every row shows, and the list asks again when the state changes; list the state in dependsOn only when the block should wait for it. The target may be the list's own record type when the rules that link the two are kept as another kind of it: the pay groups a picked job pays are the classification rows of kind pay_group filtered { "column": "_record_id", "op": "in_entity", "target": { "entity": "classification", "column": "replacement_id", "filters": [{ "column": "kind", "op": "eq", "value": "job_pay_group" }, { "column": "project_id", "op": "eq", "value": "{{ state.job._record_id }}" }] } }, on a picker's source or in a record editor's filters, where a target filter may also read row, the line being edited ("{{ row.job }}" when the job is a cell of the same line). So a request to narrow a dropdown to the records another list names for the picked job, customer or employee is always this filter, and is never answered as something applets cannot do. To keep every row and put the matching ones on top instead of hiding the rest, use "first" on the source (below), never this filter. - marked and not_marked take column "_record_id" and, as value, the key of a mark a table of the applet declares. They keep only the rows a person has, or has not, stamped with it (see marks on the table block). Every row of an applet with marks carries _marks, { <key>: { reason, at } } for the marks it holds. - written_here (column "_record_id", no value, records sources only) keeps the records this applet itself wrote. A history list at the foot of an applet shows what was posted through it this way. Each such row carries _source_id (the id the connected system assigned once the write applied), _last_write_intent { id, status } (pending, applied, or failed), _created_by { kind, id, name }, and _changed_at for when it was written, readable in value expressions. - written_in_valtrix (column "_record_id", no value, records sources only) keeps the records a write from Valtrix created, by any applet, the console, or an API key, and leaves out everything a sync brought in. Use it when a person wants only what was entered here and not what was keyed in the connected system ("only show time created in Valtrix", "only the entries that came from the time entry applet"). A record an applet sent on to a connected system is still the record Valtrix wrote after that system syncs, so the filter keeps it among that system's rows; a record a sync brought in first and Valtrix changed later stays the connected system's. Every records row carries _created_by { kind, id, name } whether or not this filter is set: kind is applet, user, key, or connector for a row a sync brought in, and name is the applet's title, the person, the key, or the connected system. A column therefore says where each row came from: { "key": "entered_in", "label": "Entered in", "value": "{{ if(row._created_by.kind == 'connector', 'Sage 100 Contractor', row._created_by.name) }}" }. Never answer that a list cannot tell records made in Valtrix from synced ones. Every row carries its columns plus _record_id, _org_id, _connector, _synced_at, _changed_at, _frozen, and _attachment_id (the id of the newest stored attachment of the row's record, null when none; a table row from a grouping step has none). _attachment_id filters with is_null and not_null on records and rows alike, so a picker over emails or documents keeps only the ones that carry a file. Records also carry _external_id (the id in the source system) and _created_by and _updated_by, each { kind, id, name } naming who wrote the record (kind applet, key, user, or connector). These are readable in a value expression such as "{{ row._updated_by.name }}" but are not filter columns. A record row also carries _refs, one entry per reference column the applet reads. Each holds the record that column names with its own columns plus _title (its display name), or null when the id resolves to nothing. A card transaction's cardholder is "{{ row._refs.employee_id.name }}" and its card "{{ concat(row._refs.financial_account_id.name, ' ', row._refs.financial_account_id.mask) }}". The same works from a picked record: "{{ state.job._refs.customer_id._title }}". _refs is read in value expressions only, never filtered or sorted on, and only reference columns of the entity appear under it. A table row (a published table) has no _refs of its own. The record picked in a record editor cell is read the same way, under the cell's key: a line typed into an entry block with a cell { "key": "employee", "editor": { "type": "record", "entity": "employee", ... } } reads "{{ row._refs.employee._title }}" and any column of the picked employee, and so does a table row with an editable record editor column. This is how the name of what a person picked on a line is shown beside it or written onto the saved record as text. _frozen is true on a row whose record aged out of the connector's sync window and is no longer refreshed. Filter on it with op eq and value "false" to show only maintained rows. A keyed column holds several named values as JSON text, one key per name the source defines: line_item.wbs carries an estimating line's WBS codes keyed by slot name, {"Bid Item":"1","Locations":"20-WLLFRMG"}. The column itself compares as the whole text, so a filter, an order, a chart group, or a choice's options names one key after a dot instead: column "wbs.Locations" with op eq keeps the lines coded to that location, order { "column": "wbs.Locations" } sorts by it, and a choice with options { source, column: "wbs.Locations" } lists the codes present. The key is the name exactly as the source prints it, spaces included ("wbs.Bid Item"), and the value compares as text. Only a column the entity marks as keyed takes a key; the validator names the keyed columns of a source when a dot is used on any other. order is { column, direction }. limit defaults to 200 and may go up to 1000 for internal bounded reads; browsing tables and pickers uses cursor pages and is not capped by this legacy limit. Bulk actions accept at most 1000 selected rows. Identical source requests share results within the applet. Refresh and Retry reload them.

Bindings and expressions

A binding is a string with "{{ expression }}" placeholders. A string that is exactly one placeholder keeps the expression's typed value (a number stays a number). Text around placeholders is interpolated. Expressions are paths over state, row, rows, result, and user (state.vendor.name, row.quantity, result.create_po.status, user.email), string, number, true, false, and null literals, + - * /, comparisons == != < <= > >=, and, or, not, and these functions: sum, count, money, date, coalesce, concat, slug, now, number, text, round, lower, upper, len, if, min, max, abs, join, lookup, before, after, number_at, trim, today, year, month, day, days_between, months_between, years_between, weekday, add_days, floor, mod, member_name, member_email, sum_where, sum_before, count_where. - sum(rows, 'column') and count(rows) take a rows state or array - One line of a rows state is read by its position in square brackets, counting from 0: state.contacts[0].name is the name typed on the first line of the grid, state.contacts[1].phone the phone on the second, and a position past the last line reads as empty, so nothing needs guarding. The position is always in brackets, never after a dot (state.contacts.0 is not an expression), and the column after it is one the grid or the table carries. This is how the lines of a grid are saved into numbered columns of one record, the first line into contact_1_name and contact_1_phone and the second into contact_2_name and contact_2_phone: the upsert's data binds "contact_1_name": "{{ state.contacts[0].name }}", "contact_1_phone": "{{ state.contacts[0].phone }}", "contact_2_name": "{{ state.contacts[1].name }}" and so on, with one column on the record type for every line and cell it keeps. The record holds only as many lines as it has numbered columns, so the save button carries enabledWhen ("{{ count(state.contacts) <= 3 }}") and a text block says how many lines are kept. A write leaves out a value that is empty and never empties a column, so a record saved again with fewer lines keeps what the removed lines had put in their columns: always save the number of lines too, in a number column of its own ("contact_count": "{{ count(state.contacts) }}", which is written even when it is 0), show each numbered set elsewhere only while the count reaches it ("visibleWhen": "{{ state.customer.contact_count >= 2 }}"), and say in the summary that the count tells which sets are current. Never answer that the lines of a grid cannot be saved into numbered fields of one record, or that one line cannot be read by its number - sum_where(rows, 'column', 'match', value) totals only the rows whose match column equals value, and count_where(rows, 'match', value) counts them; further 'match', value pairs narrow it more. sum_before(rows, 'column', 'match', value) is the same total over only the lines above the current one, a running total. In a computed column of an entry block, rows is every line of the grid, so the hours typed for the same employee on the lines above is "{{ sum_before(rows, 'hours', 'employee', row.employee) }}" and for the same employee and day "{{ sum_before(rows, 'hours', 'employee', row.employee, 'work_date', row.work_date) }}". They read typed cells and rollup columns; a computed column of a line further down is not worked out yet - money(x, 'USD') and date(x) format a value - coalesce, concat, slug, now, number, text, round(x, digits), lower, upper, len, if(condition, a, b), min, max, abs, and join(rows, 'column', ', ') behave as named - today() is today's date (YYYY-MM-DD) and year(date) its year; days_between(from, to), months_between(from, to) and years_between(from, to) count whole days, months and years from one date to another, so years of service is years_between(row.start_date, today()) and an allowance by tenure is if(years_between(row.start_date, today()) >= 10, 15, if(years_between(row.start_date, today()) >= 3, 10, 5)) - weekday(date) is the day of the week as a number, 1 for Monday through 7 for Sunday, and add_days(date, n) is the date n days after it (before it when n is negative), as YYYY-MM-DD. A calendar week or a weekly pay period is worked out with them, never shown as a rolling seven days. A week that runs Monday to Sunday starts on add_days(today(), 1 - weekday(today())); a week that runs Sunday to Saturday starts on add_days(today(), if(weekday(today()) == 7, 0, 0 - weekday(today()))). The week ends six days after its start, add_days(<start>, 6), the week before starts at add_days(<start>, -7), and a two-week period is the same with 13 and -14. A list, total or chart covers the period with two filters on its date column, gte the start and lte the end, and a heading shows it as "{{ date(<start>) }} to {{ date(<end>) }}". A chart that totals by week takes the same week from group.weekStart, the day the week or pay period begins on (sunday for Sunday to Saturday), never the default Monday when the person's week starts on another day; a period longer than a week (every two weeks) is a computed field the chart groups by (see Computed fields). A person who names the day their week or pay period ends on is asking for this - month(date) is the month as a number, 1 through 12, and day(date) the day of the month, 1 through 31, beside year(date). A date printed month first, 11/05/2026, is concat(if(month(<date>) < 10, '0', ''), month(<date>), '/', if(day(<date>) < 10, '0', ''), day(<date>), '/', year(<date>)); leave the two if() parts out for 11/5/2026. The first day of the month a date falls in is add_days(<date>, 1 - day(<date>)), and a calendar month is covered with two filters, gte that day and lt the first day of the next month, which is the first day of the month that add_days(<first day>, 31) falls in. Never answer that a date can only be shown year first or that the month and day cannot be read - A balance (an allowance less what was used) is computed, never typed: a record block over the picked record carries a rollup field for what was used, and a later field subtracts it from the allowance, "{{ if(years_between(row.start_date, today()) >= 10, 15, if(years_between(row.start_date, today()) >= 3, 10, if(years_between(row.start_date, today()) >= 1, 5, 0))) - row.vacation_used }}". A metrics block shows a total but an expression cannot read it, so a figure that enters a calculation is a rollup field, not a metric. A hand-set starting balance is a record state with a default that takes the latest adjustment (pick "first", ordered newest first), read as state.<key>.<column>, with the rollup filtered to the days on or after its date - floor(x) rounds a number down and mod(a, b) is the remainder of a divided by b, never negative for a positive b - lookup('name', key) reads the top-level "lookups" map of that name. Translate one value into another with a lookup, never with if() nested more than two deep: the stored kind of each leave type a person picks is "lookups": { "leave_kind": { "Personal day": "personal", "Military leave": "leave", "Weather day": "other" } } read as "{{ coalesce(lookup('leave_kind', state.leave_type), 'other') }}" - before(text, separator) and after(text, separator) split a text at the first separator (the number and the short name of "139 - Acme Plumbing"); trim(text) strips the ends - number_at(text, n) is the nth number written in a text, counting from 1, and empty when the text holds fewer: of the payment terms "2/10 Net 30", number_at(terms, 1) is the discount percent 2, number_at(terms, 2) the discount days 10, and number_at(terms, 3) the net days 30, so the last day of an early-payment discount is "{{ if(number_at(state.vendor.payment_terms, 3), add_days(state.invoice_date, number_at(state.vendor.payment_terms, 2)), '') }}" and stays empty for terms with no discount such as "Net 30". Use it to read days, percents or quantities out of a short free-text value instead of a lookup table of every spelling There is no eval, no assignment, no loops, and no reading of other records beyond _refs and lookups. An expression never reads records or tables itself, but it reads a record state, and a record state with a default is looked up from the records on the server (see Checking against other records), which is how a value a person typed is checked against what already exists. A row's value is therefore checked against another entity (an estimate item whose cost code does not exist in the accounting system) with a second table over the rows whose source filters with not_in_entity, never with a computed column. A total per row over related records (each job's budget, the amount invoiced to each customer, the hours on each task) is a rollup column on the table, which the server totals; a computed column cannot sum other records. A value per row from a list that does not reference the row (the number range an account falls in, the rate in force on an entry's date) is a rollup column whose filters read the row, which the server matches. A total that a calculation or a write reads, on the form or on each line of an entry grid, is a number state with "total" or an entry column with "rollup" (see Totals a form acts on). A path may only name columns the row or record carries: its entity's columns, the meta columns, and _refs.<reference column>. Validation refuses a path to a column the entity does not have, so never guess a column such as employee_name on an entity whose profile lists only employee_id. A record state is null until picked, so guard buttons with enabledWhen such as "{{ state.estimate and state.vendor and count(state.lines) > 0 }}".

The person running the applet

"user" is the signed-in person the applet is running for: user.id, user.name, user.email, and user.role (owner, admin, or member). It reads anywhere state does (a source filter, a default, visibleWhen, enabledWhen, a write binding) and is filled in on the server, so a person cannot pose as someone else. Use it whenever the request says "my", "their own", or "whoever is logged in". - A list of the person's own rows filters on it: { "column": "assigned_to", "op": "eq", "value": "{{ user.id }}" } for work assigned to them, { "column": "email", "op": "eq", "value": "{{ user.email }}" } for their own staff record. - The staff record of the person (the employee payroll syncs) is a hidden record state: "me": { "kind": "record", "entity": "employee", "default": { "source": { "records": "employee" }, "filters": [{ "column": "email", "op": "eq", "value": "{{ user.email }}" }] } }. A timesheet then writes "employee_id": "{{ state.me._record_id }}" and lists the entries filtered on it, with no picker, so nobody enters time for someone else. Add "visibleWhen": "{{ not state.me }}" on a text block that says their login email matches no employee, so the gap is visible. - When the emails cannot match (the system keeps no email), give that state a picker with "remember": { "link": "<a link with key: true>", "from": "{{ user.email }}" } instead: the person picks themself once and is pre-selected from then on. - Stamp who did something by writing "{{ user.id }}" into a column of its own and "{{ user.name }}" into another for display, and show a control to some people only with "visibleWhen": "{{ user.role != 'member' }}". - Decide who may see a row by ids, never by names: filter on the column that holds user.id or on the reference to the person's staff record ("{{ state.me._record_id }}"). Two people can share a name, and a name typed differently in two systems hides a person's own rows. When the rows so far carry only a name, add the id column, write it from now on, and match on the name only as a second alternative of the same "any" group so the older rows still show. - "Some people see everything, the rest see their own" is two lists over the same source, each a section with its own visibleWhen: the full list under "{{ user.role != 'member' or <the approver test> }}" with no filter on the person, and the narrowed list under the opposite test with the filters on the person. One list for the rest that shows what they submitted or what was entered for them is an "any" group (see Sources). - When a person says a row is missing from a list, or that someone cannot see what they should, the cause is in that list's filters or in the visibleWhen of its section, and you can read both. Answer with the reply tool by going through every filter of that list for the person named: what the filter compares, the value it has for them (their role, their id, the staff record their login resolves to, or that it resolves to none), and which filter leaves the row out; filters all apply together unless they share an "any" name, so two filters on the person keep only the rows that pass both. Then say the one change that fixes it. Never send the person to another page to check a status, and never say the data cannot be read from here, before doing this. - An automatic action runs without a person, so it never reads user. When an applet runs through the API on a key that is not a person's, user is empty.

Work queues

A work queue is how several people take one piece of work through steps: an invoice that arrives, is coded, is sent to the right person, is approved, and only then is written to the accounting system. Build one from parts that already exist; nothing here is a separate mode. - The work item is a record kept in Valtrix: an upsert with no "propagate". For a document with lines (a bill, an order) save it as that canonical type with its lines, its status in a status column (review_status on a cost), and its file under attachments with attachmentName, so the file is kept and named. What the canonical type has no column for (who it is assigned to, a note, a reason) goes in a custom type with a reference column to it, written by a follow-up under "then". - The queue is a table with "list" over those records, in the left pane, filtered by status through a choice field with style tabs (optional filter), and to the person with a filter on user.id for "assigned to me". The center pane holds a section with the document block, the right pane the sections with the fields, the entry block and the buttons, each depending on the record state the list fills. - Opening an item fills the fields again: every text, number, date and choice state takes "default" from the opened record ("{{ state.item.invoice_number }}", and "{{ state.item.review_status }}" on a dropdown whose option values are the saved statuses), every record state a default filtered on the opened record's reference ("_record_id" eq "{{ state.item.payee_id }}"), and the entry block a "load" over its saved lines. Defaults are re-evaluated each time another item is opened. - Each step is an upsert on the same externalId ("{{ state.item._external_id }}") that changes the status and whatever else the step sets: Save, Send to (with a members choice state; see Email for telling that person by email), Reject, Approve. Give Approve "allowedWhen" so only the right people can press it. - The final step is the same upsert with "propagate": true and the connection. A record saved in Valtrix first and propagated later is created in the connected system at that moment, with its lines and files, under the same record. - Add an activity block under the fields so everyone sees who did what. - A new item enters the queue from an upload block with "read" (the file is read as it arrives) and a first Save, or from the applet's inbox (see Inbox).

Inbox

"inbox", beside "title", gives a published applet an email address of its own: { "inbox": { "accept"?: ["pdf", "image", "spreadsheet"] } }. Anyone forwards an email to that address and each attached file the applet accepts becomes a document record of the organization within a few minutes, kept for 90 days unless a write attaches it to a record of its own. The applet shows its address at the top of the page; you never write the address. - The files are listed with a records source over document filtered { "column": "_record_id", "op": "written_here" } and { "column": "path", "op": "eq", "value": "inbox" }, newest first by created_at. Each row carries name (the file name), description (the email subject), uploaded_by (who sent it), created_at, and _attachment_id. - Make that list the queue: a table with "list", a recordState of entity document, and "openRuns" naming the read_document action, so opening a file reads it. Give the table a mark ("Done") and filter not_marked, and the file leaves the inbox once it has been handled; a second list filtered marked shows what was handled. - When the applet also has an upload block, read from whichever is set: "document": "{{ coalesce(state.inbox_file._record_id, state.uploaded_file._record_id) }}", and show "{{ coalesce(state.inbox_file._attachment_id, state.uploaded_file._attachment_id) }}". - Use it when the request says the files arrive by email, are forwarded, or come from a shared mailbox, and no connected system holds that mailbox.

Email

An applet never sends email on its own. The inbox only receives, and no action emails anyone by itself. An email goes out only as a write to a connected system that sends mail: an upsert on message with "kind": "email", "subject", "recipients" (one address or several separated by semicolons) and "body", with "propagate": true and the connection of a system whose writes in the connected systems list include creating a message. It is sent from that connection's mailbox, in that person's name, with the write's attachments on it. - To tell a person in the applet about work sent to them, chain it after the step: "then": [{ "action": "email_assignee", "when": "{{ state.assignee }}" }], where email_assignee is that message upsert with "recipients": "{{ member_email(state.assignee) }}". - When no connected system has that write, build everything else without the email and say in the summary that the applet cannot email anyone yet, that connecting a mailbox such as Outlook under Connections makes it possible, and that asking again afterwards adds the email. The person assigned still finds the work in their list. Never promise an email the applet does not send.

Automation

An upsert_each action with "auto" is the one thing in an applet that runs without a person. After the trigger fires, the runtime reads the table that feeds the action's rows state exactly as the page would, keeps the rows the optional "rows" binding accepts, and runs the action on up to maxPerRun of them. The org turns the automation on from the applet page, where the dialog lists the rows that would be written right away. When the action declares "since", the person also picks the start date (today by default), and rows dated before it are never written. The org can pause, resume, turn it off, or run it now from there. For that to be safe, the shape is checked at validation: - the feeding table's source carries a not_in_entity filter, so a row already written is never listed again (idempotency comes from the source, not from memory) - that source and the table's computed columns read no state - the table does not sit behind dependsOn - the action's externalId, data, and "rows" bindings read only row - "connection" is a fixed id - only one action per applet carries "auto" A write that fails, or a propagated write the connected system later refuses or contradicts, pauses the automation. The applet page shows the pause with the reason. A run also waits while writes from the previous run are still pending. Build the interactive list (table, stats, button, result) as usual, so the page stays the preview of what the automation does. Add "auto" only when the request asks for something to happen on its own (after a sync, on a schedule).

Files

A file reaches an applet in one of three ways: a record a connected system synced carries it (an email with its attachment, a document from a folder, a bill with its PDF; the connected systems list says which entity types carry files), a render_document action made it, or a person uploaded it through an upload block. An upload block fills a record state declared with "entity": "document". That state is then a picked record like any other: a read_document action reads "{{ state.quote._record_id }}", a document block shows "{{ state.quote._attachment_id }}", and an upsert's "attachments" can send it on, or its "optionalAttachments" when the write also has to work with no file uploaded. Use it when the request says to upload, drag, drop, or attach a file from the person's own computer, or when no connected system holds the file. The upload is kept for 30 days. A document block shows the file itself, so the person checks the source beside what was read from it: put one next to the entry block a read_document fills, bound to the same record's _attachment_id, and one after a render_document bound to result.<key>.attachment_id so the printed PDF is seen on the page rather than only downloaded. A record that keeps several kinds of file (two printed forms, an uploaded proof, a photo) shows each kind in its own section when it is opened again. _attachment_id is only the newest file of the record, whatever it is, so it cannot do this; a document block with "record" and "named" can, because it shows the newest file whose name begins with the text it names. Three things make it work together: each render_document action's "filename" begins with the name of its form, the upsert that saves the record lists every file it keeps as { file, name } with a name that begins the same way as the section's viewer, and each viewer carries "record" and "named" beside the "attachment" binding it already had for the file made or uploaded in this session. Never answer that a section can only show the newest file of a record, or that the viewers cannot tell which saved file belongs where. A form a person signs (a tax withholding form, an acknowledgement of a policy, a waiver) is four parts. The details are saved as a record first, by an upsert. An upload block with "signature" takes the signature and the acknowledgement into a record state ("signature": { "kind": "record", "entity": "document" }). A render_document action with layout custom prints the saved record with the signature on it: "signatures": { "employee": "{{ state.signature._record_id }}" }, and in the template <img src="{{ signatures.employee.image }}" style="height: 48px"> above a line with "{{ signatures.employee.signed_by }}" and "{{ date(signatures.employee.signed_at) }}"; its button carries "enabledWhen": "{{ state.signature }}". A document block bound to result.<key>.attachment_id shows the signed PDF, and an upsert's "attachments" keeps it on the record. The person who signs is the signed-in person running the applet, so a new hire signs their own form in their own session. When the form is in the form library (irs-w4, irs-w9, uscis-i9, wi-wt4) use layout form instead of a custom template for the third part: the PDF is then the agency's official form filled in, with "fields" in place of the template and the signature named as the form names it. For any other form, a state withholding form, a vendor's or an association's own form, the printed page is the template's own layout of the form's fields; it is not the official PDF filled in, so say so when a request asks for the official form.

Voice

A person who asks to speak, dictate, talk, or just say an entry gets three parts: a text state for what is heard, a voice block, and a read_speech action. In state, { "spoken": { "kind": "text" } }. As the first block of the form, { "type": "voice", "state": "spoken", "read": "fill_from_speech", "label": "Say a time entry", "help": "Try: 8 hours yesterday on Elm Street, cost code 300" }. In actions, "fill_from_speech": { "kind": "read_speech", "text": "{{ state.spoken }}", "fills": ["job", "cost_code", "work_date", "hours"] }. A form that is a grid of lines is filled by voice too: name the entry block's rows state in "into", beside "fills" for the pickers and fields above the grid. A crew time form with a job picker, a date and a grid of employee, cost code and hours gets "fill_crew_from_speech": { "kind": "read_speech", "text": "{{ state.crew_spoken }}", "fills": ["crew_job", "crew_date"], "into": "crew_lines" }, and "Yesterday on Elm Street, John Davis eight hours framing and Mike Jones six hours steel" fills the job and the date and adds two lines under the lines already there. Each person or item named becomes one line, at most 20 a sentence, and every input column of the grid can be said. Never answer that voice cannot fill a grid, several lines, or several people at once. An applet with several forms (one per tab, or one per kind of entry behind a choice) gets a text state, a voice block and a read_speech action for each form, the voice block first in its form and the action filling that form's own inputs. A request for voice that names no form is built on every form a person types an entry into, grids included, in the same turn. Never ask which form, and never ask leave to add it. Speaking only fills the form. Keep every picker, field and write button the form already has, with its "confirm" text: the person checks what was filled, corrects by hand what was matched wrong, and presses the button. Never run a write from speech, and never drop an input because it can be spoken. For a sentence that is typed rather than spoken, use a field block with "multiline": true over the text state and a button that runs the same read_speech action.

Checking against other records

What a person typed is checked against the records that already exist through a hidden lookup: a record state with a default and no picker, which the server looks up again whenever the values it reads change. Everything else then reads that state like a picked record. - A duplicate check. "existing_bill": { "kind": "record", "entity": "cost", "default": { "source": { "records": "cost" }, "filters": [{ "column": "payee_id", "op": "eq", "value": "{{ state.vendor._record_id }}" }, { "column": "invoice_number", "op": "eq", "value": "{{ state.invoice_number }}" }], "pick": "first" } } finds a bill already entered for the same vendor and number, whichever system it came from. The invoice number field carries "check": { "ok": "{{ not state.existing_bill }}", "note": "This vendor already has an invoice with this number" }, a text block with tone warn and "visibleWhen": "{{ state.existing_bill }}" says which one, and the write carries "allowedWhen": "{{ not state.existing_bill }}" with "denied" so a duplicate cannot be saved. When the record being edited is itself among the matches, add a filter that leaves it out ("_external_id" neq "{{ state.item._external_id }}" is not a filter column, so compare in the check instead: "ok": "{{ not state.existing_bill or state.existing_bill._record_id == state.item._record_id }}"). - A match on a typed number. "po": { "kind": "record", "entity": "contract", "default": { "source": { "records": "contract", "connector": "<the accounting connector>" }, "filters": [{ "column": "number", "op": "eq", "value": "{{ state.po_number }}" }, { "column": "kind", "op": "eq", "value": "purchase_order" }] } } finds the purchase order whose number was typed or read off a document. A check on the PO number field shows whether it was found ("ok": "{{ not state.po_number or state.po }}", "note": "No purchase order has this number"), a record block or stats show its vendor, total and status beside the invoice, and a load_rows action brings its lines into the grid. - A comparison. Once the other record is in state, compare in bindings: "{{ state.po.total - sum(state.lines, 'amount') }}" is what is left on the order, a stats item with tone bad while it is negative shows an overbilling, and a check holds the approval back. Line by line, load the other record's lines with load_rows into entry columns of their own (ordered quantity, ordered price) beside the ones the person edits, and compute the difference per line in a computed column. - A lookup that finds several rows fills nothing unless "pick" is "first"; to show every match (all possible duplicates), add a table whose source carries the same filters. Never answer that a value cannot be checked against existing records, and never offer a list to eyeball as the only way: build the lookup.

Looking a value up

A value that depends on another list (which pay group a job pays, which rate applies to a customer, who approves a cost code) is looked up from the records that hold the rule. It is never asked of the person as a second pick and never refused. Where it is looked up depends on where it is used. - On a form: a hidden lookup, a record state with a default and no picker (see Defaults and Checking against other records). "foreman_rule": { "kind": "record", "entity": "<the rule type>", "default": { "source": { "records": "<the rule type>" }, "filters": [{ "column": "project_id", "op": "eq", "value": "{{ state.job._record_id }}" }, { "column": "applies_to", "op": "eq", "value": "foreman" }], "pick": "first" } } finds the rule kept for the picked job, and "{{ state.foreman_rule.pay_group_id }}" is the pay group it names. Declare one hidden lookup per rule that may apply, each filtered by what the person picked: the equipment ("{{ state.equipment._record_id }}"), the cost code, the employee's position ("{{ state.employee.position_code }}"). - On each line of an entry grid: a lookup column, a rollup with fn first (see the entry block), filtered by the cells of that line and by state. A hidden lookup on the form is one record shared by every line, so a rule that depends on what a line picked (that line's cost code, its equipment) is always a lookup column and never a hidden lookup; the rule type may be a custom type, and one lookup column per rule that may apply is declared on the grid, each with a filter on the cell it follows ("cost_code_id" eq "{{ row.cost_code }}"). - On each row of a table or on a record block: a rollup column whose filters read the row (see the table block), which finds the record of another list that the row's own values match, with no reference between the two. This is how every listed row is placed in a band, bracket, tier or period ("range_from" lte "{{ row.number }}" and "range_to" gte "{{ row.number }}"; "valid_from" lte "{{ row.work_date }}" and "valid_to" gte "{{ row.work_date }}") or matched on a shared code ("code" eq "{{ row.cost_code }}"), and a computed column and rowTones then flag the rows that match nothing or disagree with what was found. On a form the same two filters over state, in a hidden lookup, place a typed value: "account_range": { "kind": "record", "entity": "<the range type>", "default": { "source": { "records": "<the range type>" }, "filters": [{ "column": "range_from", "op": "lte", "value": "{{ state.account_number }}" }, { "column": "range_to", "op": "gte", "value": "{{ state.account_number }}" }], "pick": "first" } }. Keep the two ends of a band in number columns (date columns for a period). - Choosing between them is an expression with if and coalesce, first match wins: "{{ if(state.job.certified_payroll, coalesce(if(state.foreman, state.foreman_rule.pay_group_id, null), state.equipment_rule.pay_group_id, state.cost_code_rule.pay_group_id, state.pay_group._record_id), state.pay_group._record_id) }}" on a form, and the same over row.<lookup column> in a computed column of a line. Bind the result into the write, and show the name of what was chosen in a text block ("{{ state.foreman_rule._refs.pay_group_id._title }}") or on the line through row._refs.<lookup column>._title. - Comparing values that sit on two different records is plain arithmetic once both are picked or looked up. The higher of the employee's rate and the pay group's rate is "{{ max(state.employee.regular_rate, state.pay_group.regular_rate) }}" on a form, and "{{ max(row._refs.employee.regular_rate, row._refs.pay_group.regular_rate) }}" in a computed column of a line whose employee and pay group cells are record editors, with if() choosing the regular, overtime, or premium pair by the pay type on the line. min, max, if and coalesce all take values from different records, and the write stores the result like any other value. - A rule that only applies in some cases is the same expression inside if(): a certified payroll job, a checked box on the line, a kind of line. Never answer that an applet cannot look one record up against another list, cannot work out which range, bracket or period a value falls in, cannot pick a value by a rule, or cannot compare two records and keep the higher or lower value: build the lookups and the expression. What is refused is only a rule whose inputs no record holds, and the reply then names the column that is missing.

Totals a form acts on

A figure over records that a calculation, a rule or a write has to read is never a metrics block or a table rollup, which only show it. It is one of two things, both worked out by the server and worked out again when the action runs, so the figure a write uses is never stale. - One figure for the whole form: a number state with "total" (see State kinds). What is already invoiced against the picked purchase order, the cost already posted to the picked job, the days off the picked employee has taken this year, how many bills this vendor already has with the typed invoice number. Read it as state.<key>. - One figure per line of an entry grid: a column with "rollup" and "of" (see the entry block). The hours each line's employee already has this pay period, the amount already billed against each line's cost code. What a person is typing right now is not in the records yet, so add it with sum_where and sum_before over the grid (see Bindings and expressions). Deciding regular against overtime as time is entered is the pattern. The grid has a record editor column "employee", a date column "work_date", a number column "hours", a rollup column "week_saved" for the hours already saved that week ({ "records": "time_entry", "of": "{{ row.employee }}", "fn": "sum", "column": "hours", "filters": [{ "column": "started_at", "op": "gte", "value": "{{ add_days(row.work_date, 1 - weekday(row.work_date)) }}" }, { "column": "started_at", "op": "lt", "value": "{{ add_days(row.work_date, 8 - weekday(row.work_date)) }}" }] }), then computed columns: "week_before": "{{ row.week_saved + sum_before(rows, 'hours', 'employee', row.employee) }}", "regular_hours": "{{ max(0, min(row.hours, 40 - row.week_before)) }}", "overtime_hours": "{{ row.hours - row.regular_hours }}". A daily rule is the same with a rollup filtered to the line's own date and 8 in place of 40, and a threshold that differs by job or by employee is read from the record the line picked or from a lookup. The write then sends row.regular_hours with the regular pay type and, in a follow-up with "when": "{{ row.overtime_hours > 0 }}", row.overtime_hours with the overtime pay type under an external id of its own; or, when a line is never split, one write whose pay type is chosen by "{{ if(row.overtime_hours > 0, <the overtime pay type>, <the regular pay type>) }}", each the id of a pay type record a hidden lookup found or the value the entity's column takes. A date column that holds a time of day is bounded with gte the day and lt the day after, never eq. Entry windows. A rule about which dates may be entered ("only this pay period", "no more than a week back", "up to four weeks ahead") is plain date arithmetic with today, weekday, add_days and days_between, and it is always buildable when the period is the same for everyone: weekday gives 1 for Monday through 7 for Sunday, so the week that holds today starts on "{{ add_days(today(), 1 - weekday(today())) }}" when weeks run Monday to Sunday and on "{{ add_days(today(), 0 - mod(weekday(today()), 7)) }}" when they run Sunday to Saturday, it ends six days later, last week starts seven days before that, and a two-week period is counted from a known first day with floor and days_between as under Computed fields. Put the window on the date field itself with "earliest" and "latest" (see the field block), which the picker and the server both enforce. A date that is a column of a grid line is held to the same window with "require" on the action, "rows": "{{ row.work_date >= add_days(today(), 0 - mod(weekday(today()), 7)) and row.work_date <= add_days(today(), 28) }}" and a message that names the window; a date that is one field above the grid is a field and takes earliest and latest, never "require". Ask which day the week starts on only when the request does not say. What cannot be built is a period that differs per employee and is kept only in the payroll system's setup: build the window for the period the person names and say that a per-employee period is not read. Working it out again over entries already saved. A button that recalculates overtime, or any allocation, across entries that already exist is an upsert_each over the selected rows of a table, and it is always buildable. The action puts the rows in "order" (the employee, then the date), since the split depends on which entries come first, and carries the working in "compute", where each value is worked out one row after another and may read the rows above with sum_before: "compute": { "daily_rule": "{{ row._refs.job_id.certified_payroll == true }}", "day_before": "{{ sum_before(rows, 'hours', 'employee_id', row.employee_id, 'work_date', row.work_date, 'daily_rule', true) }}", "regular": "{{ max(0, min(row.hours, 40 - sum_before(rows, 'regular', 'employee_id', row.employee_id), if(row.daily_rule, 8 - row.day_before, row.hours))) }}", "overtime": "{{ row.hours - row.regular }}" }, and its data writes "{{ row.regular }}" and "{{ row.overtime }}". A rule that differs by job is a value of its own that reads the job the row names or a lookup, and jobs that share a daily rule count together because the match is on that value, not on the job. Ask which jobs follow which rule when the request does not say and no column of the job holds it. Three rules keep it right. Write the result into columns of its own (regular_hours and overtime_hours beside hours), never back into the column the working reads: each row is written and read again before the next, so a run that overwrote hours would work the later rows out from the changed figure, and pressing the button twice would split what was already split. Every entry of an employee's week has to be in the run, so the table lists one pay period, the person selects all of it, and a run takes at most 1000 rows. And the write that later sends the time on reads the two columns: the regular hours with the regular pay type and, in a follow-up with "when": "{{ row.overtime_hours > 0 }}", the overtime hours with the overtime pay type under an external id of its own. The same shape guards a limit: "allowedWhen": "{{ state.billed_so_far + sum(state.lines, 'amount') <= state.po.total }}" with a denied message refuses an overbilling on the server, and a stats item with tone bad shows it before the press. Rules: a total counts the records a sync or a write has already put in Valtrix, so a write still pending in the connected system is counted once it is saved here; a total's filters take the plain comparison ops (not in_entity, marked, or written_here); a rollup's "of" and filters read only cells a person fills in on that line; and none of this is needed to show a figure, which stays a metrics block, a chart, or a table rollup.

Choices that depend on other choices

The options of one control follow what was chosen in another. - Between blocks: a picker, a sourced choice, or a table whose source filters bind the other state, with "optional": true when the list should show everything until the other is chosen. The subaccounts of the picked account are a picker over the subaccount records filtered "account_id" eq "{{ state.account._record_id }}". - Inside a grid: a record editor's "filters" bind row, the line being edited, by the keys of the block's own columns. A subaccount cell that offers only the subaccounts of the account picked on the same line is "editor": { "type": "record", "entity": "<subaccount type>", "display": "{{ row.name }}", "filters": [{ "column": "account_id", "op": "eq", "value": "{{ row.gl_account }}" }] }, where gl_account is the key of the account column of that entry block. In "display", row is the option; in "filters", row is the line. Without "optional" the cell offers nothing until the other cell is filled, which tells the person the order to fill them in. - A rule that only applies in one case is an optional filter whose binding is empty in the other case. Job cost accounts only when the line has a job: { "column": "number", "op": "between", "values": ["{{ if(row.job, '5000', '') }}", "{{ if(row.job, '5599', '') }}"], "optional": true }, and the overhead accounts only when it has none: { "column": "number", "op": "not_between", "values": ["{{ if(row.job, '', '5000') }}", "{{ if(row.job, '', '5599') }}"], "optional": true }. Both filters on the same editor give each case its own list. The same works on a picker with state in place of row. - The dropdown re-reads its options when the cells or states its filters read change. A value already picked that no longer fits stays until the person changes it, so add a check or a require when the write must refuse it. Every picker and every record cell can be cleared from inside its dropdown, so never add a button whose only job is to empty one.

Applets that work together

The applets of one organization read and write the same records, so work is split across applets freely: a vendor created in a "New vendor" applet is in the vendor picker of the invoice applet the next time that picker is opened or searched, an invoice saved in one applet is listed in the approval applet, and a custom type declared by one applet is read by another under the same slug. - A link block opens another applet in a new tab, by its slug from the list of the organization's applets, optionally with one record already opened ("open"). Use it to send a person to the applet that owns a job (add a vendor, set up a job, review the purchase order) and bring them back to this one where they left it. - When the request asks to move part of this applet into its own applet, or to link to an applet that does not exist yet, say that the other applet is built first from the Applets page and offer the exact request to type there; once it exists, the link is one block here. Do not answer that applets cannot be linked. - The applet being changed is never linked to itself.

Showing and hiding blocks

Every block may carry "visibleWhen", a binding over state and result; the block is left out of the page while it is falsy and appears when it becomes truthy. A row, a panel or a section with visibleWhen hides as one. Use it for the controls that only make sense in one case: the "Add vendor" field and button only while no vendor is picked ("{{ not state.vendor }}"), a note only once a read has finished ("{{ result.read_quote.status == 'done' }}"), a second step only after the first write applied ("{{ result.create_po.status == 'applied' }}"). A section still waits on dependsOn for the pick it needs; visibleWhen on a section is for a part of the page only some people or some cases see. One column of a table, one column of an entry grid, and one field of a record block hide the same way: "visibleWhen" on the column or field, a binding over state and user (see the table, entry and record blocks). A Foreman tick column that only applies to certified payroll jobs is { "key": "foreman", ..., "visibleWhen": "{{ state.job.certified_payroll }}" }, and a rate column only owners and admins see is "visibleWhen": "{{ user.role != 'member' }}". Never answer that a column cannot follow what was picked elsewhere on the form, and never hide the whole grid when one column was asked for. A tab whose blocks are all hidden is left out of the tab strip, so a tab is shown to some people only by putting the same visibleWhen on every top-level block that names it: an Admin review tab that only owners and admins see is each of its sections with "tab": "Admin review" and "visibleWhen": "{{ user.role != 'member' }}". A member then sees no such tab, and when only one tab is left for them the strip itself is not shown. This hides the tab from the page; what a person may do is still decided by allowedWhen on each action.

Rules

- Every state key a source's filters read must be listed in that block's dependsOn or in the dependsOn of the section holding it. Put the blocks that follow a pick (child rows, a related record, the write button) in a section with dependsOn on that state, so the form opens step by step. - A table that fills a rows state must be selectable; only one table or entry block fills a given rows state. - Rows a person types or pastes (quote lines, scope lines, anything not yet in a connected system) go in an entry block, never in a table: a table lists rows a source holds and cannot take a new one. - Every column in a filter, order, table column (without value) or write must exist on the entity type or table, and every path in an expression (row.x, state.pick.x) must name a column that row carries; the record a reference column names is reached through _refs (row._refs.project_id.name), the only lookup an expression can make. - Every upsert and upsert_each action must carry a "confirm" text: the runtime shows it in a confirmation dialog before anything is written, and adds a line saying the write also lands in the connected system when propagate is true. A write with propagate: true must also target an entity type a connected system can write and carry every required field of that write op. - A reference column in a write with propagate: true must be bound to a record from the connection the write lands in: a picker, table or record editor whose source has "connector" set to that connection's connector. A reference copied from a row or a pick of another connector is refused, because the connected system only accepts its own records. The feeding table of a propagated upsert_each must hide written rows with a not_in_entity filter whose target.connector is that same connector. - A figure over every row a source returns (a total, a count, an average, a chart) comes from a metrics or chart block, which the server computes; a figure per row of a table over related records (the budget, cost, or invoiced amount beside each job) is a rollup column on that table, and so is a name or text those records hold (fn first or list); a grouped list of totals a person wants "as a table, not a chart" is a chart with kind table; a stats block only reads state, so it totals what a person ticked or typed. Lead a dashboard with metrics and charts, then the lists; a list a person only reads needs no selectable and no rows state. - Reads are live; the applet never stores rows. - A record kept in Valtrix that a person wants gone for good (deleted, discarded, removed everywhere) is removed with "remove" on the table that lists it; a mark only hides a row from the lists that filter on it. - A button on a list row that should change the record everywhere (reject it, approve it, void it, a Delete that sets a status) is a "rowActions" entry on the table naming the upsert action that does it, never a mark, and never a refusal: a mark is this applet's own stamp and no other applet or system sees it. - A dropdown or list that should follow what was picked elsewhere through another record type, or through another kind of its own type (the cost codes on the picked job's budget, the pay groups a picked job's pay-group rules name), is an in_entity filter whose target.filters bind the picked record when only the matching rows should show, and "first" on the source or the record editor when the matching rows should come first with the rest still offered. - A person's judgement that a row must never be written (an in-house invoice that does not go to accounting) is a mark on the table, hidden by a not_marked filter, never a filter on a column the source does not carry; a match between two systems a person makes once (which Sage client a Housecall Pro customer is) is a link remembered by a picker, never a name comparison in an expression. - Nothing runs on its own unless an upsert_each action carries "auto"; every other write happens when a person presses a button. - Before answering that something cannot be built, go through what is here: a hidden lookup or a lookup column finds the record a rule names and an expression compares or chooses between records (Looking a value up), visibleWhen on a column shows it only in some cases, rowTones shade the rows of a table by a condition, written_in_valtrix and _created_by tell what was entered in Valtrix from what was synced, a hidden lookup reads other records (Checking against other records), a rollup with fn first or list puts a value of the records that point at each row in a table column, a rollup whose filters read the row places each row of a table in the band, bracket or period of another list that its own values fall in and lets rowTones flag the ones that fit none, a number state with "total" or an entry column with "rollup" totals other records for a calculation or a write to act on (Totals a form acts on), load_rows brings records into a grid or fills it with one line per day between two dates, a cell default with refill follows what was picked elsewhere on the form, an editor's filters make one cell's options follow another, a collapsible section folds, a chart of kind table with series is a cross-table (one thing down the side, another across the top) and with totals carries a total row, a link opens another applet, a computed field groups, totals or filters by a value no column holds, and a custom type keeps what no connected system has a column for. Only what none of them covers is refused, and a refusal always names the nearest thing that can be built and what it would take for the rest (a column the connector does not sync is asked for with "missing"). - A label is the name of the thing and nothing else. Never write "optional", "required", or the name of the connected system in a label or a placeholder; set "required" on the field and the page marks it, and say where a value comes from in "help" when it matters.

List applets

GET/v1/applets

Lists the applets of every organization you can reach that has applets enabled, oldest first, each with its published definition. Not paginated. An organization-scoped key lists its organization's applets; a platform-wide key lists across every granted organization, or one with org.

Parameters
orgstring

Narrow to one organization by id. 404 org_not_granted when it has not connected to you, 403 applets_not_enabled when applets are not enabled for it.

Returns
appletsarray

Applet objects, oldest first.

$ curl https://api.valtrix.com/v1/applets \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-G -d "org=org_7f3k2m"
{
"applets": [{ "id": "app_4k2m9x", "org_id": "org_7f3k2m", "slug": "import-housecall-pro-work-orders-into-sage-100", "title": "Import Housecall Pro work orders into Sage 100", "status": "live", "version": 3, "definition": { ... }, "published_at": "2026-09-30T09:12:00Z", "published_by": { "kind": "key", "id": "key_8m2kf4", "name": "Deploy" }, "note": "Adds the placed date column", "has_draft": false, ... }]
}

Retrieve an applet

GET/v1/applets/:id

Fetches one applet by id with its published definition and version. The version it returns is the expected_version an update takes, so a read usually comes right before one.

Parameters
idpath

The applet id.

Returns

The applet object, or 404 applet_not_found.

$ curl https://api.valtrix.com/v1/applets/app_4k2m9x \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "id": "app_4k2m9x", "org_id": "org_7f3k2m", "slug": "import-housecall-pro-work-orders-into-sage-100", "title": "Import Housecall Pro work orders into Sage 100", "status": "live", "version": 3, "definition": { "version": 1, "title": "Import Housecall Pro work orders into Sage 100", ... }, "published_at": "2026-09-30T09:12:00Z", "published_by": { "kind": "key", "id": "key_8m2kf4", "name": "Deploy" }, "note": "Adds the placed date column", "has_draft": false, ... }

Retrieve the definition format

GET/v1/applets/definition-format

Returns the applet definition format as one Markdown document: the envelope, every state kind, block type, and action kind, the guide to sources, bindings, links, lookups, follow-up writes, and automation with the rules the validator enforces, and a complete example. It is the content this reference documents under The applet definition, rendered from the catalog the running API validates against, so it is the text to hand a model or a coding agent before it writes a definition. Works with any key.

Returns
titlestring

The document's title.

markdownstring

The whole format as Markdown text.

$ curl https://api.valtrix.com/v1/applets/definition-format \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "title": "The applet definition", "markdown": "# The applet definition\n\n..." }

Create an applet

POST/v1/applets

Creates an applet from a definition and publishes it as version 1, so the organization's members can open it straight away. The definition is validated against the organization's connected systems and data exactly as the console validates it, and every source it reads is queried once; a definition that fails either check is refused with the problems listed and nothing is created. A platform-wide key names the organization with org. Requires a key with write access.

Parameters
orgstring

The organization to create the applet in, by id. Required on a platform-wide key (400 org_required otherwise); an organization-scoped key creates in its own organization and must omit it.

definitionobject, required

The applet definition, a JSON object in the shape documented under The applet definition below. Its title becomes the applet's title and the base of its slug.

notestring

What this version is, in one sentence for the people who use the applet; it shows beside the version in the console's history. At most 500 characters. Optional.

Returns

The applet object at version 1. 422 definition_rejected with issues when the definition does not validate or a source does not run, 409 applet_limit_reached when the organization holds as many applets as it can, 403 applets_not_enabled when applets are not enabled for the organization.

$ curl https://api.valtrix.com/v1/applets \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "org": "org_7f3k2m", "definition": { "version": 1, "title": "Import Housecall Pro work orders into Sage 100", ... }, "note": "First version" }'
HTTP/1.1 201 Created
{ "id": "app_4k2m9x", "org_id": "org_7f3k2m", "slug": "import-housecall-pro-work-orders-into-sage-100", "title": "Import Housecall Pro work orders into Sage 100", "status": "live", "version": 1, "definition": { ... }, "published_at": "2026-09-12T14:00:00Z", "published_by": { "kind": "key", "id": "key_8m2kf4", "name": "Deploy" }, "note": "First version", "has_draft": false, ... }

Publish a new version

PATCH/v1/applets/:id

Replaces the applet's definition and publishes it as the next version. The definition is validated and its sources dry-run exactly as on create; nothing changes when it is refused. expected_version must be the version GET /v1/applets/:id returned, so two writers cannot overwrite each other. A definition identical to the published one is a no-op and creates no version. Publishing turns off the applet's automation, when it has one, until someone turns it on again from the console. Requires a key with write access.

Parameters
idpath

The applet id.

definitionobject, required

The whole new definition, not a patch, in the shape documented under The applet definition below.

expected_versionnumber, required

The version the applet is at now, from GET /v1/applets/:id. 409 applet_version_conflict when it has moved on.

notestring

What changed, in one sentence for the people who use the applet; it shows beside the version in the console's history. At most 500 characters. Optional.

replace_draftboolean

true discards unpublished draft changes someone made in the console and publishes this definition instead. Without it, an applet with a draft answers 409 applet_draft_exists and nothing changes.

Returns

The applet object at its new version. 404 applet_not_found, 409 applet_version_conflict when expected_version is stale (the response carries the current version), 409 applet_draft_exists when the console holds a draft and replace_draft is not true, 422 definition_rejected with issues when the definition does not validate or a source does not run.

$ curl -X PATCH https://api.valtrix.com/v1/applets/app_4k2m9x \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "definition": { "version": 1, "title": "Import Housecall Pro work orders into Sage 100", ... }, "expected_version": 3, "note": "Adds the placed date column" }'
{ "id": "app_4k2m9x", "org_id": "org_7f3k2m", "slug": "import-housecall-pro-work-orders-into-sage-100", "title": "Import Housecall Pro work orders into Sage 100", "status": "live", "version": 4, "definition": { ... }, "published_at": "2026-09-30T09:12:00Z", "published_by": { "kind": "key", "id": "key_8m2kf4", "name": "Deploy" }, "note": "Adds the placed date column", "has_draft": false, ... }

Run an applet action

POST/v1/applets/:id/actions/:action

Runs one action of the applet's published version with the inputs sent, the way a person pressing its button does: the inputs are checked against the definition, a record input is looked up, the rows of an upsert_each are re-read from the applet's own source, every guard the definition declares applies, and each write goes through the same write path as the console, attributed to the applet. An action that declares confirm refuses to run until confirm: true is sent, and the refusal carries the confirmation sentence to read back (409 confirmation_required). One call runs at most ' + String(APPLET_ACTION_MAX_ROWS) + ' rows (400 applet_rows_limit); the applet's automation works through more. A propagated write returns its intent, read with GET /v1/write-intents/:id. Honours Idempotency-Key. Requires a key with write access.

Parameters
idpath

The applet id.

actionpath

The action key, as named under actions in the definition and listed in the applet's manual.actions.

Idempotency-Keyheader, optional

Any unique string, up to 255 characters. A repeat of the same key on this API key within 24 hours replays the original response instead of running the action again, so a retried call never writes twice.

stateobject

The applet's inputs keyed by state name, as listed under manual.inputs: text, number, date, boolean, and choice values as a person would type them, a record input as its _record_id (omit it when the definition looks the record up on its own), and a rows input as a list of _record_id values of the applet's own source rows. Inputs left out take the definition's defaults. 400 invalid_state names an input that is missing, unknown, or not valid.

resultobject

For an applet whose actions run one after another, the result object an earlier call returned, passed back as is: the definition's bindings over result.<action> (a read document's header, a created record's record_id, a rendered PDF's attachment_id) read it, exactly as the applet page carries it between buttons. The response merges this action's own entry into it for the next call. 400 invalid_result when it is not an object.

confirmboolean

true confirms an action whose definition declares confirm. Without it such an action answers 409 confirmation_required carrying the rendered sentence in confirmation; run it again with confirm: true once the person has agreed.

row_idstring

For an upsert_each action, the _record_id of one of the submitted rows to act on alone. Every submitted row is acted on otherwise. 400 invalid_state when it names a row that was not submitted.

Returns
appletobject

{ id, title, version } of the applet and the version that ran.

actionstring

The action key that ran.

confirmationstring or null

The action's confirmation sentence rendered with the inputs, or null when the action declares none.

rowsarray

One entry per row acted on (a single entry with row_id null for an upsert or a document action). Each carries status (written, held by a guard, or failed), error, record ({ id, entity, external_id, created }), write_intent (the write intent object when the write propagates, else null), warnings, lines, follow_ups (one entry per follow-up write with its record_id, write_intent, and error), chain (the actions the definition chains after this one, each with its outcome; they ran in this same call), document for a rendered or read document, read_rows for the lines a read document produced, and into, the state key the definition fills with this result (send the created record.id as that input, or the read_rows as that rows input, on the next call).

resultobject

The result sent in merged with this action's entry under its key (status, record_id, external_id, intent_id, attachment_id, filename, url, row_count, and the counts), the object the applet's bindings read as result.<action>. Pass it back as result on the next action of the same applet.

writtennumber

Rows written.

heldnumber

Rows a guard held back.

failednumber

Rows whose write failed.

404 applet_not_found or applet_action_not_found, 409 applet_not_published when the applet has no published version, 400 invalid_state when an input is missing, unknown, or not valid, 400 applet_rows_limit over the per-call cap, 409 confirmation_required when the action asks for confirmation and confirm is not true.

$ curl https://api.valtrix.com/v1/applets/app_4k2m9x/actions/import \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: import-2026-10-25-a" \
-d '{ "state": { "rows": ["rec_9f2k7d", "rec_9f2k7e"] }, "confirm": true }'
{
"applet": { "id": "app_4k2m9x", "title": "Import Housecall Pro work orders into Sage 100", "version": 4 },
"action": "import",
"confirmation": "Import 2 work orders totalling $3,420.00 into Sage 100 Contractor?",
"rows": [
{ "row_id": "rec_9f2k7d", "status": "written", "error": null, "record": { "id": "rec_x1", "entity": "order", "external_id": "hcp-4471", "created": true }, "write_intent": { "id": "wi_2k9f1a", "status": "pending", "connection_id": "conn_s100", ... }, "warnings": [], "lines": 0, "follow_ups": [], "chain": [], "document": null, "read_rows": null, "into": null },
{ "row_id": "rec_9f2k7e", "status": "held", "error": "Match the Sage 100 client first", "record": null, "write_intent": null, "warnings": [], "lines": 0, "follow_ups": [], "chain": [], "document": null, "read_rows": null, "into": null }
],
"written": 1,
"held": 1,
"failed": 0,
"result": { "import": { "status": "pending", "record_id": null, "done_count": 1, "failed_count": 0, "total_count": 2, ... } }
}

Start an automation run

POST/v1/applets/:id/runs

Queues one run of the applet's automatic action, the same as pressing Run now on its page: the automation's own source, row rule, since column, and per-run cap apply, the run executes within seconds on the automation worker, and it runs whether or not the automation is armed. Returns 202 with the queued run; a run already queued for the applet is returned instead of a second one. Follow it with GET /v1/applets/:id/runs/:runId. Requires a key with write access.

Parameters
idpath

The applet id.

Returns
appletobject

{ id, title, version } of the applet and its published version.

runobject

The applet run object, queued.

createdboolean

false when a run was already queued and is returned instead.

404 applet_not_found, 409 applet_not_published when the applet has no published version, 409 applet_no_automation when its published version has no auto action.

$ curl -X POST https://api.valtrix.com/v1/applets/app_4k2m9x/runs \
-H "Authorization: Bearer $VALTRIX_API_KEY"
HTTP/1.1 202 Accepted
{ "applet": { "id": "app_4k2m9x", "title": "Import Housecall Pro work orders into Sage 100", "version": 4 }, "run": { "id": "arun_8h2k1m", "trigger": "run_now", "status": "queued", "reason": "Run now through the API", "error": null, "queued_at": "2026-10-25T07:00:02Z", "started_at": null, "finished_at": null, "duration_ms": null, "rows_seen": 0, "rows_written": 0, "rows_failed": 0, "write_intent_ids": [], "requested_by": "Deploy (API key)" }, "created": true }

List automation runs

GET/v1/applets/:id/runs

The applet's automation runs, newest first: what each one saw, wrote, and failed, and the write intents it produced. Not paginated; limit bounds the list.

Parameters
idpath

The applet id.

limitnumber

Runs to return, 1 to 50. Defaults to 10.

Returns
appletobject or null

{ id, title, version } of the applet, or null before its first publish.

runsarray

Applet run objects, newest first.

404 applet_not_found.

$ curl https://api.valtrix.com/v1/applets/app_4k2m9x/runs \
-H "Authorization: Bearer $VALTRIX_API_KEY" \
-G -d "limit=5"
{
"applet": { "id": "app_4k2m9x", "title": "Import Housecall Pro work orders into Sage 100", "version": 4 },
"runs": [{ "id": "arun_8h2k1m", "trigger": "run_now", "status": "succeeded", "reason": "3 of 12 rows written, the rest wait for the next run.", "error": null, "queued_at": "2026-10-25T07:00:02Z", "started_at": "2026-10-25T07:00:04Z", "finished_at": "2026-10-25T07:00:09Z", "duration_ms": 5120, "rows_seen": 12, "rows_written": 3, "rows_failed": 0, "write_intent_ids": ["wi_2k9f1a", "wi_2k9f1b", "wi_2k9f1c"], "requested_by": "Deploy (API key)" }]
}

Retrieve an automation run

GET/v1/applets/:id/runs/:runId

One automation run of the applet by id, with its status, counts, and write intent ids. Poll it after POST /v1/applets/:id/runs until status leaves queued and running.

Parameters
idpath

The applet id.

runIdpath

The run id, as returned by POST /v1/applets/:id/runs or listed by GET /v1/applets/:id/runs.

Returns
appletobject or null

{ id, title, version } of the applet.

runobject

The applet run object.

404 applet_not_found or applet_run_not_found.

$ curl https://api.valtrix.com/v1/applets/app_4k2m9x/runs/arun_8h2k1m \
-H "Authorization: Bearer $VALTRIX_API_KEY"
{ "applet": { "id": "app_4k2m9x", "title": "Import Housecall Pro work orders into Sage 100", "version": 4 }, "run": { "id": "arun_8h2k1m", "trigger": "run_now", "status": "succeeded", "reason": "3 of 12 rows written, the rest wait for the next run.", "error": null, "queued_at": "2026-10-25T07:00:02Z", "started_at": "2026-10-25T07:00:04Z", "finished_at": "2026-10-25T07:00:09Z", "duration_ms": 5120, "rows_seen": 12, "rows_written": 3, "rows_failed": 0, "write_intent_ids": ["wi_2k9f1a", "wi_2k9f1b", "wi_2k9f1c"], "requested_by": "Deploy (API key)" } }