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","rowKey":"example","phase":"patch","target":"Parent_Account","keys":[["Account_Number","ac-1"]]}'};
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", "rowKey": "example", "phase": "patch", "target": "Parent_Account", "keys": [ [ "Account_Number", "ac-1" ] ] }'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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The org id the session was issued for. A token for one org can never read another.
Example
org_9f3cThe org id the session was issued for. A token for one org 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.
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.
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" ]]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).
object
Examplegenerated
{ "error": "example"}No bearer, or one that is expired, revoked or no longer resolves to a member.
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 org.
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.
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.
Examplegenerated
{ "error": "example", "zoho": { "code": "example", "status": 1, "details": "example", "retryable": true, "response": "example", "unanswered": true }}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.
object
Why: CONNECTION_UNAVAILABLE when a Zoho token for the connection will not refresh.
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}