Skip to main content
POST
cURL

Overview

The upsert method creates or updates a record depending on whether it already exists or not. If a matching record exists, it will be updated. Otherwise, a new record will be created. The request body accepts the following properties which specify how to create or update the record: You must specify match and one of create, create_or_update, or create_or_update_if_empty. All other properties are optional. The upsert method is the most reliable way of sending data into Unify, so if you’re not sure what method to use, this is the one we recommend.

Examples

This creates or updates a company record:
If there’s already a company record in Unify with the domain unifygtm.com, it will be updated with a status of “Active”. Otherwise, a new record will be created with the specified values.
This creates or updates a person record as well as their associated company and then links them together:
This works because company is the name of a reference attribute on the person object which references a company object record. This request will create a new company if it doesn’t already exist, update it if it does, and then link this person to that company.
This creates or updates a record in a custom object called product_user:
This is a custom object, so all of these attributes are custom attributes defined for the object. Since this request uses create_or_update, these values will be filled in if the record is created or overridden if an existing record is found.

Usage

Authorizations

x-api-key
string
header
required

Path Parameters

object_name
string
required

The API name of an object, e.g. company, person, opportunity, or a custom object's API name.

Query Parameters

validation_mode
enum<string>

Validation mode for request data.

  • strict: Reject requests if any attribute is invalid or unrecognized.
  • ignore_invalid: Ignore unknown attributes and omit invalid values for optional attributes. Reject requests with an invalid body structure or invalid required attributes.
Available options:
strict,
ignore_invalid

Body

application/json

Request body for upserting a record.

At least one of create, create_or_update, or create_or_update_if_empty must be provided. Together, these properties must include all required attributes.

match
object
required

Attribute values used to find an existing record. Include at least one unique attribute. Additional attributes narrow the match.

create
object

Attribute values used when no record matches. These take precedence over other creation values.

update
object

Attribute values used when a record matches. These take precedence over other update values.

update_if_empty
object

Attribute values applied to a matching record only where the existing value is null. Values in update and create_or_update take precedence.

create_or_update
object

Attribute values used for both creation and updates. Values in create or update take precedence.

create_or_update_if_empty
object

Attribute values used for creation, or for updates where the existing value is null. Values in all other properties take precedence.

Response

Response for a successful update operation.

Response for a successful update operation.

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