Create an agent (Preview)
Preview · Available to selected organizations. Creates an agent with a draft and returns it with status 201.
Creates an agent with a draft and returns it with status 201. The agent answers nothing until its draft is published. A new agent starts in supervised mode, so each reply waits for a person to approve it. The namespace is set at creation and cannot change.
apiKeyx-api-key<token>application/json- body
name*AgentName^\S[\s\S]*\S$|^\S$|^$1 <= length <= 120namespaceId?|The namespace the agent belongs to; it cannot move later. Omit for an organization-level agent. A namespace-scoped key always creates in its own namespace.
definition?|The first draft. Defaults to an agent with no instructions, knowledge, or endpoints, in supervised mode on the standard model at auto reasoning.
{ "instructions": "", "knowledge": "", "knowledgeSourceIds": [], "endpointIds": [], "integrations": [], "mode": "supervised", "model": "standard", "reasoning": "auto", "workingHours": null, "takeoverTimeoutMinutes": 30}Agent
application/json- response
id*AgentId^agt_[0-9a-hjkmnp-tv-z]{16,24}$name*stringnamespaceId*|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.create({ "name": "example"});{ "id": "string", "name": "string", "namespaceId": "string", "revision": "string", "draft": { "instructions": "string", "knowledge": "string", "knowledgeSourceIds": [ "string" ], "endpointIds": [ "string" ], "integrations": [ { "integrationId": "string", "tools": { "kind": "all" }, "requireApproval": [ "string" ] } ], "mode": "live", "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"}Related documentation
Continue an agent on Standard (Preview)
Preview · Available to selected organizations. Publishes the live version again with its model set to standard, as the next immutable version, then removes the monthly spend cap.
Get an agent (Preview)
Preview · Available to selected organizations. Returns an agent with its draft, its current revision, and its newest published version number.