Update a record
const url = 'https://api.sloose.com/orgs/org_9f3c/connectors/cnn_9f2a/records/Accounts/40000000000000101';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"payload":{"additionalProperty":"example"},"runId":"example","automations":"example","rowKey":"example","phase":"patch","target":"Parent_Account","keys":[["Account_Number","ac-1"]],"lineKeys":{"Quoted_Items":["flow#3","flow#4"]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.sloose.com/orgs/org_9f3c/connectors/cnn_9f2a/records/Accounts/40000000000000101 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "payload": { "additionalProperty": "example" }, "runId": "example", "automations": "example", "rowKey": "example", "phase": "patch", "target": "Parent_Account", "keys": [ [ "Account_Number", "ac-1" ] ], "lineKeys": { "Quoted_Items": [ "flow#3", "flow#4" ] } }'Updates fields on an existing record under an authorised run, metered the same way as a create: the row counts once, on its first record. Updating the record a row already made in this module costs nothing more; naming a different record under the same row key and module is refused. Every attempt is recorded in the run’s records under the number the ledger gave it — a patch numbered by the field it fills, apart from the write. The destination’s own automations do not run unless the write asks for them: send automations: true to ask for them on this write; absent or false asks for none, whatever they would otherwise do on a create or an update. For a Zoho CRM that means its workflow rules, and no other kind of automation, a cadence for one, is decided by this field (#1816).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation id the session was issued for. A token for one organisation can never read another.
Example
org_9f3cThe organisation id the session was issued for. A token for one organisation can never read another.
The connector id, from GET /orgs/{org}/connectors.
Example
cnn_9f2aThe connector id, from GET /orgs/{org}/connectors.
The module’s API name in the destination.
Example
AccountsThe module’s API name in the destination.
The record’s id in the destination.
Example
40000000000000101The record’s id in the destination.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The record’s fields, as the engine built them. Required.
object
The run from POST /entitlements/runs/authorise. Required.
Run the destination’s own automations on this write: the import’s own switch (#1816), a boolean where only true asks, and absent, false or any other value is read as off. What it means is the destination’s: for a Zoho CRM, true asks it to run its workflow rules (trigger: ['workflow']) and off sends trigger: [], as Zoho’s own import does; Sloose does not ask Zoho to run approvals or blueprints, and a cadence, which Zoho decides on another switch, is not decided by this field.
The row this record belongs to (rowKey(flowId, row)). One record per module per key; a second insert under the same key and module is refused. A retry or a resume sends the same key for the same row as the run it follows: that is how its rows are known as its chain’s, and a free retry that writes rows under new keys past what its chain was counted for is counted as a run. This is judged by key only while the chain’s keys are kept: a day after the chain last ran, or for a chain begun before keys were kept, a link’s rows are judged by the count it declared instead, as they were before, and no run is counted at a later row.
On an update: write (the default, and what anything else is read as) when it makes the row’s change to the record, patch when it fills one field the engine could only fill after the save. A create is always the write. Every attempt is recorded under its phase (design §3.1).
Example
patchFor a patch, the field it fills — a string, and required with phase: patch (TARGET_REQUIRED).
Example
Parent_AccountThe (field, value) pairs the engine indexed the record under, recorded with a write — and, for a patch, the one field it fills — so a later retry can resolve a link to the record, or match a later row to it, without searching. At most fifty are kept, and anything that is not a pair of strings — or is one longer than 200 characters for the field or 1,000 for the value — is dropped whole rather than refused or cut short, since a shortened key would name a different value.
Example
[ [ "Account_Number", "ac-1" ]]The row keys of the lines a CREATE carries (#2525), by the subform field of the payload that holds them: one flowId#row for each element of the payload’s array, in order. A record whose payload carries rows in a subform is metered a plan row for each of them as well as its own, admitted together or not at all; a create that carries rows without exactly their keys is refused (LINE_KEYS_MISMATCH, written: false).
Example
{ "Quoted_Items": [ "flow#3", "flow#4" ]}Responses
Section titled “Responses”Updated; the destination’s own result.
object
Examplegenerated
{ "result": "example"}No payload, run or row key, a row key over 200 characters, or a patch that names no field (TARGET_REQUIRED). Or the module is a subform (SUBFORM_NOT_WRITABLE, written: false): its rows are written inside their parent’s record, never as records of their own. A file field’s value that is not a list of { id }, or names a file with no id (INVALID_FILE_VALUE, #2441). One record naming more than 250 files, its subform rows’ included (TOO_MANY_FILES, written: false, with most and files): nothing admitted or sent.
object
Example
{ "written": false}No bearer, or one that no longer resolves: a session that is unknown or expired (code: AUTH_REQUIRED), or an API token that was revoked or expired (TOKEN_REVOKED, TOKEN_EXPIRED), whose organisation is gone (ORG_NOT_FOUND) or whose member or user row is (MEMBERSHIP_GONE).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}The run has been stopped and nothing was written (code: RUN_STOPPED, with stop); the run is an import’s and this is not the session or token that authorised it (code: NOT_YOUR_RUN); or the bearer’s role is too low, or it was issued for a different organisation. Like every route behind a session: a session signed in but in no organisation is refused code: NO_ORG, a banned person code: BANNED, and a closed organisation code: ORG_CLOSED.
object
object
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Example
{ "code": "RUN_STOPPED", "stop": { "stopped": "LIMIT_ROWS_PER_RUN", "stoppedBy": "plan" }}No such connector, or it is not visible to this session (NOT_FOUND); no such run (RUN_NOT_FOUND); or the connection has no module of that name — only its modules, as its discovery read them, are asked of the CRM (MODULE_NOT_FOUND).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}The row key names a different record in this module under this run, the run is no longer authorised, the run was authorised for a different connector (RUN_CONNECTOR_MISMATCH), or the run is an import’s and no longer holds it — its lease ran out and the import was released (LEASE_LOST).
object
Examplegenerated
{ "error": "example"}Zoho rejected the update, or a file it names was refused (FileRefusal, #2441).
object
object
True when Zoho gave no answer that says what was done — the connection dropped or timed out, Zoho failed on its side (a 5xx, or the same for the one record inside a 2xx), the answer was lost after its status or was not JSON, or Zoho said it made the record without saying which — so what was asked may have been done all the same: a create sent again after one may make a second record. A write that went unanswered stays counted, and its row may be written again for nothing. False when Zoho answered by declining (a 4xx, or a per-record refusal inside a 2xx), which made nothing.
True when Zoho asked for fewer calls and declined this one (TOO_MANY_REQUESTS): nothing was done, and the same call a little later may land — a write included, since a declined one made nothing. Absent from an older API.
How long Zoho asked to be left alone before the next call, in milliseconds, from its Retry-After; also sent as this response’s own Retry-After, in seconds. Null when it said nothing.
True when the rate limit is the CRM’s daily allowance of API calls used up — a 429 whose X-API-CREDITS-REMAINING says none are left — which waiting seconds does not bring back. Without that header the two limits cannot be told apart, and this is false.
A file refused: one this import does not hold (missing) or never finished storing (not_stored), more than the field holds, larger than it or this API sends (25 MiB), of a type it does not take, or one the destination did not take (upload_failed). Nothing was written.
object
Nothing was sent, and sending again may go through: a file not sent yet, before the record write. Absent: a refusal that stands.
Which file, of which field, and whether a reconnect is the remedy.
object
The file field, by its api name.
The stored file (import_files.id), or null where the refusal named none.
The connection cannot write files until it is connected again.
Example
{ "code": "not_found", "written": false, "retryable": true, "file": { "reconnect": true }}Zoho is throttling how often this connection’s access is renewed — ten tokens from one grant in ten minutes — so nothing was sent (code: CONNECTION_THROTTLED; written: false on a write). Retry-After says when to ask again. The connection is kept: only a grant Zoho refuses ends it. A renewal throttled after the call reached Zoho is Zoho’s rate limit, relayed as a 502 with zoho.rateLimited.
Or the CRM’s API allowance for the last 24 hours is spent (zoho.quotaSpent: true, zoho.rateLimited: true, zoho.retryable: false), said one of two ways. Zoho itself refused the call (zoho.code: TOO_MANY_REQUESTS, credits left 0): relayed as this 429, never a 502, since asking again soon is refused again. Or the tenant’s gate refused it before it was sent, because Zoho had already said so: this API’s own refusal, with no zoho (code: DAILY_ALLOWANCE_SPENT; written: false on a write). Neither carries Retry-After: Zoho’s day is a rolling 24 hours and it names no time at which credits return, so Sloose lets one call a minute through to ask, and the first one answered is the allowance’s return. GET …/credits says whether the day is held spent (spent, spentAt). A system that does name its renewal is answered with Retry-After until then.
object
Why: CONNECTION_UNAVAILABLE (502) when a Zoho token for the connection will not refresh, CONNECTION_THROTTLED (429) when Zoho is throttling its renewal — ten tokens from one grant in ten minutes — and the connection is kept, and DAILY_ALLOWANCE_SPENT (429) when the connected system said a daily allowance the call draws on is spent, which waiting seconds does not bring back.
On a write: refused before the record was sent to the CRM, so nothing was written and a retry makes no second record. Absent from a read.
Example
{ "written": false}Zoho is rate-limiting (zoho.unanswered false: nothing was done), or did not answer — it could not be reached, failed on its side, or answered without saying what it did (zoho.unanswered true: what was asked may have been done). Or this API could not use the connection before anything was sent — a Zoho token that will not refresh (code: CONNECTION_UNAVAILABLE) — and says so on a write with written: false: nothing was written.
object
object
True when Zoho gave no answer that says what was done — the connection dropped or timed out, Zoho failed on its side (a 5xx, or the same for the one record inside a 2xx), the answer was lost after its status or was not JSON, or Zoho said it made the record without saying which — so what was asked may have been done all the same: a create sent again after one may make a second record. A write that went unanswered stays counted, and its row may be written again for nothing. False when Zoho answered by declining (a 4xx, or a per-record refusal inside a 2xx), which made nothing.
True when Zoho asked for fewer calls and declined this one (TOO_MANY_REQUESTS): nothing was done, and the same call a little later may land — a write included, since a declined one made nothing. Absent from an older API.
How long Zoho asked to be left alone before the next call, in milliseconds, from its Retry-After; also sent as this response’s own Retry-After, in seconds. Null when it said nothing.
True when the rate limit is the CRM’s daily allowance of API calls used up — a 429 whose X-API-CREDITS-REMAINING says none are left — which waiting seconds does not bring back. Without that header the two limits cannot be told apart, and this is false.
object
Why: CONNECTION_UNAVAILABLE (502) when a Zoho token for the connection will not refresh, CONNECTION_THROTTLED (429) when Zoho is throttling its renewal — ten tokens from one grant in ten minutes — and the connection is kept, and DAILY_ALLOWANCE_SPENT (429) when the connected system said a daily allowance the call draws on is spent, which waiting seconds does not bring back.
On a write: refused before the record was sent to the CRM, so nothing was written and a retry makes no second record. Absent from a read.
Example
{ "written": false}A file it names could not be sent yet (retryable): nothing was written, and the write may be sent again (#2441). Or the restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, with Retry-After (the operator’s ADMIN_TOKEN alone is let through to POST /staff/people/{id}/delete, and to nothing else).
A file refused: one this import does not hold (missing) or never finished storing (not_stored), more than the field holds, larger than it or this API sends (25 MiB), of a type it does not take, or one the destination did not take (upload_failed). Nothing was written.
object
Nothing was sent, and sending again may go through: a file not sent yet, before the record write. Absent: a refusal that stands.
Which file, of which field, and whether a reconnect is the remedy.
object
The file field, by its api name.
The stored file (import_files.id), or null where the refusal named none.
The connection cannot write files until it is connected again.
object
Example
{ "code": "not_found", "written": false, "retryable": true, "file": { "reconnect": true }}Headers
Section titled “Headers”Seconds until asking again is worth it (300 while the switch is on).