Skip to main content
POST
/
objects
/
{object_name}
/
records
cURL
curl --request POST \
  --url https://api.unifygtm.com/data/v1/objects/{object_name}/records \
  --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 create method creates a new record in the specified object. This method will fail if any record already exists with conflicting unique values, which may or may not be the desired behavior depending on your use case. If you are not sure whether a record already exists with the same unique values, consider using the upsert method instead.

Examples

This creates a new company record:
POST /objects/company/records

{
  "name": "Unify",
  "domain": "unifygtm.com",
  "description": "A nice company with a top-notch API.",
  "status": "Active"
}
This creates a new person record and links them to an existing company if it exists:
POST /objects/person/records

{
  "first_name": "Austin",
  "last_name": "Hughes",
  "email": "austinhughes@unifygtm.com",
  "title": "CEO",
  "company": {
    "match": {
      "domain": "unifygtm.com"
    }
  }
}
If a company with this domain does not exist, the company reference on this person will be null. If you want to create a company in that case instead, you can use a nested upsert:
POST /objects/person/records

{
  "first_name": "Austin",
  "last_name": "Hughes",
  "email": "austinhughes@unifygtm.com",
  "title": "CEO",
  "company": {
    "match": {
      "domain": "unifygtm.com"
    },
    "create": {
      "name": "Unify",
      "domain": "unifygtm.com",
      "linkedin_url": "https://www.linkedin.com/company/unifygtm"
    }
  }
}
This creates a new record in a custom object called product_user:
POST /objects/product_user/records

{
  "user_id": "6b2a2761-3cbe-481f-8a1e-b24859c674f8",
  "full_name": "Bob Smith",
  "email_address": "bob.smith@gmail.com",
  "plan": "free_tier"
}

Usage

Authorizations

x-api-key
string
header
required

Path Parameters

object_name
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 creating a record.

data
object
required

The attribute values for the new record.

All required attributes on the object must be included.

Response

Response for a successful create operation.

Response for a successful create operation.

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