Skip to content

Update a record

PUT
/orgs/{org}/connectors/{id}/records/{module}/{recordId}
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.

org
required

The org id the session was issued for. A token for one org can never read another.

string
Example
org_9f3c

The org id the session was issued for. A token for one org can never read another.

id
required

The connector id, from GET /orgs/{org}/connectors.

string
Example
cnn_9f2a

The connector id, from GET /orgs/{org}/connectors.

module
required

The module’s API name in the destination.

string
Example
Accounts

The module’s API name in the destination.

recordId
required

The record’s id in the destination.

string
Example
40000000000000101

The record’s id in the destination.

Media typeapplication/json
object
payload

The record’s fields, as the engine built them. Required.

object
key
additional properties
runId

The run from POST /entitlements/runs/authorise. Required.

string
rowKey

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.

string
phase

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
patch
target

For a patch, the field it fills — a string, and required with phase: patch (TARGET_REQUIRED).

Example
Parent_Account
keys

The (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"
]
]
key
additional properties

Updated; the destination’s own result.

Media typeapplication/json
object
result
Examplegenerated
{
"result": "example"
}

No payload, run or row key, a row key over 200 characters, or a patch that names no field (TARGET_REQUIRED).

Media typeapplication/json
object
error
required
string
key
additional properties
Examplegenerated
{
"error": "example"
}

No bearer, or one that is expired, revoked or no longer resolves to a member.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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.

Media typeapplication/json
Any of:
object
error
required
string
code
required
string
Allowed values: RUN_STOPPED
stop
required
object
stopped
required
string
Allowed values: LIMIT_ROWS_PER_RUN
rowsPerRun
required
number
stoppedBy
required
string
Allowed values: plan declaration
rowsWrittenTotal
required
number
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).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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).

Media typeapplication/json
object
error
required
string
key
additional properties
Examplegenerated
{
"error": "example"
}

Zoho rejected the update.

Media typeapplication/json
object
error
required
string
zoho
required
object
code
required
string | null
status
required
number | null
details
retryable
required
boolean
response
unanswered
required

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.

boolean
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.

Media typeapplication/json
Any of:
object
error
required
string
zoho
required
object
code
required
string | null
status
required
number | null
details
retryable
required
boolean
response
unanswered
required

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.

boolean
Example
{
"written": false
}

Report a problem with this page