> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# List accounts eligible for a trigger (beta)

`GET /api/v1/connections/{connection_id}/triggers/{trigger_name}/eligible-accounts`

This endpoint is in beta. Its request and response may change.

Lists the connected accounts on a connection, and marks each one eligible or not for one trigger. An account that can't subscribe is still listed, with a `reason` and a `remedy`, such as reconnecting to grant a missing scope. Pass `query` to search account identifiers. Call this before you [subscribe accounts](https://docs.scalekit.com/agentkit/reference/triggers/batch-create-trigger-subscriptions/).

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `connection_id` | string | Yes | ID of the connection, in this environment. Up to 64 characters. |
| `trigger_name` | string | Yes | Name of the trigger, as returned in the name field of [List available triggers](https://docs.scalekit.com/agentkit/reference/triggers/list-available-triggers/). Up to 128 characters. |

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `page_size` | integer | No | How many accounts to return. Defaults to 10; a larger value than 100 is capped at 100 rather than refused. |
| `page_token` | string | No | The next_page_token or prev_page_token from a previous response. Omit it to read the first page. A value that is not a token from a previous response is refused with 400. |
| `query` | string | No | Narrows the list to accounts whose identifier contains this text, case-insensitively. Matched against every account on the connection, not only the current page. Up to 100 characters. |

**Response (200)**

| Name | Type | Description |
| --- | --- | --- |
| `accounts` | array of object | One page of the connection's connected accounts, eligible and ineligible, each with its health for this trigger. |
| `accounts.eligible` | boolean | Whether this account can be subscribed to the trigger. When false, reason and remedy explain why and what to do. |
| `accounts.health` | object | The account's own state, evaluated for what this trigger needs captured on the account: a webhook trigger needs the provider workspace, and an account-scoped webhook trigger also needs the provider user. A polled trigger needs neither, so the same account can be READY for one trigger and AWAITING_CONFIRMATION for another. Carried alongside eligible because they answer different questions: eligible is whether this trigger can be subscribed on this account, health is the account's own state and the single action that resolves it. |
| `accounts.health.action` | string (enum) | The single action that resolves this state. Unspecified when there is nothing to do. One of: `RECONNECT`, `COMPLETE_SETUP`. |
| `accounts.health.blocks_tool_calls` | boolean | Whether the account's credential itself is unusable, so tool calls made with it fail too. True only for NEEDS_REAUTHENTICATION. False for AWAITING_CONFIRMATION and WRONG_APP: the credential still works and tool calls still succeed, so an agent should keep using the account; only trigger events cannot reach it. |
| `accounts.health.reason` | string | Why the account is in this state. Empty when the state is READY. |
| `accounts.health.remedy` | string | What to do about it. Empty when the state is READY. |
| `accounts.health.state` | string (enum) | READY — the account can receive triggers. AWAITING_CONFIRMATION — connected and working, but Scalekit has not confirmed which provider workspace or user it belongs to, so inbound events cannot be routed to it. WRONG_APP — authorized under a different OAuth app than the connection now uses. DISCONNECTED — the account was disconnected. NEEDS_REAUTHENTICATION — the credential itself is unusable, because it has expired or the account has not finished connecting. One of: `READY`, `AWAITING_CONFIRMATION`, `WRONG_APP`, `DISCONNECTED`, `NEEDS_REAUTHENTICATION`. |
| `accounts.id` | string | ID of the connected account. Pass it as connected_account_id when creating a subscription. |
| `accounts.identifier` | string | Your app's ID for the user, the value passed when the account was created. |
| `accounts.reason` | string | Why this account cannot receive the trigger. Populated whenever eligible is false. |
| `accounts.remedy` | string | What to do so the account can receive the trigger. Populated whenever eligible is false. |
| `next_page_token` | string | Pass as page_token to read the next page. Empty when there is no next page. |
| `prev_page_token` | string | Pass as page_token to read the previous page. Empty when there is no previous page. |
| `total_size` | integer | How many of this connection's accounts match the query, across every page. Accounts on other connections are never counted. |

**Errors**

- `400`: Invalid request - connection_id is not a valid connection ID, page_token is not a token from a previous response, or query is longer than 100 characters
- `404`: Not found - the connection does not exist in this environment, the connection's provider publishes no trigger with this name, or Triggers isn't turned on for your environment
- `500`: Internal error - the accounts for this trigger could not be read; retry the request

**Request**

```bash
curl -sS -X GET \
  "$SCALEKIT_ENVIRONMENT_URL/api/v1/connections/conn_133400101014995480/triggers/salesforce_lead_created/eligible-accounts" \
  -H "Authorization: Bearer $TOKEN"
```

**Response**

```json
{
  "accounts": [
    {
      "id": "ca_133400349586228019",
      "identifier": "user_123",
      "eligible": true,
      "reason": "",
      "remedy": "",
      "health": {
        "state": "READY",
        "action": "ACCOUNT_HEALTH_ACTION_UNSPECIFIED",
        "blocks_tool_calls": false,
        "reason": "",
        "remedy": ""
      }
    }
  ],
  "next_page_token": "",
  "prev_page_token": "",
  "total_size": 1
}
```

**Python SDK:** `scalekit_client.actions.triggers.list_eligible_accounts`

List a connection's connected accounts and whether each can subscribe.

```python
scalekit_client.actions.triggers.list_eligible_accounts(
    connection_id: str,
    trigger_name: str,
    query: str | None = None,
    page_size: int | None = None,
    page_token: str | None = None,
) -> ListEligibleAccountsResponse
```

Example:

```python
result = scalekit_client.actions.triggers.list_eligible_accounts(
    connection_id="conn_133400101014995480",
    trigger_name="salesforce_lead_created",
)
```

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `connection_id` | `str` | Yes | The connection (`conn_...`). |
| `trigger_name` | `str` | Yes | `AvailableTrigger.name`. |
| `query` | `str \| None` | No | Filter accounts by identifier. |
| `page_size` | `int \| None` | No | Accounts per page; the server default is 10 and values above 100 are capped. |
| `page_token` | `str \| None` | No | `next_page_token` or `prev_page_token` of a previous page. |

Returns `ListEligibleAccountsResponse`: One page of accounts with their eligibility and health.


Part of [Triggers](https://docs.scalekit.com/agentkit/reference/triggers/) in the [AgentKit API reference](https://docs.scalekit.com/agentkit/reference/). Authentication: https://docs.scalekit.com/agentkit/reference/authentication.md. Errors and rate limits: https://docs.scalekit.com/agentkit/reference/errors.md. Pagination: https://docs.scalekit.com/agentkit/reference/pagination.md


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
