Skip to main content
POST
Create an agent

Authorizations

Authorization
string
header
required

API token authentication using format <api token id>:<api client secret>

Headers

Idempotency-Key
string

A unique identifier for the request. A retry with the same key returns the agent the first request created rather than creating a second one.

Maximum string length: 255
Example:

"550e8400-e29b-41d4-a716-446655440000"

Body

application/json
name
string
required

Human-readable name to identify the agent.

Example:

"Payroll Automation Agent"

customerId
string
required

The ID of the customer this agent will operate on behalf of.

Example:

"Customer:019542f5-b3e7-1d02-0000-000000000001"

policy
object
required

Policy governing what an agent can do, how it executes actions, and its spending boundaries.

actingFor
string

The platform's own reference for the person this agent acts for, such as a member id within a business. Grid stores it as given, never interprets it, and copies it onto every card the agent is issued, for audit and screening. Required when the customer is a BUSINESS, where agents are available only where the platform enables them for business customers; optional for an INDIVIDUAL. It cannot be changed after the agent is created.

Required string length: 1 - 255
Example:

"member_8f2c1a"

spendingPoolId
string

A spending pool of the same customer to put the agent in, where the platform enables spending pools. The agent's policy must be in the pool's currency.

Example:

"SpendingPool:019542f5-b3e7-1d02-0000-000000000007"

Response

The Idempotency-Key was already used for this request: the agent the first request created, with a new device code

Response returned when an agent is created, including the agent and a device code for installation.

agent
object
required

A programmatic agent with scoped permissions and a spending policy, used to automate payment workflows.

deviceCode
object
required