Skip to Content

Get an agent

Returns an agent with its draft, its current revision, and its newest published version number.

GET
/v1/agents/{id}

Returns an agent with its draft, its current revision, and its newest published version number.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

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

Response Body

Agent

application/json
  1. response
id*AgentId
Match^agt_[0-9a-hjkmnp-tv-z]{16,24}$
name*string
setupJob*|null
namespaceId*|null
revision*string
draft*
publishedVersion*|null
publishedAt*string|null
pausedAt*string|null
creditsPausedAt?string|null|null
monthlySpendCapDollars*number|null
spend*
createdAt*string
updatedAt*string
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.agents.get({
  "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"
}

Related documentation