Speko Docs
API Reference

Update agent

Partial update — every field on the body is optional and only supplied keys are written.

PATCH
/v1/agents/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Agent id, prefixed agent_.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

{
  "id": "agent_01HW...",
  "organizationId": "string",
  "name": "string",
  "systemPrompt": "string",
  "voice": "string",
  "intent": {
    "language": "en-US",
    "optimizeFor": "latency"
  },
  "llmOptions": {
    "temperature": 0,
    "maxTokens": 1,
    "model": "string"
  },
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "stackPreferences": {
    "allowedProviders": {
      "stt": [
        "deepgram"
      ],
      "llm": [
        "openai"
      ],
      "tts": [
        "elevenlabs"
      ],
      "s2s": [
        "openai:gpt-realtime-2.1"
      ]
    }
  },
  "turnHandling": {
    "profile": "conversational",
    "endpointing": {
      "minDelay": 0,
      "maxDelay": 0
    },
    "interruption": {
      "mode": "adaptive",
      "minDuration": 0,
      "minWords": 0
    },
    "turnDetection": true,
    "contextThreshold": true,
    "heardBy": "content",
    "dtmfToolDescription": "string",
    "amdPrompt": "string",
    "waitForCallee": true,
    "recordCallerKeypad": false,
    "onMachine": "hangup",
    "onHuman": "hangup",
    "voicemailMessage": "string",
    "voicemailSoundId": "string",
    "holdTimeoutSeconds": 60,
    "keypadAllowedKeys": [
      "0"
    ],
    "machineBudgetSeconds": 120,
    "vad": {
      "provider": "silero"
    },
    "noiseCancellation": {
      "enabled": true,
      "model": "quail"
    },
    "keypad": true,
    "textGate": true,
    "turnDetector": "smart_turn"
  },
  "maxDurationSeconds": 0,
  "idleRePrompts": {
    "enabled": true,
    "delayMs": 1000,
    "maxPrompts": 1,
    "messages": [
      "string"
    ],
    "initialDelayMs": 1000,
    "hangupOnExhausted": true
  },
  "languageRouting": {
    "enabled": true,
    "maxDetectionTurns": 1,
    "languages": [
      {
        "language": "string",
        "allowedProviders": {
          "stt": [
            "string"
          ],
          "llm": [
            "string"
          ],
          "tts": [
            "string"
          ]
        },
        "voice": "string",
        "systemPrompt": "string",
        "firstMessage": "string",
        "inboundFirstMessage": "string",
        "outboundFirstMessage": "string",
        "voicemailMessage": "string"
      }
    ],
    "continuous": true,
    "switchTurns": 1
  }
}
{
  "error": "Invalid request",
  "code": "VALIDATION_ERROR",
  "issues": [
    {
      "path": "to",
      "message": "Required"
    }
  ],
  "retryable": false,
  "docs_url": "https://docs.speko.dev/errors/validation_error"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
{
  "error": "not found",
  "code": "NOT_FOUND"
}