Skip to main content
PATCH
/
v1
/
agents
/
{agentId}
Update agent
curl --request PATCH \
  --url https://api.ledger.so/v1/agents/{agentId} \
  --header 'Api-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "status": "active",
  "spendingLimit": 123,
  "spendingLimitFrequency": "perTransaction",
  "onLimitExceeded": "suspend",
  "metadata": {}
}
'
{
  "id": "<string>",
  "userId": "<string>",
  "name": "<string>",
  "status": "active",
  "createdAt": 123,
  "description": "<string>",
  "spendingLimit": 123,
  "spendingLimitFrequency": "perTransaction",
  "currentSpend": 123,
  "onLimitExceeded": "suspend",
  "maxCards": 123,
  "cardCount": 123,
  "metadata": {}
}

Authorizations

Api-Key
string
header
required

API key for authentication. Get your key from the Dashboard.

Path Parameters

agentId
string
required

The agent ID

Body

application/json
name
string
description
string
status
enum<string>
Available options:
active,
suspended
spendingLimit
integer
spendingLimitFrequency
enum<string>
Available options:
perTransaction,
per24HourPeriod,
perWeek,
perMonth,
perYear,
allTime
onLimitExceeded
enum<string>
Available options:
suspend,
notify,
none
metadata
object

Response

Agent updated

id
string
required
userId
string
required
name
string
required
status
enum<string>
required
Available options:
active,
suspended
createdAt
integer
required
description
string
spendingLimit
integer
spendingLimitFrequency
enum<string>
Available options:
perTransaction,
per24HourPeriod,
perWeek,
perMonth,
perYear,
allTime
currentSpend
integer

Current spend in the period

onLimitExceeded
enum<string>
Available options:
suspend,
notify,
none
maxCards
integer
cardCount
integer
metadata
object