GROK BOT / trigger-a-grok-bot-routine-with-a-webhook

Grok Bot

Trigger a Grok Bot routine with a webhook

Start a Grok Bot routine from your own system by POSTing to the routine’s webhook URL with the bearer key the panel shows after save. Official Routines documents three fields on a saved webhook trigger: POST to, key, and header (the full Authorization: Bearer … line). A response of 200 means Grok Bot accepted the call and started a run; check Run history or the conversation for whether the instruction finished.

What you need

Desktop Grok Bot (credential copy, testing, and schedule edits stay on desktop), a Bot that can own the routine, and a caller that can send HTTPS POST with an Authorization header. Build the instruction first with Save a Grok Bot skill and schedule a routine. If the panel hides POST URL and key on a server-stored routine, see When a desktop webhook routine hides credentials.

Add the webhook and fire a test

  1. Open the Bot, choose View conversation details, then open Routines.
  2. Create or open the routine that should wake from your system.
  3. Open When to run and add a webhook.
  4. Save the routine (POST to and key become available after save), leave it Active, then open it again.
  5. Copy POST to, key, and header. Click a field to copy it.
  6. Send an HTTP POST to that URL with the Authorization header. You can include a JSON body; the Bot receives that body with the routine instruction.
curl -s -X POST "$POST_TO_URL" \
  -H "Authorization: Bearer $WEBHOOK_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ticket":"INC-1234","summary":"Disk near full on db-2"}'
  1. Expect HTTP 200 when Grok Bot accepted the call and started a run. Any other response means a run did not start — confirm the routine is saved and Active, and that the request uses the current key.
  2. Open Run history or the conversation for the result. Right-click a run and choose Copy request ID when you need an ID for support. Saving alone does not create a run; a run appears after a schedule hit, Slack match, webhook 200, or Test run (which does real work).

After the first 200

Keep the key out of public repos and chat logs. After any key change, copy the current header from the panel again. Pair webhooks with narrow instructions and approval gates for send, purchase, delete, and production changes. For Slack-keyword wakes, see Set a Slack listener on a Grok Bot routine. Pause or delete from the Routines panel when the caller should stop; deleting a routine is immediate with no undo.

Pitfalls

POSTing before the routine is saved, or without the current key, never starts a run and leaves history empty. Treating 200 as “job finished” skips checking Run history for failures mid-instruction. Leaving Active off keeps the webhook URL while nothing fires. Expecting phone editing of webhook credentials fails — pause or resume can happen on phone, while credential copy and schedule edits stay on desktop.