The Agents API must be enabled for your platform; until it is, agent endpoints answer
403. To enable it, book a demo or reach out to your Lightspark contact.AgentAction. Grid creates it, decides whether it can run on its own, and when it can’t, holds it in PENDING_APPROVAL until your platform sends the customer’s decision. Grid owns the approval state and the execution; your product owns how the request reaches the customer.
Approval lifecycle
- The agent submits a request: executing a quote, issuing a purchase card, using a stored card, sending a claimable payout, starting a payout run, or proposing a settlement rule.
- Grid checks the agent’s policy and spending pool. A request they forbid is refused outright. One they allow either runs at once (
APPROVED) or waits (PENDING_APPROVAL). - For a waiting request, Grid sends
AGENT_ACTION.PENDING_APPROVALto your webhook endpoint with the fullAgentAction, so you can render the request without a second API call. - You notify the customer and show the request in a surface they trust.
- Your backend calls
POST /agents/{agentId}/actions/{actionId}/approveor.../rejectwith platform credentials. - Grid re-checks the request against the current policy and executes it. The action ends
APPROVED,REJECTEDorFAILED. - The agent learns the outcome by polling
GET /agents/me/actions/{actionId}.
Action types
Approving a settlement rule does not approve its payments in advance: each share is still checked against the agent’s policy when it is sent.
What to show the customer
The approval UI should answer, at a glance:- Which agent is asking, and for what (
type)? - How much, in which currencies, and from which account?
- To whom or where? For a purchase card or stored card use, the merchant and the agent’s description of the purchase.
- Why does it need approval, and until when (
expiresAt)?
description or a stored card use’s merchant and purpose, are not verified by Grid. Present them as the agent’s words.
A pending send
A pending purchase card
Approving and rejecting
Both calls use your platform credentials and return the updatedAgentAction. The agentId and actionId are in the webhook payload.
PENDING_APPROVAL action can be decided; deciding one that is already decided returns 409. Treat a 409 on a retry as “already handled” and read the action’s current state.
Approving a stored card use
USE_STORED_CARD is the only type that takes a body on approve:
Sending either field on any other action type is refused with
400. See Cards.
When approval doesn’t execute
Grid checks the action again when you approve it, against the account and policy as they are then. Between the request and the decision the agent may have been paused, the limits lowered, the daily spend used up, or the quote expired. In those cases the action endsFAILED with a failureReason:
PRICE_MOVED is reserved and legacy; quotes to stablecoin addresses pay at a locked rate and no longer fail with it.
Expiry
expiresAt on the action is when it stops waiting:
- An
EXECUTE_QUOTEaction withoutpriceToleranceexpires with its quote. Quotes are short-lived, so notify the customer immediately. - An
EXECUTE_QUOTEaction withpriceTolerance, and everyISSUE_PURCHASE_CARD,USE_STORED_CARD,CLAIMABLE_PAYOUT,PAYOUT_RUN,CREATE_SETTLEMENT_RULEandUPDATE_SETTLEMENT_RULEaction, waits until the end of its own approval window. A payout run’s window is 24 hours and a settlement rule’s seven days.
Re-quoted sends
Where Grid has enabled it for your platform, anEXECUTE_QUOTE action carries priceTolerance and keeps waiting after its quote expires:
- Approved while the quote is live, it sends that quote as shown.
- Approved after the quote expired, Grid quotes the send again and runs every check against the new quote. If the new price is no worse for the customer than
priceToleranceallows (the larger ofbasisPointsof the amount shown andminimumAmount), Grid sends it and the action isAPPROVEDwith the newquote. - If the price moved against the customer by more, nothing is sent. Approve returns
200with the action stillPENDING_APPROVAL, the newquote, andpreviousQuoteset to the quote the customer saw. Show both and ask again; approving again repeats the check. A better price never asks again.
priceTolerance.
History and audit
rejectionReason is set only on REJECTED actions and failureReason only on FAILED ones, so the customer can always tell a decline from a failure.
Grid also records an audit entry with the agent as the actor each time an agent reveals a purchase card or a stored card, or adds a card to a digital wallet.
Pause, revoke and delete
Customers need immediate control over delegated access. Offer at least:- Pause:
PATCH /agents/{agentId}withisPaused: true. A paused agent cannot initiate any action; its pending actions fail withAGENT_INACTIVEif approved. Resume withisPaused: false. - Revoke signing:
DELETE /auth/delegated-keys/{id}stops Grid signing the agent’s sends from that wallet. - Delete:
DELETE /agents/{agentId}. Connected agent software loses access immediately.
Integration guidance
- Subscribe to
AGENT_ACTION.PENDING_APPROVALand send the customer a push notification at once. - Build an in-app approval queue from
GET /agents/approvalsfor customers who miss the notification. - Make approve and reject safe to retry: a duplicate tap should land on “already handled”, not an error.
- Show
REJECTEDandFAILEDdifferently. They mean different things to the customer. - Keep agent activity next to the account and transaction views the customer already uses.