# Attio

Attio is a modern CRM platform built for relationship-driven teams. The Sling Attio connector extracts data from the Attio REST API v2, supporting standard objects (people, companies, deals, users, workspaces), collaboration data (notes, tasks), schema metadata (objects, lists, workspace members), and automatically discovers custom objects.

{% 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 Attio API access token

**Inputs:**

* `anchor_date` (optional) -> The starting date for historical data extraction (default: 1 year ago). Format: `YYYY-MM-DD`

### Getting Your API Key

1. Log in to your [Attio workspace](https://app.attio.com/)
2. Go to **Settings** (gear icon) > **Developers**
3. Click **Generate new token**
4. Give the token a name (e.g., "Sling Integration")
5. Select the required scopes:
   * **Record Read** — for people, companies, deals, users, workspaces, and custom objects
   * **Object configuration Read** — for objects metadata
   * **List Read** — for lists
   * **Note Read** — for notes
   * **Task Read** — for tasks
   * **User management Read** — for workspace members
6. Click **Generate token** and copy the token

### Using `sling conns`

{% code overflow="wrap" %}

```bash
sling conns set ATTIO type=api spec=attio 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 ATTIO='{ type: api, spec: attio, 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:
  ATTIO:
    type: api
    spec: attio
    secrets:
      api_key: "your_api_key_here"
```

**With anchor date for historical data:**

```yaml
connections:
  ATTIO:
    type: api
    spec: attio
    secrets:
      api_key: "your_api_key_here"
    inputs:
      anchor_date: "2020-01-01"
```

## Replication

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

```yaml
source: ATTIO
target: MY_POSTGRES

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

streams:
  # CRM records with incremental sync
  people:
  companies:
  deals:

  # Schema & reference data (full-refresh only)
  objects:
    mode: full-refresh
  lists:
    mode: full-refresh
  workspace_members:
    mode: full-refresh

  # Collaboration data (full-refresh only)
  notes:
    mode: full-refresh
  tasks:
    mode: full-refresh
```

**Sync all endpoints:**

```yaml
source: ATTIO
target: MY_POSTGRES

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

streams:
  '*':
```

## Endpoints

### CRM Records

| Endpoint     | Description       | Incremental |
| ------------ | ----------------- | ----------- |
| `people`     | People records    | Yes         |
| `companies`  | Company records   | Yes         |
| `deals`      | Deal records      | Yes         |
| `users`      | User records      | Yes         |
| `workspaces` | Workspace records | Yes         |

### Schema & Metadata

| Endpoint            | Description                 | Incremental |
| ------------------- | --------------------------- | ----------- |
| `objects`           | Object definitions (schema) | No          |
| `lists`             | Lists in the workspace      | No          |
| `workspace_members` | Workspace members           | No          |

### Collaboration

| Endpoint | Description               | Incremental |
| -------- | ------------------------- | ----------- |
| `notes`  | Notes attached to records | No          |
| `tasks`  | Tasks in the workspace    | No          |

### Dynamic Endpoints (Custom Objects)

| Endpoint     | Description                             | Incremental |
| ------------ | --------------------------------------- | ----------- |
| `{api_slug}` | Custom object records (auto-discovered) | Yes         |

To discover available endpoints including custom objects:

```bash
sling conns discover ATTIO
```

## Custom Objects

The Attio connector automatically discovers custom objects in your workspace. Any object that is not one of the standard types (people, companies, deals, users, workspaces) will be available as a dynamic endpoint named `{api_slug}`.

For example, if you have a custom object called "Projects" with slug `projects`, it will appear as the endpoint `projects`.

## Incremental Sync

The Attio connector uses time-based incremental sync for record endpoints:

* **First run:** Fetches records created from `anchor_date` (default: 1 year ago) to present
* **Subsequent runs:** Only fetches records created after the last sync

Incremental sync is supported for:

* CRM record endpoints (people, companies, deals, users, workspaces)
* Dynamic custom object endpoints

## Rate Limiting

The Attio API enforces rate limits:

* **Read operations:** 100 requests/second
* **Write operations:** 25 requests/second

The connector automatically:

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

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).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.slingdata.io/connections/api-connections/attio.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
