Triggers

List accounts eligible for a trigger

Changed on

Lists the connected accounts on a connection, and marks each one as eligible or ineligible for one trigger. Use this endpoint to choose which accounts to subscribe, before calling CreateTriggerSubscription or BatchCreateTriggerSubscriptions. Pass the connection ID and the trigger name in the path. Use query to search account identifiers, and page_size and page_token to page through the results. An ineligible account is returned with a reason and a remedy instead of being left out, so you can see why an account is refused. Each account also carries its health for this trigger: a state, and the single action that resolves it. Returns one page of accounts, the next and previous page tokens, and total_size, which counts the accounts on this connection that match the query.

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

Request

Path parameters

connection_idstring required

ID of the connection, in this environment. Up to 64 characters.

trigger_namestring required

Name of the trigger, as returned in the name field of ListAvailableTriggers. Up to 128 characters.

Query parameters

querystring

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.

page_sizeinteger

How many accounts to return. Defaults to 10; a larger value than 100 is capped at 100 rather than refused.

page_tokenstring

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.

Response

One page of the connection's accounts, each with its eligibility and health for the trigger, plus page tokens and the total match count

next_page_tokenstring

Pass as page_token to read the next page. Empty when there is no next page.

prev_page_tokenstring

Pass as page_token to read the previous page. Empty when there is no previous page.

total_sizeinteger

How many of this connection's accounts match the query, across every page. Accounts on other connections are never counted.

Example response

{
  "accounts": [
    {
      "eligible": true,
      "health": {
        "reason": "This account was disconnected.",
        "remedy": "Connect the account again to resume triggers."
      },
      "id": "ca_123456789012345",
      "identifier": "user_123",
      "reason": "This account was authorized under a different app than the connection now uses.",
      "remedy": "Re-authorize this account under your app, then subscribe."
    }
  ],
  "next_page_token": "<next_page_token>",
  "prev_page_token": "<prev_page_token>",
  "total_size": 104
}

Changes