Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

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.

Authorization

Authorization: Bearer $TOKEN, an access token from the client credentials grant. See Authentication.

Path parameters

connection_idstringrequired
ID of the connection, in this environment. Up to 64 characters.
trigger_namestringrequired
Name of the trigger, as returned in the name field of List available triggers. Up to 128 characters.

Query parameters

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

Response 200

accountsarray of object
One page of the connection's connected accounts, eligible and ineligible, each with its health for this trigger.
Show 6 child attributes
eligibleboolean
Whether this account can be subscribed to the trigger. When false, reason and remedy explain why and what to do.
healthobject
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.
Show 5 child attributes
actionstring (enum)
The single action that resolves this state. Unspecified when there is nothing to do.
RECONNECTCOMPLETE_SETUP
blocks_tool_callsboolean
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.
reasonstring
Why the account is in this state. Empty when the state is READY.
remedystring
What to do about it. Empty when the state is READY.
statestring (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.
READYAWAITING_CONFIRMATIONWRONG_APPDISCONNECTEDNEEDS_REAUTHENTICATION
idstring
ID of the connected account. Pass it as connected_account_id when creating a subscription.
identifierstring
Your app's ID for the user, the value passed when the account was created.
reasonstring
Why this account cannot receive the trigger. Populated whenever eligible is false.
remedystring
What to do so the account can receive the trigger. Populated whenever eligible is false.
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.

Errors

Every error has the same body: code, message and details. See Errors and rate limits.

400Invalid 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
404Not 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
500Internal error - the accounts for this trigger could not be read; retry the request