# Trello

Trello is a project management and collaboration tool that organizes tasks into boards, lists, and cards. The Sling Trello connector extracts data from the Trello REST API, supporting boards, lists, cards, actions, members, labels, checklists, and organizations.

{% 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 are accepted:

**Secrets:**

* `api_key` **(required)** -> Your Trello API Key
* `api_token` **(required)** -> Your Trello API Token

### Getting Your API Key and Token

1. Log in to [Trello](https://trello.com)
2. Go to the [Power-Up Admin Portal](https://trello.com/power-ups/admin)
3. Click **New** to create a new Power-Up/Integration
4. Fill in a name (e.g., "Sling Integration") and select your workspace
5. Click **Create** and then navigate to the **API Key** tab
6. Click **Generate a new API Key** to get your API key
7. Click the **Token** link next to your API key to generate a token
8. Authorize the application and copy the generated token

{% hint style="warning" %}
**Important:** API tokens grant access to your Trello account data. Keep your key and token secure and never share them publicly.
{% endhint %}

### Using `sling conns`

Here are examples of setting a connection named `TRELLO`. We must provide the `type=api` property:

{% code overflow="wrap" %}

```bash
sling conns set TRELLO type=api spec=trello secrets='{ api_key: your_api_key, api_token: your_api_token }'
```

{% 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 TRELLO='{ type: api, spec: trello, secrets: { api_key: "your_api_key", api_token: "your_api_token" } }'
```

{% 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:
  TRELLO:
    type: api
    spec: trello
    secrets:
      api_key: "your_api_key"
      api_token: "your_api_token"
```

## Replication

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

```yaml
source: TRELLO
target: MY_POSTGRES

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

streams:
  # sync all endpoints
  '*':
```

**Incremental sync for actions:**

```yaml
source: TRELLO
target: MY_POSTGRES

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

streams:
  boards:
  organizations:
  lists:
  cards:
  labels:
  members:
  checklists:
  actions:
    mode: incremental
```

## Endpoints

| Endpoint        | Description                                             | Incremental | Depends On |
| --------------- | ------------------------------------------------------- | ----------- | ---------- |
| `boards`        | All boards for the authenticated user                   | No          | —          |
| `organizations` | All organizations/workspaces for the authenticated user | No          | —          |
| `lists`         | All lists for each board                                | No          | `boards`   |
| `cards`         | All cards for each board with members and attachments   | No          | `boards`   |
| `labels`        | All labels for each board                               | No          | `boards`   |
| `members`       | All members for each board                              | No          | `boards`   |
| `checklists`    | All checklists for each board with check items          | No          | `boards`   |
| `actions`       | All actions/activity for each board                     | Yes         | `boards`   |

The connector uses a **queue-based architecture** to handle parent-child relationships. The `boards` endpoint runs first and populates board IDs, which are used by `lists`, `cards`, `labels`, `members`, `checklists`, and `actions`.

To discover available endpoints:

```bash
sling conns discover TRELLO
```

### Endpoint Details

**`boards`** — Returns all boards (open, closed, and starred) the authenticated user has access to. Board IDs are queued for all child endpoints. Includes board metadata such as name, description, preferences, labels, and membership info.

**`organizations`** — Returns all organizations (workspaces) the authenticated user belongs to, including name, display name, URL, and membership details.

**`lists`** — Returns all lists for each board, including open and archived lists. Contains list name, position, and status.

**`cards`** — Returns all cards for each board with full detail: name, description, due dates, labels, position, checklist status, member assignments, and attachments.

**`labels`** — Returns all labels defined on each board, including name, color, and usage information.

**`members`** — Returns all members of each board, including username, full name, avatar, and member type.

**`checklists`** — Returns all checklists for each board, including all check items with their names and completion status.

**`actions`** — Returns all activity/actions for each board, including card creates, moves, comments, member additions, and other board activity. Supports incremental sync via the `since` parameter.

## Incremental Sync

The `actions` endpoint supports incremental sync using the `since` parameter:

* **First run:** Fetches all actions from the last 30 days
* **Subsequent runs:** Only fetches actions created after the last sync timestamp

All other endpoints run in full-refresh mode since the Trello API does not provide server-side time-based filtering for those resources.

## Rate Limiting

The Trello API enforces rate limits:

* **Per API Key:** 300 requests per 10 seconds
* **Per API Token:** 100 requests per 10 seconds

The connector automatically:

* Uses rate limiting (8 requests/second with concurrency of 3)
* Retries with exponential backoff on 429 (rate limit) responses
* Allows up to 5 retry attempts
* Retries with linear backoff on 5xx server errors

## Common Use Cases

### Sync All Trello Data

```yaml
source: TRELLO
target: MY_POSTGRES

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

streams:
  '*':
```

### Sync Actions Incrementally

```yaml
source: TRELLO
target: MY_POSTGRES

defaults:
  object: trello.{stream_name}

streams:
  boards:
    mode: full-refresh
  actions:
    mode: incremental
```

### Extract Cards and Checklists for Reporting

```yaml
source: TRELLO
target: MY_POSTGRES

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

streams:
  boards:
  lists:
  cards:
  checklists:
```

### Sync Board Structure and Members

```yaml
source: TRELLO
target: MY_POSTGRES

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

streams:
  boards:
  organizations:
  lists:
  members:
  labels:
```

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/trello.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.
