Update a record

Change some of a record's values and leave the others as they are.

PATCH/records/{recordId}

Only the fields in values change. Send null to clear a field.

cURL
curl --fail-with-body -X PATCH "$JEMERO_URL/records/$RECORD_ID" \
  -H "Authorization: Bearer $JEMERO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "values": { "jobTitle": "Chief Analyst", "phone": null } }'
Node.js
const response = await fetch(
  `${process.env.JEMERO_URL}/records/${process.env.RECORD_ID}`,
  {
    method: 'PATCH',
    headers: {
      Authorization: `Bearer ${process.env.JEMERO_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ values: { jobTitle: 'Chief Analyst', phone: null } }),
  },
);
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
console.log((await response.json()).record.values.jobTitle);
Python
import os
import requests

response = requests.patch(
    f"{os.environ['JEMERO_URL']}/records/{os.environ['RECORD_ID']}",
    headers={"Authorization": f"Bearer {os.environ['JEMERO_API_KEY']}"},
    json={"values": {"jobTitle": "Chief Analyst", "phone": None}},
    timeout=30,
)
response.raise_for_status()
print(response.json()["record"]["values"]["jobTitle"])

The answer is 200 with the whole updated record.

  • A composite value, such as email or address, is replaced as a whole. Parts you leave out are not kept.
  • There is no version check: if two writers change the same field, the later write wins. Changes to different fields don't overwrite each other.
  • To change links to other records, see Relations.

Errors#

StatusCause
400A value is invalid, or a field is unknown or read-only.
403Your role can't change this record or one of the fields.
404 Record not foundNo such record, your role can't view it, or it is in the trash. Restore it first.
409Another record already has the value of a unique field.