Skip to main content
Reference

Start runs from a webhook

Trigger an agent from another system with any JSON body, check each call with an API key or a signature, and retry deliveries without duplicate runs.

Last updated 10 days ago

Use an inbound webhook to start a run from an event in another system, for example a new signup in PostHog or a pull request on GitHub. The endpoint returns the run ID after creation; it doesn't wait for the result.

Before you start

  • Test the agent with a manual run.
  • You must be the app's owner to turn the webhook on or change how it checks calls. Other members see its settings read-only.

Turn on the webhook

Each agent has one webhook. It is off until the owner turns it on.

  1. Open the agent and select the Settings tab.
  2. Under Triggers → Webhook, turn on On.
  3. Copy the URL.

The URL has the form https://<server>/api/webhooks/trigger/<agentId>/<token>. Treat it as a secret. Turning the webhook off stops the URL. Turning it on again makes a new URL, so a URL that leaked stops working.

Choose how calls are checked

Select an option under Authentication and select Save.

OptionUse it whenEach call must send
API keyYou write the calling codeAuthorization: Bearer <organization API key>
No keyThe sender can't add a key or a signatureNothing; the URL alone starts a run
HMACThe sender signs each body with a shared secret (GitHub, Shopify, and many others)The signature in the header you name
Standard WebhooksThe sender follows Standard Webhooks or uses Svixwebhook-id, webhook-timestamp and webhook-signature headers

Get an organization API key from workspace Settings → API keys, with an organization admin's help if needed.

For HMAC, enter the sender's settings from its documentation:

FieldMeaningExample (GitHub)
Signature headerThe header that holds the signatureX-Hub-Signature-256
EncodingHex or Base64Hex
PrefixText before the signature, if anysha256=
Signing secretThe secret you set at the sender

The signature must be the HMAC-SHA256 of the raw request body. For Standard Webhooks, paste the signing secret, which starts with whsec_. A call more than 5 minutes old is refused.

Pump Up never shows a saved secret again. Paste it each time you save these settings.

Send JSON

Send any JSON object. The whole body becomes the run's input data, exactly as sent. The run's name is the agent's name and the time.

curl --request POST "$PUMPUP_WEBHOOK_URL" \  --header "Authorization: Bearer $PUMPUP_API_KEY" \  --header "Content-Type: application/json" \  --header "Idempotency-Key: signup-4821" \  --data '{"event": "user_signed_up", "person": {"email": "ana@example.com", "plan": "trial"}}'

A successful request returns 201 Created:

{"id": "0123456789abcdef01234567"}

The id identifies the run. Follow it in Pump Up.

The body must be a JSON object. An array, a plain value, or a form-encoded body is refused. The webhook doesn't accept files.

The agent reads the input data as it is. Tell the agent in its instructions which fields matter, for example "The new user's email is at person.email".

Avoid duplicate runs

A sender may deliver one event more than once. Pump Up starts one run per event id, and a repeated id returns the existing run with the same 201 response. It does not update that run's input.

OptionEvent id
API keyThe Idempotency-Key header, if sent
No key, HMACThe Event id header you name, if any, for example X-GitHub-Delivery
Standard WebhooksAlways the webhook-id header

Without an event id, each delivery starts a new run. Two concurrent requests with the same id can produce a 409; retry with the same id to retrieve the existing run.

Handle errors

HTTP statusCheck or action
400Check that the body is a JSON object
401Check the API key, the signature settings and the secret, or the sender's clock for Standard Webhooks
402Resolve the credit or payment issue before starting more work
404Check the URL; the webhook may be off, or turned on again with a new URL
409Retry a concurrent delivery with the same event id
429More than 120 calls in an hour; slow delivery and retry later
5xxRetry after a delay with the same event id

Use the app to inspect runs and answer requests. A general public REST API and SDK aren't available.

Was this helpful?

Still need help? Ask the team