Agents

Publish an agent (Preview)

Preview · Available to selected organizations. Publishes the draft as the next immutable version.

POST
/v1/agents/{id}/publish

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.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^agt_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json
  1. body
revision*string
Length1 <= length

Response Body

PublishAgentResponse

application/json
  1. response
agent*
version*
published*boolean
Example Request
import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.agents.publish({  "id": "example",  "revision": "example"});
Example Response
{  "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