API access & tokens
Everything the Tessule app does goes through its REST API, and that same API is open to your own scripts, integrations, and external applications. This guide covers the two kinds of credential you can mint — personal API tokens for scripts and server-to-server integrations, and OAuth clients for external applications that act on a user’s behalf — plus the per-workspace OpenAPI document that describes your tables as typed endpoints, and the rate limits that apply.
If you only remember one thing: there is no separate “API permission system”. Every credential resolves to a principal in the same roles model the app uses — an API token is a principal with member-level baseline permissions (or none, if it is role-only), never more than its creator’s own, and an OAuth token acts as the user who approved it, further capped by the scopes they approved. A credential can never do more than the permission model allows.
Who can do what
Section titled “Who can do what”- Create and revoke API tokens — requires the
tokens:manageaction, granted to admins and members by default. Readers deliberately cannot create tokens: a token acts with member-level (write-capable) permissions, so minting one is a write-capability grant. - Create agents and attach roles to them — requires the
agents:manageaction, which members and admins hold. An agent takes only roles its owner holds; whoever holdspermissions:managemay attach any role. - Create integrations, attach roles to them, and issue their tokens —
requires the
integrationAccounts:manageaction, which admins hold. You attach only roles you hold yourself; whoever holdspermissions:managemay attach any role. - Assign extra roles to an API token — requires
permissions:manage(admin-only), the same action that governs the role editor. The role’s assignments dialog offers your own tokens. - Approve an OAuth client — any signed-in user can approve access for themselves, to workspaces they are a member of. The resulting token is bounded by their own permissions.
- Enable AI record writes over MCP — an organization owner/admin decision; see AI assistants & MCP.
Five ways into the API
Section titled “Five ways into the API”| Credential | Best for | Acts as |
|---|---|---|
| Personal API token | Scripts, CI, backups, server-to-server integrations | Its own principal: member-level baseline (or none, if role-only), plus any roles assigned to the token, never more than its creator |
| Integration token | A machine that works for the workspace: a scanner, a feed, a device (see Integrations) | The integration: exactly its roles, and named on everything it writes |
| OAuth access token | External apps and AI clients acting for a user | The approving user, capped by the approved scopes |
| Connected app token | Your organization’s own frontend, signed in through your identity provider (see Connected apps) | The signed-in member, capped by the app’s ceiling |
| Your session | The app itself, and quick manual experiments | You |
All five are sent the same way, as a bearer token:
Authorization: Bearer <token>Base URL
Section titled “Base URL”The REST API is served at:
https://api.tessule.com/apiEvery path in this guide and in the API reference is relative to
it: GET /tables is https://api.tessule.com/api/tables. The MCP endpoint
is https://api.tessule.com/mcp (see AI assistants & MCP).
The platform’s own OpenAPI document — every operation in the reference, the
same for every workspace — is public at
https://api.tessule.com/api/openapi/v1/openapi.json (GET /openapi/v1/openapi.json)
and, as YAML, GET /openapi/v1/openapi.yaml. No token is needed, the answer
is cacheable, and its servers block names this base URL, so a code
generator or a linter can read it by URL. It describes no workspace’s tables;
for those, see the per-workspace OpenAPI spec.
Personal API tokens
Section titled “Personal API tokens”Create and manage tokens from the user menu → API Tokens
(/settings/api-tokens in the app). Programmatically: GET /api-tokens
lists yours, POST /api-tokens creates one, and
DELETE /api-tokens/{tokenId} revokes one.
Creating a token
Section titled “Creating a token”A token has a name (e.g. “CI pipeline”, “backup script”), an optional expiry date — leave it blank for a token that never expires — and its starting access:
- Member access (the default): the member baseline, described below.
- Role-only: nothing at all until a role is attached to it. Use this for
a narrow credential, such as one that only deploys a custom app from CI
(a role holding just
hostedSites:manage). Over the API, pass"baseRole": "none"toPOST /api-tokens.
The token list shows each token’s short ID, its access (Member or Role-only), creation date, last used date (handy for spotting abandoned credentials), and expiry.
A token is scoped to one workspace
Section titled “A token is scoped to one workspace”Every token is bound — cryptographically, inside the token itself — to the workspace you were signed into when you created it. It can never read or write any other workspace. To integrate with two workspaces, create a token in each.
What a token is allowed to do
Section titled “What a token is allowed to do”Four rules decide what a token may do:
- A token does not inherit your role. Every API token starts from the member baseline — even when its creator is an admin — or from nothing, if it is role-only. An admin’s token cannot manage members, roles, or apply schema plans.
- Tokens can be widened with roles. A token is a first-class principal in
the roles model: an admin can assign custom roles to it in Workspace
Settings → Roles (a role’s assignments dialog lists your own tokens), or
with
POST /roles/{roleId}/assignments(passing anapiTokenId). Its effective permissions become the union of its baseline and every assigned role. - A token never does more than its creator can. Whatever roles it holds, a token is limited to what its creator may do at the moment it is used. If the creator is demoted, their tokens lose the difference at once, and get it back if they are promoted again.
- Record visibility applies as you. On private tables, the token sees the records its creator owns or has been granted — “own” means owned by you.
Revocation, expiry, and lifecycle
Section titled “Revocation, expiry, and lifecycle”- Revoking is immediate. Every request verifies the token against its stored record; a revoked token fails on the next call. Anything using it stops working at once.
- Expiry is checked on every request — an expired token behaves exactly like a revoked one.
- Losing workspace access kills your tokens. When your workspace membership is removed (or you are removed from the organization), the API tokens you held in that workspace are deleted with it. They do not revive if you are re-added — you mint new ones.
A quick test
Section titled “A quick test”curl -H "Authorization: Bearer crm_..." \ https://api.tessule.com/api/tablesAgents
Section titled “Agents”An agent is a principal of its own that you create, attach roles to, and connect an AI client to. Where a personal OAuth grant lets the client do what you can do (narrowed by the scopes you approve), a grant made as an agent lets it do only what the agent’s roles allow — never your own baseline, never your other roles — still narrowed by the scopes. That is the answer to “what stops it doing something stupid”: the agent holds exactly the roles you gave it, and nothing else.
Programmatically: GET /agents lists your agents (every agent in the
workspace when you hold permissions:manage), POST /agents creates one,
PATCH /agents/{agentId} renames, describes, disables or enables it, and
DELETE /agents/{agentId} deletes it with the roles attached to it.
Attaching roles
Section titled “Attaching roles”POST /agents/{agentId}/roles attaches a role; DELETE /agents/{agentId}/roles/{roleId} detaches it. The cap is enforced when you
attach, not on every request:
- You may attach a role you hold yourself — one of the custom roles assigned to you. You cannot hand an agent a role you do not have.
- Someone who holds
permissions:managemay attach any role, under the same anti-escalation rule as every other role assignment: the role’s grants must be within their own. The same holds forPOST /roles/{roleId}/assignmentswith anagentId, where an agent is a principal like a member, an API token or a flow. - When you lose a role, every agent you own loses it at the same moment. When you leave the workspace, your agents are disabled.
An agent has no baseline role, so a freshly created one can do nothing until a role is attached.
Connecting a client as an agent
Section titled “Connecting a client as an agent”On the consent screen, choose the agent under Act as (the default is yourself). The tokens issued then act as the agent: the access token carries the agent’s id beside your user id, every request checks that the agent still exists, is yours and is enabled, and a refresh re-checks it too. Disabling or deleting the agent therefore ends its access on its next request, not when its token expires.
A request made through an agent’s grant can never create or change agents, so an agent cannot give itself, or another agent, roles it was not given.
What an agent’s writes look like
Section titled “What an agent’s writes look like”What the agent writes is yours: the record’s createdBy and ownedBy are
you, and the audit trail’s userId is yours. Beside that, the audit event’s
userMetadata.agent and the record history entry’s agent name the agent,
so you can tell an agent’s writes from your own at a glance.
Integrations: connecting a machine
Section titled “Integrations: connecting a machine”An integration is a principal the workspace owns, made for a machine: an invoice scanner, a payroll feed, a telematics box. A personal token stops or narrows when the member who made it leaves or loses a role, and what it writes is that member’s. An integration belongs to the workspace instead:
- It holds exactly the roles attached to it, over no baseline. A new integration can do nothing.
- It cannot sign in. It reaches the API only with the tokens issued to it.
- What it writes names it: a record’s
createdBy, the record’s history and the audit trail all show the integration, by name. - It is never counted as a seat, never emailed or notified, and is not listed among the members or offered when you pick a person. It has its own list.
GET /integration-accounts lists the workspace’s integrations, with their
roles and how many tokens each holds. POST /integration-accounts creates
one, PATCH /integration-accounts/{integrationId} renames, describes,
disables or enables it, and DELETE /integration-accounts/{integrationId}
deletes it.
Attaching roles
Section titled “Attaching roles”POST /integration-accounts/{integrationId}/roles attaches a role, and
DELETE /integration-accounts/{integrationId}/roles/{roleId} detaches it. As
with agents, you attach a role you hold yourself, and whoever holds
permissions:manage may attach any role whose grants are within their own.
The change applies to the integration’s next request.
Give the role the least the machine needs. A scanner that delivers to an
intake needs to read tables and records, create
records, stage files (attachments:manage), and create rows in the
metadata tables it writes, granted on the
role per metadata table. It needs nothing to update or delete.
Tokens
Section titled “Tokens”POST /integration-accounts/{integrationId}/tokens issues a token that acts
as the integration. Give it a name (where it is installed) and, if you want,
an expiresAt. The value, crm_..., is in that answer only.
GET /integration-accounts/{integrationId}/tokenslists the tokens, never their values.POST /integration-accounts/{integrationId}/tokens/{tokenId}/rotateissues a new token with the same name and expiry and revokes the old one in the same write.DELETE /integration-accounts/{integrationId}/tokens/{tokenId}revokes a token on its next request.
Disabling an integration stops every one of its tokens at once, and enabling it again brings them back. Deleting it deletes its tokens and roles. What it wrote keeps its name, in history and the audit trail.
Only a person manages integrations. A request made with an integration’s own
token, or through an agent, cannot create or change integrations, and an
integration cannot issue itself a token through POST /api-tokens.
Installing a partner
Section titled “Installing a partner”A partner that serves many customers, such as a scanning service, can be offered for install. Instead of you issuing it a token, the partner mints its own short-lived tokens for each workspace that installed it.
-
Install it.
POST /integration-accountswith anameand the partner’spartnerClientId, which the partner publishes. Optionally sendscopesto narrow what its tokens may ever do here; omitted, the install takes the partner’s whole ceiling. A workspace holds one install per partner. -
Attach roles, as for any integration. An install with no roles can do nothing.
-
Tell the partner your workspace. It asks the token endpoint for a token naming it:
POST /oauth/tokengrant_type=client_credentialsclient_id=...&client_secret=...resource=https://api.tessule.com/workspaces/ws_0123abcdThe token lasts 15 minutes and acts as the install. It carries no refresh token: the partner asks again.
An install’s partnerClient and scopes say whose it is and what its tokens
may do. Disabling it or deleting it stops the partner’s tokens on their next
request. The workspace issues an install no tokens of its own: POST /integration-accounts/{integrationId}/tokens is refused for one.
The per-workspace OpenAPI spec
Section titled “The per-workspace OpenAPI spec”Your workspace publishes a live OpenAPI 3.1 document describing its own
API surface: download it from Workspace Settings → API Spec, or fetch it
with GET /workspace/openapi.
What’s in it:
- Your tables as typed endpoints. Every table you have defined becomes a
set of concrete list/get/create/update/patch/delete operations, with request
and response schemas generated from your actual fields — a picklist becomes
a string with its options, a date field a
format: datestring, and so on. Field descriptions carry through. A list’sfilteris typed too: each field takes only the operators its type takes, and each operator the value it takes, and the same typed filter is what the table’s aggregate, report, export and saved views take. The same holds for the table’s bulk create, bulk update and bulk patch, its recycle bin, and, where it has a recurrence or a stage field, its occurrences and its stage moves. - The record-graph write, typed to your tables. The body of
POST /records/graphis a union of one create and one update per table plus a delete: each names the table by name or id and carries that table’s own fields, with{ "ref": "<name>" }accepted where a record id goes. See Writing many records at once. - Your intakes as typed endpoints. Every published intake is an
operation of its own, and a
jsonintake’s inline document is typed to its document schema. See Intakes. - The event stream, typed to your tables. The workspace’s WebSocket
reports changes as they happen, and the document describes every frame it
sends as
WorkspaceEvent, told apart bytype. A record change carries the record as its own table types it, chosen bypayload.tableId, with the fields the recipient may read. The rootx-realtimeblock gives the address and how to connect: with an access token as thetokenquery parameter, which is what a connected app holds. A personal API token cannot open the stream. - Approval conditions and import rules, typed. The
conditionan approval rule is created or updated with isApprovalRuleCondition, and the rule chain an import request sends for a column is a list ofImportRule, one shape per rule. Both are the shapes the server validates with. A rule or a chain read back is left open. The plan sent toPOST /dashboard-plans/validateandPOST /dashboard-plans/applyis typed the same way, asDashboardPlanDocument, and so is a flow: the document a flow is created or its draft saved with isFlowDocument, a union of one shape per trigger and per step, and the single step sent toPOST /flows/{flowId}/blocks/testis aFlowBlock. A schema plan is aSchemaPlanDocumentonPOST /schema-plans/validate,POST /schema-plans/applyandPOST /imports/jobs, and each field of a metadata table declared withPOST /tables/{tableId}/metadata-tablesis aSchemaPlanField. The planGET /schema-plans/exportanswers with is left open: it describes the whole workspace, which can hold more than one plan may create. - API names for what code runs. A saved query, a dashboard and a flow
each carry an
apiNamebeside the id: a name set when it is created (yours, or one derived from its display name), unique among its kind, that stays the same when the resource is renamed and in a copy of the workspace.POST /queries/{queryId}/run,POST /dashboards/{dashboardId}/runandPOST /flows/{flowId}/record-runsaccept it in place of the id, so a program namesdeals_by_stageand not an id it had to look up. The app shows each one’s API name on its page. The complete document has an operation for each:runDealsByStageQueryat/queries/deals_by_stage/run,run<Name>Dashboardand, for a flow whose published trigger is a record action,run<Name>Flow. A query’s and a dashboard’s request lists the variables it declares by name, each described with its label, declared type, options and default. A value is read by its own type (text, a number, a list or a date range), not the declared one, so each stays that union. - The shared resources — dashboards, charts, saved queries, views,
imports, members, roles and the rest — spliced in from the
canonical API description so they can never drift from what the server
actually serves. They are most of the document’s size and the same for
every workspace: the
scope=tablesquery parameter ofGET /workspace/openapileaves them out and returns the tables-only document, for a client that only reads and writes records or a tool that needs a small document. - One table at a time.
scope=tablewithtableset to a table’s name or id returns that table’s operations alone, with the schemas they use. It is the smallest form, for a tool that works on one table.
Because it is generated from the live schema, re-download it after schema
changes. Import it into Postman, Insomnia, or any OpenAPI-compatible client
or code generator, and you get typed access to your own data model. Each
table’s field values are described once, in a <Table>Fields schema that
the write, patch and expanded record shapes extend, so a generator emits one
type per table that the others build on.
Use the complete document, as a file. It is large — a megabyte or more, most
of it the shared resources — and a document fetched whole is the one the
generator was written for; scope=tables stays available for a client that
deliberately wants the records surface alone. Three ways to get the file:
- With a token:
GET /workspace/openapiwith your bearer, saved to a file. Without a credential the route answers401with codeAUTHENTICATION_REQUIREDand aWWW-Authenticate: Bearerchallenge, so a misconfigured build sees what it is missing rather than a bare refusal. - From an AI assistant: the MCP tool
get_openapi_documentanswers with a download URL for the document, plus its version, digest and size, never the document itself (a tool result cannot carry it). The URL needs no header, is valid for ten minutes, reaches only this workspace’s document, and grants nothing beyond what the assistant’s own connection can read: the download re-checks that access, so a link outlives neither the membership nor the token it was created under. The same documents are listed as MCP resources (workspace-openapi://api/fulland the other three forms). Behind both isPOST /workspace/openapi/download-links, which any client withtables:readcan call, andGET /workspace/openapi/documents, which describes every form with its version and size without serving any. - For a custom app:
audience=siterenders the document as the app’s pages call the API — only the operations the app’s/_apiproxy forwards, with paths relative to/_api— so the app’s build generates from it without rewriting anything. See Building a custom app.
The general (workspace-independent) API reference lives at the API reference.
OAuth clients for external applications
Section titled “OAuth clients for external applications”OAuth is how an external application — an AI client over MCP, or any other integration acting on a user’s behalf — gets access without ever seeing the user’s password. Tessule implements the standard authorization code flow with PKCE, plus dynamic client registration.
Registering a client
Section titled “Registering a client”POST /oauth/register implements RFC 7591 dynamic client registration —
an MCP or desktop client can register itself with a name and its redirect
URIs, without contacting support. Because registration is unauthenticated, two
protections apply:
- Every self-registered redirect URI must be an http loopback address
(
127.0.0.1,[::1], orlocalhost). An authorization code can then only ever be delivered to the user’s own machine, even if an attacker registered the client. To register a hosted application with an https callback, contact support@tessule.com. - Re-registration never overwrites. Registering a
software_idthat already exists returns the stored client — name and grants stand, and only additional loopback redirect URIs are added (a native client takes a fresh ephemeral port each run). Knowing asoftware_idbuys an attacker nothing.
What the user sees: the consent screen
Section titled “What the user sees: the consent screen”GET /oauth/authorize sends the user’s browser to Tessule, where they sign
in (if needed) and land on an explicit consent screen — access is never
auto-approved. The screen shows:
- Which application is asking: its registered name, and the host the
authorization code goes back to (
claude.ai,localhost, …), which the application cannot choose for itself the way it chooses its name. An application that identifies itself by a client metadata document URL instead of registering (client_id_metadata_document_supportedin the server’s metadata) also shows the host that publishes that document. - The requested scopes, each with a human-readable description sourced from the server’s own scope catalog — the screen can never overstate or understate what a scope allows. Unknown or unissued scopes are dropped before display, so what you approve is exactly what the token carries.
- A workspace picker: the grant is for one workspace. When the client
asked for a specific workspace through an RFC 8707 resource indicator, as a
connection to a workspace’s own MCP URL (
/mcp/{workspaceId}) does, the workspace is shown read-only and cannot be changed. A connection to the fixed MCP URL (/mcp) chooses its workspace here. - Who the application acts as — you, or one of your agents in that workspace. As an agent, the tokens hold the agent’s roles instead of your own permissions, still narrowed by the scopes you approve.
- Token lifetimes, so the user knows how long access lasts.
Approve, and the browser delivers a one-time authorization code to the client’s redirect URI. Deny, and nothing is issued.
Scopes
Section titled “Scopes”A scope is a workspace permission action under its own name: the string
a role grants (records:read, flows:update) is the string a token carries,
so the consent screen and your role say the same thing. The consent screen
lists the requested scopes under five headings — Data, Analytics, Processes,
Schema and Administration — and a heading ticks or unticks its whole group.
A client that names no scope asks for every scope below. A client that names
some gets exactly those, narrowed to what the server issues; asking only for
scopes the server does not issue is refused with invalid_scope. A hosted
site’s sign-in never offers the Administration scopes.
| Scope | Allows |
|---|---|
records:read |
See records, within their record visibility. |
records:create |
Create records, one at a time or by importing a file. |
records:update |
Edit records, within their record visibility. |
records:delete |
Delete records, within their record visibility. |
records:importProvenance |
Set imported records’ original created and updated times, authors and owners from the file instead of the import’s own. |
records:backfillHistory |
Write records’ past stage moves as history dated when they happened, on a production workspace too. |
store:read |
Read items in the workspace key/value store. |
store:manage |
Add, change and delete items in the workspace key/value store. |
attachments:read |
Download files attached to records. |
attachments:manage |
Upload and remove files attached to records. |
comments:read |
Read the comments on records they can see. |
comments:create |
Post comments, and edit or delete their own. |
comments:moderate |
Delete other people’s comments (never edit them). |
notifications:read |
Use the notification centre. Each notification still goes only to the people it is for. |
Analytics
Section titled “Analytics”| Scope | Allows |
|---|---|
query:execute |
Run read-only SQL queries against workspace data. |
savedQueries:read |
See saved queries. |
savedQueries:manage |
Create, edit and delete saved queries. |
charts:read |
See charts. |
charts:manage |
Create, edit and delete charts. |
dashboards:read |
See dashboards. |
dashboards:manage |
Create, edit and delete dashboards, including by applying a dashboard plan. |
derivedViews:read |
See derived fields and table summaries, and make personal ones. |
derivedViews:manage |
Create and remove shared derived fields and summaries, and promote one to a stored field. |
pages:read |
Open published pages shared with them. |
pages:publish |
Publish pages and change their own. |
pages:manage |
Change, roll back and delete anyone’s published pages. |
customization:read |
Load saved views, record layouts, the home page, navigation and branding, and keep personal ones. |
Processes
Section titled “Processes”| Scope | Allows |
|---|---|
flows:read |
See flows and their run history. |
flows:create |
Create flows. A flow can send email and call external services. |
flows:update |
Edit, publish, enable and disable flows. |
flows:delete |
Delete flows and their run history. |
flows:execute |
Test-run flows, run one on a record and cancel runs. Runs have real effects. |
approvals:request |
Ask for a change that an approval rule holds back. |
approvals:decide |
Approve or decline changes and flow steps held for their decision. |
approvals:manage |
Create, edit and delete approval rules. |
Schema
Section titled “Schema”| Scope | Allows |
|---|---|
tables:read |
See the tables and their fields. |
tables:manage |
Create, change and delete tables and SQL views. Deleting a table removes its records. |
fields:manage |
Add, change and remove fields, constraints and stage rules. |
schema:apply |
Apply a whole schema plan at once, for example from an AI assistant. |
intakes:manage |
Create, edit, publish and delete intakes, which turn external documents into records. |
Administration
Section titled “Administration”| Scope | Allows |
|---|---|
audit:read |
Read the workspace’s audit trail and each record’s change history. |
workspace:members:read |
See the workspace’s members. |
workspace:members:manage |
Add and remove members and change their base role. |
groups:read |
See groups and who is in them. |
groups:manage |
Create, change and delete groups. |
tokens:manage |
Create and revoke their own API tokens. |
agents:manage |
Create, change and delete their own agents, and attach to them roles they hold themselves. |
integrationAccounts:manage |
Create integrations for machines, attach roles to them, and issue and revoke their tokens. |
secrets:manage |
Add, replace and delete workspace secrets. A saved secret can never be read back. |
webhooks:manage |
Subscribe URLs to record events and see their deliveries. Each subscription sends what its creator can read. |
exports:manage |
Send every record and field of chosen tables to a data warehouse on a schedule, whoever can see them in the app. |
integrations:read |
See which marketing-platform connections exist (never their credentials). |
integrations:manage |
Connect, change and remove marketing platforms, and send audiences to them. |
mirrors:manage |
Detach a mirrored table so Tessule owns its records. Detaching cannot be undone. |
hostedSites:manage |
Create, deploy, roll back and delete the workspace’s hosted sites, code that runs as every member who opens it. |
limits:manage |
See limits usage and set per-resource quotas, within the organization’s own limits. |
permissions:manage |
Create, edit and assign roles, set field permissions, and manage automation rules. |
customization:manage |
Change branding, the home page, navigation and record layouts, and share saved views with the workspace or a group. |
Scopes are ceilings, never grants. The token’s effective permissions are
the intersection of the approved scopes with the user’s own role-based
permissions. A reader who approves records:create still cannot create
records — their role never had the action. Member, role and secret management
are Administration scopes, so a grant without them cannot reach those
operations whatever the user’s own role allows in the app. A scope needs the
reads its work depends on: records:create through an assistant also needs
tables:read to find the table.
Tokens and refresh
Section titled “Tokens and refresh”POST /oauth/token exchanges the code (with PKCE verification) for an
access token valid for 30 minutes and a refresh token valid for 14
days. Codes are single-use and expire after 10 minutes.
Permissions are resolved from the database on every request, so a role
change applies to the next API call made with an existing access token, and a
user removed from the workspace is refused on their next call. The refresh
grant re-verifies workspace membership and re-derives the user’s role as
well — a user who has been removed from the workspace gets invalid_grant,
so an OAuth client cannot mint a new token for a workspace its user has left.
Errors
Section titled “Errors”Every operation documents the statuses it can return, and every error status
carries a JSON body. Unless the operation declares a more specific schema for
that status, the body is ErrorResponse:
{ "error": "Insufficient permissions", "code": "PERMISSION_DENIED" }erroris always present: a sentence written for the person using your client. It is not stable — branch on the HTTP status or oncode, never on this text.codeappears when a client is expected to react to the refusal in a specific way (PERMISSION_DENIED,VIEW_READ_ONLY,EARLY_ACCESS_PENDING,MFA_REQUIRED, …). The operation’s response documents the codes it can carry.detailsappears on a400whoseerrorisValidation failed: the request did not match the OpenAPI document, or a record’s values failed the table’s rules, and each key names the offending field (a path such asfieldConfig/options/2/labelfor nested bodies; a field name indata, or the comma-joined field list of a composite constraint, for a record write) with what is wrong with it.instanceappears on a500: the serving instance, worth quoting when you report a fault.
What each status means here:
| Status | Meaning | What to do |
|---|---|---|
400 |
Refused before or during handling: the request did not match the spec (details says where), or the operation’s own checks rejected it. |
Fix the request. |
401 |
No usable credential: the token is missing, malformed, expired, revoked, or its session has ended. | Obtain a new token and retry. |
403 |
Authenticated but not allowed: the principal lacks the action, is not a member of the workspace, or the account is blocked (early access pending, MFA required, password change required). | Retrying will not help without a change of permissions. |
404 |
Nothing the caller may see lives at the path. Existence is not disclosed across tenancy boundaries, so this is also returned where another API might return 403. |
Check the identifier and the workspace the token belongs to. |
409 |
The write conflicts with current state (a stale record version, a name already in use, a transition the lifecycle forbids). The operation documents its conflict body. | Re-read, then decide. |
429 |
A rate limit or quota refused the request (next section). | Wait Retry-After seconds, then retry. |
500 |
The server failed unexpectedly. | Reads may be retried; check a write before retrying it. |
The OAuth 2.0 endpoints (POST /oauth/token, POST /oauth/register) are the
one exception: their errors use the RFC 6749 shape — error is the protocol
code (invalid_grant, invalid_client, …) and error_description explains
it — so standard OAuth client libraries read them unchanged.
Headers follow the HTTP standards, so generic clients behave correctly: every
401 carries a WWW-Authenticate: Bearer challenge (RFC 6750; with
error="invalid_token" when a token was presented and refused), a 405
carries Allow with the methods the path accepts, and a 429 carries
Retry-After whenever the limiter knows when its window ends.
Rate limits and quotas
Section titled “Rate limits and quotas”Two layers apply:
-
Durable daily quotas on the expensive read endpoints, counted per workspace per UTC day and returned as
429when exhausted:POST /query(ad-hoc SQL) — default ceiling 20,000 executions/day. Asynchronous CSV exports count against the same quota, so exporting can’t buy extra executions.GET /search(workspace-wide search) — default ceiling 50,000/day.
These ceilings are entitlements: plans and per-organization overrides can raise them, workspace admins can tighten them per resource, and the value actually enforced is the lowest tier in force. Admins can see every counter, its effective ceiling, which tier set it, and when the window resets in the workspace’s limits view (
GET /workspace/limits/usage). -
Protective limits (per-IP flood protection at the edge, and tight brakes on authentication endpoints). Ordinary API clients do not reach these; if you do get a
429from an auth endpoint, back off and retry later.
Treat any 429 as retryable-later, and prefer batching over polling loops.
Inbound webhooks
Section titled “Inbound webhooks”Flows can start from an inbound webhook. In Automations, create a flow with When a webhook URL is called, then choose either URL token only or URL token + API key. Publishing mints an unguessable URL and reveals it exactly once, so copy it immediately. The API-key option additionally requires a workspace API token as a bearer credential.
Webhook flows can use the payload in later conditions and steps, including record writes, email, HTTP requests, and sandboxed code. Keep the hook URL secret: with URL token only, possession of that URL is sufficient to start a run. More in Automations.
A webhook flow can declare the body it expects. Set payloadSchema on the
flow’s trigger to a JSON Schema (draft-07) with an object at its root, through
POST /flows or PUT /flows/{flowId}/draft:
{ "kind": "inbound_webhook", "auth": "public", "payloadSchema": { "type": "object", "required": ["order_id"], "properties": { "order_id": { "type": "string" } } }}The hook then refuses a body that does not match with 400 and starts no run,
so later steps can rely on {{payload.order_id}} being there. Your
workspace’s OpenAPI document lists each published webhook flow as an
operation of its own, named after the flow’s API name
(deliverOrderReceivedHook), with that schema as its request body. The
secret at the end of the URL is a parameter of the operation and is never in
the document.
Outbound webhooks
Section titled “Outbound webhooks”A webhook subscription sends a signed POST to your URL whenever a record
changes in one table, so an integration receives changes instead of polling
for them. Creating, changing and reading subscriptions needs
webhooks:manage, which workspace admins hold.
: "${TABLE_ID:?Set TABLE_ID to the table's 12-character ID}"
curl -X POST https://api.tessule.com/api/webhooks \ -H "Authorization: Bearer crm_..." \ -H "Content-Type: application/json" \ -d "{ \"url\": \"https://hooks.example.com/tessule\", \"tableId\": \"$TABLE_ID\", \"events\": [\"record.created\", \"record.updated\"], \"fieldAllowList\": [\"name\", \"stage\", \"amount\"] }"The response includes a secret. It is shown once — store it, or replace it
later with POST /webhooks/{webhookId}/rotate-secret, which only the person
the subscription runs as can call.
The request your endpoint receives is described in your workspace’s
OpenAPI document too, under webhooks as recordWebhookDelivery: its
body, each header, and what each answer does to the retry schedule. A
client generated from the complete document gets the receiver’s types from
it.
Events
Section titled “Events”| Event | Sent when |
|---|---|
record.created |
A record is created. |
record.updated |
A record is changed. |
record.deleted |
A record is deleted (moved to the recycle bin). |
record.restored |
A record is restored from the recycle bin. |
record.stage_changed |
An update moves a stage field to a new value. |
comment.created |
Someone comments on a record. |
Record events follow every single-record and bulk write, whether it came from the app, an API token, an AI assistant over MCP, a flow or an approved change. Imports add records in bulk and send no per-record events.
What a delivery carries
Section titled “What a delivery carries”Each delivery’s body is a WebhookEvent:
event,occurredAt,tableIdandrecordId.record— the record after the change (just before deletion, forrecord.deleted);nullforcomment.created.previous— for updates, the earlier value of each field that changed, and only those fields.stage— forrecord.stage_changed, the field and the stage it moved from and to.comment— forcomment.created, the comment.changeSource— who made the change (user,api_token,mcp,automationorsystem), their user id when one is known (otherwisenull), andisBulkEdit, which is true when the change was one record of a bulk edit.sequence— strictly increasing per subscription. Deliveries can arrive out of order; sort bysequenceto restore it and to notice a gap.
A subscription runs as the person who created it, or who last moved its URL to a
new address (its createdBy). Each delivery is checked
against their permissions when it is sent: records and fields they cannot read
are left out, an update that changed only fields they cannot read is not sent,
and once they lose access to the table, deliveries stop. A fieldAllowList
narrows every delivery to the fields named, and an update that changes none of
them is not sent.
Verifying a delivery
Section titled “Verifying a delivery”Every delivery carries these headers:
| Header | Value |
|---|---|
X-CRM-Event |
The event, for example record.updated. |
X-CRM-Delivery |
The delivery’s id, also the body’s id. |
Idempotency-Key |
The same id. It does not change between retries, so use it to ignore a repeat. |
X-CRM-Timestamp |
Unix seconds when the delivery was signed. |
X-CRM-Signature |
sha256= and the hex HMAC-SHA256 of <timestamp>.<raw body> under the subscription’s secret. |
import { createHmac, timingSafeEqual } from 'node:crypto';
function verify(secret, timestamp, rawBody, signature) { const expected = 'sha256=' + createHmac('sha256', secret) .update(`${timestamp}.${rawBody}`) .digest('hex'); return expected.length === signature.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signature));}Reject a delivery whose timestamp is more than a few minutes old. Flows’ HTTP request steps sign in the same format, so one verifier serves both.
Retries and failures
Section titled “Retries and failures”Answer with any 2xx once the delivery is stored. A 408, 429 or 5xx
answer, or a connection that fails, is retried after 1 minute, 5 minutes, 30
minutes, 2 hours and then every 8 hours, for up to 3 days. A 429 with a
Retry-After header waits that long instead (up to 8 hours). Any other 4xx
is final.
Deliveries are at least once: the same delivery can arrive twice, with the same
Idempotency-Key. A subscription whose deliveries have failed continuously for
3 days is switched off, and everyone holding webhooks:manage is notified;
switching it back on (PATCH /webhooks/{webhookId} with "enabled": true)
clears the failure count.
GET /webhooks/{webhookId}/deliveries lists the last 30 days of deliveries
with each one’s status, attempts, last response code and error. The body that
was sent is included only for the person it was built for: the subscription’s
createdBy when that delivery was sent. POST /webhooks/{webhookId}/deliveries/{deliveryId}/redeliver
sends a finished delivery again, with the same id.
The URL must use https and resolve to a public address. It is checked when
the subscription is created and again before every delivery, and redirects are
not followed. The number of subscriptions per workspace and the number of
deliveries per day are limited; past the daily limit, events are dropped and
the subscription’s lastError says so.
API and MCP traffic is not a side door: requests made with tokens pass through the same audit logging as the app, and mutations show up in the workspace audit trail attributed to the token’s owner.
Q: My token gets 401 Unauthorized — why?
In order of likelihood: the token was revoked; it expired; or your membership
in the token’s workspace ended (which deletes the token). Also check you’re
sending Authorization: Bearer crm_... — the whole value, including the
crm_ prefix.
Q: I’m an admin, but my token can’t manage members or apply schema plans.
Working as designed: tokens start from the member baseline regardless of
who created them. If a token genuinely needs more, an admin can assign it a
custom role granting exactly the extra actions it needs, in Workspace
Settings → Roles (or via the role-assignment endpoint with an
apiTokenId). The token can use those actions only while you hold them too.
Q: Can I create a read-only token?
Yes: create a role-only token and attach a role holding only read
actions (records:read, tables:read, …). A role-only token holds nothing
its roles do not grant. An OAuth grant approved with only read scopes
(records:read, tables:read, …) is read-only too: scopes cap permissions, so such a token cannot
write no matter whose it is.
Q: One token for all my workspaces?
No. Tokens are hard-bound to one workspace; create one per workspace.
Q: Where do I find the API’s shapes and endpoints?
The API reference for the general API, and
GET /workspace/openapi (or Workspace Settings → API Spec) for a
document that includes your tables as typed endpoints.