Publish an agent (Preview)
Preview · Available to selected organizations. Publishes the draft as the next immutable version.
Publishes the draft as the next immutable version. Each conversation moves to it from its next agent reply; a reply already running finishes on the version it started on. The request names the revision it read; a stale revision returns 409. Publishing a draft identical to the newest version changes nothing and answers published false. An endpoint answers for one agent at a time: publishing a draft whose endpoint another agent answers on returns 409. In supervised mode each reply waits for a person to approve it.
apiKeyx-api-key<token>id*string^agt_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
revision*string1 <= lengthPublishAgentResponse
application/json- response
agent*version*published*booleanimport { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.agents.publish({ "id": "example", "revision": "example"});{ "agent": { "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" }, "version": { "agentId": "string", "version": -9007199254740991, "definition": { "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 }, "publishedAt": "string", "modelFallback": { "from": "string", "to": "standard", "reason": "candidate", "since": "string" } }, "published": true}Related documentation
List published agent versions (Preview)
Preview · Available to selected organizations. Returns an agent's published versions, newest first, without their definitions. Pass nextCursor back as cursor for the next page.
Delete an agent (Preview)
Preview · Available to selected organizations. Deletes an agent with its draft and published versions.