Skip to main content
Mintive is the new name for MintMCP.Read the announcement

Start a Coworker Agent from a webhook

Give another system a URL and a secret so it can start a Coworker Agent run with a signed HTTP request, and tell the agent what to do in that request.

Availability: Webhooks are enabled per organization. Contact Mintive to turn them on. They work on platform-managed agents only.

When to use this​

  • An alert from a monitoring tool should start a triage run.
  • A CI job or deploy pipeline should hand its results to an agent for a summary or a follow-up.
  • Your own script or internal tool needs to start an agent and say what to do, without anyone mentioning it in Slack.

How a webhook run works​

Each webhook belongs to one agent and has its own URL and secret. The sender signs every request with the secret using the Standard Webhooks scheme, so any system or library that speaks Standard Webhooks can send requests. When Mintive verifies the signature, it answers right away with 202 Accepted and starts a run, which shows up in the agent's run list with Webhook as its trigger.

The run gets three things:

WhatWhere it comes fromHow the agent sees it
Standing instructionsWritten on the webhook by an agent editorIn the run's prompt, for every request from this webhook
MessageThe top-level message field of a JSON request bodyAs the run's message, the way a Slack mention's text arrives
Request bodyThe whole body the sender postedAs a file, /tmp/config/webhook-request.json (JSON bodies) or /tmp/config/webhook-request.txt (anything else)

The agent is told to treat the request body as data from an external system, not as instructions, because it can carry text written by third parties. Only the standing instructions and the message say what to do.

Most SaaS tools (PagerDuty, Datadog, GitHub and others) sign their own webhooks with their own scheme, so pointing one straight at a Mintive webhook URL gets 401. Put a small relay in between, like a serverless function or a CI step, that receives the vendor's webhook and re-sends it signed, with a message that says what to do.

The sender doesn't get the agent's answer back in the HTTP response. Put where the results should go (a Slack channel, a ticket, a pull request) in the standing instructions or the message.

Prerequisites​

  • Webhooks enabled for your organization.
  • A platform-managed agent.
  • The agent's connectors that a webhook run needs set to use the agent's credential, because a webhook run has no calling user (see Agent identities).
  • Edit access to the agent and the Share agents permission (see Roles and permissions), because a webhook's secret lets someone outside Mintive start the agent.

Create a webhook​

  1. Open the agent and go to the Triggers tab.
  2. In the Webhooks section, click New webhook.
  3. Enter a Name. Name it after the system that sends requests, like PagerDuty incidents.
  4. Optionally, enter Standing instructions (up to 20,000 characters), which apply to every request before the request's own message. For example: Triage the incident and post a summary in #oncall.
  5. Click Create webhook.
New webhook dialog with a Name field set to PagerDuty incidents and a Standing instructions field
  1. Copy the URL and the Secret. The secret is shown only once. The URL alone can't start the agent, but keep it out of public places anyway, and store the secret like an API key.

An agent can have up to 10 webhooks, counting ones that are turned off. Click a webhook's row to open its drawer, where you can see its URL, standing instructions and latest request, and find code examples for Node, Python and a terminal.

Webhook drawer showing standing instructions, the webhook URL, a note that the previous secret still works, and the Send a test request button

Send a request​

Send a POST to the webhook's URL with these headers:

HeaderValue
webhook-idA unique ID for this delivery, up to 200 characters of letters, digits, _, : and - (no periods). Reuse the same ID when you retry a delivery
webhook-timestampThe current time in Unix seconds. It must be within 5 minutes of Mintive's clock
webhook-signaturev1, followed by the base64 HMAC-SHA256 of <webhook-id>.<webhook-timestamp>.<body>, keyed with the secret's bytes (the part after whsec_, base64-decoded)
content-typeapplication/json for a JSON body. Parameters such as ; charset=utf-8 are fine

The body can be up to 64 KB. To tell the agent what to do, send a JSON object with a message:

{
"message": "Summarize today's open incidents",
"incidents": [{ "id": "P1234", "service": "checkout-api", "status": "triggered" }]
}

The message can be up to 4,000 characters. A longer one is cut short with a note, and the full text stays in the request body file. Without a message, the run follows the standing instructions alone.

