Change a voice agent

Changes the fields you name and answers with the agent as stored, the same shape GET returns.

A key left out is left alone. A key sent as null clears an optional field (websocket_url makes the agent dial in, greeting and fallback go, speech, audio, tools, limits and transcripts return to their defaults). A key sent with a value replaces that field whole: send the whole limits object, not one of its keys. Changing session_type drops speech, audio and greeting unless the body sends them, since the other type cannot carry them. The result is checked like a new agent, and a body that changes nothing is 400.

With sandbox: true nothing is written: the request is validated against the stored agent and the agent is reported with 200 as it would read after the change.

PATCH
/v3/voice/agents/{id}

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X PATCH "https://example.com/v3/voice/agents/string" \  -H "Idempotency-Key: req_abc123_retry1" \  -H "Content-Type: application/json" \  -d '{}'
{
  "success": true,
  "data": {
    "id": "string",
    "name": "string",
    "session_type": "string",
    "websocket_url": "string",
    "speech": {
      "setting": "string",
      "voice": "string",
      "language": "string"
    },
    "audio": {
      "sample_rate": 0
    },
    "greeting": "string",
    "tools": [
      "string"
    ],
    "transfer_targets": [
      {
        "kind": "string",
        "value": "string"
      }
    ],
    "fallback": {
      "kind": "string",
      "value": "string"
    },
    "limits": {
      "max_call_seconds": 0,
      "max_concurrent_calls": 0,
      "allowed_countries": [
        "string"
      ]
    },
    "transcripts": {
      "store": true,
      "retention_days": 0
    },
    "signing_secret": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  },
  "error": {
    "code": "string",
    "message": "string",
    "details": {
      "property1": [
        "string"
      ],
      "property2": [
        "string"
      ]
    },
    "doc_url": "string"
  },
  "meta": {
    "request_id": "string",
    "timestamp": "2019-08-24T14:15:22Z",
    "version": "string"
  }
}
{
  "success": true,
  "error": {
    "code": "string",
    "message": "string",
    "details": {
      "property1": [
        "string"
      ],
      "property2": [
        "string"
      ]
    },
    "doc_url": "string"
  },
  "meta": {
    "request_id": "string",
    "timestamp": "2019-08-24T14:15:22Z",
    "version": "string"
  }
}
Empty
Empty
{
  "success": true,
  "error": {
    "code": "string",
    "message": "string",
    "details": {
      "property1": [
        "string"
      ],
      "property2": [
        "string"
      ]
    },
    "doc_url": "string"
  },
  "meta": {
    "request_id": "string",
    "timestamp": "2019-08-24T14:15:22Z",
    "version": "string"
  }
}