Skip to main content
PUT
/
objects
/
{object_name}
/
records
/
{record_id}
cURL
curl --request PUT \
  --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 defaults instead.

Examples

This updates specific fields on a company record:
PUT /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:
PUT /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:
PUT /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

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.

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