The Standard Webhooks libraries sign requests exactly the way Mintive verifies them.

Node:

// npm install standardwebhooks
import { randomUUID } from "node:crypto";
import { Webhook } from "standardwebhooks";

const webhook = new Webhook(process.env.MINTIVE_WEBHOOK_SECRET); // "whsec_..."
const url = "https://app.mintmcp.com/api/coworker-webhooks/cwhook_...";
const body = JSON.stringify({ message: "Summarize today's open incidents" });
const id = `msg_${randomUUID()}`;
const now = new Date();

const response = await fetch(url, {
method: "POST",
headers: {
"content-type": "application/json",
"webhook-id": id,
"webhook-timestamp": String(Math.floor(now.getTime() / 1000)),
"webhook-signature": webhook.sign(id, now, body),
},
body,
});
console.log(response.status, await response.json());

Python:

# pip install standardwebhooks requests
import json, os, uuid
from datetime import datetime, timezone
import requests
from standardwebhooks.webhooks import Webhook

webhook = Webhook(os.environ["MINTIVE_WEBHOOK_SECRET"]) # "whsec_..."
url = "https://app.mintmcp.com/api/coworker-webhooks/cwhook_..."
body = json.dumps({"message": "Summarize today's open incidents"})
msg_id = f"msg_{uuid.uuid4()}"
now = datetime.now(timezone.utc)

response = requests.post(
url,
headers={
"content-type": "application/json",
"webhook-id": msg_id,
"webhook-timestamp": str(int(now.timestamp())),
"webhook-signature": webhook.sign(msg_id, now, body),
},
data=body,
)
print(response.status_code, response.json())

Terminal (openssl and curl):

