# Apollo

Apollo.io is a sales intelligence and engagement platform that provides access to a database of over 210 million contacts and 35 million companies. The Sling Apollo connector extracts data from the Apollo REST API, supporting contacts, accounts, deals/opportunities, sequences, tasks, calls, users, and reference data (stages, labels, custom fields).

{% hint style="success" %}
**CLI Pro Required**: APIs require a [CLI Pro token](https://docs.slingdata.io/sling-cli/cli-pro) or [Platform Plan](https://docs.slingdata.io/sling-platform/platform).
{% endhint %}

## Setup

The following credentials and inputs are accepted:

**Secrets:**

* `api_key` **(required)** -> Your Apollo API key (master key recommended for full access)

**Inputs:**

* `anchor_date` (optional) -> The starting date for incremental sync on call records (default: 1 year ago). Format: `YYYY-MM-DD`

### Getting Your API Key

1. Log in to your [Apollo account](https://app.apollo.io/)
2. Go to **Settings** > **Integrations** > **API Keys**
3. Click **Create New Key**
4. Select **Master Key** for full API access (required for most endpoints)
5. Copy the generated API key

{% hint style="warning" %}
A **Master API key** is required for most endpoints (users, deals, sequences, tasks, calls, email accounts, stages, labels, custom fields). Only contacts and accounts search work with a regular API key.
{% endhint %}

### Using `sling conns`

{% code overflow="wrap" %}

```bash
sling conns set APOLLO type=api spec=apollo secrets='{ api_key: your_api_key_here }'
```

{% endcode %}

### Environment Variable

See [here](https://docs.slingdata.io/sling-cli/environment#dot-env-file-.env.sling) to learn more about the `.env.sling` file.

{% code overflow="wrap" %}

```bash
export APOLLO='{ type: api, spec: apollo, secrets: { api_key: "your_api_key_here" } }'
```

{% endcode %}

### Sling Env File YAML

See [here](https://docs.slingdata.io/sling-cli/environment#sling-env-file-env.yaml) to learn more about the sling `env.yaml` file.

```yaml
connections:
  APOLLO:
    type: api
    spec: apollo
    secrets:
      api_key: "your_api_key_here"
```

## Replication

Here's an example replication configuration to sync Apollo data to a PostgreSQL database:

```yaml
source: APOLLO
target: MY_POSTGRES

defaults:
  mode: incremental
  object: apollo.{stream_name}

streams:
  # Core objects with incremental sync
  contacts:
  accounts:

  # Core objects (full-refresh only)
  opportunities:
    mode: full-refresh
  sequences:
    mode: full-refresh
  tasks:
    mode: full-refresh
  calls:
  users:
    mode: full-refresh

  # Reference data
  email_accounts:
    mode: full-refresh
  opportunity_stages:
    mode: full-refresh
  account_stages:
    mode: full-refresh
  contact_stages:
    mode: full-refresh
  labels:
    mode: full-refresh
  custom_fields:
    mode: full-refresh
```

**Sync all endpoints:**

```yaml
source: APOLLO
target: MY_POSTGRES

defaults:
  mode: full-refresh
  object: apollo.{stream_name}

streams:
  '*':
```

## Endpoints

### Core Objects

| Endpoint        | Description                               | Incremental |
| --------------- | ----------------------------------------- | ----------- |
| `contacts`      | Contacts in your Apollo account           | Yes         |
| `accounts`      | Accounts/companies in your Apollo account | Yes         |
| `opportunities` | Deals/opportunities                       | No          |
| `sequences`     | Email sequences/campaigns                 | No          |
| `tasks`         | Tasks assigned to users                   | No          |
| `calls`         | Phone call records                        | Yes         |
| `users`         | Team members/users                        | No          |

### Reference Data

| Endpoint             | Description              | Incremental |
| -------------------- | ------------------------ | ----------- |
| `email_accounts`     | Connected email accounts | No          |
| `opportunity_stages` | Deal pipeline stages     | No          |
| `account_stages`     | Account lifecycle stages | No          |
| `contact_stages`     | Contact lifecycle stages | No          |
| `labels`             | Labels/tags              | No          |
| `custom_fields`      | Custom field definitions | No          |

## Incremental Sync

The Apollo connector supports incremental sync for the following endpoints:

* **contacts** — Uses `updated_at` as the update key, sorted by most recently updated
* **accounts** — Uses `created_at` as the update key, sorted by most recently created
* **calls** — Uses date range filtering with `anchor_date` input for the initial sync window

For other endpoints, use `full-refresh` mode.

## Rate Limiting

Apollo enforces rate limits based on your pricing plan (typically 50-200 requests per minute). The connector automatically:

* Limits to 3 requests/second
* Retries with exponential backoff on 429 (rate limit) responses

## API Limitations

* Search endpoints (contacts, accounts, tasks) have a display limit of **50,000 records** (100 per page, up to 500 pages)
* A **Master API key** is required for most list/search endpoints
* Search/list operations on your own data do not consume API credits

If you are facing issues connecting, please reach out to us at <support@slingdata.io>, on [discord](https://discord.gg/q5xtaSNDvp) or open a Github Issue [here](https://github.com/slingdata-io/sling-cli/issues).
