Create a trigger inbox for an app
This tutorial covers the Trigger Inbox API connected to an app using the user’s app connection. It follows the same queue model as Trigger Inbox onboarding, adding connection setup before inbox creation.Before you begin
- An access token set as
$TOKEN. Token exchange covers how to get one. - A connected app account for the user. Connection flow covers setup. You will gather everything else in Step 1.
Step 1: Gather your subscription values
Creating an inbox for an app needs three values from the Powered by Zapier API, all authenticated with the same$TOKEN as the Trigger Inbox API, plus your trigger’s input fields:
app_key: the app’s key, fromGET /v2/apps. Accepts the versionless key (e.g.SlackCLIAPI), a slug (e.g.slack), or@latestsuffix (e.g.SlackCLIAPI@latest). All resolve to the latest version automatically.action_key: the trigger’s key, fromGET /v2/actions. Identifies which trigger the inbox subscribes to.connection_id: the ID of the user’s connected account, fromGET /v2/authentications.
1. Find the app key
List apps and read thekey field. The query parameter narrows the list by app title, but returns partial matches, you may get more than one result. Match the title field to identify the correct app.
key and a UUID id:
key (for example, SlackCLIAPI) as your app_key. Replace APP_ID in the next steps with the id value from the response.
2. Find the action key
List the app’s read actions withGET /v2/actions, using the app id from the previous step. The action key identifies which trigger the inbox subscribes to. Scan the response for the trigger you want by its human-readable title, then read its key. That key is your action_key.
title, a stable key, and an opaque id:
title, then use its key (for example, channel_message) as your action_key. Replace ACTION_ID in the next steps with the id value from the response.
Each action’s
id is its action ID: the opaque, encoded value you pass as the {action_id} path parameter in later requests. It is distinct from action_key: action_key is the stable key you put in the inbox subscription (Step 2), while the action ID is this opaque id you put in /v2/actions/{action_id}/... URLs. It is not something you can construct. It is also not stable: the same action returns a different id on each GET /v2/actions call, though any id you capture stays valid for later requests. Capture it now. You need it to list input fields in Step 4 (POST /v2/actions/{action_id}/inputs), and the optional schema preview below uses it too.3. Find the connection ID
List the user’s authentications for your app. ReplaceAPP_ID in the request with the app id from the app key step. Each authentication represents a connected app account, with a UUID id and an app field holding the app’s UUID.
app equals the app id from the previous step, then use its id as your connection_id. Replace CONNECTION_ID in the next steps with this id.
The authentications endpoint requires the app’s UUID (
id), not the app_key string. Use the app id from the app key step here, and app_key in the subscription request in Step 2.4. Find the trigger’s input fields
A trigger accepts input fields, for example, which channel to monitor. List them withPOST /v2/actions/{action_id}/inputs, using the action ID and connection_id from the previous steps. Pass empty inputs ({}) to get the initial set of fields.
input_field has an id (the key you use in inputs), a title, and is_required:
inputs object from the field ids and the values you want, for example, {"channel": "C0123456789"}.
Some fields are dynamic: they appear only after a connection or another field is set (check each field’s
depends_on). To reveal them, send the values you have back as inputs and call again. The response may also include info_field entries (display-only) and fieldset entries (groups of related fields).| Inbox subscription field | Source | Example |
|---|---|---|
app_key | GET /v2/apps → key | SlackCLIAPI |
action_key | GET /v2/actions → key | channel_message |
connection_id | GET /v2/authentications → id | 019487c8-6b2a-7c1e-9f3d-2a1b0c4d5e6f |
inputs | POST /v2/actions/{action_id}/inputs → field ids | {"channel": "C0123456789"} |
Optional: Preview the data your inbox will produce
Optional: Preview the data your inbox will produce
Before you create the inbox, you can preview the fields its messages will contain. The trigger’s declared output schema covers the core fields that land in each message’s Each
payload (real payloads can include additional fields, as the note below explains). It is available from the Powered by Zapier API using the action ID you captured in Step 1. No inbox or live data required.Post the action_id to the outputs endpoint with empty inputs to get the declared schema. Passing the connection_id and the actual inputs you’ll use (from the steps above) sharpens the result. Both keys are required: authentication may be null and inputs may be {}, but neither key can be omitted.id is a field that will appear in your message payload; sample is illustrative:This is the trigger’s declared schema, not fields inferred from this inbox’s received messages. Set
fetch_live_samples to true to populate sample values with real data from the app through your connection. A real-data fetch needs a valid authentication and the inputs the trigger reads from (for example, a channel); without them it usually returns nothing and falls back to the declared samples. Setting fetch_live_samples to true always performs the fetch, even when empty inputs mean it returns nothing useful, and each fetch adds noticeable latency and counts against a rate limit. It is not available for write actions. Live results may also include fields beyond the declared schema.Step 2: Create the inbox
ReplaceYOUR_APP_KEY, YOUR_ACTION_KEY, YOUR_CONNECTION_ID, and YOUR_INPUT_KEY/YOUR_INPUT_VALUE with the values from Step 1 and your prerequisites.
Step 3: Wait for active
Poll until the status isactive. Initialization typically takes a few seconds. Go to inbox states for an overview of all status transitions.
Step 4: Send an event from the connected app
Perform an action in the connected app to produce a trigger event. For example, if you subscribed to Slack new messages, post a message to the monitored channel. The event will appear in the inbox within a few seconds to a few minutes, depending on the trigger type.Step 5: Lease messages
results[] contains the trigger payload in payload. If possible_duplicate_data is true, deduplication was not possible and your processing logic must be idempotent.
Step 6: Acknowledge messages
Complete script
Complete the Before you begin steps first, then set your variables and run the script:Next steps
- Consuming messages for partial acknowledgment, release, backoff strategy, and quarantine handling.
- Manage your inbox for pause, resume, update, and delete operations.
- Trigger Inbox API reference for full endpoint documentation.