Speko Docs
API Reference

Agent draft

Stage agent changes without touching live calls, then ship them with deploy.

GET
/v1/agents/{id}/draft

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Response Body

application/json

application/json

application/json

{
  "agent_id": "string",
  "has_draft": true,
  "changed_fields": [
    "name"
  ],
  "config": {},
  "draft_version_number": 0,
  "live_version_number": 0,
  "stale": true,
  "updated_at": "2019-08-24T14:15:22Z",
  "updated_by_user_id": "string"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
{
  "error": "agent not found",
  "code": "NOT_FOUND"
}
PUT
/v1/agents/{id}/draft

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Request Body

application/json

The PATCH /v1/agents/{id} body. webhooks and outboundDtmf are rejected with 400; update them with PATCH. Only fields the draft snapshot carries are stored: name, systemPrompt, voice, voiceInstructions, firstMessage, inboundFirstMessage, outboundFirstMessage, timezone, intent, llmOptions, stackPreferences, sttOptions, ttsOptions, runMode, runtime, backgroundAudio, audioOutput, speechNormalization, idleRePrompts, sttMissRecovery, turnHandling, languageRouting. Other fields pass validation but are not saved.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

{
  "agent_id": "string",
  "has_draft": true,
  "changed_fields": [
    "name"
  ],
  "config": {},
  "draft_version_number": 0,
  "live_version_number": 0,
  "stale": true,
  "updated_at": "2019-08-24T14:15:22Z",
  "updated_by_user_id": "string"
}

{
  "error": "Request body is not valid JSON.",
  "code": "INVALID_JSON"
}

{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
{
  "error": "agent not found",
  "code": "NOT_FOUND"
}
DELETE
/v1/agents/{id}/draft

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Response Body

application/json

application/json

application/json

{
  "agent_id": "string",
  "has_draft": true,
  "changed_fields": [
    "name"
  ],
  "config": {},
  "draft_version_number": 0,
  "live_version_number": 0,
  "stale": true,
  "updated_at": "2019-08-24T14:15:22Z",
  "updated_by_user_id": "string"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
{
  "error": "agent not found",
  "code": "NOT_FOUND"
}