Skip to main content

Overview

This tutorial walks through the process of sending record from a Clay sheet into Unify. To do this, we’ll set up a webhook in Clay that sends records to the Data API.
This guide uses a sheet of companies as an example, but the same approach can be used for any object type (such as Person or custom object records).

Prerequisites

  • An existing Clay sheet that you want to send into Unify
  • An existing API key for Unify

Steps

1

Select the webhook action

Navigate to your Clay sheet and open the Actions pane.
Under Enrichments, select View all enrichments and then choose HTTP API.
2

Add credentials

Select the Configure tab. Under Select HTTP API (Headers) account, choose Add account.
If you have already completed this step in the past, you can simply select your existing headers account for Unify.
Give the new account a name (e.g., “unify-api”) and add a header named X-Api-Key whose value is your Unify API key.
Select Save to confirm the credentials.
3

Determine which object to use

You can send records into Unify for any standard or custom object using the Data API. Before constructing the request, decide which object you want to send records into (e.g., Company, Person, or a custom object).Once you’ve picked an object, you will need its API name. The API name can be found on the object settings page. For example, the Company object’s API name is company.For an overview of how objects work in Unify, see Objects in Unify.
4

Construct the request

The best way to send data into Unify is with the Upsert method. The URL for this API method is:
https://api.unifygtm.com/data/v1/objects/{object_name}/records/upsert
You will need to replace {object_name} with the API name of the object you want to send records into (e.g., company, person, or a custom object).For example, the Company object’s API name is company, so the URL is:
https://api.unifygtm.com/data/v1/objects/company/records/upsert
Under Setup Inputs, fill in a few fields:
  • Method: Choose PUT when performing an upsert. For other operations, use the correct method (typically POST or PUT).
  • Endpoint: Insert the URL of the API constructed above.
  • Body: A valid payload for the Upsert method. For example:
    {
      "match": {
        "domain": "{{Website}}"
      },
      "create_or_update_if_empty": {
        "name": "{{Company Name}}",
        "domain": "{{Website}}",
        "status": "{{Status}}"
      }
    }
    
    Be sure to replace these placeholders with the actual column names from your Clay sheet. Press the slash (/) key to select a column when editing the body.
    Don’t forget to include quotation marks around the column placeholders!
That’s it! All of the other settings can be left in their default state or modified as needed.
5

Test and save

Once the action is configured, you can test it by clicking the Try on 5 rows button. You should see a status code in the range 200-299 if the request was successful.
Finally, select Save and choose whether you want to immediately run the action on all rows in the sheet. Once run, you should see successful status codes appear in the column.
You can click into any cell in the column to see the full response from the API. Typically, the Data API will return the full record that was created or updated.
If you search for that record in Unify, you should see it appear with the correct data!

FAQ

Here are a few things to try:
  • Check the body formatting: Ensure that the JSON body correctly matches the expected format of the Data API method you are trying to use.
    • Double check that you are including quotation marks around all of the column variable placeholders.
    • Try pasting the request you are submitting into the Unify docs agent (or ChatGPT, etc.) to ask it to validate that your format is correct.
  • Check for sheet errors: Look for a red error symbol in the column name of the HTTP API column in the sheet. Sometimes, this will indicate an error in the Clay UI. For example, you may be referencing a deleted column name, or there may have been a subtle error when pasting the body into the Clay UI.