# Custom events Source: https://docs.unifygtm.com/developers/api/analytics/custom POST /track Track actions in your website or application. ## Overview Send a custom event for an action you want to track, such as starting a trial or inviting a teammate. Give the event a consistent name and include properties that explain what happened. ## Examples > **Track a trial signup** > > Set `UNIFY_WRITE_KEY` to the event source's write key and use an allowed origin > in the `Origin` header. Replace the example visitor ID and timestamp with those > from the actual event. See [Analytics authentication](/developers/api/analytics/overview#authentication) > for setup. > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifyintent.com/analytics/v1/track" \ > --header "X-Write-Key: $UNIFY_WRITE_KEY" \ > --header "Origin: https://app.your-company.example" \ > --header "Content-Type: application/json" \ > --data '{ > "type": "track", > "visitorId": "visitor-trial-1042", > "sessionId": "session-trial-1042-1", > "timestamp": "2026-10-06T15:00:00Z", > "context": {}, > "name": "Trial started", > "properties": { > "plan": "team", > "signup_source": "pricing_page" > } > }' > ``` > > Use the same `visitorId` as the visitor's page and identify events. Custom event > names and properties can then inform your > [event filters](/reference/filter-builder#custom-events). # Identify events Source: https://docs.unifygtm.com/developers/api/analytics/identify POST /identify Associate a visitor with a person and company. ## Overview Associate a visitor with a known person when they sign in, submit a form, or provide their email address. Use the same `visitorId` in that visitor's page and custom events so their activity can be associated with their identity. ## Examples > **Identify a trial user** > > Set `UNIFY_WRITE_KEY` to the event source's write key and use an allowed origin > in the `Origin` header. Replace the example visitor ID and timestamp with those > from the actual event. See [Analytics authentication](/developers/api/analytics/overview#authentication) > for setup. > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifyintent.com/analytics/v1/identify" \ > --header "X-Write-Key: $UNIFY_WRITE_KEY" \ > --header "Origin: https://app.your-company.example" \ > --header "Content-Type: application/json" \ > --data '{ > "type": "identify", > "visitorId": "visitor-trial-1042", > "sessionId": "session-trial-1042-1", > "timestamp": "2026-10-06T15:00:00Z", > "context": {}, > "person": { > "email": "alex@northstar.example", > "first_name": "Alex", > "last_name": "Morgan" > }, > "company": { > "domain": "northstar.example", > "name": "Northstar Labs" > } > }' > ``` > > Use `person` and `company` to provide record attributes. For additional > attributes, use their API names and values that match their types in Unify. # Unify Analytics API Source: https://docs.unifygtm.com/developers/api/analytics/overview Send website and product analytics data into the Unify platform. ## Overview The Analytics API allows you to send both client-side and server-side events into Unify. There are three types of events you can send: * [Page events](/developers/api/analytics/page) capture page visits on your website or web application * [Custom events](/developers/api/analytics/custom) capture actions or other custom activities that you define * [Identify events](/developers/api/analytics/identify) capture visitor identity information (e.g., their email address) These event types form the building blocks to track visitor behavior and actions on your marketing website, web application, or other custom software. ## Usage ### Request format The base URL of all API requests to the Analytics API is: ```shell theme={null} https://api.unifyintent.com/analytics/v1 ``` Note that the base URL uses a different domain than other Unify APIs. ### Authentication > [!CAUTION] > > When sending requests to the Analytics API from client devices, you should use > your **write key** rather than an API key. Write keys are safe to expose > publicly whereas API keys are not. > > To prevent exposure of sensitive API keys, if you send a request to > the Analytics API that contains an API key by accident, Unify will immediately > expire the key as a precautionary measure. Write keys are used to authenticate requests to the Analytics API. You can find your write key in Unify by navigating to [Settings → Web & product data → Settings](https://app.unifygtm.com/dashboard/settings/data/web-intent?webEventsTab=Settings). To authenticate a request, include the following header in your request: ```http theme={null} X-Write-Key: ``` Replace `` with your Unify write key. ### Request origin Requests that use a write key must include an allowed `Origin` header. This applies to requests sent from both browsers and from server-side code. For server-side requests, set `Origin` to the website or application origin associated with the event source. ### Rate limits The Analytics API is rate-limited by default to 100,000 requests per five minute window. We are able to provide higher limits upon request if needed. ### OpenAPI specification The OpenAPI specification can be found [here](https://api.unifyintent.com/analytics/v1/openapi.json). # Page events Source: https://docs.unifygtm.com/developers/api/analytics/page POST /page Record visits to your website or application. ## Overview Send a page event when a visitor views a page on your website or application. Include the page URL and title so the visit has useful context in Unify. ## Examples > **Track a pricing page visit** > > Set `UNIFY_WRITE_KEY` to the event source's write key and use an allowed origin > in the `Origin` header. Replace the example visitor ID and timestamp with those > from the actual event. See [Analytics authentication](/developers/api/analytics/overview#authentication) > for setup. > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifyintent.com/analytics/v1/page" \ > --header "X-Write-Key: $UNIFY_WRITE_KEY" \ > --header "Origin: https://app.your-company.example" \ > --header "Content-Type: application/json" \ > --data '{ > "type": "page", > "visitorId": "visitor-trial-1042", > "sessionId": "session-trial-1042-1", > "timestamp": "2026-10-06T15:00:00Z", > "context": {}, > "name": "Pricing", > "properties": { > "url": "https://app.your-company.example/pricing", > "path": "/pricing", > "title": "Pricing" > } > }' > ``` > > Keep `visitorId` consistent across events from the same visitor. When their > identity becomes known, send an [identify event](/developers/api/analytics/identify) > with that visitor ID and their email address. # Create attribute Source: https://docs.unifygtm.com/developers/api/data/attributes/create POST /data/v1/objects/{object_name}/attributes Add an attribute to an object. # Delete attribute Source: https://docs.unifygtm.com/developers/api/data/attributes/delete DELETE /data/v1/objects/{object_name}/attributes/{attribute_name} Delete an attribute from an object by its API name. # Get attribute Source: https://docs.unifygtm.com/developers/api/data/attributes/get GET /data/v1/objects/{object_name}/attributes/{attribute_name} Get a single attribute on an object by its API name. # List attributes Source: https://docs.unifygtm.com/developers/api/data/attributes/list GET /data/v1/objects/{object_name}/attributes List the attributes defined on an object. # Create option Source: https://docs.unifygtm.com/developers/api/data/attributes/options/create POST /data/v1/objects/{object_name}/attributes/{attribute_name}/options Add an option to a `SELECT` or `MULTI_SELECT` attribute. # Delete option Source: https://docs.unifygtm.com/developers/api/data/attributes/options/delete DELETE /data/v1/objects/{object_name}/attributes/{attribute_name}/options/{option_name} Delete an option from a `SELECT` or `MULTI_SELECT` attribute. # Get option Source: https://docs.unifygtm.com/developers/api/data/attributes/options/get GET /data/v1/objects/{object_name}/attributes/{attribute_name}/options/{option_name} Get a single option on a `SELECT` or `MULTI_SELECT` attribute by its API name. # List options Source: https://docs.unifygtm.com/developers/api/data/attributes/options/list GET /data/v1/objects/{object_name}/attributes/{attribute_name}/options List the options defined for a `SELECT` or `MULTI_SELECT` attribute. # Update option Source: https://docs.unifygtm.com/developers/api/data/attributes/options/update PATCH /data/v1/objects/{object_name}/attributes/{attribute_name}/options/{option_name} Update an option on a `SELECT` or `MULTI_SELECT` attribute by its API name. # Update attribute Source: https://docs.unifygtm.com/developers/api/data/attributes/update PATCH /data/v1/objects/{object_name}/attributes/{attribute_name} Update an attribute on an object by its API name. # Add entries Source: https://docs.unifygtm.com/developers/api/data/list-entries/add POST /data/v1/lists/{list_id}/entries/add Add up to 100 records to a list. ## Overview The *add entries* method adds up to 100 records to a list in one request. Each record is identified either by its ID or by `match` criteria on the list's object. Both forms can be mixed in one request. The request returns HTTP 200 whenever the body is valid, even if some records could not be added. Each item in `data` reports the outcome for one record, in request order: | Status | Meaning | | - | - | | `added` | The record was added to the list. | | `already_in_list` | The record was already in the list. Nothing changed. | | `record_not_found` | No record with this ID, or matching this `match`, exists. | | `object_mismatch` | The record belongs to a different object than the list. | No records are created. Re-adding a record that is already in the list has no effect, so the request is safe to retry. ## Examples > **Add records by ID and by match** > > This adds one person by ID and one by email to a person list: > > ```http Request theme={null} > POST /data/v1/lists/0b5d3c1e-6f2a-4b8e-9c71-2d4e8a6f1b03/entries/add > > { > "records": [ > { "id": "73fcb798-9ccd-4138-8f6a-9a801123783c" }, > { "match": { "email": "ada@acme.com" } } > ] > } > ``` > > ```json Response theme={null} > { > "status": "success", > "data": [ > { > "status": "added", > "record": { "id": "73fcb798-9ccd-4138-8f6a-9a801123783c" }, > "entry": { > "id": "c4a1e2f0-8b3d-4e6a-9f12-5d7c8b9a0e14", > "created_at": "2026-10-01T12:00:00Z", > "updated_at": "2026-10-01T12:00:00Z", > "list_id": "0b5d3c1e-6f2a-4b8e-9c71-2d4e8a6f1b03", > "object": "person", > "record_id": "73fcb798-9ccd-4138-8f6a-9a801123783c" > } > }, > { > "status": "record_not_found", > "record": { "match": { "email": "ada@acme.com" } } > } > ], > "summary": { > "total": 2, > "added": 1, > "already_in_list": 0, > "record_not_found": 1, > "object_mismatch": 0 > } > } > ``` ## Usage `match` works the same way as the request body of [find unique record](/developers/api/data/records/find-unique). It must include at least one unique attribute of the list's object, such as `email` for a person or `domain` for a company. The request fails as a whole only when: * The body is malformed, including a record listed twice or a `match` that is not valid for the list's object (HTTP 400) * The list does not exist (HTTP 404) * The caller does not have manage access to the list (HTTP 403) # Get entry Source: https://docs.unifygtm.com/developers/api/data/list-entries/get GET /data/v1/lists/{list_id}/entries/{entry_id} Get a single list entry by its ID. # List entries Source: https://docs.unifygtm.com/developers/api/data/list-entries/list GET /data/v1/lists/{list_id}/entries List the records in a list. ## Overview Read the records that belong to a list. Each entry identifies a member using `record_id` and `object`, along with the entry's own ID and timestamps. ## Examples > **Read a campaign list** > > Set `UNIFY_API_KEY` to your API key. Replace the example IDs with records from > your workspace. > > ```bash theme={null} > curl --request GET \ > --url "https://api.unifygtm.com/data/v1/lists/0b5d3c1e-6f2a-4b8e-9c71-2d4e8a6f1b03/entries?limit=100" \ > --header "X-Api-Key: $UNIFY_API_KEY" > ``` > > The response contains entries in `data`. Use an entry's `object` and `record_id` > with [Get record](/developers/api/data/records/get) when you also need the > record's attributes. # Remove entries Source: https://docs.unifygtm.com/developers/api/data/list-entries/remove POST /data/v1/lists/{list_id}/entries/remove Remove up to 100 records from a list. # Create list Source: https://docs.unifygtm.com/developers/api/data/lists/create POST /data/v1/lists Create an empty list of records of one object. ## Overview Create a list to collect records for a campaign, account review, or another workflow. Each list holds records from one object. Add its members in a separate request after creating the list. ## Examples > **Create a prospect list** > > Set `UNIFY_API_KEY` to your API key. This creates a private person list: > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/data/v1/lists" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "name": "Trial follow-up", > "object": "person", > "share_status": "ONLY_ME" > }' > ``` > > Save `data.id` from the response, then use it to > [add entries](/developers/api/data/list-entries/add). A list's name must be > unique in the workspace, and its object cannot change after creation. # Delete list Source: https://docs.unifygtm.com/developers/api/data/lists/delete DELETE /data/v1/lists/{list_id} Delete a list without deleting its records. # Get list Source: https://docs.unifygtm.com/developers/api/data/lists/get GET /data/v1/lists/{list_id} Get a single list by its ID. # List lists Source: https://docs.unifygtm.com/developers/api/data/lists/list GET /data/v1/lists Find lists by object or exact name. ## Overview Find lists visible to the caller. Filter by object to browse relevant lists, or by exact name to find a list your integration created previously. ## Examples > **Find a list by name** > > Set `UNIFY_API_KEY` to your API key: > > ```bash theme={null} > curl --request GET \ > --url "https://api.unifygtm.com/data/v1/lists?object=person&name=Trial%20follow-up&limit=100" \ > --header "X-Api-Key: $UNIFY_API_KEY" > ``` > > The `name` filter requires an exact match. Use a returned list's `id` to > [read its entries](/developers/api/data/list-entries/list) or add records. # Lists Source: https://docs.unifygtm.com/developers/api/data/lists/overview Create and manage lists of records in Unify. ## Overview A list is a named collection of records from one object, such as companies to target this quarter. Use lists to organize records for campaigns or workflows that span Unify and other tools. For the workflow in the app, see [Lists](/reference/lists). Each list entry identifies a member by `record_id` and `object`. Use [Get record](/developers/api/data/records/get) to retrieve that member's attributes. ## Sharing Each list belongs to a user. Its `share_status` controls workspace-wide access and defaults to `ONLY_ME`. Lists can also be shared with individual users in the Unify app. Administrators and users with workspace-wide list permissions retain their access regardless of the sharing setting. Updating or deleting a list and adding or removing entries require manage access. ## List membership [Add](/developers/api/data/list-entries/add) or [remove](/developers/api/data/list-entries/remove) up to 100 records per request, identifying each by its ID or unique attributes. The response reports an outcome for each record, so a missing record does not fail the whole batch. Deleting a list or removing an entry leaves the underlying records intact. # Update list Source: https://docs.unifygtm.com/developers/api/data/lists/update PATCH /data/v1/lists/{list_id} Update a list's name or sharing. ## Overview Rename a list or change who can view and edit it. Include the properties you want to change. Omitted properties keep their existing values. ## Examples > **Share a campaign list** > > Set `UNIFY_API_KEY` to your API key. Replace the example IDs with records from > your workspace. This request gives other workspace members view access to an existing > list: > > ```bash theme={null} > curl --request PATCH \ > --url "https://api.unifygtm.com/data/v1/lists/0b5d3c1e-6f2a-4b8e-9c71-2d4e8a6f1b03" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "share_status": "ALL_OTHERS_CAN_VIEW" > }' > ``` > > To let teammates also edit it, use `ALL_OTHERS_CAN_EDIT`. To rename the list, > include `name` in the same request. List names must be unique in the workspace. > > The caller must have manage access to the list. The response returns the > updated list in `data`. # Create object Source: https://docs.unifygtm.com/developers/api/data/objects/create POST /data/v1/objects Create a new object. # Delete object Source: https://docs.unifygtm.com/developers/api/data/objects/delete DELETE /data/v1/objects/{object_name} Delete an object by its API name. # Get object Source: https://docs.unifygtm.com/developers/api/data/objects/get GET /data/v1/objects/{object_name} Get a single object definition by its API name. # List objects Source: https://docs.unifygtm.com/developers/api/data/objects/list GET /data/v1/objects List the objects in the workspace. # Update object Source: https://docs.unifygtm.com/developers/api/data/objects/update PATCH /data/v1/objects/{object_name} Update an object by its API name. # Unify Data API Source: https://docs.unifygtm.com/developers/api/data/overview Interact with Unify objects, attributes, records, and lists. ## Overview Data within Unify is stored in *objects*. Objects are the building blocks that allow you to store and interact with data in Unify. Every object has a set of *attributes* which represent the fields that make up the object, and *records* represent instances of the object. *Lists* are named collections of records from one object. The Unify Data API allows you to interact with these objects, attributes, and associated records. The following API groups are available: * [Object APIs](/developers/api/data/objects/create) allow you to create and manage object definitions and schemas * [Attribute APIs](/developers/api/data/attributes/create) allow you to create and manage the attributes on objects * [Record APIs](/developers/api/data/records/create) allow you to query, create, and modify object records * [List APIs](/developers/api/data/lists/overview) allow you to group records into lists and manage their entries These APIs provide the means to connect custom data sources to Unify, import data from external tools, and export data to other systems. ## Usage ### Request format The base URL of all API requests to the Data API is: ```shell theme={null} https://api.unifygtm.com/data/v1 ``` ### Authentication API keys are used to authenticate requests to the Data API. Your Unify admin can generate an API key in Unify by navigating to [Settings → Developers](https://app.unifygtm.com/dashboard/settings/integrations/api-keys). To authenticate a request, include the following header in your request: ```http theme={null} X-Api-Key: ``` Replace `` with your Unify API key. > [!WARNING] > > Treat API keys as sensitive credentials. Avoid pasting them as plaintext into Slack, email, or LLM chats, and store them in a password manager whenever possible. > > As a best practice rotate API keys regularly. ### Pagination List endpoints return `next_cursor`. Pass a non-null value as `cursor` with the same filters to fetch the next page. Continue until `next_cursor` is `null`. ### Rate limits The Data API is rate-limited to 100,000 requests per five minute window. We may introduce daily limits in the future to prevent extraordinary usage. ### OpenAPI specification The OpenAPI specification can be found [here](https://api.unifygtm.com/data/v1/openapi.json). # Create record Source: https://docs.unifygtm.com/developers/api/data/records/create POST /data/v1/objects/{object_name}/records Create a new record. ## Overview Create a record in a standard or custom object. Put attribute values inside `data` and include all required attributes defined on the object. A conflicting unique value returns an error. If your workflow should update an existing record or create one when missing, use [Upsert record](/developers/api/data/records/upsert). ## Examples Set `UNIFY_API_KEY` to your API key. > **Create a company** > > This example uses synthetic company data: > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/data/v1/objects/company/records" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "data": { > "name": "Northstar Labs", > "domain": "northstar.example", > "description": "Software for managing laboratory operations." > } > }' > ``` > > The response contains the new record in `data`. Save `data.id` for later > updates or list membership operations. > **Create a person at an existing company** > > A nested `match` finds the company by its unique domain. Replace these example > values with the person's details and a company already in your workspace. > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/data/v1/objects/person/records" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "data": { > "first_name": "Alex", > "last_name": "Morgan", > "email": "alex@northstar.example", > "title": "Operations director", > "company": { > "match": { > "domain": "northstar.example" > } > } > } > }' > ``` > > If the referenced company is missing, its reference resolves to `null`. To > create the company when needed, include a nested `create`: > > ```json theme={null} > { > "match": { "domain": "northstar.example" }, > "create": { "name": "Northstar Labs", "domain": "northstar.example" } > } > ``` > > Use this object as the value of `data.company` in the person request. > **Create a custom record** > > Suppose you've defined a `product_user` object with `user_id`, `full_name`, > `email_address`, and `plan` attributes. Use those attributes' API names in > `data`: > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/data/v1/objects/product_user/records" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "data": { > "user_id": "trial-user-1042", > "full_name": "Alex Morgan", > "email_address": "alex@northstar.example", > "plan": "free_tier" > } > }' > ``` > > Create the object and its attributes before sending this request. Match each > value to the attribute's type and use valid options for select attributes. # Delete record Source: https://docs.unifygtm.com/developers/api/data/records/delete DELETE /data/v1/objects/{object_name}/records/{record_id} Delete a record by ID. ## Overview Permanently delete a record by its ID from the specified object. This operation cannot be undone. If the record doesn't exist, the API will return a 404 error. If the record is referenced by other records, those other records will not be deleted, but their reference to this record will be set to `null`. ## Examples > **Delete a company record** > > This permanently deletes a company record: > > ```http Request theme={null} > DELETE /data/v1/objects/company/records/349b4a49-38b7-407d-aeee-db4ead1bbae2 > ``` > > ```json Response theme={null} > { > "status": "success" > } > ``` > > People associated with this company will have their `company` attribute set > to `null`. > **Delete a custom record** > > This permanently deletes a record from a custom object: > > ```http Request theme={null} > DELETE /data/v1/objects/product_user/records/5ff35db4-20de-4a12-9eef-ca0e9cc24818 > ``` > > ```json Response theme={null} > { > "status": "success" > } > ``` # Find unique record Source: https://docs.unifygtm.com/developers/api/data/records/find-unique POST /data/v1/objects/{object_name}/records/find-unique Find a specific record based on unique values. ## Overview Find a record using a unique attribute, such as a company's domain or a person's email address. Put the attribute values inside `match`. Additional attributes narrow the match, and at least one must be unique on the object. ## Examples Set `UNIFY_API_KEY` to your API key. > **Find a company by domain** > > Replace the example domain with the company to find: > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/data/v1/objects/company/records/find-unique" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "match": { > "domain": "northstar.example" > } > }' > ``` > > The response's `data` contains the matching record, or `null` when no record > matches. Use the returned ID to update the record or add it to a list. > **Find a person by email** > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/data/v1/objects/person/records/find-unique" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "match": { > "email": "alex@northstar.example" > } > }' > ``` > **Find a custom record** > > If `user_id` is a unique attribute on your `product_user` object, find a record > by that ID. Including `plan` additionally requires the record to have that value: > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/data/v1/objects/product_user/records/find-unique" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "match": { > "user_id": "trial-user-1042", > "plan": "enterprise" > } > }' > ``` > > All supplied criteria must match. The custom object and these attributes must > exist before you query them. # Get record Source: https://docs.unifygtm.com/developers/api/data/records/get GET /data/v1/objects/{object_name}/records/{record_id} Retrieve a specific record by ID. ## Overview Retrieve a record by its ID from the specified object. If the record doesn't exist, the request returns an error. ## Examples > **Get a company record** > > This retrieves a specific company record: > > ```http Request theme={null} > GET /data/v1/objects/company/records/de885595-2d9a-4fb9-ae30-25ef18b6219b > ``` > > ```json Response theme={null} > { > "status": "success", > "data": { > "object": "company", > "id": "de885595-2d9a-4fb9-ae30-25ef18b6219b", > "created_at": "2025-09-04T01:23:45Z", > "updated_at": "2025-09-04T01:23:45Z", > "attributes": { > "name": "Northstar Labs", > "domain": "northstar.example", > "description": "Software for managing laboratory operations.", > "status": "Active" > } > } > } > ``` > **Get a custom record** > > This retrieves a record from a custom object: > > ```http Request theme={null} > GET /data/v1/objects/product_user/records/6741cc39-b332-45a8-a439-75b69db998b1 > ``` > > ```json Response theme={null} > { > "status": "success", > "data": { > "object": "product_user", > "id": "6741cc39-b332-45a8-a439-75b69db998b1", > "created_at": "2025-09-04T01:23:45Z", > "updated_at": "2025-09-04T01:23:45Z", > "attributes": { > "user_id": "6b2a2761-3cbe-481f-8a1e-b24859c674f8", > "full_name": "Alex Morgan", > "email_address": "alex@northstar.example", > "plan": "free_tier" > } > } > } > ``` # Cancel job Source: https://docs.unifygtm.com/developers/api/data/records/query-records/cancel POST /data/v1/objects/{object_name}/query-jobs/{job_id}/cancel Cancel a record query job that is in progress. # Create job Source: https://docs.unifygtm.com/developers/api/data/records/query-records/create POST /data/v1/objects/{object_name}/query-jobs Create a job to query records. ## Overview Create a query job to query and export records from an object. Use the request body to select which attributes to return and optionally filter or sort the results. See [Using query jobs](/developers/guides/request-data/query-jobs) for an overview of using jobs to query data. # Get job Source: https://docs.unifygtm.com/developers/api/data/records/query-records/get GET /data/v1/objects/{object_name}/query-jobs/{job_id} Get the status and metadata for a record query job. # List jobs Source: https://docs.unifygtm.com/developers/api/data/records/query-records/list GET /data/v1/objects/{object_name}/query-jobs List all record query jobs. # Get results Source: https://docs.unifygtm.com/developers/api/data/records/query-records/results GET /data/v1/objects/{object_name}/query-jobs/{job_id}/results Get results for a finished record query job. # Update record Source: https://docs.unifygtm.com/developers/api/data/records/update PATCH /data/v1/objects/{object_name}/records/{record_id} Update an existing record by ID. ## Overview Update a record by ID. Put the attributes you want to change inside `data`. Supplied values replace existing values, while omitted attributes retain their values. To fill only missing values, use [Upsert record](/developers/api/data/records/upsert) with `update_if_empty`. ## Examples Set `UNIFY_API_KEY` to your API key. > **Update a company description** > > Replace the example IDs with records from > your workspace. > > ```bash theme={null} > curl --request PATCH \ > --url "https://api.unifygtm.com/data/v1/objects/company/records/73fcb798-9ccd-4138-8f6a-9a801123783c" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "data": { > "description": "Laboratory operations software for multi-site research teams." > } > }' > ``` > **Update a person's job** > > Update the person's title and company together. This example references the > company by record ID: > > ```bash theme={null} > curl --request PATCH \ > --url "https://api.unifygtm.com/data/v1/objects/person/records/bf3f4d5e-c995-496f-8774-5a1c58d05197" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "data": { > "title": "VP of operations", > "company": { > "id": "73fcb798-9ccd-4138-8f6a-9a801123783c" > } > } > }' > ``` > > A successful response contains the updated record in `data`. If the target > record does not exist, the API returns `404`. > **Update a custom record** > > For a custom object, use its API name in the URL and its attribute API names in > `data`. For example, a `product_user` object with a `plan` attribute could use: > > ```json theme={null} > { > "data": { "plan": "enterprise" } > } > ``` > > The attribute and any referenced select option must already exist. # Upsert record Source: https://docs.unifygtm.com/developers/api/data/records/upsert POST /data/v1/objects/{object_name}/records/upsert Create or update a record based on unique values. ## Overview Upsert a record to keep data from another system current in Unify. A matching record is updated. If no record matches, a new record is created. The request body accepts the following properties which specify how to create or update the record: | Property | Behavior | | - | - | | `match` | Values to match against existing records. At least one of these values must be a unique attribute to avoid matching more than one record. | | `create` | Values to use when creating a new record. | | `update` | Values to use when updating an existing record. These values will replace any existing values on the record. | | `update_if_empty` | Values to use when updating an existing record. These values will only be used if the attribute is currently empty. | | `create_or_update` | Values to use when creating a new record or updating an existing record. When updating, these values will replace any existing values on the record. | | `create_or_update_if_empty` | Values to use when creating a new record or updating an existing record. When updating, these values will only be used if the attribute is currently empty. | You must specify `match` and one of `create`, `create_or_update`, or `create_or_update_if_empty`. All other properties are optional. ## Examples Set `UNIFY_API_KEY` to your API key. > **Keep company data current** > > This request creates Northstar Labs if its > domain is missing, or updates its name and description if it already exists: > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/data/v1/objects/company/records/upsert" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "match": { > "domain": "northstar.example" > }, > "create_or_update": { > "name": "Northstar Labs", > "domain": "northstar.example", > "description": "Software for managing laboratory operations." > } > }' > ``` > **Fill missing person and company details** > > Use `create_or_update_if_empty` to preserve populated attributes. In this > example, both the person and the referenced company are created if needed: > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/data/v1/objects/person/records/upsert" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "match": { > "email": "alex@northstar.example" > }, > "create_or_update_if_empty": { > "first_name": "Alex", > "last_name": "Morgan", > "email": "alex@northstar.example", > "title": "Operations director", > "company": { > "match": { > "domain": "northstar.example" > }, > "create_or_update_if_empty": { > "name": "Northstar Labs", > "domain": "northstar.example" > } > } > } > }' > ``` > > “Empty” means the current value is `null`. The response returns the resulting > record in `data`. > **Sync a custom record** > > For a `product_user` object with a unique `user_id`, use the external user's ID > as the match key: > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/data/v1/objects/product_user/records/upsert" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "match": { > "user_id": "trial-user-1042" > }, > "create_or_update": { > "user_id": "trial-user-1042", > "full_name": "Alex Morgan", > "email_address": "alex@northstar.example", > "plan": "free_tier" > } > }' > ``` > > Create the custom object and attributes before sending this request. The > attribute values must match their configured types and select options. # Standard objects and attributes Source: https://docs.unifygtm.com/developers/api/data/standard-objects Reference the built-in attributes that ship with Unify's standard objects. ## Overview Unify provides a set of **standard objects** that ship with built-in attributes. The most commonly used standard objects are **Company**, **Person**, **Opportunity**, and **User**, documented below. Each attribute has an **API name** (used in API requests and responses) and a [value type](/reference/objects/value-types). You can extend any standard object with [custom attributes](/reference/objects/create-attributes), and you can link objects to one another with [reference](/reference/objects/value-types#reference) attributes. > [!NOTE] > > These tables list the attributes that ship by default. A workspace may add > custom attributes, so for the authoritative, live set on an object, list its > attributes via the API: > > ```http theme={null} > GET /data/v1/objects/{object_name}/attributes > ``` A few attributes are **read-only** and maintained by Unify. They appear in records and query results but cannot be set directly through the API. ## Company The **Company** object (`company`) represents an organization or business entity, such as a customer, competitor, or partner. | API name | Value type | Required | Description | | :- | :- | :- | :- | | `name` | Text | | Name of the company. | | `domain` | URL | Yes | Website domain. Normalized and deduplicated — see the note below. | | `description` | Text | | Description of the company. | | `industry` | Text | | Industry the company operates in. | | `employee_count` | Integer | | Estimated employee count. | | `revenue` | Currency | | Estimated revenue. | | `founded` | Date | | Date the company was founded. | | `address` | Address | | Physical address of the company. | | `time_zone` | Time zone | | Time zone the company is located in. | | `corporate_phone` | Phone number | | Corporate phone number. | | `linkedin_url` | URL | | LinkedIn company profile. Standardized to `https://www.linkedin.com/company//`. | | `status` | Text | | Status of the company. | | `lead_source` | Text | | Source of the company record. | | `do_not_contact` | Boolean | | Whether contacting this company is disallowed. | | `record_owner` | Reference | | The user that owns the record. References the **User** object. | | `hubspot_url` | URL | | HubSpot record URL for the company. | | `salesforce_url` | URL | | Salesforce record URL for the company. | | `last_activity_at` | Datetime | | Last time any activity was recorded for the company. Read-only. | | `last_website_activity_at` | Datetime | | Last time a website activity was recorded for the company. Read-only. | > [!NOTE] > > The `domain` attribute has special validation and preprocessing to prevent > duplicate company records. The domain is normalized (protocol and path are > stripped). See > [Attribute value types](/reference/objects/value-types#url) for details. ## Person The **Person** object (`person`) represents an individual who interacts with your business, such as a prospect, customer, or contact at a partner company. | API name | Value type | Required | Description | | :- | :- | :- | :- | | `email` | Email address | Yes | Email address of the person. | | `first_name` | Text | | First name of the person. | | `last_name` | Text | | Last name of the person. | | `title` | Text | | Job title of the person. | | `company` | Reference | | Company the person is associated with. References the **Company** object. | | `address` | Address | | Physical address of the person. | | `time_zone` | Time zone | | IANA time zone identifier derived from the person's address. Read-only. | | `mobile_phone` | Phone number | | Mobile phone number. | | `work_phone` | Phone number | | Work phone number. | | `corporate_phone` | Phone number | | Corporate phone number. | | `phone_numbers` | Phone number | | Additional phone numbers associated with the person. Returns a list. | | `linkedin_url` | URL | | LinkedIn profile. Standardized to `https://www.linkedin.com/in//`. | | `status` | Text | | Status of the person. | | `lead_source` | Text | | Source of the person record. | | `do_not_call` | Boolean | | Whether calling this person is disallowed. | | `do_not_email` | Boolean | | Whether emailing this person is disallowed. | | `email_opt_out` | Boolean | | Whether the person has opted out of email communications. | | `eu_resident` | Boolean | | Whether the person is a resident of the European Union. | | `record_owner` | Reference | | The user that owns the record. References the **User** object. | | `hubspot_url` | URL | | HubSpot record URL for the person. | | `salesforce_url` | URL | | Salesforce record URL for the person. | | `last_activity_at` | Datetime | | Last time any activity was recorded for the person. Read-only. | | `last_website_activity_at` | Datetime | | Last time a website activity was recorded for the person. Read-only. | ## Opportunity The **Opportunity** object (`opportunity`) represents a deal or potential business relationship. Opportunities can carry a monetary value and a stage, and can be linked to companies and people. | API name | Value type | Required | Description | | :- | :- | :- | :- | | `name` | Text | Yes | Name of the opportunity. | | `uniqueness_key` | Text | Yes | Unique identifier used to distinguish this opportunity from others. | | `amount` | Currency | | Monetary value associated with the opportunity. | | `stage` | Text | | Stage of the opportunity in the sales process (such as "open" or "closed"). | | `opportunity_type` | Text | | Type of the opportunity. | | `company` | Reference | | Company associated with the opportunity. References the **Company** object. | | `person` | Reference | | Person associated with the opportunity. References the **Person** object. | | `lead_source` | Text | | Source of the opportunity. | | `record_owner` | Reference | | The user that owns the record. References the **User** object. | | `original_created_at` | Datetime | | Date when the opportunity was originally opened. | | `hubspot_url` | URL | | HubSpot record URL for the opportunity. | | `salesforce_url` | URL | | Salesforce record URL for the opportunity. | ## User The **User** object (`user`) represents a member of your Unify workspace. Users are referenced by the `record_owner` attribute on other objects to indicate who owns a record. | API name | Value type | Required | Description | | :- | :- | :- | :- | | `email` | Email address | Yes | Email address of the user. | | `first_name` | Text | | First name of the user. | | `last_name` | Text | | Last name of the user. | > [!NOTE] > > Unlike other standard objects, the **User** object does not support custom > attributes. ## What's next > **[Attribute value types](/reference/objects/value-types)** > > Learn how each value type behaves and what it accepts. > **[List attributes](/developers/api/data/attributes/list)** > > Fetch the live set of attributes on any object via the API. # Approve enrollment Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/approve POST /sequences/v1/enrollments/{id}/approve Start an agentic enrollment after reviewing its drafts. ## Overview [Agentic sequences](/reference/sequences/personalization/agentic-sequences) generate a draft for each person and wait for approval before the enrollment starts. While an enrollment waits, `is_draft_approval_pending` is `true`. Approve the enrollment after reviewing its copy. Approval starts the enrollment, and automatic emails follow the sequence's [send schedule](/reference/sequences/send-schedules). The API returns `409 Conflict` when the enrollment is not waiting for approval, for example because it was already approved or was canceled. It returns `400 Bad Request` when the person has opted out of email or is marked do not email. ## Examples > **Review and approve a draft** > > Set `UNIFY_API_KEY` to your API key and replace the example enrollment ID. > First, list the enrollment's steps to review the drafted copy: > > ```bash theme={null} > curl --request GET \ > --url "https://api.unifygtm.com/sequences/v1/enrollments/a8b35494-e82e-4a0c-9b8f-0b80c5b5d8f2/steps" \ > --header "X-Api-Key: $UNIFY_API_KEY" > ``` > > Use [Update enrollment step](/developers/api/sequences/enrollments/update-step) > to revise any email. When the copy is ready, approve the enrollment: > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/sequences/v1/enrollments/a8b35494-e82e-4a0c-9b8f-0b80c5b5d8f2/approve" \ > --header "X-Api-Key: $UNIFY_API_KEY" > ``` > > A successful response sets `is_draft_approval_pending` to `false`. You can > still update steps that have not sent. # Create enrollment Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/create POST /sequences/v1/enrollments Enroll a person in a sequence. ## Overview Create an enrollment to add a person to a published template sequence. The sequence's [ruleset](/reference/sequences/rulesets) determines enrollment eligibility. ## Examples > **Enroll a trial signup** > > Use an existing person and a published template sequence. Set `UNIFY_API_KEY` > to your API key, replace the example IDs, and use an eligible connected sending > mailbox: > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/sequences/v1/enrollments" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "sequence_id": "c14aae21-3073-4c5d-98ac-9a8458cd0f2b", > "person_id": "bf3f4d5e-c995-496f-8774-5a1c58d05197", > "mailbox_emails": [ > "rep@your-company.example" > ] > }' > ``` > > Creating an enrollment starts the sequence's workflow, which can send emails > and create tasks. Review the sequence, recipient, and sending mailbox before > running the request. Save the returned enrollment ID to inspect or pause it > later. ## Handle enrollment conflicts When active enrollments prevent a new enrollment, the API returns `409 Conflict`. Inspect `reason` and `active_enrollments`; the response can also include `blocking_sequence_ids` or `unapproved_sequence_ids`. If user approval is required, present the active enrollments for review before retrying with `allowed_concurrent_sequence_ids`. Those IDs record the user's approval. Enrollment must still satisfy the sequences' simultaneous enrollment policies. Other eligibility failures return `400 Bad Request` with a message explaining the cause. Examples include an unpublished sequence, ineligible mailboxes, opt-outs, exclusions, and re-enrollment restrictions. Resolve that cause before retrying. Agentic sequences use the [workflow for generating drafts](/reference/sequences/personalization/agentic-sequences) in Unify. This endpoint returns `400 Bad Request` for an agentic sequence. After Unify generates the drafts, you can review and edit their copy with [List enrollment steps](/developers/api/sequences/enrollments/list-steps) and [Update enrollment step](/developers/api/sequences/enrollments/update-step), then start each enrollment with [Approve enrollment](/developers/api/sequences/enrollments/approve). # Delete enrollment Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/delete DELETE /sequences/v1/enrollments/{id} Delete a sequence enrollment, removing the person from the sequence. # Get enrollment Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/get GET /sequences/v1/enrollments/{id} Retrieve a single sequence enrollment by its ID. # Get enrollment step Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/get-step GET /sequences/v1/enrollment-steps/{id} Retrieve one enrollment step and its current email copy. ## Overview Retrieve one step of an enrollment by its ID. For email steps, `email` contains the current copy and its `version_id`. Read the step before [updating its copy](/developers/api/sequences/enrollments/update-step) so your edit starts from the latest version. Get step IDs from [List enrollment steps](/developers/api/sequences/enrollments/list-steps). # List enrollments Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/list GET /sequences/v1/enrollments Inspect enrollment status and recent changes. ## Overview Inspect a person's enrollments or check progress in a sequence. Combine filters to narrow the results. Use a query job for bulk exports. ## Examples > **Check a person's active enrollments** > > Set `UNIFY_API_KEY` to your API key. Replace the example IDs with records from > your workspace. > > ```bash theme={null} > curl --request GET \ > --url "https://api.unifygtm.com/sequences/v1/enrollments?person_id=bf3f4d5e-c995-496f-8774-5a1c58d05197&status=IN_PROGRESS&limit=100" \ > --header "X-Api-Key: $UNIFY_API_KEY" > ``` > > Inspect `is_paused` on each enrollment to distinguish paused work from work that > can progress. To check a whole sequence, replace `person_id` with `sequence_id`. > **Find drafts waiting for approval** > > List the in-progress enrollments in an agentic sequence: > > ```bash theme={null} > curl --request GET \ > --url "https://api.unifygtm.com/sequences/v1/enrollments?sequence_id=c14aae21-3073-4c5d-98ac-9a8458cd0f2b&status=IN_PROGRESS&limit=100" \ > --header "X-Api-Key: $UNIFY_API_KEY" > ``` > > Enrollments with `is_draft_approval_pending` set to `true` are waiting for > review. Inspect their copy with > [List enrollment steps](/developers/api/sequences/enrollments/list-steps), then > start them with [Approve enrollment](/developers/api/sequences/enrollments/approve). ## Retrieve recent changes Use `updated_after` and `updated_before` to bound the enrollment's `updated_at` timestamp. Both bounds are inclusive. When syncing changes to another system, use enrollment IDs to update existing rows if successive time windows overlap. For a larger export, use [Query enrollments](/developers/api/sequences/enrollments/query-enrollments/create). # List enrollment steps Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/list-steps GET /sequences/v1/enrollments/{id}/steps List one person's steps in a sequence, including email copy. ## Overview List the steps of one enrollment in the order they run. Email steps include the copy prepared for that person in `email`, so you can review a draft before [approving the enrollment](/developers/api/sequences/enrollments/approve) or [edit a step's copy](/developers/api/sequences/enrollments/update-step) before it sends. To export steps across many enrollments, use [Query enrollment steps](/developers/api/sequences/enrollments/query-enrollment-steps/create). ## Examples > **Review the copy prepared for a person** > > Set `UNIFY_API_KEY` to your API key and replace the example enrollment ID: > > ```bash theme={null} > curl --request GET \ > --url "https://api.unifygtm.com/sequences/v1/enrollments/a8b35494-e82e-4a0c-9b8f-0b80c5b5d8f2/steps" \ > --header "X-Api-Key: $UNIFY_API_KEY" > ``` > > Each email step returns its current `subject` and `body`. While > `email.is_ready` is `false`, Unify is still preparing the copy and `body` can > be `null`. Save each step's `id` and `email.version_id` if you plan to edit > the copy. # Pause enrollment Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/pause POST /sequences/v1/enrollments/{id}/pause Pause one person’s progress through a sequence. ## Overview Pause one person's enrollment to stop its progress until you resume it. Use this when a rep needs to review an enrollment before further outreach. ## Examples > **Pause an enrollment** > > Set `UNIFY_API_KEY` to your API key and replace the example enrollment ID: > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/sequences/v1/enrollments/a8b35494-e82e-4a0c-9b8f-0b80c5b5d8f2/pause" \ > --header "X-Api-Key: $UNIFY_API_KEY" > ``` > > A successful response sets `is_paused` to `true`. Use > [Resume enrollment](/developers/api/sequences/enrollments/resume) when the person > should continue through the sequence. # Cancel job Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/query-enrollment-steps/cancel POST /sequences/v1/enrollment-steps/query-jobs/{job_id}/cancel Cancel a sequence enrollment step query job that is in progress. # Create job Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/query-enrollment-steps/create POST /sequences/v1/enrollment-steps/query-jobs Create a job to query sequence enrollment steps. ## Overview Create a query job to query and export enrollment steps. Use the request body to optionally filter or sort the results. See [Using query jobs](/developers/guides/request-data/query-jobs) for an overview of using jobs to query data. # Get job Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/query-enrollment-steps/get GET /sequences/v1/enrollment-steps/query-jobs/{job_id} Get the status and metadata for a sequence enrollment step query job. # List jobs Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/query-enrollment-steps/list GET /sequences/v1/enrollment-steps/query-jobs List all sequence enrollment step query jobs. # Get results Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/query-enrollment-steps/results GET /sequences/v1/enrollment-steps/query-jobs/{job_id}/results Get results for a finished sequence enrollment step query job. # Cancel job Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/query-enrollments/cancel POST /sequences/v1/enrollments/query-jobs/{job_id}/cancel Cancel a sequence enrollment query job that is in progress. # Create job Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/query-enrollments/create POST /sequences/v1/enrollments/query-jobs Create a job to query sequence enrollments. ## Overview Create a query job to query and export enrollments. Use the request body to optionally filter or sort the results. See [Using query jobs](/developers/guides/request-data/query-jobs) for an overview of using jobs to query data. # Get job Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/query-enrollments/get GET /sequences/v1/enrollments/query-jobs/{job_id} Get the status and metadata for a sequence enrollment query job. # List jobs Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/query-enrollments/list GET /sequences/v1/enrollments/query-jobs List all sequence enrollment query jobs. # Get results Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/query-enrollments/results GET /sequences/v1/enrollments/query-jobs/{job_id}/results Get results for a finished sequence enrollment query job. # Resume enrollment Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/resume POST /sequences/v1/enrollments/{id}/resume Resume a paused sequence enrollment. # Update enrollment step Source: https://docs.unifygtm.com/developers/api/sequences/enrollments/update-step PATCH /sequences/v1/enrollment-steps/{id} Edit one person's email copy before it sends. ## Overview Replace the subject, fallback subject, or body of one person's email before it sends. The change applies only to this enrollment and leaves the sequence's template unchanged. Use it to revise copy that Unify drafted for an [agentic sequence](/reference/sequences/personalization/agentic-sequences) before you [approve the enrollment](/developers/api/sequences/enrollments/approve), or to adjust a scheduled email for one recipient. Include only the fields you want to change. The request must include at least one of `subject`, `fallback_subject`, or `body`. Only email steps have copy; other step types return `400 Bad Request`. Get step IDs from [List enrollment steps](/developers/api/sequences/enrollments/list-steps). ## Examples Set `UNIFY_API_KEY` to your API key and replace the example step ID and `version_id` with values from [Get enrollment step](/developers/api/sequences/enrollments/get-step). > **Rewrite a drafted email** > > This request replaces the email body and keeps the first name variable from > the original copy: > > ```bash theme={null} > curl --request PATCH \ > --url "https://api.unifygtm.com/sequences/v1/enrollment-steps/3f6c2a90-58d1-4e7b-9a43-2c8e1d7b5f06" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "body": "

