v45

latestOpenAPI 3.0.0raw.githubusercontent.com2026-08-0114775543.6 KB
Agents

Get agent by ID

Returns the agent document merged with the resolved config of the active version under _resolvedConfig. Non-versioned fields (name, telephonyProductId, allowInboundCall, etc.) sit at the top level; versioned fields (prompt, tools, language, synthesizer, post-call analytics, …) are resolved from the target version and exposed under _resolvedConfig.

Previewing a draft or specific version

Pass ?draftId=<id> to resolve config from a specific draft instead of the active version. Pass ?versionId=<id> to resolve config from a specific published version. When either param is used, the response includes _configSource: "draft" | "version" | "active" indicating which config was resolved.

Notable resolved fields in _resolvedConfig:

  • prompt — active version's single-prompt text
  • tools — configured tools on the resolved version
  • postCallAnalyticsConfig — disposition metrics + analytics model flags
  • modelName — LLM model name on the resolved version
  • defaultLanguage, supportedLanguages — active language config
  • firstMessage, globalPrompt — active messaging config
  • workflowGraph — full node graph for workflow_graph agents

To read prompt + tools alone, use GET /agent/{id}/workflow (deprecated for new integrations but still live). To inspect a specific non-active version, use GET /agent/{id}/versions/{versionId}.

400 — also used for "not found": if the agent ID does not exist in the organization, the API returns 400 with errors: ["No agent found"] rather than 404.

get/agent/{id}

Path parameters

idstring required

Agent identifier (Mongo ObjectId string). Must be non-empty. An empty id would resolve to GET /agent/, which is the list endpoint — Fern adds the minLength: 1 guard so the generated SDK raises locally rather than silently calling the wrong route.

Query parameters

draftIdstring

Resolve _resolvedConfig from this draft instead of the active version. Sets _configSource to "draft" in the response.

versionIdstring

Resolve _resolvedConfig from this published version instead of the active version. Sets _configSource to "version" in the response.

Response

Successful response

statusboolean

Example response

{
  "status": true,
  "data": {
    "postCallAnalyticsConfig": {
      "dispositionMetrics": [
        {
          "identifier": "call_resolved",
          "dispositionMetricPrompt": "Was the customer issue resolved by the end of the call?",
          "dispositionMetricType": "STRING",
          "choices": [
            "resolved",
            "escalated",
            "callback_scheduled",
            "no_action"
          ]
        }
      ]
    },
    "_resolvedConfig": {
      "tools": [
        {
          "name": "end_call",
          "description": "End the conversation when the user is satisfied",
          "transferNumber": "+1234567890",
          "url": "https://api.example.com/orders",
          "method": "GET",
          "headers": {
            "Authorization": "Bearer TOKEN",
            "Content-Type": "application/json"
          },
          "headersArray": [
            {
              "key": "Authorization",
              "value": "Bearer TOKEN"
            }
          ],
          "queryParams": [
            {
              "key": "id",
              "value": "{{order_id}}"
            }
          ],
          "requestBody": "{\"customer_id\": \"{{customer_id}}\"}",
          "responseVariables": [
            {
              "variableName": "orderStatus",
              "jsonPath": "$.data.status"
            }
          ],
          "variablesExtractionSchema": [
            {
              "name": "customer_name",
              "description": "The customer's full name",
              "values": [
                "satisfied",
                "unsatisfied",
                "neutral"
              ]
            }
          ],
          "knowledgeBaseId": "60d0fe4f5311236168a109ca",
          "fillerPhrases": [
            "Let me check that for you",
            "One moment please"
          ]
        }
      ],
      "postCallAnalyticsConfig": {
        "dispositionMetrics": [
          {
            "identifier": "call_resolved",
            "dispositionMetricPrompt": "Was the customer issue resolved by the end of the call?",
            "dispositionMetricType": "STRING",
            "choices": [
              "resolved",
              "escalated",
              "callback_scheduled",
              "no_action"
            ]
          }
        ]
      }
    },
    "_versionedWorkflow": {
      "tools": [
        {
          "name": "end_call",
          "description": "End the conversation when the user is satisfied",
          "transferNumber": "+1234567890",
          "url": "https://api.example.com/orders",
          "method": "GET",
          "headers": {
            "Authorization": "Bearer TOKEN",
            "Content-Type": "application/json"
          },
          "headersArray": [
            {
              "key": "Authorization",
              "value": "Bearer TOKEN"
            }
          ],
          "queryParams": [
            {
              "key": "id",
              "value": "{{order_id}}"
            }
          ],
          "requestBody": "{\"customer_id\": \"{{customer_id}}\"}",
          "responseVariables": [
            {
              "variableName": "orderStatus",
              "jsonPath": "$.data.status"
            }
          ],
          "variablesExtractionSchema": [
            {
              "name": "customer_name",
              "description": "The customer's full name",
              "values": [
                "satisfied",
                "unsatisfied",
                "neutral"
              ]
            }
          ],
          "knowledgeBaseId": "60d0fe4f5311236168a109ca",
          "fillerPhrases": [
            "Let me check that for you",
            "One moment please"
          ]
        }
      ]
    }
  }
}