Update an agent
Renames an agent or sets its monthly spend cap. Both take effect at once, without publishing.
PATCH
Renames an agent or sets its monthly spend cap. Both take effect at once, without publishing. At the cap the agent pauses and its conversations wait for your team until the month turns (UTC) or the cap is raised or removed.
apiKeyheader
x-api-key<token>id*stringMatch
^agt_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
name?|nullmonthlySpendCapDollars?||The most the agent may spend in a calendar month (UTC), in dollars and whole cents. Null removes the cap. Takes effect at once, without publishing.
Agent
application/json- response
id*AgentIdMatch
^agt_[0-9a-hjkmnp-tv-z]{16,24}$name*stringsetupJob*|nullnamespaceId*|nullrevision*stringdraft*publishedVersion*|nullpublishedAt*string|nullpausedAt*string|nullcreditsPausedAt?string|null|nullmonthlySpendCapDollars*number|nullspend*createdAt*stringupdatedAt*stringimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.agents.update({
"id": "example"
});Example Response
{
"id": "string",
"name": "string",
"setupJob": "support",
"namespaceId": "string",
"revision": "string",
"draft": {
"instructions": "string",
"knowledge": "string",
"knowledgeSourceIds": [
"string"
],
"endpointIds": [
"string"
],
"integrations": [
{
"integrationId": "string",
"tools": {
"kind": "all"
}
}
],
"policy": {
"presets": [
"string"
],
"rules": [
{
"match": {
"kind": "send",
"effect": "read",
"channel": "sms",
"integration": "string",
"tool": "string",
"subject": "agent"
},
"note": "string",
"decide": "run",
"atLeast": null
}
],
"instructions": "string"
},
"model": "standard",
"reasoning": "auto",
"workingHours": {
"timeZone": "string",
"ranges": [
{
"day": "monday",
"opens": "string",
"closes": "string"
}
]
},
"takeoverTimeoutMinutes": 1
},
"publishedVersion": -9007199254740991,
"publishedAt": "string",
"pausedAt": "string",
"creditsPausedAt": "string",
"monthlySpendCapDollars": 0,
"spend": {
"month": "string",
"spentDollars": 0,
"capReachedAt": "string"
},
"createdAt": "string",
"updatedAt": "string"
}