Skip to main content
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.
Every money movement an agent asks for is an 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

  1. 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.
  2. 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).
  3. For a waiting request, Grid sends AGENT_ACTION.PENDING_APPROVAL to your webhook endpoint with the full AgentAction, so you can render the request without a second API call.
  4. You notify the customer and show the request in a surface they trust.
  5. Your backend calls POST /agents/{agentId}/actions/{actionId}/approve or .../reject with platform credentials.
  6. Grid re-checks the request against the current policy and executes it. The action ends APPROVED, REJECTED or FAILED.
  7. 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)?
Values the agent supplies, such as a purchase card’s 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 updated AgentAction. The agentId and actionId are in the webhook payload.
Only a 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.
Grid cannot see the customer when you call approve. Confirm the decision with them in your app first, with a fresh step-up such as a passkey or an emailed code, especially for stored card uses and anything above your own risk thresholds.

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 ends FAILED 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_QUOTE action without priceTolerance expires with its quote. Quotes are short-lived, so notify the customer immediately.
  • An EXECUTE_QUOTE action with priceTolerance, and every ISSUE_PURCHASE_CARD, USE_STORED_CARD, CLAIMABLE_PAYOUT, PAYOUT_RUN, CREATE_SETTLEMENT_RULE and UPDATE_SETTLEMENT_RULE action, 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, an EXECUTE_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 priceTolerance allows (the larger of basisPoints of the amount shown and minimumAmount), Grid sends it and the action is APPROVED with the new quote.
  • If the price moved against the customer by more, nothing is sent. Approve returns 200 with the action still PENDING_APPROVAL, the new quote, and previousQuote set to the quote the customer saw. Show both and ask again; approving again repeats the check. A better price never asks again.
Tell the customer about the tolerance when you ask them, using the numbers in 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} with isPaused: true. A paused agent cannot initiate any action; its pending actions fail with AGENT_INACTIVE if approved. Resume with isPaused: 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_APPROVAL and send the customer a push notification at once.
  • Build an in-app approval queue from GET /agents/approvals for customers who miss the notification.
  • Make approve and reject safe to retry: a duplicate tap should land on “already handled”, not an error.
  • Show REJECTED and FAILED differently. They mean different things to the customer.
  • Keep agent activity next to the account and transaction views the customer already uses.