Confirmation lifecycle
- Send a normal Murph chat request.
- If the response includes
pendingConfirmations(orpendingConfirmation), show the proposed action and an approve/cancel control for each entry. - POST each user decision to the confirmation decision endpoint.
- If the user confirms, the response is a normal Murph chat response for the turn that executed the approved write.
- If the user cancels, the response only records the cancelled confirmation.
Prefer
pendingConfirmations (plural). Murph can propose multiple gated
writes in a single turn (e.g. queue N delete_campaign calls). Older clients
that only read pendingConfirmation (singular) render just the first widget
and silently drop the rest. New clients should iterate pendingConfirmations
and render one approve/cancel control per entry; each entry has its own
confirmationUid and is decided independently.Chat response fields
POST /api/v2/murph/chat and POST /api/v2/murph/chat/stream can return
two related fields on a turn where one or more protected writes were
proposed but did not run:
pendingConfirmations(array, new) — every pending confirmation issued this turn, in tool-call order. Render one approve/cancel control per entry. Empty (or omitted) when nothing gated this turn. New callers should prefer this field.pendingConfirmation(object, retained) — the first entry frompendingConfirmations, ornull. Kept for back-compat with clients that render at most one confirmation per turn (Slack, older SDKs). A client that reads only this field will silently drop the remaining N-1 controls when Murph gates multiple writes in one turn.
| Field | Type | Notes |
|---|---|---|
confirmationUid | UUID | Pass this to the decision endpoint. Each pending confirmation gets its own UID; a multi-write turn yields N distinct UIDs. |
toolName | string | Internal Murph tool that requested the write. |
toolKey | string | Stable key for the gated action. |
summary | string | Human-readable action summary for the confirmation UI. |
policy | "always" or "tainted" | Why the confirmation gate applied. |
resolvedParams | object | Parameters the user is approving. |
writeExecuted | false | The write did not run on this turn. |
plainAffirmativeAccepted | false | The user must use the confirmation control. |
expiresAt | datetime | Confirmation expiry time. |
Confirm or cancel
POST /api/v2/murph/confirmations/{confirmationUid}/decision
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
decision | "confirm" or "cancel" | Yes | Confirms or cancels the pending write. |
Confirm response
Whendecision is confirm, the endpoint returns the same shape as a Murph
chat response. The approved write may appear in toolsUsed, and fields such as
escalated or customerSwitch reflect the write that actually ran.
Cancel response
Whendecision is cancel, no write runs and the response only records the
cancelled confirmation.
Errors
400 VALIDATION_ERROR- the path or request body is malformed.404 NOT_FOUND- the confirmation is unknown, expired, cancelled, or already used.403 FORBIDDEN- the confirmation belongs to another actor or account.503 SERVICE_UNAVAILABLE- Murph is not available to process a confirmed write.
Related
Ask Murph
Use Murph to operate and troubleshoot your storefront.
Authentication
Authenticate Murph API requests.