SECRET='whsec_...'
URL='https://app.mintmcp.com/api/coworker-webhooks/cwhook_...'
BODY='{"message": "Summarize the open incidents"}'
ID="msg_$(openssl rand -hex 12)"; TS="$(date +%s)"
KEY="$(printf '%s' "${SECRET#whsec_}" | base64 -d | od -An -v -tx1 | tr -d ' \n')"
SIG="$(printf '%s' "$ID.$TS.$BODY" | openssl dgst -sha256 -mac HMAC -macopt "hexkey:$KEY" -binary | base64)"
curl --fail-with-body -X POST "$URL" \
-H 'content-type: application/json' \
-H "webhook-id: $ID" -H "webhook-timestamp: $TS" \
-H "webhook-signature: v1,$SIG" \
-d "$BODY"

Copy the exact URL from the webhook's drawer, and allow outbound HTTPS from the sender to its host. The examples in the drawer fill it in for you, and right after you create a webhook or rotate its secret they fill in the secret too.

Responses​

StatusBodyMeaningWhat to do
202{"status": "accepted", "runId": "...", "deliveryId": "..."}The request started a runNothing. Find the run in the agent's run list
200{"status": "duplicate", "runId": "..."}A request with this webhook-id already started a run (in the last 30 days), so no new run startsNothing. This is the answer to a retry
401{"error": "Unauthorized"}The signature, timestamp or headers didn't check out, or the webhook is off, deleted or unknownSign with the current secret and the current time, and check the URL
409{"error": "agent_unavailable"}The agent can't run right now, for example because its setup is incompleteCheck the agent's setup, then retry
413{"error": "Payload Too Large"}The body is over 64 KBSend a smaller body, for example IDs the agent can look up instead of full records
429{"error": "rate_limited"}This webhook already started 5 runs in the last minuteRetry after the Retry-After header (60 seconds) with the same webhook-id, signed again with a fresh timestamp
503{"error": "Service Unavailable"}Mintive couldn't verify the secret or start the run just thenRetry after the Retry-After header with the same webhook-id, signed again with a fresh timestamp

Every authentication failure gets the same 401, so the response never tells a sender whether a webhook exists. Retry-After is always a whole number of seconds. For any other 5xx response or a timeout, retry with backoff using the same webhook-id: a delivery that already started a run gets 200 instead of starting a second one.

Test a webhook​

Send a test request from Mintive to check the agent's behavior before you wire up the real sender:

  1. Open the webhook's drawer from the Triggers tab.
  2. Click Send a test request.
  3. Edit the Message, then send it.
  4. Open the run from the agent's run list to see what the agent did with it.

A test request goes through the same checks, rate limit and run as a signed request, and the run names you as the person who started it. It starts a real run, so it uses the agent's tools and model budget. The webhook has to be on to send a test request.

Hand a webhook to another team​

Give the developer who wires up the sender:

  • The webhook's URL, and its secret through your secrets manager rather than chat or email.
  • The code example for their language, from the webhook's drawer or this page.
  • What the agent expects in message, and anything their payload should leave out.
  • Who to ask for a new secret, since only people with Share agents can rotate it.

Manage a webhook​

TaskHowWho can do it
Change the name or standing instructionsMore actions (⋯) → Edit name and instructions. Changes apply to requests from then onAgent editors
Pause a webhookTurn off its switch in the Webhooks table, or More actions → Turn off. Requests to it get 401Agent editors
Turn a webhook back onIts switch, or More actions → Turn onEditors with Share agents
Rotate the secretRotate secret in the drawer's Send a request sectionEditors with Share agents
Delete a webhookMore actions → Delete webhook. Requests to it get 401Agent editors

When you rotate a secret, choose what happens to the old one:

  • Keep the old secret working for 24 hours, for a routine rotation, so the sender keeps working while you update it. The drawer shows when the previous secret stops working.
  • Stop the old secret now, if the secret leaked. Requests signed with it are rejected right away.

The new secret is shown once, so copy it before you close the dialog.

Monitor requests​

The Webhooks table on the Triggers tab shows each webhook's latest request and its result:

Webhooks table listing three webhooks with their last request result and an on/off switch for each
ResultMeaning
Started a runThe request was accepted and started a run
Rate limitedThe webhook was over 5 runs a minute
RejectedThe agent couldn't run when the request arrived

Requests that fail authentication (401) or are too large (413) are turned away before they reach the webhook, so they don't appear in the table, the run list or the audit events. Debug them from the sender's side.

Fix a 401​

Every authentication failure gets the same 401, so work through these on the sender:

  1. The webhook is on. Its switch in the Webhooks table is on, and it hasn't been deleted.
  2. The URL matches the one in the webhook's drawer exactly.
  3. The secret is the current one. After a rotation with Stop the old secret now, or 24 hours after a routine rotation, the old secret stops working.
  4. The clock. webhook-timestamp is the current time in Unix seconds (not milliseconds), within 5 minutes of Mintive's clock.
  5. The signed bytes. The signature covers the exact body you send. Re-serializing the JSON after signing, or letting an HTTP client change it, breaks the signature, so sign the same string you post.
  6. The webhook-id has no periods and uses only letters, digits, _, : and -.

Then send a test request from the drawer: if that starts a run, the webhook and agent are fine and the problem is in the sender's signing.

Every webhook run appears in the agent's run list and in the agent's audit events, including your SIEM export, with Webhook as its trigger and the webhook and delivery IDs. Rejected and rate-limited requests are recorded as denied runs, at most once per webhook per minute.

Handle bursts​

Each webhook starts at most 5 runs a minute, and requests over the limit get 429 rather than waiting in a queue. If a sender can burst, like an alerting tool during an incident storm, have the relay batch events into one request (the agent gets all of them in the request body file), or retry each 429 after the Retry-After header with the same webhook-id. A sender with separate kinds of events can also use one webhook per kind, since the limit is per webhook.

Security​

  • Treat the secret like an API key. Anyone with it can start the agent and tell it what to do with the agent's tools, so keep it in a secrets manager and rotate it if it leaks.
  • Keep outside text out of message. The agent is told to treat the request body as data, but that's an instruction, not a filter, so put alert or ticket text in the body and give the agent only the tools the task needs.
  • Send IDs, not full records. Mintive keeps each request body for 30 days so the run can read it.
  • Share edit access carefully. Any agent editor can change a webhook's standing instructions.

For how Mintive checks requests, see Coworker Agent security.

Limits​

LimitValue
Webhooks per agent10
Runs per webhook5 a minute
Request body64 KB
message4,000 characters