Sync Trello Cards Automatically with Webhooks
Learn how to set up Trello REST API webhooks, handle duplicate events, and avoid rate‑limit pitfalls for reliable card syncing.
17 Jun 2026, 13:12 UTC

Problem: Keeping an external system in sync with Trello
Many teams use Trello for lightweight project tracking, but the cards often need to trigger actions in another application – for example, creating a ticket in Jira when a card is moved to “Done”. Polling the board on a regular schedule works, but it wastes API calls, can miss events, and adds latency.
Why webhooks are the better fit
Trello’s REST API provides a webhook mechanism that pushes a JSON payload each time an action occurs on a board, list, card, or member you subscribe to. The payload arrives via an HTTP POST to a URL you control, so your service can react immediately without repeatedly hitting Trello’s endpoints. This approach reduces load on Trello, respects rate limits, and delivers updates as soon as they happen, provided your handler responds quickly.
Setting up a webhook
To create a webhook you call /1/webhooks and supply four pieces of information:
- the idModel – the object you want changes from (board, list, card, or member)
- a description – free‑form text for your logs
- the public callbackURL – an endpoint reachable from Trello’s servers
- your Trello API key and token – used for authentication and to tie the webhook to a specific token
Example request (run on a server with curl):
curl -X POST "https://api.trello.com/1/webhooks" \
-d "key={api_key}&token={token}" \
-d "description=Sync board changes to internal tracker" \
-d "callbackURL=https://example.com/trello-webhook" \
-d "idModel=board:{board_id}"
The response contains a id (the webhook identifier) and a callbackURL you must make publicly reachable. For local development you need a tunneling service such as ngrok or a staging server exposed to the internet.
De‑duplicating events
Trello may resend the same action if a callback times out or if the network retries, so the same action.id can appear multiple times. To avoid duplicate side effects you can:
- Store the
action.idtogether with a timestamp in a durable store. - When a new payload arrives, check whether the ID is already present before processing.
- Alternatively, design your upsert logic so that re‑applying the same data does not change the outcome (e.g., “create or update” instead of “create”).
Both strategies make the handler idempotent, which is essential for reliability.
Operational limits and rate‑limit awareness
Every request your handler makes – whether to fetch the full card, write to a database, or call another API – counts against the token’s rate limits. Trello may retry failed callbacks, and repeated failures can cause the webhook to be disabled. To stay within limits:
- Respond with HTTP 200 quickly; offload heavy work to a background queue.
- Avoid combining webhooks with aggressive polling of the same resource.
- Monitor the token’s quota in the Trello dashboard and set alerts for approaching thresholds.
Because delivery is eventually consistent, plan for missed events by periodically back‑filling data from the board if needed.
Worked example: syncing a card move
Suppose you want to create a ticket in your issue tracker whenever a card is moved to the “Done” list. The relevant action type is updateCard with a data object that includes listBefore and listAfter. A minimal processing flow looks like this:
# 1. Receive POST on https://example.com/trello-webhook
# 2. Parse JSON payload
# 3. If payload['action']['type'] == 'updateCard' and payload['data']['listAfter']['id'] == 'listDoneId':
# 4. Extract cardId = payload['data']['card']['id']
# 5. Call your issue‑tracker API to create or update the ticket (store cardId for idempotency)
# 6. Return HTTP 200 immediately
In code you would verify the action.id against a table of processed IDs before step 5, ensuring that a retry does not create duplicate tickets.
Trade‑off and limitation
The main limitation is eventual consistency: Trello does not guarantee that every event reaches your endpoint, especially during high‑traffic periods or transient network issues. You may need a periodic back‑fill job that queries the board for cards that have changed since a known timestamp. Additionally, webhooks are bound to the token that created them; if the token expires or is revoked, the webhook stops working and must be recreated.
Actionable closing checklist
- Choose the smallest idModel that covers the events you need (board, list, or card).
- Expose a stable HTTPS endpoint; use a tunnel for development.
- Store the webhook
idand theaction.idfor idempotency. - Respond with 200 promptly and defer any long‑running processing.
- Monitor rate limits and set up alerts for token exhaustion.
- Plan a back‑fill strategy in case events are missed.
Following these steps lets you build a reliable, low‑latency integration between Trello and any external system while respecting Trello’s API constraints.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.