> ## Documentation Index
> Fetch the complete documentation index at: https://docs.unifygtm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Build a data 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.

<GitHub.Repo repo="unifygtm/bulk-api-connector-examples" />

## Example connectors

<CardGroup cols={1}>
  <Card title="Fivetran Connector SDK" href="https://github.com/unifygtm/bulk-api-connector-examples/tree/main/fivetran" icon="code" horizontal>
    Start with a Python connector that queries data incrementally and upserts
    rows into a Fivetran destination.
  </Card>

  <Card title="Airbyte" href="https://github.com/unifygtm/bulk-api-connector-examples/tree/main/airbyte" icon="file-code" horizontal>
    Start with a declarative source that models query jobs with Airbyte's
    asynchronous stream support.
  </Card>
</CardGroup>

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

<Steps titleSize="h3">
  <Step title="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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="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.
  </Step>
</Steps>

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

<Steps titleSize="h3">
  <Step title="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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="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.
  </Step>
</Steps>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.