UTR / INTEGRATE · DOCS

Integrate with Uptrig

Uptrig is driven by the system that already runs your business. That system sends an event, and Uptrig runs a workflow whose steps call your SMS, WhatsApp, email, Slack, courier and payment services — with retries and a record of every attempt. There are three ways in, and they compose.

  • A trigger URL — POST /t/{key}, one unguessable address per workflow. The system that runs the business posts events to it.
  • The REST API — /api/*, an account key in Authorization: Bearer. Build workflows, book parcels, start payments, read runs.
  • MCP — /mcp, streamable HTTP, the same key. The same operations as tools for an AI agent.

1. Get a key

Uptrig is invite-only while we onboard our first businesses, so start by writing to hello@uptrig.com. Inside the dashboard, Settings → API keys mints a key; it is shown once and stored hashed, so write it down. Send it on every API and MCP call:

Authorization: Bearer upt_9f3c…

2. Send an event

Add a trigger to a workflow and give its URL to the system that runs the business. A delivery is a JSON body; the workflow decides what that body means.

curl -X POST https://uptrig.com/t/k_9f2c… \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: order-A-1042' \
  -d '{"order":{"id":"A-1042","total":2450},
       "customer":{"name":"Sita","phone":"9800000001"}}'
  • The body must be JSON.
  • Idempotency-Key, or a field you nominate, de-duplicates: a repeat starts no second run.
  • A workflow can require X-Hub-Signature-256, an HMAC-SHA256 of the raw body signed with a secret you set.
  • Credentials and signature headers are never stored, so a message template can never read one.

3. Or start a run yourself

When your system can call out directly, fire a workflow by name instead of waiting for an event. You supply data; the workflow keeps the wording, the channel and the recipient.

curl -X POST https://uptrig.com/api/workflows/by-name/order-confirmation/runs \
  -H 'Authorization: Bearer upt_9f3c…' \
  -H 'Content-Type: application/json' \
  -d '{"body":{"order":{"id":"A-1042"}},
       "idempotency_key":"order-A-1042"}'

# 202 {"event_id":"…","run_id":"…","duplicate":false}
# 200 {…,"duplicate":true}   when the key matched an earlier call

4. Read what happened

  • GET /api/runs?workflow_id=&status=&limit= — runs, newest first.
  • GET /api/runs/{id} — the run and every step attempt: what was sent, to whom, the provider's answer, the duration.
  • POST /api/runs/{id}/retry — resume a failed run at the step that failed; earlier steps are not repeated, so no message is sent twice.
  • POST /api/runs/{id}/replay — a new run of the same event, from the first step. Steps that already succeeded happen again, which is why the dashboard asks twice.

5. Agents (MCP)

An MCP server runs at /mcp (streamable HTTP, stateless), authenticated with the same key. Nine tools: list_workflows, get_workflow, preview_workflow, fire_workflow, list_runs, get_run, get_event, replay_run, retry_run. Read tools are marked read-only so a host can gate the rest; calls are rate limited per account and logged. An agent fires workflows — it does not compose them, so your wording and channels stay under your own control.

6. Payments and parcels

  • POST /api/payments starts an eSewa or Khalti payment and returns a link and, for wallets, a QR. Uptrig verifies the gateway's callback and settles each payment exactly once. A settled payment fires the account's payment trigger, which is how a cleared payment starts the next workflow.
  • POST /api/shipments books a Pathao parcel from the order; its reply carries the tracking link for a following message. Booking is idempotent, so a retry never double-books.

7. Errors and limits

Every call answers with {"error":"…"}, and the message is safe to show a user. A missing or malformed field is 400; a wrong key 401; something not found for your account 404; a duplicate name, an inactive workflow or an already-settled payment 409; a throttle 429 with Retry-After. Bodies are capped at 1 MiB and unknown JSON fields are rejected, so a typo fails loudly instead of being ignored.

Uptrig is invite-only today; write to us and we will set you up.