Speko Docs
API Reference

Agent versions

List an agent's versions, deploy the draft as the new live version, and roll back to an earlier one.

GET
/v1/agents/{id}/versions

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Response Body

application/json

application/json

application/json

[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "organization_id": "string",
    "agent_id": "string",
    "version_number": 1,
    "status": "draft",
    "session_config": {},
    "briefing_markdown": "string",
    "briefing_md": "string",
    "source": "string",
    "created_by_user_id": "string",
    "created_at": "2019-08-24T14:15:22Z"
  }
]
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
{
  "error": "not found",
  "code": "NOT_FOUND"
}
POST
/v1/agents/{id}/deploy

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Request Body

application/json

Optional. A missing or unparseable body is treated as {}.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "organization_id": "string",
  "agent_id": "string",
  "version_number": 1,
  "status": "draft",
  "session_config": {},
  "briefing_markdown": "string",
  "briefing_md": "string",
  "source": "string",
  "created_by_user_id": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "published_draft": true
}

{
  "error": "Invalid request",
  "code": "VALIDATION_ERROR"
}

{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
{
  "error": "not found",
  "code": "NOT_FOUND"
}

{
  "error": "This agent's current live version failed the pre-prod reliability gate. Fix the flagged issues, or redeploy with override=true to ship anyway.",
  "code": "GATE_BLOCKED"
}

{
  "error": "Voice 'aBcDeFgHiJkLmNoPqRsT' is not available to hosted agents: it is not in Speko's ElevenLabs account. Use a voice from the voice picker or a Speko voice clone.",
  "code": "VOICE_NOT_AVAILABLE"
}
POST
/v1/agents/{id}/rollback

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "organization_id": "string",
  "agent_id": "string",
  "version_number": 1,
  "status": "draft",
  "session_config": {},
  "briefing_markdown": "string",
  "briefing_md": "string",
  "source": "string",
  "created_by_user_id": "string",
  "created_at": "2019-08-24T14:15:22Z"
}
{
  "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"
}

{
  "error": "This agent's current live version failed the pre-prod reliability gate. Fix the flagged issues, or redeploy with override=true to ship anyway.",
  "code": "GATE_BLOCKED"
}