Skip to main content
PATCH
/
objects
/
{object_name}
/
records
/
{record_id}
cURL
curl --request PATCH \
  --url https://api.unifygtm.com/data/v1/objects/{object_name}/records/{record_id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "data": {}
}'
{
  "status": "success",
  "data": {
    "object": "<string>",
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "attributes": {}
  }
}

Overview

The update method modifies an existing record by its unique ID. You can provide values for any attributes you want to update in the request body. Attributes not included in the request will remain unchanged. If the record doesn’t exist, the API will return a 404 error. This method will not create a new record. If you want to create a record if it doesn’t exist, use the upsert method instead.
This method will overwrite existing values on the record, which may be undesirable. If you want a safer alternative, use the upsert method and pass update_if_empty instead.

Examples

This updates specific fields on a company record:
PATCH /objects/company/records/11b41071-1ac7-4419-b3bd-3da132502826

{
  "status": "Inactive",
  "description": "An updated description for this company."
}
This updates only the status and description fields on the company. All other fields remain unchanged.
This updates a person’s job title and associated company:
PATCH /objects/person/records/5ce127ba-8d7e-42d0-9e60-76017a04caec

{
  "title": "Senior Developer",
  "company": {
    "id": "11b41071-1ac7-4419-b3bd-3da132502826"
  }
}
In this case, we knew the exact ID of the company we wanted to link this person to, but you could also use a nested match or upsert if desired.
This updates fields on a custom object record:
PATCH /objects/product_user/records/e624b659-7a50-4925-9a49-dc2dae8dcb60

{
  "plan": "enterprise",
  "last_login": "2024-01-15T10:30:00Z"
}

Usage

Authorizations

x-api-key
string
header
required

Path Parameters

object_name
string
required
record_id
string
required

Query Parameters

validation_mode
enum<string>

Validation mode to use when validating request data.

strict validation will fail requests if any attribute fails validation, including unrecognized attributes.

ignore_invalid validation will strip out unknown attributes and replace known, non-required attributes with undefined if they fail validation. The request will still fail if the request body does not contain the proper structure or if any required attributes fail validation.

Available options:
strict,
ignore_invalid

Body

application/json

Request body for updating a record.

data
object
required

The attribute values to update in the record.

Response

Response for a successful update operation.

Response for a successful update operation.

status
enum<string>
required
Available options:
success
data
object
required