Hi {{variable::person.firstName}},

Congratulations on the new office in Austin. Would a short call next week be useful?

", > "version_id": "0b7d9e4c-6a21-4f3e-8c55-9d1a2b3c4e5f" > }' > ``` > > The response returns the step with its new copy and a new > `email.version_id`. > **Change the subject of a thread** > > Send a subject only to the first email of a thread: > > ```json theme={null} > { > "subject": "{{variable::company.name}} and Unify", > "fallback_subject": "Quick introduction", > "version_id": "0b7d9e4c-6a21-4f3e-8c55-9d1a2b3c4e5f" > } > ``` > > Unify uses `fallback_subject` if the variable in `subject` cannot be > resolved when the email sends. ## Write the copy `body` is HTML and replaces the step's entire body. Template variables and [snippets](/reference/sequences/personalization/snippets) appear in the copy as `{{ ... }}` tokens, such as `{{variable::person.firstName}}`. Keep the tokens you want to preserve. To add a variable or snippet, copy its token from the sequence's template, which [Get sequence step](/developers/api/sequences/sequences/get-step) returns in `config.body`. After an update, Unify resolves the tokens in the new copy for this person. `email.is_ready` is `false` until they are resolved, and the email does not send before then. Only the first email of a thread accepts `subject` and `fallback_subject`. Its `email.is_root_message` is `true`. Later emails reply in the same thread and reuse its subject, so a subject change on a reply returns `400 Bad Request`. ## Avoid overwriting other edits Send the `email.version_id` you last read as `version_id`. If the copy changed after that version, for example because a teammate edited it in Unify, the API returns `409 Conflict` with `reason` set to `VERSION_OUTDATED`. Get the step again, apply your change to the latest copy, and retry. Without `version_id`, the update replaces the current copy regardless of earlier changes. The API also returns `409 Conflict` once the step has sent or the enrollment has ended, for example because the person replied or opted out. `reason` identifies the cause. Only `VERSION_OUTDATED` can be resolved by retrying. # Unify Sequences API Source: https://docs.unifygtm.com/developers/api/sequences/overview Interact with sequences and sequence enrollments in the Unify platform. ## Overview A *sequence* is an automated series of steps — emails, tasks, and conditions — that runs against a person. Enrolling a person in a sequence creates an *enrollment*, which tracks that person's progress through the sequence's steps along with reply, bounce, and opt-out state. The Sequences API lets you manage these resources programmatically. The following API groups are available: * [Sequence APIs](/developers/api/sequences/sequences/list) let you list and retrieve sequences, inspect their steps, and pause or resume them * [Enrollment APIs](/developers/api/sequences/enrollments/create) let you enroll people in sequences, review and approve drafted enrollments, edit each person's email copy, and query or manage enrollments and enrollment steps ## Usage ### Request format The base URL of all API requests to the Sequences API is: ```shell theme={null} https://api.unifygtm.com/sequences/v1 ``` ### Authentication API keys are used to authenticate requests to the Sequences API. You can generate an API key in Unify by navigating to [Settings → Developers](https://app.unifygtm.com/dashboard/settings/integrations/api-keys). To authenticate a request, include the following header in your request: ```http theme={null} X-Api-Key: ``` Replace `` with your Unify API key. ### Pagination List endpoints use cursor pagination. Each response includes a `next_cursor` value; pass it as the `cursor` query parameter to fetch the next page. A `null` `next_cursor` means there are no more results. ### Rate limits The Sequences API is rate-limited to 100,000 requests per five minute window. We may introduce daily limits in the future to prevent extraordinary usage. ### OpenAPI specification The OpenAPI specification can be found [here](https://api.unifygtm.com/sequences/v1/openapi.json). # Delete sequence Source: https://docs.unifygtm.com/developers/api/sequences/sequences/delete DELETE /sequences/v1/sequences/{id} Delete a sequence. # Get sequence Source: https://docs.unifygtm.com/developers/api/sequences/sequences/get GET /sequences/v1/sequences/{id} Retrieve a single sequence by its ID. # Get sequence step Source: https://docs.unifygtm.com/developers/api/sequences/sequences/get-step GET /sequences/v1/sequences/{id}/steps/{step_id} Retrieve a single step within a sequence. # List sequences Source: https://docs.unifygtm.com/developers/api/sequences/sequences/list GET /sequences/v1/sequences Find sequences by name. ## Overview Find a sequence before creating enrollments or checking its steps. Search by name to narrow the results, then inspect the returned sequence before using its ID in another request. ## Examples > **Find a follow-up sequence** > > Set `UNIFY_API_KEY` to your API key: > > ```bash theme={null} > curl --request GET \ > --url "https://api.unifygtm.com/sequences/v1/sequences?name=trial&limit=50" \ > --header "X-Api-Key: $UNIFY_API_KEY" > ``` > > The `name` filter matches a case-insensitive substring, so this can return > sequences such as “Trial follow-up” and “Enterprise trial.” Use > [Get sequence](/developers/api/sequences/sequences/get) or > [List steps](/developers/api/sequences/sequences/list-steps) to inspect the > sequence you intend to use. # List sequence steps Source: https://docs.unifygtm.com/developers/api/sequences/sequences/list-steps GET /sequences/v1/sequences/{id}/steps List the steps that make up a sequence. # Pause sequence Source: https://docs.unifygtm.com/developers/api/sequences/sequences/pause POST /sequences/v1/sequences/{id}/pause Pause a sequence, halting progress for all of its enrollments. # Resume sequence Source: https://docs.unifygtm.com/developers/api/sequences/sequences/resume POST /sequences/v1/sequences/{id}/resume Resume a paused sequence. # Unify Tasks API Source: https://docs.unifygtm.com/developers/api/tasks/overview Interact with tasks in the Unify platform. ## Overview A *task* is a unit of outreach work such as sending an email, making a phone call, or completing a manual action. Tasks are tied to people and assigned to users. Every task tracks its own type, status, priority, and due date. Use the Tasks API to create follow-up work from another system, update assignments and due dates, or export task activity for reporting. ## Usage ### Request format The base URL of all API requests to the Tasks API is: ```shell theme={null} https://api.unifygtm.com/tasks/v1 ``` ### Authentication API keys are used to authenticate requests to the Tasks API. You can generate an API key in Unify by navigating to [Settings → Developers](https://app.unifygtm.com/dashboard/settings/integrations/api-keys). To authenticate a request, include the following header in your request: ```http theme={null} X-Api-Key: ``` Replace `` with your Unify API key. ### Pagination List endpoints use cursor pagination. Each response includes a `next_cursor` value; pass it as the `cursor` query parameter to fetch the next page. A `null` `next_cursor` means there are no more results. ### Rate limits The Tasks API is rate-limited to 100,000 requests per five minute window. We may introduce daily limits in the future to prevent extraordinary usage. ### OpenAPI specification The OpenAPI specification can be found [here](https://api.unifygtm.com/tasks/v1/openapi.json). # Complete task Source: https://docs.unifygtm.com/developers/api/tasks/tasks/complete POST /tasks/v1/tasks/{id}/complete Mark a task as completed. ## Overview Mark a task complete after its work has been done. For example, complete an action item after a rep has reviewed an account in an external workflow. ## Examples > **Complete an action item** > > Set `UNIFY_API_KEY` to your API key. Replace the example IDs with records from > your workspace. Use the ID of a ready action item task. > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/tasks/v1/tasks/02db977b-1df7-4c91-bd5c-9b3f5284aa57/complete" \ > --header "X-Api-Key: $UNIFY_API_KEY" > ``` > > A successful request returns `204 No Content`. Fetch the task with > [Get task](/developers/api/tasks/tasks/get) to inspect its resulting state. # Create task Source: https://docs.unifygtm.com/developers/api/tasks/tasks/create POST /tasks/v1/tasks Create a task for a person. ## Overview Create a ready task for an existing person. The task is initially assigned to the user associated with your API key. Use this endpoint to add follow-up work from another system, such as reviewing a new trial signup or calling a qualified lead. ## Examples Set `UNIFY_API_KEY` to your API key. > **Create an action item** > > Replace the example IDs with records from > your workspace. > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/tasks/v1/tasks" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "type": "ACTION_ITEM", > "person_id": "bf3f4d5e-c995-496f-8774-5a1c58d05197", > "priority": "HIGH", > "due_at": "2030-01-15T17:00:00Z", > "note_content": "Review the trial signup and prepare questions for the discovery call." > }' > ``` > > The response contains the new task in `data`. Save `data.id` if you need to > [update](/developers/api/tasks/tasks/update) or > [complete](/developers/api/tasks/tasks/complete) it later. > **Create a call task** > > Use `PHONE_CALL` when the follow-up should appear as a call task. Creating the > task adds work to the queue. A user can then place the call in Unify. > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/tasks/v1/tasks" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "type": "PHONE_CALL", > "person_id": "bf3f4d5e-c995-496f-8774-5a1c58d05197", > "note_content": "Follow up on the requested product demonstration." > }' > ``` > > To assign either task to another user, create it first, then > [update its assignee](/developers/api/tasks/tasks/update). # Delete task Source: https://docs.unifygtm.com/developers/api/tasks/tasks/delete DELETE /tasks/v1/tasks/{id} Delete a task. # Get task Source: https://docs.unifygtm.com/developers/api/tasks/tasks/get GET /tasks/v1/tasks/{id} Retrieve a single task by its ID. # List tasks Source: https://docs.unifygtm.com/developers/api/tasks/tasks/list GET /tasks/v1/tasks Find tasks by status, type, assignee, or person. ## Overview List tasks to build a work queue or inspect a person's follow-up activity. Combine filters to narrow the results. For bulk exports, use a [task query job](/developers/api/tasks/tasks/query-tasks/create). ## Examples > **Find ready call tasks** > > Set `UNIFY_API_KEY` to your API key. This request returns up to 50 ready > phone call tasks: > > ```bash theme={null} > curl --request GET \ > --url "https://api.unifygtm.com/tasks/v1/tasks?status=READY&type=PHONE_CALL&limit=50" \ > --header "X-Api-Key: $UNIFY_API_KEY" > ``` > > To restrict the queue to one teammate, also pass `assigned_user_id`. To inspect > a person's work, pass `person_id` or their exact `person_email`. # Cancel job Source: https://docs.unifygtm.com/developers/api/tasks/tasks/query-tasks/cancel POST /tasks/v1/tasks/query-jobs/{job_id}/cancel Cancel a task query job that is in progress. # Create job Source: https://docs.unifygtm.com/developers/api/tasks/tasks/query-tasks/create POST /tasks/v1/tasks/query-jobs Create a job to query tasks. ## Overview Export tasks asynchronously for reporting or a recurring data sync. Create a job with the filters you need, poll its status, then retrieve the finished results. ## Examples > **Export completed calls** > > Set `UNIFY_API_KEY` to your API key. This example selects completed call tasks > that changed during September 2026: > > ```bash theme={null} > curl --request POST \ > --url "https://api.unifygtm.com/tasks/v1/tasks/query-jobs" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "filter": { > "type": { > "in": [ > "PHONE_CALL" > ] > }, > "status": { > "in": [ > "COMPLETED" > ] > }, > "updated_at": { > "gte": "2026-09-01T00:00:00Z", > "lt": "2026-10-01T00:00:00Z" > } > } > }' > ``` > > The response includes `job_id`, `status`, and `expires_at`. Save the job ID and > [check its status](/developers/api/tasks/tasks/query-tasks/get) until it reaches > `FINISHED`. Then [retrieve the results](/developers/api/tasks/tasks/query-tasks/results). > > The date filter applies to when each task was last updated. Use `ended_at` > instead when your report needs the date the task finished. > > See [Query jobs](/developers/guides/request-data/query-jobs) for retry behavior, > expiration, and rate limits. # Get job Source: https://docs.unifygtm.com/developers/api/tasks/tasks/query-tasks/get GET /tasks/v1/tasks/query-jobs/{job_id} Get the status and metadata for a task query job. # List jobs Source: https://docs.unifygtm.com/developers/api/tasks/tasks/query-tasks/list GET /tasks/v1/tasks/query-jobs List all task query jobs. # Get results Source: https://docs.unifygtm.com/developers/api/tasks/tasks/query-tasks/results GET /tasks/v1/tasks/query-jobs/{job_id}/results Get results for a finished task query job. ## Overview Retrieve a finished task query job one page at a time. Check the job's status before requesting results and download all pages before `expires_at`. ## Examples Set `UNIFY_API_KEY` to your API key. > **Read a page of tasks** > > Replace the example job ID with your finished query job: > > ```bash theme={null} > curl --request GET \ > --url "https://api.unifygtm.com/tasks/v1/tasks/query-jobs/e5a1aab2-3d0c-4a47-9a0d-11a7ac6d3a34/results?page=1&page_size=1000" \ > --header "X-Api-Key: $UNIFY_API_KEY" > ``` > > The JSON response contains `data`, `total`, `page`, and `page_size`. Increment > `page` until you've retrieved all `total` rows. JSON pages support up to 2,000 > rows. If a page exceeds the payload limit, request fewer rows or use NDJSON. > **Stream a larger page** > > Add `Accept: application/x-ndjson` to receive one task per line. NDJSON supports > up to 10,000 rows per page and returns pagination metadata in the `x-total`, > `x-page`, and `x-page-size` response headers. > > ```bash theme={null} > curl --no-buffer \ > --url "https://api.unifygtm.com/tasks/v1/tasks/query-jobs/e5a1aab2-3d0c-4a47-9a0d-11a7ac6d3a34/results?page=1&page_size=10000" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Accept: application/x-ndjson" > ``` > > A `409` response means the job has no available results. Inspect the job status > to distinguish an in-progress job from a failed or canceled job. A `410` > response means the results expired and you need to create a new job. # Update task Source: https://docs.unifygtm.com/developers/api/tasks/tasks/update PATCH /tasks/v1/tasks/{id} Update a task's assignee, priority, or due date. ## Overview Change a task's assignee, priority, or due date. Include the fields you want to change. Set `assigned_user_id` or `due_at` to `null` to clear that value. ## Examples Set `UNIFY_API_KEY` to your API key. > **Prioritize a follow-up** > > Replace the example IDs with records from > your workspace. This request marks an existing task urgent and changes its due date. > > ```bash theme={null} > curl --request PATCH \ > --url "https://api.unifygtm.com/tasks/v1/tasks/02db977b-1df7-4c91-bd5c-9b3f5284aa57" \ > --header "X-Api-Key: $UNIFY_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "priority": "URGENT", > "due_at": "2030-01-16T17:00:00Z" > }' > ``` > **Reassign a task** > > Use the teammate's Unify user ID as `assigned_user_id`: > > ```json theme={null} > { > "assigned_user_id": "21fe3c71-6f4a-4089-a80b-f56873ae27f8" > } > ``` > > The response returns the updated task in `data`. Use > [Complete task](/developers/api/tasks/tasks/complete) when the work is finished. # Connecting your data Source: https://docs.unifygtm.com/developers/connecting-data Choose the right approach to get your data into Unify. ## Overview There are two fundamental ways to get data into Unify: * **Sending events** — Real-time signals from websites and products (page visits, user actions, identity information) * **Syncing object records** — Structured data from CRMs, warehouses, databases, APIs, and other systems (product users, subscriptions, enrichment data) Events and records often come from different sources, but they serve the same overall purpose of connecting all of the data relevant to your go-to-market operations in one place. ## Sending events Events are the real-time behavioral signals that power intent-based workflows in Unify. They capture what visitors and users are doing on your website or in your product and link that activity to Companies and People. ### Example use cases * You want to identify companies visiting your marketing website (IP reveal) * You want to track product usage to trigger sales plays (PLG motions) * You want to capture form fills, logins, or other user interactions * You want real-time or near-real-time signals to power automations ### Choosing an event source The right way to send events depends on what tools you already have deployed. #### Marketing websites For marketing websites, blogs, docs sites, and other public-facing pages, the goal is typically to capture page visits and identify visitors. | Your situation | Recommended approach | | :- | :- | | No existing analytics tool on the site | **[Unify Website Tag](/developers/intent-client/website-tag)** — Copy and paste a script tag. Fastest way to get started. Automatically captures page visits and basic form fills. | | Already using **Segment** on the site | **[Segment integration](/reference/integrations/segment)** — Forward existing Segment events to Unify. No additional SDK needed. | | Already using **PostHog** on the site | **[PostHog integration](/reference/integrations/posthog)** — Forward existing PostHog events to Unify. No additional SDK needed. | | Using another tool (e.g., Google Analytics) | **[Unify Website Tag](/developers/intent-client/website-tag)** — GA doesn't forward events to Unify. The Website Tag can run alongside GA without conflicts since they serve different purposes. | #### Web applications (product usage) For SaaS products and web applications, the goal is typically to track user actions (feature usage, paywall hits, milestones) and identify logged-in users. | Your situation | Recommended approach | | :- | :- | | Already using **PostHog** in your product | **[PostHog integration](/reference/integrations/posthog)** — Reuse your existing PostHog instrumentation. No new SDK needed. | | Already using **Segment** in your product | **[Segment integration](/reference/integrations/segment)** — Reuse your existing Segment instrumentation. | | Using another tool with webhook support (e.g., RudderStack, Amplitude) | **[Analytics API](/developers/api/analytics/overview)** — Configure a webhook destination in your tool pointing to Unify's Analytics API. You'll need to map events to Unify's `track` and `identify` format. | | Using another tool without webhook support | **[JavaScript](/developers/intent-client/js-client) or [React](/developers/intent-client/react) Library** — Install the Unify Intent Client alongside your existing tool for the specific events you want to action on in Unify. | | No analytics tool | **[JavaScript](/developers/intent-client/js-client) or [React](/developers/intent-client/react) Library** — The Unify Intent Client is the default path for in-product tracking. The `identify()` and `track()` methods send data directly to Unify. | #### Backend and server-side events Some events originate from backend systems rather than browsers—for example, a subscription renewal, a usage limit being hit, or a derived milestone like "onboarding completed." | Your situation | Recommended approach | | :- | :- | | Need to send events from backend services | **[Analytics API](/developers/api/analytics/overview)** — Send `track` and `identify` events directly to Unify from your server. Use a stable identifier like email or user ID. | > [!NOTE] > > Server-side events complement client-side tracking—but they are typically not > a replacement. Client-side events provide session context, attribution data, > and browser-based identity. Server-side events cover backend-only actions and > provide resilience against ad blockers. ### Quick reference: event ingestion methods | Method | Best for | Requires code changes? | | :- | :- | :- | | [Website Tag](/developers/intent-client/website-tag) | Marketing websites with no existing analytics | No—copy and paste | | [React Library](/developers/intent-client/react) | React web applications | Yes | | [JavaScript Library](/developers/intent-client/js-client) | Non-React web applications | Yes | | [Segment integration](/reference/integrations/segment) | Teams already using Segment | No—configuration only | | [PostHog integration](/reference/integrations/posthog) | Teams already using PostHog | No—configuration only | | [Analytics API](/developers/api/analytics/overview) | Server-side events, unsupported tools, custom pipelines | Yes | ## Syncing records Records are the structured, persistent data that populates [objects](/reference/objects/overview) in Unify. While events capture what's happening right now, records represent what Unify knows—companies, people, CRM data, product users, subscriptions, and more. ### Example use cases * You want to sync CRM data from Salesforce or HubSpot * You have product usage data modeled in a data warehouse (e.g., a `users` table in BigQuery or Snowflake) * You want to bring in business data like subscriptions, contracts, or usage tiers * You have enrichment data from a third-party tool ### Choosing a sync method | Your situation | Recommended approach | | :- | :- | | Data lives in a **CRM** (Salesforce, HubSpot) | **[Salesforce](/reference/integrations/salesforce)** or **[HubSpot](/reference/integrations/hubspot) native integrations** — These keep your CRM data in sync with Unify objects automatically. | | Data lives in a **warehouse** (Snowflake, BigQuery, ClickHouse, Redshift, etc.) | **[Hightouch](/developers/guides/data-systems/hightouch-destination)** or **[Fivetran](/developers/guides/data-systems/fivetran-destination)** — Reverse ETL tools that sync warehouse tables into Unify objects on a schedule. | | Data lives in a **database** (PostgreSQL, MySQL, MongoDB, etc.) | **[Hightouch](/developers/guides/data-systems/hightouch-destination)** or **[Fivetran](/developers/guides/data-systems/fivetran-destination)** — Both support databases as sources in addition to warehouses. | | Data comes from **internal APIs or custom pipelines** | **[Data API](/developers/api/data/overview)** — Programmatically create objects, define attributes, and push records. | | Data comes from a **third-party tool** (e.g., Clay) | **[Data API](/developers/api/data/overview)** — Use webhooks or scripts to push data from external tools into Unify objects. | > [!TIP] > > **Model your data as objects.** Rather than adding lots of custom attributes > directly to the Company or Person objects, create dedicated custom objects > (e.g., **Product User**) and link them to Person or Company with reference > attributes. This keeps your data organized and makes it easy to filter based > on data source. For a step-by-step walkthrough, see [Connect a data system](/developers/guides/data-systems/overview). ## CRM data If you use Salesforce or HubSpot, Unify has native integrations that sync CRM data automatically. This is managed through the Unify UI—no developer setup is required. > **[Salesforce](/reference/integrations/salesforce/overview)** > > Connect your Salesforce instance. > **[HubSpot](/reference/integrations/hubspot/overview)** > > Connect your HubSpot CRM. When you connect a CRM, Unify creates objects (like **Salesforce Account** or **HubSpot Contact**) that are linked to the Company and Person objects. CRM data flows bidirectionally and stays in sync. ## Combining data sources Many teams use multiple data sources together. For example: * **Website Tag** on the marketing site for anonymous visitor identification * **PostHog integration** in the product for usage events * **Hightouch** to sync product user records from the data warehouse * **Salesforce integration** to keep CRM data in sync Events and records complement each other. Events provide real-time behavioral signals. Records provide structured context. Together, they give Unify the full picture it needs to power targeted, timely go-to-market actions. ## Next steps > **[Connect website traffic](/developers/guides/website-traffic/introduction)** > > Get started with marketing website tracking. > **[Connect product usage data](/developers/guides/product-usage-data/introduction)** > > Track in-app user behavior and product signals. > **[Connect a data system](/developers/guides/data-systems/overview)** > > Sync structured data from warehouses and databases. > **[Send records via API](/developers/guides/send-data/overview)** > > Push data programmatically from custom pipelines. # Sync data from Fivetran Source: https://docs.unifygtm.com/developers/guides/data-systems/fivetran-destination Learn how to connect upstream data sources to Unify via Fivetran. ## Overview > [!NOTE] > > This guide assumes that you already have a Fivetran account. If you don't, you > can sign up for a free plan [here](https://www.fivetran.com/). Unify provides a Fivetran destination which allows you to sync data from any Fivetran data source into Unify objects. Fivetran supports a range of data sources, including data warehouses, databases, and more. ## Connect Fivetran to Unify ### 1. Select the Unify destination type Within Fivetran, navigate to **Destinations** and select **Add a destination**. ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-add-destination.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=2c8030f000e765d26da9584fb0e2285c) Look for the **Unify** destination type and select it. ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-unify-destination.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=cc89e4f8fd4838cf6e2ce84dd03cfbd1) ### 2. Configure the destination Fill in a name for your destination and provide an API key. You can generate an API key within Unify by navigating to [Settings → API Keys](https://app.unifygtm.com/dashboard/settings/integrations/api-keys). ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-unify-destination-configuration.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=dd8568abba546afe3208d5d585170b0e) ### 3. Save the destination Wait for the test to complete and then choose **Finish** to save the new destination. ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-unify-destination-test.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=e058563e2452fb4d437754b1e51036f2) Once saved, you will see this destination listed in the **Destinations** tab. ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-unify-destination-created.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=cc5191b48ae444842ef84eeeccbae9e5) ## Sync to an object ### 1. Create a new sync Within Fivetran, navigate to **Syncs** and select **Create a sync**. ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-create-sync.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=1937a31235a21644a6e18bb7aa0dc469) ### 2. Select a data source Select the data source you want to sync from. This can be a table in a data warehouse, database, or any other supported data source. ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-sync-source.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=21f04281f3abbf4ccd5cd67a3a729643) ### 3. Select the Unify destination Select the Unify destination you created previously. ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-sync-select-destination.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=d56ab71babcf13b1e0f51063fd024992) ### 4. Determine the sync behavior Choose the sync behavior. You can choose to either **Insert** or **Upsert** records into Unify. Inserting records will only add new records, while upserting will sync changes to existing records as well. ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-sync-select-behavior.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=3b733182dd754af880d47048d9e9fe3b) ### 5. Select the sync key Choose which unique key to use for the sync. This is the key that will be used to identify records in Unify to avoid creating duplicates and to update existing records (if applicable). ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-sync-select-key.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=996936c3c2fa1f61f032f81120afda58) ### 6. Map fields from source to object Fill in the mapping between the fields in your data source and the attributes on the Unify object. This is how you tell Fivetran which fields in your data source should be synced to which attributes in Unify. ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-sync-map-fields.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=4f0ce329dce6ecdf66b8934a41d130c6) In Unify, each object attribute has a value type which determines what kind of data it can hold. For example, **Text** attributes can hold any string value, while **Integer** and **Decimal** attributes can only hold numbers. You will only be able to map fields from your data source to attributes in Unify that support an equivalent value type. > [!TIP] > > One special value type is the **Reference** type, which is used to link to > other objects. When mapping fields in Fivetran, you will see the unique > attributes for each object that is referenced by the object you are > syncing to. > > This allows you to link records in this object to other objects based on > the data available in your data source, which is important in order to use > the data in Unify. A common example is linking rows in a data warehouse > table to company or person records in Unify so that they can be used for > pesonalization or segmentation. ### 7. Test sync Click **Run test** to send a single record from your data source to the object in Unify. ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-sync-test.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=91f377dd0cf8259d490f86f64ee24159) ### 8. Confirm sync Choose **Next** and verify the sync configuration. You can also choose to run the sync manually, on a trigger, or on a schedule. ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-sync-confirm.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=c114a374e36cf71d0ca5e26787366fe1) Once you are happy with the configuration, choose **Create** to save the sync. You will then be able to see it in the **Syncs** tab. ![](https://mintcdn.com/unify-19/or7oiwhUUaLcSwrc/images/developers/guides/import-data/fivetran/fivetran-sync-created.png?fit=max\&auto=format\&n=or7oiwhUUaLcSwrc\&q=85\&s=4a722224edf7e9dcf907619e2d107564) # Sync data from Hightouch Source: https://docs.unifygtm.com/developers/guides/data-systems/hightouch-destination Learn how to connect upstream data sources to Unify via Hightouch. ## Overview > [!NOTE] > > This guide assumes that you already have a Hightouch account. If you don't, > you can sign up for a demo [here](https://hightouch.com/demo). Hightouch provides a destination which allows you to sync data from any Hightouch-supported data source into Unify objects. Hightouch supports a range of data sources, including data warehouses, databases, and more. ## Connect Hightouch to Unify ### 1. Select the Unify destination type Within Hightouch, navigate to **Destinations** and select **Add destination**. Look for the **Unify** destination type and select it. ![](https://mintcdn.com/unify-19/OIfApGfIvPJ-YWJ2/images/developers/guides/import-data/hightouch/hightouch-select-destination.png?fit=max\&auto=format\&n=OIfApGfIvPJ-YWJ2\&q=85\&s=b21a8865daab0d9b693d777aa7030ca5) ### 2. Configure the destination Provide an API key for your destination. You can generate an API key within Unify by navigating to [Settings → Developers](https://app.unifygtm.com/dashboard/settings/integrations/api-keys). You can verify that the API key is valid and working by selecting **Test connection**. You should see a message that says "Successfully connected to Unify". ![](https://mintcdn.com/unify-19/OIfApGfIvPJ-YWJ2/images/developers/guides/import-data/hightouch/hightouch-destination-api-key.png?fit=max\&auto=format\&n=OIfApGfIvPJ-YWJ2\&q=85\&s=2152a3d22c61ae7aa4f29ee0929c64c4) Next, configure any alerts you want to receive for this destination. ![](https://mintcdn.com/unify-19/OIfApGfIvPJ-YWJ2/images/developers/guides/import-data/hightouch/hightouch-destination-alerts.png?fit=max\&auto=format\&n=OIfApGfIvPJ-YWJ2\&q=85\&s=f99c34a39882e92cf43f37f59e31f5c6) Lastly, choose a name for your destination, set the desired permissions, and select **Finish** to save the destination. ![](https://mintcdn.com/unify-19/OIfApGfIvPJ-YWJ2/images/developers/guides/import-data/hightouch/hightouch-destination-finalize.png?fit=max\&auto=format\&n=OIfApGfIvPJ-YWJ2\&q=85\&s=2ee4ea8e545a312590888b60dff8deca) ### 3. Save the destination Once saved, you will see this destination listed in the **Destinations** tab. ![](https://mintcdn.com/unify-19/OIfApGfIvPJ-YWJ2/images/developers/guides/import-data/hightouch/hightouch-destination-created.png?fit=max\&auto=format\&n=OIfApGfIvPJ-YWJ2\&q=85\&s=4bf04be58ef8cfecfd434569e9e229e7) You can modify the destination settings and test the connection again from here. ## Sync to an object ### 1. Create a new sync From the destination or syncs page, select **Add sync**. The first step is to select a *model* which represents the data source you want to send into Unify. If you haven't configured one yet, head over to **Models** and create one. ![](https://mintcdn.com/unify-19/hIdm9AItOuBuD9a5/images/developers/guides/import-data/hightouch/hightouch-sync-select-model.png?fit=max\&auto=format\&n=hIdm9AItOuBuD9a5\&q=85\&s=ac2616486a9e3a2b8c12b679041bd962) ### 2. Configure sync options Select the Unify destination you created previously. Choose "Records" for the first option and then select the Unify object you want to sync records to. You can select a "standard" object (e.g., Companies or People) or a custom object. ![](https://mintcdn.com/unify-19/hIdm9AItOuBuD9a5/images/developers/guides/import-data/hightouch/hightouch-sync-select-object.png?fit=max\&auto=format\&n=hIdm9AItOuBuD9a5\&q=85\&s=3be4ce7afc61c5bbbb24f4a89f043921) Once the object is selected, choose whether you want to "upsert" records (create and update) or "insert" records (create only). ![](https://mintcdn.com/unify-19/OIfApGfIvPJ-YWJ2/images/developers/guides/import-data/hightouch/hightouch-sync-insert-or-upsert.png?fit=max\&auto=format\&n=OIfApGfIvPJ-YWJ2\&q=85\&s=2d323467454bfe10c36d0e868074da89) ### 3. Select the sync key Choose which unique key to use for the sync. This is the key that will be used to identify records in Unify to avoid creating duplicates and to update existing records (if applicable). ![](https://mintcdn.com/unify-19/OIfApGfIvPJ-YWJ2/images/developers/guides/import-data/hightouch/hightouch-sync-id.png?fit=max\&auto=format\&n=OIfApGfIvPJ-YWJ2\&q=85\&s=a9e404edc285b76d4eb160b70eb7e46c) This must be a unique attribute on the Unify object and in the data source. For example, the unique attribute on Companies is `domain`, and the unique attribute on People is `email`. On custom objects, you can define your own unique attributes. ### 4. Map fields The next step is to map fields in your data source to Unify object attributes. This defines how record values will be copied over to Unify. ![](https://mintcdn.com/unify-19/hIdm9AItOuBuD9a5/images/developers/guides/import-data/hightouch/hightouch-sync-mapping.png?fit=max\&auto=format\&n=hIdm9AItOuBuD9a5\&q=85\&s=cb30db45ac749f132e38eaa44addb9ef) Unify objects support *reference* attributes which represent relationships between objects. For example, the Person object has a reference attribute for the Company that the person works at. In the above example, we are mapping our data source to the Person object, and we are also linking each person to a Company by mapping Company fields. ### 5. Finalize settings Finally, choose how you want to run the sync and then select **Finish**. ![](https://mintcdn.com/unify-19/OIfApGfIvPJ-YWJ2/images/developers/guides/import-data/hightouch/hightouch-sync-finalize-settings.png?fit=max\&auto=format\&n=OIfApGfIvPJ-YWJ2\&q=85\&s=09898f09bdb9c3c78263957d69fae1c4) ## Inspect the sync ### 1. Verify running On the sync page, you can see the newly created sync, trigger a run, and inspect results. ![](https://mintcdn.com/unify-19/hIdm9AItOuBuD9a5/images/developers/guides/import-data/hightouch/hightouch-sync-ran.png?fit=max\&auto=format\&n=hIdm9AItOuBuD9a5\&q=85\&s=ac2790d250de930f784d6f5227c21602) ### 2. View results Click on a sync run to view the successfully synced records and any errors that were encountered. ![](https://mintcdn.com/unify-19/hIdm9AItOuBuD9a5/images/developers/guides/import-data/hightouch/hightouch-sync-summary.png?fit=max\&auto=format\&n=hIdm9AItOuBuD9a5\&q=85\&s=9dbd272739f96a68eba75c8087a37ca9) Select the **Successful** tab to view synced records. ![](https://mintcdn.com/unify-19/hIdm9AItOuBuD9a5/images/developers/guides/import-data/hightouch/hightouch-sync-successful.png?fit=max\&auto=format\&n=hIdm9AItOuBuD9a5\&q=85\&s=f34b9c2cbae643c969892995000ed988) You should then see the created records in Unify! ![](https://mintcdn.com/unify-19/OIfApGfIvPJ-YWJ2/images/developers/guides/import-data/hightouch/hightouch-created-person.png?fit=max\&auto=format\&n=OIfApGfIvPJ-YWJ2\&q=85\&s=2abfab72fa745f49425beea7c7a07769) # Connect data systems to Unify Source: https://docs.unifygtm.com/developers/guides/data-systems/overview Sync databases, data warehouses, data lakes, and more into Unify. ## Overview Unify is built to support custom data models and huge volumes of data. If you have data that lives in an external data system, you can send it over and use it to power anything within Unify. Examples of data systems you can connect to Unify include: * **Data warehouses** — Snowflake, BigQuery, ClickHouse, Redshift, etc. * **Databases** — PostgreSQL, MySQL, MongoDB, etc. * **Data lakes** — S3, Databricks, etc. Data within Unify is stored in *objects*. Objects are the building blocks that allow you to store and interact with records in Unify. Every object has a set of *attributes* which represent the fields that make up the object. You can send external data into objects in Unify. Unify provides a set of standard objects, such as Company and Person, that are used throughout the platform. You can also create custom objects to store data from external sources or represent information that doesn't fit into standard objects. ## Modeling data You can insert data directly into the standard Company and Person objects. However, this loses track of where the data came from. It can also lead to lots of custom attributes being created on those standard objects over time, many of which are not applicable for most records. Instead, Unify recommends defining custom objects to represent external data sources. You can create a custom object which aligns with the data source and then create a reference attribute to link it to the standard objects. **Example** Suppose you have a table of product users in your data warehouse. One thing you could do is insert them directly into the Person object in Unify: > [!CAUTION] > > **Avoid**: Directly inserting external data sources into standard objects. > > ```mermaid theme={null} > flowchart LR > subgraph data_warehouse["Data Warehouse"] > external_product_user["Product Users Table"] > end > > subgraph unify["Unify"] > person["Person"] > end > > external_product_user -->|Insert| person > ``` However, a better strategy is to create a new object in Unify called "Product User" and connect it to the Person object using a reference attribute. Then, insert the product user records into that object instead: > [!TIP] > > **Prefer**: Inserting external data sources into custom objects linked to > standard objects. > > ```mermaid theme={null} > flowchart LR > subgraph data_warehouse["Data Warehouse"] > external_product_user["Product Users Table"] > end > > subgraph unify["Unify"] > unify_product_user["Product User"] -->|Reference| person["Person"] > end > > external_product_user -->|Insert| unify_product_user > ``` This is how Unify builds its integrations into Salesforce, HubSpot, and more. This has several benefits. It allows you to connect many data sources to Unify without adding many custom attributes to the standard objects. It also makes it easy to filter data based on whether it came from a specific source or not. ## Getting started ### 1. Define objects and attributes The first step is to define the objects and attributes that will store your data. This is how you declare the format of the data and how it relates to other objects. > **[Manage via API](/developers/api/data/overview)** > > Create and manage objects, attributes, and records in Unify via API. > **[Manage via UI](/reference/objects/overview)** > > Create and manage objects, attributes, and records within the Unify app. Once the objects are created, you can create, update, and delete records using the API. They will also become available in any tools that connect to Unify, such as the Hightouch and Fivetran destinations for Unify. ### 2. Sync data into Unify Once the objects are created, you can sync data into Unify using the API directly or via a supported integration. > **[Connect via Hightouch](/developers/guides/data-systems/hightouch-destination)** > > Sync object records from Hightouch data sources into Unify. > **[Connect via Fivetran](/developers/guides/data-systems/fivetran-destination)** > > Sync object records from Fivetran data sources into Unify. > **[Sync directly via API](/developers/api/data/overview)** > > Create, update, and link object records using the Unify API and SDKs. # Connect product usage data to Unify Source: https://docs.unifygtm.com/developers/guides/product-usage-data/introduction Send web application and software usage data into Unify. > [!TIP] > > This guide is focused on web applications and software where the goal is to > track usage and interactions of identifiable users. If you are looking to send > events from marketing or other public-facing website, [Connect website traffic to Unify](/developers/guides/website-traffic/introduction) > may be more relevant. ## Overview One of the most powerful strategies in Unify is to identify existing customers and users to reach out to based on their product usage and behavior. By sending product usage data into Unify, you can instantly launch plays to start taking action on these users. Some examples of the ways this data can be used include: * **Free plan conversions** — Identify free plan users who are actively using key features and send them targeted upgrade campaigns. * **Upsells and cross-sells** — Identify existing customers who are using specific features and send them relevant upsell or cross-sell offers. * **Enterprise expansion** — Identify individual users at companies, reach out to other contacts at those companies, and target them with enterprise offers. Unify provides a full suite of [analytics APIs](/developers/api/analytics/overview) for tracking user interactions and identities. All event tracking capabilities integrate natively with the rest of the Unify data layer. This makes it easy to link product usage data to companies or people and access that data throughout Unify. ## Setup Unify provides an SDK called the [Unify Intent Client](/developers/intent-client/overview) that can be installed in your web application to start sending events. This is the easiest and recommended way to get started. > **[Unify Intent Client (Recommended)](/developers/guides/product-usage-data/unify-intent-client)** > > Send events using Unify’s native JavaScript or React client. If you're already collecting events using a third-party tool, you can also send that data into Unify using either a supported integration or the general-purpose [Analytics API](/developers/api/analytics/overview). You can find guides for some popular tools below. > **[Segment](/reference/integrations/segment)** > > Send Segment events into Unify. > **[Posthog](/reference/integrations/posthog)** > > Send Posthog events into Unify. Lastly, if you already collect product usage data in a database, data warehouse, or data lake, you can connect those systems directly to Unify. For details, see [Connect data systems to Unify](/developers/guides/data-systems/overview). > [!WARNING] > > Analytics events (such as page, identify, and custom events) cannot currently > be sent into Unify via reverse ETL tools like [Hightouch](https://hightouch.com/) > or [Fivetran](https://www.fivetran.com/). This capability is coming soon. > > In the meantime, the recommended solution is to send data to the [Analytics API](/developers/api/analytics/overview) > directly or via one of the supported integrations listed above. Alternatively, > you can create [custom objects](/developers/guides/data-systems/overview) to > represent these events and send them via reverse ETL. ## Examples Once you've configured events to be sent into Unify, you can start using that data to launch plays based on user intent. See the following guides for examples. > **[Capture user logins](/developers/guides/product-usage-data/user-logins)** > > Identify users when they sign in to your application. > **[Capture user interactions](/developers/guides/product-usage-data/user-interactions)** > > Track in‑app user activity with the Unify Intent client. # Set up the Unify Intent client Source: https://docs.unifygtm.com/developers/guides/product-usage-data/unify-intent-client Send product usage and events directly into Unify with the native SDK. ## Installation There are multiple ways to install the Unify Intent client depending on your setup. When installing the client into the web application for your product, using either the JavaScript client or the React client is recommended. > **[React library](/developers/intent-client/react)** > > Install the client in your React web application for a more native > integration. > **[JavaScript library](/developers/intent-client/js-client)** > > Install the client in your non-React frontend application, such as a Single > Page App (SPA). > [!NOTE] > > You should only use one installation method per website or application. If the > client is installed twice on the same site, it may not work correctly. ## Usage **React library** ### Automatic events By default, the React library will not automatically collect any events. You can enable automatic event collection when initializing the client. See the full [Usage guide](/developers/intent-client/usage-guide) for more details. ### Manual events You can manually trigger events in specific places in your web application by calling the client directly. #### Page events Page events record a page visit. Typically, the easiest strategy is to enable automatic collection of page visits, but you can also call them manually. ```javascript theme={null} // Enable automatic "page" event collection unify.startAutoPage(); // Send a "page" event unify.page(); ``` #### Custom events Custom events record specific actions taken by a visitor, such as button clicks or form fills. You can send custom events with arbitrary properties anywhere in your React application. ```javascript theme={null} // Send a basic custom event unify.track("See More Button Clicked"); // Send a custom event with additional properties unify.track("Modal Opened", { modalName: "Contact Sales Modal" }); ``` #### Identify events Identify events link a visitor to a specific company or person. You can send identify events whenever you have information about a visitor, such as their name or email address. ```javascript theme={null} // Send a basic "identify" event unify.identify("user@email.com"); // Send an "identify" event with additional company or person attributes unify.identify("first.last@acme.com", { person: { email: "first.last@acme.com", first_name: "First", last_name: "Last", }, company: { domain: "acme.com", name: "Acme Corp.", } }); ``` **JavaScript library** ### Automatic events By default, the JavaScript library will not automatically collect any events. You can enable automatic event collection when initializing the client. See the full [Usage guide](/developers/intent-client/usage-guide) for more details. ### Manual events You can manually trigger events in specific places in your web application by calling the client directly. #### Page events Page events record a page visit. Typically, the easiest strategy is to enable automatic collection of page visits, but you can also call them manually. ```javascript theme={null} // Enable automatic "page" event collection unify.startAutoPage(); // Send a "page" event unify.page(); ``` #### Custom events Custom events record specific actions taken by a visitor, such as button clicks or form fills. You can send custom events with arbitrary properties anywhere in your web application. ```javascript theme={null} // Send a basic custom event unify.track("See More Button Clicked"); // Send a custom event with additional properties unify.track("Modal Opened", { modalName: "Contact Sales Modal" }); ``` #### Identify events Identify events link a visitor to a specific company or person. You can send identify events whenever you have information about a visitor, such as their name or email address. ```javascript theme={null} // Send a basic "identify" event unify.identify("user@email.com"); // Send an "identify" event with additional company or person attributes unify.identify("first.last@acme.com", { person: { email: "first.last@acme.com", first_name: "First", last_name: "Last", }, company: { domain: "acme.com", name: "Acme Corp.", } }); ``` For complete instructions, see the [Usage guide](/developers/intent-client/usage-guide). # Capture user interactions Source: https://docs.unifygtm.com/developers/guides/product-usage-data/user-interactions Track in‑app user activity with the Unify Intent client. ## Overview Use user interactions to trigger plays for activation, upgrades, and expansion. By tracking key in‑app events, you can identify and engage with users based on their actual product usage and behavior. Some examples of interaction‑based plays include: * **Activation plays** — Target users who clicked on or started using key features but haven't yet completed the activation criteria. * **Upsell plays** — Reach out to users who encountered paywalls or usage limits to offer assistance or upgrade options. * **Expansion plays** — Identify users who are actively using specific features and target them with relevant cross-sell or upsell offers. There is no limit to the number or types of interactions you can track. All the activities you track can be linked to company, person, and other object records in Unify. This gives a complete view of user behavior within the context of your business. ## Prerequisites * Ensure you've already installed the Unify Intent client in your application. See [Set up the Unify Intent client](/developers/guides/product-usage-data/unify-intent-client) for instructions. * Ensure your users are being identified when they log in. See [Capture user logins](/developers/guides/product-usage-data/user-logins) for a walkthrough. ## Examples Custom events can be used to capture any type of user interaction within your application. Below are some examples of common use cases and patterns for recording user activity. ### Feature button clicked When a user clicks a button to open or use a feature: ```ts theme={null} unify.track('Created a Widget', { feature: 'widget-builder', type: 'gizmo', number_created: 4, }); ``` ### Paywall encountered When a user hits a paywall or usage limit: ```ts theme={null} unify.track('Widget Limit Reached', { feature: 'widget-builder', reason: 'plan_limit', current_plan: 'Free Tier', limit_reached: 10, number_requested: 20, }); ``` If you present upgrade options, also track the click: ```ts theme={null} unify.track('Upgrade CTA Clicked', { destination: 'billing', source: 'widget_paywall', plan_selected: 'Pro', }); ``` ### User added When a user invites another user to their account: ```ts theme={null} unify.track('User Invited', { added_user_email: 'bob@acme.com', role: 'Editor', }); ``` # Capture user logins Source: https://docs.unifygtm.com/developers/guides/product-usage-data/user-logins Identify users when they sign in to your application. ## Overview All the activity you track in your application is associated with a *visitor* who may or may not have a known identity. When a user signs in, you can send an Identify event. This associates all their past and future activity with a known person (and optionally a company) in Unify. ## Prerequisites * Ensure you've already installed the Unify Intent client in your application. See [Set up the Unify Intent client](/developers/guides/product-usage-data/unify-intent-client) for instructions. ## Walkthrough ### Identify on login Call `identify` as soon as the user is authenticated. Include useful traits for the person and (optionally) the company they belong to. ```ts theme={null} // Determine the current user however you normally do so const currentUser = getCurrentUser(); // Send an "Identify" event unify.identify(currentUser.emailAddress, { // Link this visitor to a Person person: { email: currentUser.emailAddress, first_name: currentUser.firstName, last_name: currentUser.lastName, }, // If possible, link this visitor to a Company as well company: currentUser.organization ? { domain: currentUser.organization.domain, name: currentUser.organization.name, } : undefined, }); ``` ### Send custom event (optional) You may also want to track that the user logged in. Identify events link visitors to people or companies, but they don't record an activity that can be seen or used in Unify. If you want to see when users log in or filter plays based on login activity, you should also send a custom event. ```ts theme={null} unify.track('User Logged In'); ``` As with all custom events, you can also include additional properties to provide more context about the login. ## Capture interactions Now that visitors to your application are identified, you can start tracking key in-app interactions to power plays. For more information, see [Capture user interactions](/developers/guides/product-usage-data/user-interactions). # Build a data connector Source: https://docs.unifygtm.com/developers/guides/request-data/build-connector Use example code to build a connector that queries data from Unify. ## Overview Build a connector when you need to query Unify data on a schedule and load it into a warehouse or another destination. A connector coordinates the query job lifecycle, writes each result row to the destination, and saves a checkpoint so the next sync only requests new or changed data. Unify maintains example connectors that you can run without modification or adapt to another platform. Each example implements job polling, pagination, retries, and incremental syncs. ## Example connectors > **[Fivetran Connector SDK](https://github.com/unifygtm/bulk-api-connector-examples/tree/main/fivetran)** > > Start with a Python connector that queries data incrementally and upserts > rows into a Fivetran destination. > **[Airbyte](https://github.com/unifygtm/bulk-api-connector-examples/tree/main/airbyte)** > > Start with a declarative source that models query jobs with Airbyte's > asynchronous stream support. The Fivetran example is useful when you want to customize connector behavior in Python. The Airbyte example is useful when you prefer a declarative manifest that you can inspect and test in Connector Builder. ## How the examples work ### 1. Create a query job The connector creates a job for each resource being synced. After the first sync, it filters the query using the checkpoint from the previous run. ### 2. Wait for the job to finish The connector polls the job with backoff until it reaches `FINISHED`. It retries temporary failures and respects the `Retry-After` header when rate limited. ### 3. Load the results The connector retrieves each result page and writes the rows to the destination. Rows are keyed by stable IDs so overlapping incremental queries can be processed idempotently. ### 4. Save a checkpoint After the rows are loaded successfully, the connector saves the newest update time. The next run uses that checkpoint to query new or changed data. See [Using query jobs](/developers/guides/request-data/query-jobs) for more information about creating jobs, polling their status, and retrieving results. ## Prerequisites Before using an example, make sure you have: * A Unify API key associated with a user. * Access to the destination where you want to load data. * The local development tools required by the example's README. * A list of the resources and fields that you want to sync. Store credentials in a local, ignored configuration file. Do not commit API keys or destination credentials to your repository. ## Getting started ### 1. Choose an example Select the Fivetran or Airbyte implementation based on your destination and preferred development model. Open its README for the current installation and runtime requirements. ### 2. Configure the connector Add your Unify API key and choose which resources to query. For object records, also select the attributes that should be included in each result. ### 3. Test a focused sync Start with one resource and a recent checkpoint. Run the connector locally, inspect the destination rows, and verify that a second run only processes new or changed data. ### 4. Customize the data model Adjust resource selection, field mappings, destination table names, and concurrency for your use case. Keep query job creation rate limits in mind when syncing multiple resources in parallel. ### 5. Deploy and monitor Follow the example's deployment instructions for your platform. Monitor job failures, expired results, retries, and checkpoint advancement as part of normal connector operations. # Using query jobs Source: https://docs.unifygtm.com/developers/guides/request-data/query-jobs Use query jobs to query and export data from Unify. ## Overview Query jobs let you query and export data asynchronously. Create a job, poll it until processing finishes, and then retrieve the results one page at a time. Jobs run in seconds for small queries and minutes for large queries. You can use them for recurring syncs or one-time exports. For targeted lookups, the normal endpoints can be faster and offer higher rate limits. ## How it works The following walkthrough uses sequence enrollments as an example. Set the `UNIFY_API_KEY` environment variable to your [API key](/developers/api/sequences/overview#authentication) before running the curl examples. ### 1. Create a query job Create a job for the data you want to query. This request queries all sequence enrollments: ```bash theme={null} curl -X POST 'https://api.unifygtm.com/sequences/v1/enrollments/query-jobs' \ -H "X-Api-Key: ${UNIFY_API_KEY}" ``` The response includes the job ID, current status, and expiration time: ```json theme={null} { "job_id": "", "status": "IN_PROGRESS", "expires_at": "2026-09-01T12:00:00Z" } ``` ### 2. Poll the job Poll the job until it reaches a terminal status: ```bash theme={null} curl 'https://api.unifygtm.com/sequences/v1/enrollments/query-jobs/' \ -H "X-Api-Key: ${UNIFY_API_KEY}" ``` A finished job includes the number of result rows: ```json theme={null} { "job_id": "", "status": "FINISHED", "total_rows": 123, "error_code": null, "created_at": "2026-08-31T12:00:00Z", "expires_at": "2026-09-01T12:00:00Z", "canceled_at": null } ``` ### 3. Retrieve the results After the job reaches `FINISHED`, retrieve each page of results: ```bash theme={null} curl 'https://api.unifygtm.com/sequences/v1/enrollments/query-jobs//results?page=1&page_size=1000' \ -H "X-Api-Key: ${UNIFY_API_KEY}" \ -H 'Accept: application/json' ``` ```json theme={null} { "total": 123, "page": 1, "page_size": 1000, "data": [ { "id": "", "updated_at": "2026-08-31T11:58:00Z" } ] } ``` ## Examples > **[Query records](/developers/api/data/records/query-records/create)** > > Export records from an object. > **[Query enrollments](/developers/api/sequences/enrollments/query-enrollments/create)** > > Export sequence enrollments. > **[Query enrollment steps](/developers/api/sequences/enrollments/query-enrollment-steps/create)** > > Export enrollment steps. > **[Query tasks](/developers/api/tasks/tasks/query-tasks/create)** > > Export tasks. ## Usage guide ### Job endpoints | Method | Path | Description | | - | - | - | | `POST` | `{base}/query-jobs` | Create a query job | | `GET` | `{base}/query-jobs` | List query jobs | | `GET` | `{base}/query-jobs/{job_id}` | Get a query job | | `POST` | `{base}/query-jobs/{job_id}/cancel` | Cancel a query job | | `GET` | `{base}/query-jobs/{job_id}/results` | Retrieve results | Each resource follows the same job management pattern summarized here. The API reference pages describe the available filters and results for each resource. ### Job statuses A query job has one of the following statuses: | Status | Meaning | | :- | :- | | `IN_PROGRESS` | Results are still being prepared. | | `FINISHED` | The job completed and results are available. | | `FAILED` | The job failed. Check its [`error_code`](#error-codes). | | `CANCELED` | The job was canceled before completion. | | `EXPIRED` | The job or its results are no longer available. | Jobs and results are available until `expires_at`, which is 24 hours after job creation. Retrieve all required pages before that time. ### Error codes A `FAILED` job has one of the following `error_code` values: | Error code | Meaning | | :- | :- | | `QUERY_TIMEOUT` | The query ran longer than the 60-second time limit. | | `RESOURCE_EXHAUSTED` | The query used more memory than its limit allows. | | `INTERNAL_ERROR` | The job failed because of an unexpected error. | Unify does not retry failed jobs. Create a new job to try again. Before you retry after `QUERY_TIMEOUT` or `RESOURCE_EXHAUSTED`, reduce the amount of data the job queries. Narrow its filters, select fewer attributes, or split the export into several jobs that each cover a shorter time range. ### List and cancel jobs List query jobs by sending a `GET` request to a resource's `query-jobs` path. List endpoints accept the following query parameters: | Parameter | Description | | :- | :- | | `limit` | Number of jobs to return. The default and maximum are `100`. | | `cursor` | Opaque pagination cursor from the previous response. | | `status` | Optional job status filter. | Cancel an in-progress job by sending a `POST` request to its `cancel` endpoint: ```bash theme={null} curl -X POST 'https://api.unifygtm.com/sequences/v1/enrollments/query-jobs//cancel' \ -H "X-Api-Key: ${UNIFY_API_KEY}" ``` Only `IN_PROGRESS` jobs can be canceled. ### Retrieve results Result pagination is page based. Rows use a stable ordering with a tie-breaker, so pages remain stable for a finished job. #### JSON JSON is the default response format: ```http theme={null} Accept: application/json ``` | Limit | Value | | :- | :- | | Default `page_size` | `1000` | | Maximum `page_size` | `2000` | | Maximum raw payload size | `8 MiB` | Request a smaller page or use NDJSON if a JSON page is too large. #### NDJSON Use NDJSON to stream larger pages: ```http theme={null} Accept: application/x-ndjson ``` ```bash theme={null} curl -N 'https://api.unifygtm.com/sequences/v1/enrollments/query-jobs//results?page=1&page_size=10000' \ -H "X-Api-Key: ${UNIFY_API_KEY}" \ -H 'Accept: application/x-ndjson' ``` NDJSON responses return one JSON object per line. Pagination metadata is returned in response headers: ```http theme={null} x-total: 123 x-page: 1 x-page-size: 10000 ``` The maximum NDJSON `page_size` is `10000`. ### Rate limits Rate limits are applied by operation type: | Operation | Rate limit | | :- | :- | | Create query jobs | Approximately 100 jobs per day | | Get or list job status | Approximately 10 requests per second | | Retrieve or stream results | Approximately 5 requests per second | | Cancel in-progress jobs | Approximately 1 request per second | Poll conservatively, page through results with bounded concurrency, and reuse a finished job instead of creating another snapshot. If you receive `429 Too Many Requests`, wait before retrying and honor the `Retry-After` header. ### Best practices * **Request only the data you need.** Use filters and focused field selections to keep queries small and fast. * **Design for retries.** Store the `job_id` and current status. * **Process results idempotently.** Use stable record IDs so retrying a page does not create duplicates. * **Use NDJSON for large pages.** NDJSON streams results and supports larger pages than JSON. * **Retrieve results before expiration.** Create a new job if its results have expired. # Send records from Clay sheet Source: https://docs.unifygtm.com/developers/guides/send-data/clay-webhook Learn how to send records from a Clay sheet into Unify via webhook. ## Overview This tutorial walks through the process of sending records from a Clay sheet into Unify. To do this, we'll set up a webhook in Clay that sends records to the [Data API](/developers/api/data/overview). > [!TIP] > > 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 a custom object. ## Prerequisites * An existing Clay sheet that you want to send into Unify * An existing [API key](https://app.unifygtm.com/dashboard/settings/integrations/api-keys) for Unify ## Steps ### 1. Select the webhook action Navigate to your Clay sheet and open the **Actions** pane. ![](https://mintcdn.com/unify-19/sc9t8pwF45Nnu44g/images/developers/guides/send-data/clay-webhook/clay-sheet-select-action.png?fit=max\&auto=format\&n=sc9t8pwF45Nnu44g\&q=85\&s=7b039977d07e1b98add67004e02b52af) The webhook action appears under Enrichments in the Actions pane. Under **Enrichments**, select **View all enrichments** and then choose **HTTP API**. ![](https://mintcdn.com/unify-19/sc9t8pwF45Nnu44g/images/developers/guides/send-data/clay-webhook/clay-sheet-select-enrichment.png?fit=max\&auto=format\&n=sc9t8pwF45Nnu44g\&q=85\&s=f9813c324d0b8ae5cf868f4ad976372f) Select the HTTP API action from the menu. ![](https://mintcdn.com/unify-19/sc9t8pwF45Nnu44g/images/developers/guides/send-data/clay-webhook/clay-sheet-http-api-empty.png?fit=max\&auto=format\&n=sc9t8pwF45Nnu44g\&q=85\&s=0ba92680880b5505c3385e09eba21a04) After selecting the HTTP API action, the configuration panel should appear. ### 2. Add credentials Select the **Configure** tab. Under **Select HTTP API (Headers) account**, choose **Add account**. ![](https://mintcdn.com/unify-19/sc9t8pwF45Nnu44g/images/developers/guides/send-data/clay-webhook/clay-sheet-http-api-empty-configure.png?fit=max\&auto=format\&n=sc9t8pwF45Nnu44g\&q=85\&s=e3819f6d331e4c235b098b09965ed0e3) The Configure tab can be selected in the top-right corner of the panel. > [!NOTE] > > 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. ![](https://mintcdn.com/unify-19/sc9t8pwF45Nnu44g/images/developers/guides/send-data/clay-webhook/clay-sheet-http-api-add-headers.png?fit=max\&auto=format\&n=sc9t8pwF45Nnu44g\&q=85\&s=9530eabaab7687ea7b4a2058e471d331) Fill in your Unify credentials here. 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](/developers/api/data/overview). 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](https://app.unifygtm.com/dashboard/settings/integrations/objects). For example, the company object's API name is `company`. For an overview of how objects work in Unify, see [Objects in Unify](/reference/objects/overview). ### 4. Construct the request The best way to send data into Unify is with the [Upsert method](/developers/api/data/records/upsert). The URL for this API method is: ```http theme={null} https://api.unifygtm.com/data/v1/objects/{object_name}/records/upsert ``` > [!NOTE] > > 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: > > ```http theme={null} > https://api.unifygtm.com/data/v1/objects/company/records/upsert > ``` Under **Setup Inputs**, fill in a few fields: * **Method**: Choose `POST` when performing an upsert. For other operations, use the correct method from the API reference. * **Endpoint**: Insert the URL of the API constructed above. * **Body**: A valid payload for the [Upsert method](/developers/api/data/records/upsert). For example: ```json theme={null} { "match": { "domain": "{{Website}}" }, "create_or_update_if_empty": { "name": "{{Company Name}}", "domain": "{{Website}}", "status": "{{Status}}" } } ``` A person upsert can also include a nested company match or upsert: ```json theme={null} { "match": { "email": "{{Email}}" }, "create_or_update_if_empty": { "first_name": "{{First Name}}", "last_name": "{{Last Name}}", "email": "{{Email}}", "title": "{{Title}}", "company": { "match": { "domain": "{{Company Domain}}" }, "create_or_update_if_empty": { "name": "{{Company Name}}", "domain": "{{Company Domain}}" } } } } ``` 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. > [!WARNING] > > 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. ![](https://mintcdn.com/unify-19/sc9t8pwF45Nnu44g/images/developers/guides/send-data/clay-webhook/clay-sheet-http-api-json-body.png?fit=max\&auto=format\&n=sc9t8pwF45Nnu44g\&q=85\&s=7b4dd14395834c610fb48206febde0de) A fully configured HTTP API action for upserting records into Unify. ### 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. ![](https://mintcdn.com/unify-19/sc9t8pwF45Nnu44g/images/developers/guides/send-data/clay-webhook/clay-sheet-http-api-preview.png?fit=max\&auto=format\&n=sc9t8pwF45Nnu44g\&q=85\&s=94ff091f44f51890ce06aed2537f586c) Test the configured API call for the first five rows in the sheet. 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. ![](https://mintcdn.com/unify-19/sc9t8pwF45Nnu44g/images/developers/guides/send-data/clay-webhook/clay-sheet-http-api-success.png?fit=max\&auto=format\&n=sc9t8pwF45Nnu44g\&q=85\&s=02633071b32bd8f8fb0897cd2b022724) Test the configured API call for the first five rows in the sheet. 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. ![](https://mintcdn.com/unify-19/sc9t8pwF45Nnu44g/images/developers/guides/send-data/clay-webhook/clay-sheet-http-api-success-result.png?fit=max\&auto=format\&n=sc9t8pwF45Nnu44g\&q=85\&s=5c2245e7b3dad97353042530617b3dbf) View the full API response for a specific row. If you search for that record in Unify, you should see it appear with the correct data! ## FAQ > **Why am I getting an undefined or 400 status code error response?** > > Here are a few things to try: > > * **Inspect the response**: All error responses should contain details about > why the request failed. Click into the cell in the sheet to view the full > response and look for any error messages or details. > * **Check the object API name**: The URL must use the object's API name, > such as `company`, `person`, or the custom object API name from settings. > * **Check the upsert body**: Upsert requests must include `match` and one of > `create`, `create_or_update`, or `create_or_update_if_empty`. > * **Check the body formatting**: Ensure that the JSON body correctly matches > the expected format of the [Data API](/developers/api/data/overview) > method you are trying to use. Double check that all Clay column variable > placeholders are inside quotation marks. > * **Check nested references**: If you are linking a person to a company, > make sure the nested company value is a valid match, create, or upsert > payload. > * **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. # Import data from a CSV Source: https://docs.unifygtm.com/developers/guides/send-data/csv-import Upload data from a CSV file or spreadsheet into Unify. ## Overview This tutorial walks through the process of creating Company records via API using a simple script. We'll assume the starting point is a CSV of company data to upload, but in general the approach here can be used for any data source. The **Company** object is one of the standard objects provided by default in Unify. Along with **Person**, it powers many of the core capabilities in Unify. The unique identifier of a company is its website domain. ## Steps ### 1. Prerequisites Before you begin, be sure to [generate an API key](https://app.unifygtm.com/dashboard/settings/integrations/api-keys) if you don't already have one. You’ll pass it as an HTTP header on each request: ```http theme={null} X-Api-Key: ``` In addition, you will need to install one of the official SDKs to follow along: ```bash Python theme={null} pip install unifygtm-sdk ``` ```bash TypeScript theme={null} npm install @unifygtm/sdk csv-parse ``` ### 2. Prepare a CSV of companies Construct a CSV file that includes the companies you want to send into Unify. The columns don't need to match the attribute names in Unify since we'll map them over in the script. Here's an example CSV for the sake of this tutorial: ```csv example_companies.csv theme={null} Website,Name,LinkedIn,Score "tailscale.com","Tailscale","linkedin.com/company/tailscale",100 "dagster.io","Dagster","linkedin.com/company/dagsterlabs",90 "hashicorp.com","HashiCorp","linkedin.com/company/hashicorp",80 "langchain.com","LangChain","linkedin.com/company/langchain",90 "vercel.com","Vercel","linkedin.com/company/vercel",80 "datadoghq.com","Datadog","linkedin.com/company/datadog",70 "temporal.io","Temporal Technologies","linkedin.com/company/temporal-technologies",100 "elastic.co","Elastic","linkedin.com/company/elastic-co",60 "clickhouse.com","ClickHouse","linkedin.com/company/clickhouseinc",90 "streamnative.io","StreamNative","linkedin.com/company/streamnative",70 ``` The only required column is a website or domain for the company. That's because Unify uses a company's domain as its unique identifier. Everything else is optional. ### 3. Understand the request payload We’ll use the [upsert method](/developers/api/data/records/upsert) to create companies if they don't exist and update them if they do. The upsert method is the recommended way of sending data into Unify since it gives you the most control and never fails if a record already exists. The upsert requests we send will have two properties: * `match` -- This contains the value(s) used to match existing records. In this case, the only value we will use for matching is the `domain`. * `create_or_update_if_empty` -- This contains the values used when creating or updating the record. This will avoid overwriting existing values. > [!TIP] > > The `create_or_update_if_empty` property never overwrites values if the > record already exists, which is a nice property. For full control over how > existing records are updated, you can specify [more specific properties](/developers/api/data/records/upsert#overview) > instead. Here’s what a single request looks like for one company row: ```http Request theme={null} POST /data/v1/objects/company/records/upsert Host: api.unifygtm.com Content-Type: application/json X-Api-Key: { "match": { "domain": "unifygtm.com" }, "create_or_update_if_empty": { "name": "Unify", "domain": "unifygtm.com", "description": "A nice company with a top-notch API.", "industry": "Software", "linkedin_url": "https://www.linkedin.com/company/unifygtm" } } ``` ### 4. Assemble the script The script needs to perform a few steps: 1. Read the CSV 2. Construct an upsert request payload for each row 3. Send the requests Here's a complete script that does just that: ```python Python theme={null} import csv import sys from typing import TypedDict from unify import NotFoundError, Unify class Company(TypedDict): name: str | None domain: str linkedin_url: str | None account_score: float | None def read_csv(path: str) -> list[Company]: rows = [] with open(path, newline="", encoding="utf-8") as f: reader = csv.DictReader(f) for i, raw in enumerate(reader, start=1): domain = raw.get("Website") if not domain: print(f"[WARN] Row {i} skipped: missing required 'domain'") continue rows.append( { "name": raw.get("Name"), "domain": domain, "linkedin_url": raw.get("LinkedIn"), "account_score": raw.get("Score"), } ) return rows def main(): if len(sys.argv) != 2: print("Usage: python upload_companies.py ") return 2 # Read the CSV file companies = read_csv(path=sys.argv[1]) if not companies: print("No valid rows to process.") return 0 # Instantiate the client client = Unify() # Create a custom attribute for the account scores try: client.data.attributes.retrieve( object_name="company", attribute_name="account_score", ) except NotFoundError: client.data.attributes.create( object_name="company", api_name="account_score", display_name="Account Score", description="Account score for the CSV upload guide.", type="DECIMAL", is_required=False, is_unique=False, ) print("Created custom attribute 'account_score' for companies.") # Create or update all records from the CSV file success = 0 for row in companies: result = client.data.records.upsert( object_name="company", match={ "domain": row["domain"], }, create_or_update_if_empty={ "domain": row["domain"], "name": row["name"], "linkedin_url": row["linkedin_url"], "account_score": row["account_score"], }, ) success += 1 print(f"[OK] Upserted company {row['domain']} -> id={result.data.id}") print(f"Done. Upserted {success} of {len(companies)} companies.") if __name__ == "__main__": main() ``` ```typescript TypeScript theme={null} import { readFileSync } from "fs"; import { parse } from "csv-parse/sync"; import Unify from "@unifygtm/sdk"; import { UCompanyAttributes } from "@unifygtm/sdk/resources/data"; interface CompanyRow { Name?: string; Website?: string; LinkedIn?: string; Score?: string; } function readCsv(path: string): UCompanyAttributes[] { const raw = readFileSync(path, "utf-8"); const rows = parse(raw, { columns: true }) as CompanyRow[]; const companies = new Array(); for (const row of rows) { if (!row.Website) { console.log( `[WARN] Skipping row with missing 'Website': ${JSON.stringify(row)}`, ); continue; } companies.push({ name: row.Name, domain: row.Website, linkedin_url: row.LinkedIn, score: row.Score ? parseFloat(row.Score) : undefined, }); } return companies; } async function main(): Promise { const path = process.argv[2]; if (!path) { console.log("Usage: npx tsx upload_companies.ts "); process.exit(2); } const companies = readCsv(path); if (companies.length === 0) { console.log("No valid rows to process."); return; } const client = new Unify(); // Create a custom attribute for the account scores try { await client.data.attributes.retrieve("account_score", { object_name: "company", }); } catch (err: any) { if (err.status === 404) { await client.data.attributes.create("company", { api_name: "account_score", display_name: "Account Score", description: "Account score for the CSV upload guide.", type: "DECIMAL", is_required: false, is_unique: false, }); console.log("Created custom attribute 'account_score' for companies."); } else { throw err; } } // Create or update all records from the CSV file let success = 0; for (const row of companies) { const result = await client.data.records.upsert("company", { match: { domain: row.domain, }, create_or_update_if_empty: { name: row.name, domain: row.domain, linkedin_url: row.linkedin_url, account_score: row.score, }, }); success++; console.log(`[OK] Upserted company ${row.domain} -> id=${result.data.id}`); } console.log(`Done. Upserted ${success} of ${companies.length} companies.`); } main(); ``` ### 5. Run the script Set your API key as an environment variable and then run the script: ```shell Python theme={null} export UNIFY_API_KEY="" python send_companies.py example_companies.csv ``` ```shell TypeScript theme={null} export UNIFY_API_KEY="" npx tsx send_companies.ts example_companies.csv ``` You should see output like this: ```text Output theme={null} [OK] Upserted company tailscale.com -> id=04caa07b-cbdd-4bb4-9de4-49abdc106aaa [OK] Upserted company dagster.io -> id=18cd4c36-3e6c-4778-88c3-4bd5c103f381 ... Done. Upserted 10 of 10 companies. ``` ### 6. Verify records exist (optional) You can verify a specific company with the [Find unique record](/developers/api/data/records/find-unique) API. Simply send a request with a `match` property containing the domain of one of the companies the script ran on: ```http Request theme={null} POST /objects/company/find-unique { "domain": "tailscale.com" } ``` ```json Response theme={null} { "status": "success", "data": { "object": "company", "id": "04caa07b-cbdd-4bb4-9de4-49abdc106aaa", "created_at": "2025-09-04T01:23:45Z", "updated_at": "2025-09-04T01:23:45Z", "attributes": { "name": "Tailscale", "domain": "tailscale.com", "linkedin_url": "linkedin.com/company/tailscale", "lead_source": "CSV Tutorial" // ... } } } ``` ## Conclusion This approach works for any type of object in Unify, including both standard objects and custom objects that you create. This script can be used as a starting point and customized to send additional values, read from other data sources, or send different types of records. # Send records via API Source: https://docs.unifygtm.com/developers/guides/send-data/overview Send data from external tools and systems via API. ## Overview For tools and data sources that can't be connected using an existing integration, Unify's [Data API](/developers/api/data/overview) can be used instead. This general-purpose API allows you to programmatically find, create, update, and delete records in Unify. ## Quickstart ### 1. Generate an API key Navigate to [Settings → Developers](https://app.unifygtm.com/dashboard/settings/integrations/api-keys) in Unify and select **Generate API Key**. For the curl examples, set the `UNIFY_API_KEY` environment variable to your API key. ### 2. (Optional) Install the SDK If you are writing Python or TypeScript code, you can install the official Unify SDK to simplify interacting with the API. > **[Python library](/developers/sdks/python-library)** > > Install and use the official Unify Python library. > **[TypeScript library](/developers/sdks/typescript-library)** > > Install and use the official Unify TypeScript library. ### 3. Choose an object You can create records for any object in Unify, including standard objects like `company` or `person`. But you can also create custom objects with whatever attributes and relationships you need. > **[Manage via API](/developers/api/data/overview)** > > Create and manage objects, attributes, and records in Unify via API. > **[Manage via UI](/reference/objects/overview)** > > Create and manage objects, attributes, and records within the Unify app. ### 4. Upsert a record Now you can push records into the selected object. The recommended API for creating and updating records is [Upsert record](/developers/api/data/records/upsert). This allows you to specify a unique attribute to match existing records and create or update based on whether a match is found, preventing duplicates. ```python Python theme={null} record = client.data.records.upsert( object_name="my_object", match={ "email": "jane@example.com", }, create_or_update_if_empty={ "email": "jane@example.com", "login_count": 12, "plan_tier": "pro", }, ) print(f"Record ID: {record.data.id}") print(f"Email: {record.data.attributes['email']}") ``` ```typescript TypeScript theme={null} const record = await client.data.records.upsert('my_object', { match: { email: 'jane@example.com', }, create_or_update_if_empty: { email: 'jane@example.com', login_count: 12, plan_tier: 'pro', }, }); console.log(`Record ID: ${record.data.id}`); console.log(`Email: ${record.data.attributes.email}`); ``` ```shell curl theme={null} curl -X POST 'https://api.unifygtm.com/data/v1/objects/product_user/records/upsert' \ -H "X-Api-Key: ${UNIFY_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "match": { "email": "jane@example.com" }, "create_or_update_if_empty": { "email": "jane@example.com", "login_count": 12, "plan_tier": "pro" } }' ``` ### 5. Verify in Unify The record should now exist in Unify. You can verify this by searching for the record in the UI or by retrieving it via API. ```python Python theme={null} record = client.data.records.find_unique( object_name="my_object", match={ "email": "jane@example.com", }, ) print(f"Record ID: {record.data.id}") print(f"Email: {record.data.attributes['email']}") ``` ```typescript TypeScript theme={null} const record = await client.data.records.findUnique('my_object', { match: { email: 'jane@example.com', }, }); console.log(`Record ID: ${record.data.id}`); console.log(`Email: ${record.data.attributes.email}`); ``` ```shell curl theme={null} curl -X POST 'https://api.unifygtm.com/data/v1/objects/product_user/records/find-unique' \ -H "X-Api-Key: ${UNIFY_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "match": { "email": "jane@example.com" } }' ``` ## What's next > **[Import data from a CSV](/developers/guides/send-data/csv-import)** > > Sync data from a CSV file or spreadsheet into Unify. > **[Send records from Clay sheet](/developers/guides/send-data/clay-webhook)** > > Send records from a Clay sheet into Unify via webhook. > **[Data API reference](/developers/api/data/overview)** > > Explore the full Data API reference. # Capture button clicks Source: https://docs.unifygtm.com/developers/guides/website-traffic/button-clicks Record button clicks and other interactions with the Unify Intent client. ## Overview Website and product interactions are a strong indicator of a visitor's goal. For example, a visitor to your marketing website who interacts with a pricing calculator is much more likely to be an interested buyer than the average visitor. In Unify, you capture these types of interactions by sending a custom event when buttons or website components are clicked. If a visitor is then identified (e.g., from another form fill or based on company IP matches), their interactions can be viewed in Unify and used to run plays. ## Prerequisites * Ensure you've already installed the Unify Intent client on your website. See [Set up the Unify Intent client](/developers/guides/website-traffic/unify-intent-client) for instructions. ## Example Suppose you have a button that opens your pricing calculator. You can log this interaction with a custom event that includes useful context as properties. ### Send a custom event Call `track` when the button is clicked. Include properties that help with attribution and routing later (e.g., `button_id`, page, placement, or variant). ```ts theme={null} unify.track('Pricing Calculator Opened', { button_id: 'pricing-calculator', placement: 'pricing-page-hero', }); ``` ### Send multiple custom events There's no limit on the number of events you can send into Unify, and more data is always better. You can fire off multiple custom events to capture interactions at a more granular level. For example, suppose your pricing calculator contains buttons to select which pricing plan to view (e.g., "Basic," "Pro," "Enterprise"). You can send an event each time this button is clicked: ```ts theme={null} unify.track('Pricing Plan Selected', { button_id: 'select-pro-plan', plan: 'Pro', }); ``` Suppose that the pricing calculator also contains a slider to select the usage quantity they expect to use. This information can be sent as well: ```ts theme={null} unify.track('Pricing Quantity Selected', { slider_id: 'usage-quantity', credits_needed: '5000', plan: 'Pro', }); ``` Now, you can run a play that segments visitors based on what pricing tier they are most likely to be interested in. Your reps will also know what usage tier they viewed or selected. ### Identifying the visitor This example assumes the button click itself does not collect any information about the visitor, such as name or email address. That's fine—if the visitor is identified later (e.g., via form fill or IP match), Unify will link this event to that person or company. If you *do* have information about the visitor at click time, you should also send an Identify event. This will immediately link the visitor to the person or company you specify. ```ts theme={null} // Send a basic "Identify" event unify.identify('alice@acme.com'); // Send an "Identify" event with company and person information unify.identify('alice@acme.com', { person: { email: 'alice@acme.com', first_name: 'Alice', last_name: 'Smith', title: 'Product Manager', }, company: { name: 'Acme Inc.', domain: 'acme.com', }, }); ``` You do not need to send an Identify event on every click. Send it wherever you first learn the visitor's identity and then subsequent events will be linked automatically. ## Launch a play With this custom event in place, you can create plays in Unify that react to high‑intent clicks like “Pricing Calculator Opened.” For example, a play could: 1. Apply exclusions (competitors, open opportunities, current customers) 2. Launch an AI agent to research the company or person for ICP fit 3. Enroll the person in a follow‑up sequence 4. Prospect more contacts at the same company and enroll them in outreach ## FAQ > **What properties should I include?** > > Include any information that may help you qualify and route interactions, > such as: > > * Button or form identifier > * Values entered by the visitor > * Page or component context > * Variant (for A/B tests) > > When in doubt, err on the side of including more properties. # Capture form fills Source: https://docs.unifygtm.com/developers/guides/website-traffic/form-fills Record form submissions with the Unify Intent client. ## Overview One of the most effective ways to capture leads on your website is through form submissions. With Unify, you can capture these submissions and then run plays on them. The Unify Intent client can be used to capture these form fills. This can be achieved by firing two separate events: * **Custom event** — This captures the submission and any data entered into the form. Any plays will be able to filter companies or people based on whether they have a matching custom event. * **Identify event** — This captures the identity of the visitor and links them to a company or person in Unify. The Identify event is necessary to associate the form submission with a specific person or company. Typically, the simplest approach is to send both events at the same time when a visitor completes and submits a form. ## Prerequisites * Ensure you've already installed the Unify Intent client on your website. See [Set up the Unify Intent client](/developers/guides/website-traffic/unify-intent-client) for instructions. ## Example Suppose you have a "demo sign-up" form that collects the following information: * **First name** (e.g., `Alice`) * **Last name** (e.g., `Smith`) * **Email address** (e.g., `alice@acme.com`) * **Company name** (e.g., `Acme Inc.`) * **What are you most interested in seeing?** (e.g., `AI capabilities`) To send this data into Unify, you should send two events. ### Send a custom event First, send a custom event that records the form submission. The form fields can be included as *properties* on the event. Properties are arbitrary key-value pairs that can be viewed and used to filter events in Unify. ```ts theme={null} unify.track('Demo Requested', { form_id: 'demo-signup', first_name: 'Alice', last_name: 'Smith', company: 'Acme Inc.', interest: 'AI capabilities', }); ``` ### Send an Identify event Next, send an Identify event that associates the submission with a known person (using their email address). You can also include additional traits about the person and their company. These traits will appear on the person and company records in Unify. ```ts theme={null} unify.identify('alice@acme.com', { person: { email: 'alice@acme.com', first_name: 'Alice', last_name: 'Smith', }, company: { name: 'Acme Inc.', }, }); ``` ## Launch a play With both events sent, you can now create plays in Unify that run on the inbound lead. Plays can be triggered based on the custom event (e.g., "Demo Requested") and can use filters based on the properties you sent. For example, a play running on inbound form fills could: 1. Apply exclusions to ensure the inbound lead is not a competitor, open opportunity, or existing customer 2. Launch an AI agent to research the company or person and qualify or disqualify them based on ICP fit or other criteria 3. Enroll the person in an outbound sequence 4. Find a few more contacts at the same company that match your ideal buyer persona and enroll them in another outbound sequence ## FAQ > **What if I don't have an email address?** > > If you don't have an email address to include in the Identify event, Unify > will not have a unique identifier to link this visitor to a person. However, > you have other options. > > **Link to a company instead:** > > If you have a company website, you can send an Identify event with the > visitor's company instead. This will not link the custom event to a specific > person, but it will link it to a specific company. > > You can then run a play on companies with matching custom events. That play > can prospect for contacts at the company with ICP personas. > > **Capture identity elsewhere:** > > If the visitor does not provide an email address on the form, consider > capturing their identity elsewhere on your website. For example: > > * If you have another sign-up form that collects email addresses, you can > send an Identify event when a visitor completes that form. > * If you link the custom event to a company, prospect for people at that > company, and then send sequence emails to them, you can track email link > clicks. When a person clicks a link in an email, their website activity > will be identified. > > If the visitor is identified through other means, all of their past activity > will also be retroactively identified. > > **Automatically identify the company:** > > If you do not send an Identify event, Unify will still automatically attempt > to identify the visitor's company using reveal providers based on their IP > address. > **How is a person linked to a company?** > > If you send an Identify event with a corporate email address but no company, > Unify can infer the company from the email domain. > > For example, if you identify a visitor as `alice@acme.com`, Unify can link > the person to the company with the `acme.com` domain. This inference is not > performed for personal or non-corporate email domains. If the visitor uses a > personal email address, include a company domain in the Identify event when > you want to link the person to a company. > **Can I track partial form fills?** > > Yes. If you want to track partial progress before final submission, send a > custom event when a meaningful step is completed or enable automatic email > input monitoring with the Unify Intent Client. > > For most lead routing workflows, still send a final custom event when the > form is actually submitted. This gives you a clean trigger for plays and > avoids treating abandoned form activity as a submitted form. > **Should I send both a custom event and an Identify event?** > > Usually, yes. The custom event captures what happened, such as `Demo > Requested`. The Identify event captures who did it. Sending both gives you a > reliable play trigger and a person or company record to act on. # Connect website traffic to Unify Source: https://docs.unifygtm.com/developers/guides/website-traffic/introduction Send website visitors, sessions, and events into Unify. > [!TIP] > > This guide is applicable to any website, but it is especially focused on > marketing websites. If you are looking to connect product usage or analytics > data from your web application, see [Connect product usage data to Unify](/developers/guides/product-usage-data/introduction) > for a more targeted guide. ## Overview One of the most popular strategies in Unify is to identify the companies and people who are visiting your website and accessing your content. By sending website traffic data into Unify, you can instantly launch plays to start taking action on these visitors. Unify can automatically identify companies visitors are associated with by using a combination of built-in matching providers for high coverage and accuracy. Unify also supports person-level identification through a combination of email link click tracking, form fills, and [Identify events](/developers/api/analytics/identify). Website traffic data in Unify consists of three types of events: | Event type | What it captures | Common examples | | - | - | - | | Page view | A visitor viewed a URL. | Pricing page viewed, docs page viewed, product page viewed. | | Identify event | A visitor's person or company identity became known. | Form submit, sign in, OAuth login, demo request, company domain submitted. | | Custom event | A named action you define. | Button clicked, form submitted, plan selected, product limit reached. | All event tracking capabilities integrate natively with the rest of the Unify data layer. This makes it easy to link website intent to companies or people and access that data throughout Unify. ## Setup Unify provides an SDK called the [Unify Intent Client](/developers/intent-client/overview) that can be installed on your website to start sending visitor events. This is the easiest and recommended way to get started. > **[Unify Intent Client (Recommended)](/developers/guides/website-traffic/unify-intent-client)** > > Send events using Unify’s native JavaScript or React client. If you're already collecting website traffic data using a third-party tool, you can also send that data into Unify. This can be done using either a supported integration or the general-purpose [Analytics API](/developers/api/analytics/overview). You can find guides for popular tools below. > **[Segment](/reference/integrations/segment)** > > Send Segment events into Unify. > **[PostHog](/reference/integrations/posthog)** > > Send PostHog events into Unify. > [!WARNING] > > If you forward events from Segment or PostHog, do not also install the Unify > Intent Client on the same site. Running multiple event sources on the same > site can produce duplicate data. ## Examples Once you've configured events to be sent into Unify, you can start using that data to launch plays based on visitor intent. See the following guides for examples. > **[Capture form fills](/developers/guides/website-traffic/form-fills)** > > Record form submissions with the Unify Intent client. > **[Capture button clicks](/developers/guides/website-traffic/button-clicks)** > > Record button clicks and other interactions with the Unify Intent client. # Set up the Unify Intent client Source: https://docs.unifygtm.com/developers/guides/website-traffic/unify-intent-client Send website events directly into Unify with the native SDK. ## Installation There are multiple ways to install the Unify Intent client depending on your setup. In most cases, the website tag is the best option to get started. > **[Website tag](/developers/intent-client/website-tag)** > > Paste a preconfigured JavaScript snippet in your website's HTML. This > method is the easiest way to get started and is suitable for most websites. > **[React library](/developers/intent-client/react)** > > Install the client in your React web application for a more native > integration. > **[JavaScript library](/developers/intent-client/js-client)** > > Install the client in your non-React frontend application, such as a Single > Page App (SPA). > [!NOTE] > > You should only use one installation method per website or application. If the > client is installed twice on the same site, it may not work correctly. ## Usage **Website tag** ### Automatic events Once the website tag is added, it will automatically start collecting certain types of events: * **Page events**: Every time a visitor loads a page on your website, a page view event is sent to Unify. When that visitor is identified, all their sessions will be linked to that identity. * **Custom events**: Certain button clicks and interactions will be tracked automatically. This does not cover all possible interactions, and you will likely want to manually trigger events in specific places on your website for more complete coverage. * **Identify events**: When a visitor fills out a form with their email address, they will be automatically identified and linked to that address. Other information they fill out (such as first and last name) will not be automatically recorded, so you may also want to manually send "identify" events on form fills, logins, etc. If desired, you can disable automatic event collection by setting specific options when initializing the client. See the full [Usage guide](/developers/intent-client/usage-guide) for more details. ### Manual events You can manually trigger events in specific places on your website by calling the client directly. When you include the tag in your HTML, you will immediately be able to access the client at `window.unify` (or simply `unify` since `window` is global). #### Page events Page events record a page visit. They are fired automatically by default when using the website tag, but you can also call them manually. ```javascript theme={null} // Send a "page" event unify.page(); ``` #### Custom events Custom events record specific actions taken by a visitor, such as button clicks or form fills. Some custom events are captured automatically when using the website tag, but you can also send custom events manually. ```javascript theme={null} // Send a basic custom event unify.track("See More Button Clicked"); // Send a custom event with additional properties unify.track("Modal Opened", { modalName: "Contact Sales Modal" }); ``` #### Identify events Identify events link a visitor to a specific company or person. Basic identify events are sent automatically when a visitor fills out a form with their email address, but you can also send more detailed identify events when you have additional information. ```javascript theme={null} // Send a basic "identify" event unify.identify("user@email.com"); // Send an "identify" event with additional company or person attributes unify.identify("first.last@acme.com", { person: { email: "first.last@acme.com", first_name: "First", last_name: "Last", }, company: { domain: "acme.com", name: "Acme Corp.", } }); ``` **React library** ### Automatic events By default, the React library will not automatically collect any events. You can enable automatic event collection when initializing the client. See the full [Usage guide](/developers/intent-client/usage-guide) for more details. ### Manual events You can manually trigger events in specific places in your web application by calling the client directly. #### Page events Page events record a page visit. Typically, the easiest strategy is to enable automatic collection of page visits, but you can also call them manually. ```javascript theme={null} // Enable automatic "page" event collection unify.startAutoPage(); // Send a "page" event unify.page(); ``` #### Custom events Custom events record specific actions taken by a visitor, such as button clicks or form fills. You can send custom events with arbitrary properties anywhere in your React application. ```javascript theme={null} // Send a basic custom event unify.track("See More Button Clicked"); // Send a custom event with additional properties unify.track("Modal Opened", { modalName: "Contact Sales Modal" }); ``` #### Identify events Identify events link a visitor to a specific company or person. You can send identify events whenever you have information about a visitor, such as their name or email address. ```javascript theme={null} // Send a basic "identify" event unify.identify("user@email.com"); // Send an "identify" event with additional company or person attributes unify.identify("first.last@acme.com", { person: { email: "first.last@acme.com", first_name: "First", last_name: "Last", }, company: { domain: "acme.com", name: "Acme Corp.", } }); ``` **JavaScript library** ### Automatic events By default, the JavaScript library will not automatically collect any events. You can enable automatic event collection when initializing the client. See the full [Usage guide](/developers/intent-client/usage-guide) for more details. ### Manual events You can manually trigger events in specific places in your web application by calling the client directly. #### Page events Page events record a page visit. Typically, the easiest strategy is to enable automatic collection of page visits, but you can also call them manually. ```javascript theme={null} // Enable automatic "page" event collection unify.startAutoPage(); // Send a "page" event unify.page(); ``` #### Custom events Custom events record specific actions taken by a visitor, such as button clicks or form fills. You can send custom events with arbitrary properties anywhere in your web application. ```javascript theme={null} // Send a basic custom event unify.track("See More Button Clicked"); // Send a custom event with additional properties unify.track("Modal Opened", { modalName: "Contact Sales Modal" }); ``` #### Identify events Identify events link a visitor to a specific company or person. You can send identify events whenever you have information about a visitor, such as their name or email address. ```javascript theme={null} // Send a basic "identify" event unify.identify("user@email.com"); // Send an "identify" event with additional company or person attributes unify.identify("first.last@acme.com", { person: { email: "first.last@acme.com", first_name: "First", last_name: "Last", }, company: { domain: "acme.com", name: "Acme Corp.", } }); ``` For complete instructions, see the [Usage guide](/developers/intent-client/usage-guide). # Install JavaScript package Source: https://docs.unifygtm.com/developers/intent-client/js-client Install the Unify Intent client in a frontend web application framework. > **[Github](https://github.com/unifygtm/intent-js-client)** > **[npm](https://www.npmjs.com/package/@unifygtm/intent-client)** ## Installation You can install the Unify Intent JS Client with your preferred package manager: ```shell npm theme={null} npm install @unifygtm/intent-client ``` ```shell yarn theme={null} yarn add @unifygtm/intent-client ``` ```shell pnpm theme={null} pnpm add @unifygtm/intent-client ``` ```shell bun theme={null} bun add @unifygtm/intent-client ``` ## Usage After installing the client, you must initialize it in your application code: ```ts index.ts theme={null} import { UnifyIntentClient, UnifyIntentClientConfig } from '@unifygtm/intent-client'; const writeKey = 'YOUR_PUBLIC_WRITE_KEY'; const config: UnifyIntentClientConfig = { autoPage: true, autoIdentify: false, }; const unify = new UnifyIntentClient(writeKey, config); // Do not call mount during server side rendering. Only call it in a browser context. unify.mount(); ``` > [!WARNING] > > Be sure to only initialize the client one time in your application. For details on how to use the client to send events, see the full [Usage guide](/developers/intent-client/usage-guide). ## Cleanup When you are done using the client, if you wish to clean up the side effects generated by it, you can do so with the `unmount` method: ```ts cleanup.ts theme={null} import { UnifyIntentClient, UnifyIntentClientConfig } from '@unifygtm/intent-client'; const writeKey = 'YOUR_PUBLIC_API_KEY'; const unify = new UnifyIntentClient(writeKey); unify.mount(); // Use the client for some time, then later... unify.unmount(); ``` # Unify Intent Client Source: https://docs.unifygtm.com/developers/intent-client/overview Send website and product events directly into Unify with the native SDK. ## Overview The Unify Intent client is a JavaScript library that allows you to collect events from your website and send them to Unify. It supports page, identify, and custom events. > **Page events** > > e.g. a user visits the pricing page of your marketing website > **Custom events** > > e.g. a user clicks a button to open a pricing calculator > **Identify events** > > e.g. a user logs into your web app with their email address When you install the Unify Intent client on your website, it can automatically collect these events and send them to Unify. You can also customize its behavior by sending events manually. > [!NOTE] > > The Intent Client source code is [available on GitHub](https://github.com/unifygtm/intent-js-client). ## Installation There are multiple ways to install the Unify Intent client depending on your setup. In most cases, the website tag is the best option to get started. > **[Website tag](/developers/intent-client/website-tag)** > > Paste a preconfigured JavaScript snippet in your website's HTML. This > method is the easiest way to get started and is suitable for most websites. > **[React library](/developers/intent-client/react)** > > Install the client in your React web application for a more native > integration. > **[JavaScript library](/developers/intent-client/js-client)** > > Install the client in your non-React frontend application, such as a Single > Page App (SPA). > [!NOTE] > > You should only use one installation method per website or application. If the > client is installed twice on the same site, it may not work correctly. ## Usage If you install the client using the website tag method, it will start collecting page visits automatically. Often, no further setup is required unless you wish to track visitor interactions manually. For other installation methods, or to learn how to manually send other types of events, see the complete [Usage guide](/developers/intent-client/usage-guide). # Install React package Source: https://docs.unifygtm.com/developers/intent-client/react Install the Unify Intent client in a React app. > **[Github](https://github.com/unifygtm/intent-react)** > **[npm](https://www.npmjs.com/package/@unifygtm/intent-react)** ## Installation You can install the Unify Intent React library with your preferred package manager: ```shell npm theme={null} npm install @unifygtm/intent-react ``` ```shell yarn theme={null} yarn add @unifygtm/intent-react ``` ```shell pnpm theme={null} pnpm add @unifygtm/intent-react ``` ```shell bun theme={null} bun add @unifygtm/intent-react ``` ## Usage First, wrap your React app in a `UnifyIntentProvider`: ```tsx index.tsx theme={null} import { UnifyIntentClient, UnifyIntentClientConfig, UnifyIntentProvider, } from '@unifygtm/intent-react'; const writeKey = 'YOUR_PUBLIC_WRITE_KEY'; const config: UnifyIntentClientConfig = { autoPage: true, autoIdentify: false, }; const intentClient = new UnifyIntentClient(writeKey, config); const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement, ); root.render( ); ``` The `UnifyIntentProvider` automatically takes care of mounting and unmounting the client for you whenever the component mounts and unmounts. Any components rendered in your app can access and use the intent client using the `useUnifyIntent` hook: ```tsx Example.tsx theme={null} import { useUnifyIntent } from '@unifygtm/intent-react'; const Example = () => { // Get the Unify Intent Client const unify = useUnifyIntent(); // However you access the current user... const currentUser = useCurrentUser(); useEffect(() => { if (currentUser?.emailAddress) { // Log an identify event for the current user unify.identify(currentUser.emailAddress, { firstName: currentUser.firstName, lastName: currentUser.lastName, company: { name: currentUser.companyName, domain: currentUser.companyDomain }, }); } }, [currentUser, unify]); ... }; export default Example; ``` For details on how to use the client to send events, see the full [Usage guide](/developers/intent-client/usage-guide). # Usage guide Source: https://docs.unifygtm.com/developers/intent-client/usage-guide Learn how to send events using the Unify Intent Client. > [!TIP] > > The Unify Intent Client can be used to log user activity across multiple subdomains of the > same top-level domain. For example, if a user visits your marketing website at `www.yoursite.com` > and then logs into your production web application at `app.yoursite.com`, the activity in both > places will be attributed to the same person. ## Event types ### Page view events Website page views are an indicator of buyer intent. You can log this information to the Unify platform for usage with the `page` method. There are two ways to collect page data with the Unify intent client: 1. Automatic monitoring of the current page (see [here](#automatic-page-monitoring)) 2. Manually via the client `page` method (see [here](#manual-page-logging)) Utilizing both of these methods when appropriate is recommended to take full advantage of intent data within Unify. #### Automatic page monitoring The Unify intent client is capable of automatically monitoring the user's current page to trigger page events. This will happen by default when the client is installed via the Unify JavaScript tag. If the client is installed via a package manager, you must pass the `autoPage` configuration option when instantiating the client. See [Configuration](#configuration) below for more details. In either case, this behavior can be enabled or disabled programmatically via the `startAutoPage` and `stopAutoPage` methods on the client: ```TypeScript theme={null} // Initialize the client and tell it to automatically monitor pages const unify = new UnifyIntentClient( 'YOUR_PUBLIC_WRITE_KEY', { autoPage: true }, ); unify.mount(); // Tell the client to stop monitoring pages unify.stopAutoPage(); // Tell the client to start monitoring pages again unify.startAutoPage(); ``` #### Manual page logging You can also manually trigger a page event with the `page` method on the client. This is useful when you do not want to trigger page events for *every* page. ```TypeScript theme={null} const unify = new UnifyIntentClient('YOUR_PUBLIC_WRITE_KEY'); unify.mount(); // Trigger a page event for whatever page the user is currently on unify.page(); // Trigger a page event for a custom page that the user is not necessarily on unify.page({ pathname: '/some-custom-page' }); ``` ### Identify events All intent data collected for users by Unify is anonymous by default. When intent events are logged, Unify will attempt to identify the company associated with a user’s IP address, but their personal identity will remain anonymous until an identify event is triggered for them. There are two ways to collect identity data with the Unify intent client: 1. Automatic monitoring of email input elements (see [here](#automatic-input-monitoring)) 2. Manually via the client `identify` method (see [here](#manual-identification)) Utilizing both of these methods when appropriate is recommended to take full advantage of intent data within Unify. #### Automatic input monitoring The Unify intent client is capable of automatically monitoring text and email input elements on the page to collect user identity. This will happen by default when the client is installed via the Unify JavaScript tag. If the client is installed via a package manager, you must pass the `autoIdentify` configuration option when instantiating the client. See [Configuration](#configuration) below for more details. In either case, this behavior can be enabled or disabled programmatically via the `startAutoIdentify` and `stopAutoIdentify` methods on the client: ```TypeScript theme={null} // Initialize the client and tell it to automatically monitor inputs const unify = new UnifyIntentClient( 'YOUR_PUBLIC_WRITE_KEY', { autoIdentify: true }, ); unify.mount(); // Tell the client to stop monitoring inputs for now unify.stopAutoIdentify(); // Tell the client to start monitoring inputs again unify.startAutoIdentify(); ``` #### Manual identification You can also manually trigger an identify event with the `identify` method on the client. This is useful when users log in with OAuth or SSO, for example, because they do not enter their email into an input on the page. When using this method, you can also optionally specify a set of Person or Company attributes to upsert and associate with the identified user. This is done in the form of an optional second argument to `identify`. ```TypeScript theme={null} const unify = new UnifyIntentClient('YOUR_PUBLIC_WRITE_KEY'); unify.mount(); // However you determine the currently logged-in user const currentUser = getCurrentUser(); // Identify the current user unify.identify(currentUser.emailAddress); // OR identify the current user and upsert the associated Company/Person in Unify unify.identify( currentUser.emailAddress, { person: { email: currentUser.emailAddress, first_name: currentUser.firstName, last_name: currentUser.lastName, }, company: { domain: currentUser.organization.domain, // must match domain of email above name: currentUser.organization.name, } } ) ``` ### Custom events Certain user actions are valuable indicators of buying intent. You can use custom events to log these events along with custom properties for each event that you can then use within Unify to filter your visitors and act accordingly. There are three ways to fire custom events with the Unify intent client: 1. Manually via the client `track` method (see [here](#manual-tracking)) 2. Custom HTML data attributes (see [here](#html-data-attributes)) 3. Automatically with CSS selectors (see [here](#automatic-tracking)) #### Manual tracking You can also manually trigger a custom event with the `track` method on the client: ```TypeScript theme={null} const unify = new UnifyIntentClient('YOUR_PUBLIC_WRITE_KEY'); unify.mount(); // Only the event name is required - we recommend spaces between capitalized words unify.track('See More Button Clicked'); // You can also specify custom properties to include unify.track('Modal Opened', { modalName: 'Contact Sales Modal' }); ``` The `track` method accepts two arguments: 1. A string `name` (required) - this is used to identify the event downstream within Unify. 2. An object of keys and string values `properties` (optional) - this is used to specify custom properties associated with the event which can be used for filtering and identification downstream within Unify. #### HTML data attributes You can leverage various data attributes in the HTML of your site or application to automatically track click events for elements you care about: ##### `data-unify-click-event-name` The presence of this attribute on an element indicates that the intent client should automatically fire an event when the element is clicked. The *value* of this attribute defines the **name** of the event which will be fired. For example, clicking the `button` in the following HTML will result in a custom event with the name `See More Button Clicked` to be fired: ```html theme={null} ``` By default, the intent client will make a best effort at identifying a **label** for the clicked element to include in the **properties** of the event which is fired. It will do so using the text content and ARIA attributes of the element. This can be used to differentiate between custom events with the *same name* fired for *different elements*. If the client is not able to determine a human-readable label, the `label` property will simply be omitted from the event properties. For example, clicking the `div` in the following HTML will result in a custom event with the name `Download Button Clicked` to be fired with `properties` containing a `label` with the value `Free sample`: ```html theme={null}
Free sample
``` ##### `data-unify-label` This attribute can be used to override the label (or provide a label which is otherwise missing) for an element that is tracked by the client. For example, even though clicking the `button` in the following HTML would normally result in a custom event with the label `See more` to be fired, the presence of the `data-unify-label` attribute results in the event being fired with a `label` property of `Custom label`: ```html theme={null} ``` ##### `data-unify-event-prop-*` By default, only the label of an element is included in the `properties` of auto tracked events. You can specify additional properties to include using the prefix `data-unify-event-prop-`. For example, clicking the `button` in the following HTML will result in an event being fired with `properties` including a property of `customValue` set to `100`: ```html theme={null} ``` #### Automatic tracking The Unify intent client is capable of automatically monitoring elements that match a list of CSS selectors specified by you in the `UnifyIntentClientConfig`'s `autoTrackOptions.clickTrackingSelectors`. When an element matching one of these selectors is clicked by the user, the client will automatically fire an event for it. `clickTrackingSelectors` can be a list of simple CSS string selectors, in which case the default event name `Element Clicked` will be used: ```typescript theme={null} const options: AutoTrackOptions = { clickTrackingSelectors: ['.button', '.another-custom-selector'], }; // Will fire `Element Clicked` events for clicked elements matching CSS selectors const unify = new UnifyIntentClient('YOUR_PUBLIC_WRITE_KEY', { autoTrackOptions: options, }); ``` Alternatively, you can customize the event name fired for each selector by passing a list of objects for `clickTrackingSelectors`, where each object contains a `selector` string and optional `eventName` which will be used as the name of the auto tracked event: ```typescript theme={null} const options: AutoTrackOptions = { clickTrackingSelectors: [ { selector: '.button', eventName: 'Button Clicked' }, { selector: '.another-custom-selector', eventName: 'Custom Element Clicked', }, ], }; // Will fire events with specified custom names for clicked elements matching CSS selectors const unify = new UnifyIntentClient('YOUR_PUBLIC_WRITE_KEY', { autoTrackOptions: options, }); ``` You can use the `data-unify-label` to customize the element `label` in the event `properties` and the `data-unify-event-prop-` prefix to add custom `properties`. See [HTML data attributes](#html-data-attributes) for more info. If you would like to exclude a specific element from tracking which matches your specified CSS selectors list, you can do so with the `data-unify-exclude` attribute. This behavior can be enabled or disabled programmatically via the `startAutoTrack` and `stopAutoTrack` methods on the client: ```TypeScript theme={null} // Initialize the client and tell it to automatically track clicks for all elements with class="button" const unify = new UnifyIntentClient( 'YOUR_PUBLIC_WRITE_KEY', { autoTrackOptions: { clickTrackingSelectors: ['.button'] } }, ); unify.mount(); // Tell the client to stop monitoring buttons for now unify.stopAutoTrack(); // Tell the client to start monitoring buttons again unify.startAutoTrack(); // OR tell the client to start monitoring something else unify.startAutoTrack({ clickTrackingSelectors: ['.custom-button'] }); ``` ## Server side It is possible to send requests to the Unify Intent API directly. You might do this on a web server, for example, to circumvent ad blockers. The Unify client exposes a method for each of its event types (`page`, `identify`, and `track` events) which can be used to generate the request payload for each event. This payload can then be sent to your web server which functions as a proxy to forward the request directly to the Unify Intent API. The three methods on the client for generating event payloads are the following: * `getPagePayload` * `getIdentifyPayload` * `getTrackPayload` Below is an example of using the `getIdentifyPayload` method in a React app to generate the payload for an `identify` event, send it to a proxy web server, and forward it to the Unify Intent API. ```tsx client.tsx theme={null} // However you make requests to your web server const apiClient = useApiClient(); // However you get your current user object const currentUser = useCurrentUser(); // Get the Unify client const unify = useUnifyIntent(); useEffect(() => { if (currentUser.email) { const payload = unify.getIdentifyPayload(currentUser.email); // If the email is valid if (payload) { // Send event to server apiClient.post('/identify', payload); } } }, [currentUser, unify, apiClient]); ``` ```TypeScript server.ts theme={null} const unifyClient = axios.create({ // The Unify Intent API URL baseURL: 'https://api.unifyintent.com/analytics/v1', headers: { 'Content-type': 'application/json; charset=UTF-8', // Your public write key which can be found at https://app.unifygtm.com/dashboard/settings/integrations/unify-intent-client 'X-Write-Key': 'wk_5fTtsDLJ_7vx9DsjPcr79yk4FweES727w59pxS8EJ', }, }); router.post( '/identify', async (req: Request, res: Response) => { // Forward the event to the Unify Intent API const response = await unifyClient.post('/identify', req.body); return res.status(200).json({ success: response.status === 200, }); } ); ``` ## Third-party tools The intent client ships with out-of-the-box event tracking for some popular third-party tools such as [Default](https://www.default.com/) and [Navattic](https://www.navattic.com/). If these tools are embedded into a page where the intent client is running, the client will track relevant events automatically. This behavior can be disabled with the `UnifyIntentClientConfig`. See [Configuration](#configuration) for more details on configuring the intent client. ### Default [Default](https://www.default.com/) is a popular tool for automating inbound form submission workflows. If you use a Default form wherever the intent client is running, the client will automatically fire events for corresponding Default form events. The following Default form events are supported: | Default event | Unify event name | Unify event properties | Description | | - | - | - | - | | `default.form_completed` | `Default Form Completed` | `form`, `formId` | When a user completes all steps in a form. | | `default.form_page_submitted` | `Default Form Page Submitted` | `form`, `formId`, `pageNumber` | When a user completes one step in a form. | | `default.meeting_booked` | `Default Meeting Booked` | `memberName`, `memberEmail`, `durationInMinutes`, `startDateTime` | When a user successfully books a meeting via the Default scheduler. | | `default.scheduler_closed` | `Default Scheduler Closed` | | When a user closes the Default scheduler UI. | | `default.scheduler_displayed` | `Default Scheduler Displayed` | `formId` | When the Default scheduler UI is displayed to the user. | ### Navattic [Navattic](https://www.navattic.com/) is a popular tool for automating interactive product demos. If you use a Navattic demo wherever the intent client is running, the client will automatically fire events for corresponding Navattic demo events. The following Navattic demo events are supported: | Navattic event | Unify event name | Unify event properties | Description | | - | - | - | - | | `START_FLOW` | `Navattic Demo Started` | `demo` | When a user starts a Navattic demo. | | `VIEW_STEP` | `Navattic Demo Step Viewed` | `demo`, `step` | When a user views a new step of the demo. | | `COMPLETE_FLOW` | `Navattic Demo Completed` | `demo` | When a user successfully completes the entire demo. | ## Configuration **autoPage** `boolean` (default: false) > [!NOTE] > > If installed via the [Unify Website tag](./website-tag) then the `autoPage` config will default to `true`. Tells the client to automatically log page events whenever the current page changes. Works for static websites and Single Page Apps. Also logs a page event for the initial page. **autoIdentify** `boolean` (default: false) > [!NOTE] > > If installed via the [Unify Website tag](./website-tag) then the `autoIdentify` config will default to `true`. Tells the client to automatically monitor text and email input elements on the page for changes. When the current user enters a valid email address into an input, the client will log an identify event for that email address. **autoTrackOptions** `AutoTrackOptions` Options to customize automatic tracking of user actions such as click events. **properties** **clickTrackingSelectors** `string[] | \{ selector: string; eventName?: string \}[]` Optional list of CSS selectors to customize which elements the client will automatically fire a custom event for when clicked. Can be a list of string selectors, in which case the default event name `Element Clicked` will be used as the event name. Can also be a list of objects containing a `selector` key and `eventName` key, in which case the value of `eventName` will be used as the event name. **defaultForms** `DefaultFormAutoTrackOptions` By default, the intent client will fire custom events for [Default](https://www.default.com/) form events. This option can be used to customize which Default form events will result in Unify events being fired or disable this behavior entirely. **navatticProductDemos** `NavatticDemoAutoTrackOptions` By default, the intent client will fire custom events for [Navattic](https://www.navattic.com/) product demos. This option can be used to customize which Navattic demo events will result in Unify events being fired or disable this behavior entirely. **sessionDurationMinutes** `number` (default: 30) Length in minutes that user sessions will persist when no activities are tracked. Activities include `page`, `identify,` and `track` activities. ## Cookies > [!NOTE] > > This section only applies to intent client versions `1.4.0` and up. If you install the intent client with the website tag, you automatically get access to the latest client version. Versions older than this use obfuscated cookie names. When the intent client mounts, it places two values in the user's cookies: * `unify_visitor_id` - A randomly generated UUID which uniquely identifies the user. This persists across sessions. * `unify_session_id` - A randomly generated UUID which uniquely identifies the user's current session. Sessions will persist as long as a new `page`, `identify`, or `track` event is fired at least once every 30 minutes. This duration be customized with the `sessionDurationMinutes` option on the `UnifyIntentClientConfig`. These cookies are *first-party cookies* and associated with the top-level domain where the intent client is running. **Example** If the intent client is running on [https://www.unifygtm.com](https://www.unifygtm.com) then the cookies will be associated with `.unifygtm.com`. This means that they are accessible and reused across all subdomains of the top-level domain. In this example, if the intent client were also running on [https://app.unifygtm.com](https://app.unifygtm.com) then a visitor ID stored while on the `www` subdomain would be reused on `app` subdomain. These cookies are stored for the maximum permitted time by Google Chrome of 400 days and updated every time the visitor visits your site. In other words, as long as the same visitor visits your site at least once every 400 days and does not clear their browser cookies, their visitor ID will be reused across sessions. Note that some browsers have default limits lower than 400 days. In these cases, the maximum allowed limit by the browser will be used. # Website tag Source: https://docs.unifygtm.com/developers/intent-client/website-tag Set up the Unify Intent client on a marketing website. ## Installation You can automatically load and install the client by placing a `