Skip to content

confirm_agent_spend

Approve or decline the spend a Layer agent's turn waits on, as get_agent_response gives it in
`pending_spend`. The answer is recorded as the user's own, as if they answered the card in the
Layer app, and the turn carries on: wait for it with get_agent_response.

Spending the workspace's Creative Units is the user's decision: show them the cost and approve only
when they say so, never on their behalf.

Parameters

ParameterTypeDefaultDescription
session_idrequiredstring (uuid)—The session the turn belongs to.
confirmation_idrequiredstring1–∞ chars—The `confirmation_id` of the turn's `pending_spend`.
approvedrequiredboolean—true runs the spend; false declines it and the agent stops short of it.
reasonstring0–1000 chars—Why the user declined, passed to the agent.