{
  "openapi": "3.1.0",
  "info": {
    "title": "Kejue API",
    "version": "2026-11-09",
    "description": "Automation-first access to Kejue Voice and Inference for API clients, CLIs, and agents. Every error uses a stable machine-readable envelope. This allowlisted contract excludes browser-session, provider-callback, and operator routes."
  },
  "servers": [
    {
      "url": "https://api.kejue.co/v1",
      "description": "Kejue production"
    },
    {
      "url": "{host}/v1",
      "description": "On-prem",
      "variables": {
        "host": {
          "default": "http://localhost:8081"
        }
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Inference"
    },
    {
      "name": "Agents"
    },
    {
      "name": "Models and voices"
    },
    {
      "name": "Guardrails"
    },
    {
      "name": "Pronunciation"
    },
    {
      "name": "Tools"
    },
    {
      "name": "MCP servers"
    },
    {
      "name": "Secrets"
    },
    {
      "name": "Flows"
    },
    {
      "name": "SIP trunks"
    },
    {
      "name": "Phone numbers"
    },
    {
      "name": "Outbound calls"
    },
    {
      "name": "Campaigns"
    },
    {
      "name": "DNCR screening"
    },
    {
      "name": "Contacts"
    },
    {
      "name": "Calls"
    },
    {
      "name": "Transfers"
    },
    {
      "name": "Extraction objects"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "Analytics boards"
    },
    {
      "name": "Alerts"
    },
    {
      "name": "Usage"
    },
    {
      "name": "Human call imports"
    },
    {
      "name": "Eval suites"
    },
    {
      "name": "Eval checks"
    },
    {
      "name": "Eval runs"
    },
    {
      "name": "Eval results"
    },
    {
      "name": "Groups"
    },
    {
      "name": "Auth and API keys"
    },
    {
      "name": "Members and roles"
    },
    {
      "name": "Organization and audit"
    },
    {
      "name": "Connected apps (MCP)"
    }
  ],
  "x-sonus-eval-lifecycle-example": {
    "description": "Complete automation workflow for defining a suite, adding a scenario, starting a dry-run eval, polling it to a terminal state, and inspecting one sanitized call. Every POST uses one stable Idempotency-Key per logical intent. Copy ETags exactly when editing or archiving suites and scenarios. Live external tools are isolated on create_live_eval_run and require the additional eval-runs:execute-live-tools scope.",
    "steps": [
      {
        "operation_id": "create_eval_suite",
        "request": {
          "method": "POST",
          "path": "/v1/eval-suites",
          "headers": {
            "Idempotency-Key": "eval-suite-support-regression-v1"
          },
          "body": {
            "slug": "support_regression",
            "name": "Support regression",
            "description": "Core escalation and refund scenarios.",
            "definition": {
              "schema_version": 1
            }
          }
        },
        "response": {
          "status": 201,
          "headers": {
            "Location": "/v1/eval-suites/11111111-1111-4111-8111-111111111111",
            "ETag": "\"eval-suite-11111111-1111-4111-8111-111111111111-v1\""
          }
        }
      },
      {
        "operation_id": "create_eval_scenario",
        "request": {
          "method": "POST",
          "path": "/v1/eval-suites/11111111-1111-4111-8111-111111111111/scenarios",
          "headers": {
            "Idempotency-Key": "eval-scenario-angry-refund-v1"
          },
          "body": {
            "slug": "angry_refund",
            "label": "Angry refund request",
            "persona_text": "The caller is frustrated but cooperative.",
            "scenario_text": "Request a refund, then ask for a supervisor if denied.",
            "assertions": {
              "escalation_offered": true
            }
          }
        },
        "response": {
          "status": 201,
          "headers": {
            "Location": "/v1/eval-suites/11111111-1111-4111-8111-111111111111/scenarios/22222222-2222-4222-8222-222222222222",
            "ETag": "\"eval-scenario-22222222-2222-4222-8222-222222222222-v1\""
          }
        }
      },
      {
        "operation_id": "create_eval_run",
        "request": {
          "method": "POST",
          "path": "/v1/eval-runs",
          "headers": {
            "Idempotency-Key": "eval-run-support-regression-agent-v17"
          },
          "body": {
            "agent_id": "33333333-3333-4333-8333-333333333333",
            "agent_version_id": "44444444-4444-4444-8444-444444444444",
            "suite_id": "11111111-1111-4111-8111-111111111111",
            "mode": "text",
            "concurrency": 4,
            "tool_policy": "dry_run",
            "runtime_profile": {}
          }
        },
        "response": {
          "status": 202,
          "headers": {
            "Location": "/v1/eval-runs/55555555-5555-4555-8555-555555555555",
            "Retry-After": "2"
          },
          "body": {
            "id": "55555555-5555-4555-8555-555555555555",
            "effective_concurrency": 4,
            "total": 1
          }
        }
      },
      {
        "operation_id": "get_eval_run",
        "request": {
          "method": "GET",
          "path": "/v1/eval-runs/55555555-5555-4555-8555-555555555555"
        },
        "response": {
          "status": 200,
          "body": {
            "id": "55555555-5555-4555-8555-555555555555",
            "status": "done",
            "tool_policy": "dry_run",
            "completed": 1,
            "total": 1
          }
        }
      },
      {
        "operation_id": "get_eval_call",
        "request": {
          "method": "GET",
          "path": "/v1/eval-calls/66666666-6666-4666-8666-666666666666"
        },
        "response": {
          "status": 200,
          "body": {
            "id": "66666666-6666-4666-8666-666666666666",
            "timed_out": false,
            "error": null,
            "error_code": null
          }
        }
      }
    ]
  },
  "x-kejue-eval-lifecycle-example": {
    "description": "Complete automation workflow for defining a suite, adding a scenario, starting a dry-run eval, polling it to a terminal state, and inspecting one sanitized call. Every POST uses one stable Idempotency-Key per logical intent. Copy ETags exactly when editing or archiving suites and scenarios. Live external tools are isolated on create_live_eval_run and require the additional eval-runs:execute-live-tools scope.",
    "steps": [
      {
        "operation_id": "create_eval_suite",
        "request": {
          "method": "POST",
          "path": "/v1/eval-suites",
          "headers": {
            "Idempotency-Key": "eval-suite-support-regression-v1"
          },
          "body": {
            "slug": "support_regression",
            "name": "Support regression",
            "description": "Core escalation and refund scenarios.",
            "definition": {
              "schema_version": 1
            }
          }
        },
        "response": {
          "status": 201,
          "headers": {
            "Location": "/v1/eval-suites/11111111-1111-4111-8111-111111111111",
            "ETag": "\"eval-suite-11111111-1111-4111-8111-111111111111-v1\""
          }
        }
      },
      {
        "operation_id": "create_eval_scenario",
        "request": {
          "method": "POST",
          "path": "/v1/eval-suites/11111111-1111-4111-8111-111111111111/scenarios",
          "headers": {
            "Idempotency-Key": "eval-scenario-angry-refund-v1"
          },
          "body": {
            "slug": "angry_refund",
            "label": "Angry refund request",
            "persona_text": "The caller is frustrated but cooperative.",
            "scenario_text": "Request a refund, then ask for a supervisor if denied.",
            "assertions": {
              "escalation_offered": true
            }
          }
        },
        "response": {
          "status": 201,
          "headers": {
            "Location": "/v1/eval-suites/11111111-1111-4111-8111-111111111111/scenarios/22222222-2222-4222-8222-222222222222",
            "ETag": "\"eval-scenario-22222222-2222-4222-8222-222222222222-v1\""
          }
        }
      },
      {
        "operation_id": "create_eval_run",
        "request": {
          "method": "POST",
          "path": "/v1/eval-runs",
          "headers": {
            "Idempotency-Key": "eval-run-support-regression-agent-v17"
          },
          "body": {
            "agent_id": "33333333-3333-4333-8333-333333333333",
            "agent_version_id": "44444444-4444-4444-8444-444444444444",
            "suite_id": "11111111-1111-4111-8111-111111111111",
            "mode": "text",
            "concurrency": 4,
            "tool_policy": "dry_run",
            "runtime_profile": {}
          }
        },
        "response": {
          "status": 202,
          "headers": {
            "Location": "/v1/eval-runs/55555555-5555-4555-8555-555555555555",
            "Retry-After": "2"
          },
          "body": {
            "id": "55555555-5555-4555-8555-555555555555",
            "effective_concurrency": 4,
            "total": 1
          }
        }
      },
      {
        "operation_id": "get_eval_run",
        "request": {
          "method": "GET",
          "path": "/v1/eval-runs/55555555-5555-4555-8555-555555555555"
        },
        "response": {
          "status": 200,
          "body": {
            "id": "55555555-5555-4555-8555-555555555555",
            "status": "done",
            "tool_policy": "dry_run",
            "completed": 1,
            "total": 1
          }
        }
      },
      {
        "operation_id": "get_eval_call",
        "request": {
          "method": "GET",
          "path": "/v1/eval-calls/66666666-6666-4666-8666-666666666666"
        },
        "response": {
          "status": 200,
          "body": {
            "id": "66666666-6666-4666-8666-666666666666",
            "timed_out": false,
            "error": null,
            "error_code": null
          }
        }
      }
    ]
  },
  "x-sonus-agent-lifecycle-example": {
    "description": "Complete conditional-write sequence for one automation client. ETags are opaque; the r1 representation-version and cap-00 capability segments are illustrative and can change independently of the persisted revision. Reuse an Idempotency-Key only to replay the identical logical request.",
    "steps": [
      {
        "operation_id": "create_agent",
        "request": {
          "method": "POST",
          "path": "/v1/agents",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "agent-create-billing-20260720"
          },
          "body": {
            "slug": "billing_assistant",
            "name": "Billing Assistant",
            "mode": "prompt",
            "prompt": "Help {{lead_name}} with billing. Correlation ID is {{system.call_id}}."
          }
        },
        "response": {
          "status": 201,
          "headers": {
            "Location": "/v1/agents/11111111-1111-4111-8111-111111111111",
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v1\""
          },
          "body": {
            "id": "11111111-1111-4111-8111-111111111111",
            "slug": "billing_assistant",
            "name": "Billing Assistant",
            "mode": "prompt",
            "draft_version_id": "22222222-2222-4222-8222-222222222222",
            "revision": 1,
            "updated_at": "2026-07-20T09:00:00Z"
          }
        }
      },
      {
        "operation_id": "update_agent_draft",
        "request": {
          "method": "PATCH",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/draft",
          "headers": {
            "Content-Type": "application/json",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v1\""
          },
          "body": {
            "prompt": "Resolve {{vars.account_id}} safely for caller {{system.caller_phone}}.",
            "pipeline_topology": "two_stage_speechlm"
          }
        },
        "response": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v2\""
          },
          "body": {
            "id": "22222222-2222-4222-8222-222222222222",
            "agent_id": "11111111-1111-4111-8111-111111111111",
            "updated": true,
            "revision": 2,
            "updated_at": "2026-07-20T09:08:00Z",
            "draft": {
              "id": "22222222-2222-4222-8222-222222222222",
              "is_draft": true,
              "prompt": "Resolve {{vars.account_id}} safely for caller {{system.caller_phone}}.",
              "pipeline_topology": "two_stage_speechlm",
              "pipeline_mode": "speech_model",
              "endpointing_mode": "auto",
              "created_at": "2026-07-20T09:00:00Z"
            }
          }
        }
      },
      {
        "operation_id": "get_agent_version_after_call",
        "request": {
          "method": "GET",
          "path": "/v1/agent-versions/22222222-2222-4222-8222-222222222222/after-call"
        },
        "response": {
          "status": 200,
          "headers": {
            "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v0\""
          },
          "body": {
            "id": null,
            "agent_version_id": "22222222-2222-4222-8222-222222222222",
            "summary_enabled": true,
            "summary_prompt": null,
            "extraction_object_ids": [],
            "webhook_config_ids": [],
            "version": 0,
            "created_at": null,
            "updated_at": null
          }
        }
      },
      {
        "operation_id": "update_agent_version_after_call",
        "request": {
          "method": "PATCH",
          "path": "/v1/agent-versions/22222222-2222-4222-8222-222222222222/after-call",
          "headers": {
            "Content-Type": "application/json",
            "If-Match": "\"after-call-22222222-2222-4222-8222-222222222222-v0\""
          },
          "body": {
            "summary_enabled": true,
            "extraction_object_ids": [
              "44444444-4444-4444-8444-444444444444"
            ],
            "webhook_config_ids": [
              "55555555-5555-4555-8555-555555555555"
            ]
          }
        },
        "response": {
          "status": 200,
          "headers": {
            "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v1\"",
            "Sonus-Agent-ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\"",
            "Kejue-Agent-ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\""
          },
          "body": {
            "id": "66666666-6666-4666-8666-666666666666",
            "agent_version_id": "22222222-2222-4222-8222-222222222222",
            "summary_enabled": true,
            "summary_prompt": null,
            "extraction_object_ids": [
              "44444444-4444-4444-8444-444444444444"
            ],
            "webhook_config_ids": [
              "55555555-5555-4555-8555-555555555555"
            ],
            "version": 1,
            "created_at": "2026-07-20T09:10:00Z",
            "updated_at": "2026-07-20T09:10:00Z"
          }
        }
      },
      {
        "operation_id": "promote_agent_draft_to_staging",
        "request": {
          "method": "POST",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/promote-staging",
          "headers": {
            "Content-Type": "application/json",
            "Idempotency-Key": "agent-promote-billing-v1-20260720",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\""
          },
          "body": {
            "name": "Initial production candidate"
          }
        },
        "response": {
          "status": 201,
          "headers": {
            "Location": "/v1/agent-versions/33333333-3333-4333-8333-333333333333",
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v4\""
          },
          "body": {
            "id": "33333333-3333-4333-8333-333333333333",
            "agent_id": "11111111-1111-4111-8111-111111111111",
            "staging_version_id": "33333333-3333-4333-8333-333333333333",
            "version": 1,
            "revision": 4,
            "updated_at": "2026-07-20T09:15:00Z"
          }
        }
      },
      {
        "operation_id": "deploy_agent_to_production",
        "request": {
          "method": "POST",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/deploy",
          "headers": {
            "Idempotency-Key": "agent-deploy-billing-v1-20260720",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v4\""
          },
          "body": null
        },
        "response": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v5\""
          },
          "body": {
            "agent_id": "11111111-1111-4111-8111-111111111111",
            "production_version_id": "33333333-3333-4333-8333-333333333333",
            "updated": true,
            "revision": 5,
            "updated_at": "2026-07-20T09:25:00Z"
          }
        }
      },
      {
        "operation_id": "set_agent_staging_version",
        "context": "A later version 2 is now staged/produced and the aggregate is revision 7; selecting immutable version 1 prepares a rollback without mutating history.",
        "request": {
          "method": "PUT",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/staging",
          "headers": {
            "Content-Type": "application/json",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v7\""
          },
          "body": {
            "version_id": "33333333-3333-4333-8333-333333333333"
          }
        },
        "response": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v8\""
          },
          "body": {
            "agent_id": "11111111-1111-4111-8111-111111111111",
            "staging_version_id": "33333333-3333-4333-8333-333333333333",
            "updated": true,
            "revision": 8,
            "updated_at": "2026-07-20T10:00:00Z"
          }
        },
        "next": "Call deploy_agent_to_production with a new Idempotency-Key and the returned v8 ETag to move production to the rollback snapshot."
      }
    ]
  },
  "x-kejue-agent-lifecycle-example": {
    "description": "Complete conditional-write sequence for one automation client. ETags are opaque; the r1 representation-version and cap-00 capability segments are illustrative and can change independently of the persisted revision. Reuse an Idempotency-Key only to replay the identical logical request.",
    "steps": [
      {
        "operation_id": "create_agent",
        "request": {
          "method": "POST",
          "path": "/v1/agents",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "agent-create-billing-20260720"
          },
          "body": {
            "slug": "billing_assistant",
            "name": "Billing Assistant",
            "mode": "prompt",
            "prompt": "Help {{lead_name}} with billing. Correlation ID is {{system.call_id}}."
          }
        },
        "response": {
          "status": 201,
          "headers": {
            "Location": "/v1/agents/11111111-1111-4111-8111-111111111111",
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v1\""
          },
          "body": {
            "id": "11111111-1111-4111-8111-111111111111",
            "slug": "billing_assistant",
            "name": "Billing Assistant",
            "mode": "prompt",
            "draft_version_id": "22222222-2222-4222-8222-222222222222",
            "revision": 1,
            "updated_at": "2026-07-20T09:00:00Z"
          }
        }
      },
      {
        "operation_id": "update_agent_draft",
        "request": {
          "method": "PATCH",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/draft",
          "headers": {
            "Content-Type": "application/json",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v1\""
          },
          "body": {
            "prompt": "Resolve {{vars.account_id}} safely for caller {{system.caller_phone}}.",
            "pipeline_topology": "two_stage_speechlm"
          }
        },
        "response": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v2\""
          },
          "body": {
            "id": "22222222-2222-4222-8222-222222222222",
            "agent_id": "11111111-1111-4111-8111-111111111111",
            "updated": true,
            "revision": 2,
            "updated_at": "2026-07-20T09:08:00Z",
            "draft": {
              "id": "22222222-2222-4222-8222-222222222222",
              "is_draft": true,
              "prompt": "Resolve {{vars.account_id}} safely for caller {{system.caller_phone}}.",
              "pipeline_topology": "two_stage_speechlm",
              "pipeline_mode": "speech_model",
              "endpointing_mode": "auto",
              "created_at": "2026-07-20T09:00:00Z"
            }
          }
        }
      },
      {
        "operation_id": "get_agent_version_after_call",
        "request": {
          "method": "GET",
          "path": "/v1/agent-versions/22222222-2222-4222-8222-222222222222/after-call"
        },
        "response": {
          "status": 200,
          "headers": {
            "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v0\""
          },
          "body": {
            "id": null,
            "agent_version_id": "22222222-2222-4222-8222-222222222222",
            "summary_enabled": true,
            "summary_prompt": null,
            "extraction_object_ids": [],
            "webhook_config_ids": [],
            "version": 0,
            "created_at": null,
            "updated_at": null
          }
        }
      },
      {
        "operation_id": "update_agent_version_after_call",
        "request": {
          "method": "PATCH",
          "path": "/v1/agent-versions/22222222-2222-4222-8222-222222222222/after-call",
          "headers": {
            "Content-Type": "application/json",
            "If-Match": "\"after-call-22222222-2222-4222-8222-222222222222-v0\""
          },
          "body": {
            "summary_enabled": true,
            "extraction_object_ids": [
              "44444444-4444-4444-8444-444444444444"
            ],
            "webhook_config_ids": [
              "55555555-5555-4555-8555-555555555555"
            ]
          }
        },
        "response": {
          "status": 200,
          "headers": {
            "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v1\"",
            "Sonus-Agent-ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\"",
            "Kejue-Agent-ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\""
          },
          "body": {
            "id": "66666666-6666-4666-8666-666666666666",
            "agent_version_id": "22222222-2222-4222-8222-222222222222",
            "summary_enabled": true,
            "summary_prompt": null,
            "extraction_object_ids": [
              "44444444-4444-4444-8444-444444444444"
            ],
            "webhook_config_ids": [
              "55555555-5555-4555-8555-555555555555"
            ],
            "version": 1,
            "created_at": "2026-07-20T09:10:00Z",
            "updated_at": "2026-07-20T09:10:00Z"
          }
        }
      },
      {
        "operation_id": "promote_agent_draft_to_staging",
        "request": {
          "method": "POST",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/promote-staging",
          "headers": {
            "Content-Type": "application/json",
            "Idempotency-Key": "agent-promote-billing-v1-20260720",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\""
          },
          "body": {
            "name": "Initial production candidate"
          }
        },
        "response": {
          "status": 201,
          "headers": {
            "Location": "/v1/agent-versions/33333333-3333-4333-8333-333333333333",
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v4\""
          },
          "body": {
            "id": "33333333-3333-4333-8333-333333333333",
            "agent_id": "11111111-1111-4111-8111-111111111111",
            "staging_version_id": "33333333-3333-4333-8333-333333333333",
            "version": 1,
            "revision": 4,
            "updated_at": "2026-07-20T09:15:00Z"
          }
        }
      },
      {
        "operation_id": "deploy_agent_to_production",
        "request": {
          "method": "POST",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/deploy",
          "headers": {
            "Idempotency-Key": "agent-deploy-billing-v1-20260720",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v4\""
          },
          "body": null
        },
        "response": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v5\""
          },
          "body": {
            "agent_id": "11111111-1111-4111-8111-111111111111",
            "production_version_id": "33333333-3333-4333-8333-333333333333",
            "updated": true,
            "revision": 5,
            "updated_at": "2026-07-20T09:25:00Z"
          }
        }
      },
      {
        "operation_id": "set_agent_staging_version",
        "context": "A later version 2 is now staged/produced and the aggregate is revision 7; selecting immutable version 1 prepares a rollback without mutating history.",
        "request": {
          "method": "PUT",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/staging",
          "headers": {
            "Content-Type": "application/json",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v7\""
          },
          "body": {
            "version_id": "33333333-3333-4333-8333-333333333333"
          }
        },
        "response": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v8\""
          },
          "body": {
            "agent_id": "11111111-1111-4111-8111-111111111111",
            "staging_version_id": "33333333-3333-4333-8333-333333333333",
            "updated": true,
            "revision": 8,
            "updated_at": "2026-07-20T10:00:00Z"
          }
        },
        "next": "Call deploy_agent_to_production with a new Idempotency-Key and the returned v8 ETag to move production to the rollback snapshot."
      }
    ]
  },
  "x-sonus-agent-recovery-examples": {
    "invalid_path": {
      "status": 400,
      "response": {
        "error": {
          "code": "invalid_path_parameter",
          "message": "path parameter \"id\" must be a UUID",
          "request_id": "req_agent_400_path",
          "details": {
            "parameter": "id",
            "value": "not-a-uuid",
            "expected": "uuid"
          }
        }
      },
      "recovery": "Use the canonical UUID returned by create/list/get. Do not substitute an agent slug for an id or an agent id for an agent-version id."
    },
    "invalid_cursor": {
      "status": 400,
      "response": {
        "error": {
          "code": "invalid_query_parameter",
          "message": "cursor is malformed or was not issued by this endpoint",
          "request_id": "req_agent_400_cursor",
          "details": {
            "parameter": "cursor",
            "reason": "invalid_cursor"
          }
        }
      },
      "recovery": "Discard the cursor and restart the same traversal without cursor. Only reuse next_cursor with the exact endpoint, agent, sort, and filter shape that issued it."
    },
    "malformed_request": {
      "status": 400,
      "response": {
        "error": {
          "code": "invalid_json",
          "message": "request body is not valid JSON",
          "request_id": "req_agent_400"
        }
      },
      "recovery": "Correct JSON syntax and Content-Type, then retry. Reuse the same Idempotency-Key only when the corrected request represents the same logical intent; otherwise choose a new key."
    },
    "slug_conflict": {
      "status": 409,
      "response": {
        "error": {
          "code": "slug_taken",
          "message": "an agent with this slug already exists",
          "request_id": "req_agent_409",
          "details": {
            "field": "slug",
            "value": "billing_assistant"
          }
        }
      },
      "recovery": "Choose a different stable slug or GET /agents?q=billing_assistant and operate on the existing aggregate. Do not retry the unchanged create body."
    },
    "stale_aggregate": {
      "status": 412,
      "response_headers": {
        "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v6\""
      },
      "response": {
        "error": {
          "code": "precondition_failed",
          "message": "resource has changed",
          "request_id": "req_agent_412"
        }
      },
      "recovery": "GET the aggregate, reconcile the intended patch against its current representation, and retry with the response ETag. Never blindly substitute the 412 tag when the intervening change may conflict with the intent."
    },
    "stale_after_call": {
      "status": 412,
      "response_headers": {
        "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v2\""
      },
      "response": {
        "error": {
          "code": "precondition_failed",
          "message": "resource has changed",
          "request_id": "req_agent_after_call_412"
        }
      },
      "recovery": "GET the same after-call resource, reconcile its fields, and retry with that primary ETag. Do not use Sonus-Agent-ETag as the after-call If-Match; retain Sonus-Agent-ETag only for the next parent-agent lifecycle mutation."
    },
    "invalid_template": {
      "status": 422,
      "response": {
        "error": {
          "code": "validation_failed",
          "message": "request failed validation",
          "request_id": "req_agent_422_template",
          "details": {
            "fields": [
              {
                "path": "behavior.system_tools.transfer_cold[0].destination",
                "code": "template_scope_required",
                "message": "this field requires an explicit slots, vars, or system scope"
              }
            ]
          }
        }
      },
      "recovery": "Replace a bare transfer alias such as {{phone}} with a defined scoped reference such as {{slots.phone}}, then rerun estimate-baseline before saving."
    },
    "baseline_over_budget": {
      "status": 422,
      "response": {
        "error": {
          "code": "agent_baseline_too_large",
          "message": "agent baseline exceeds the configured headroom budget",
          "request_id": "req_agent_422_budget",
          "details": {
            "baseline_tokens": 27120,
            "max_model_len": 24576,
            "model_context_limit": 32768,
            "headroom_budget": 24576,
            "system_tokens": 13000,
            "tools_tokens": 14120
          }
        }
      },
      "recovery": "Remove or shorten prompt instructions and unneeded assigned tools until estimate-baseline reports baseline_tokens <= max_model_len, then save with the latest aggregate ETag."
    },
    "remove_unsupported_query_parameters": {
      "status": 400,
      "response": {
        "error": {
          "code": "unknown_query_parameter",
          "message": "one or more query parameters are not supported",
          "request_id": "req_agent_400_query",
          "details": {
            "parameters": [
              "limit"
            ],
            "allowed_parameters": []
          }
        }
      },
      "recovery": "Remove every parameter listed in details.parameters. Catalog reads such as GET /background-noises take no query parameters and return the full list in one response."
    }
  },
  "x-kejue-agent-recovery-examples": {
    "invalid_path": {
      "status": 400,
      "response": {
        "error": {
          "code": "invalid_path_parameter",
          "message": "path parameter \"id\" must be a UUID",
          "request_id": "req_agent_400_path",
          "details": {
            "parameter": "id",
            "value": "not-a-uuid",
            "expected": "uuid"
          }
        }
      },
      "recovery": "Use the canonical UUID returned by create/list/get. Do not substitute an agent slug for an id or an agent id for an agent-version id."
    },
    "invalid_cursor": {
      "status": 400,
      "response": {
        "error": {
          "code": "invalid_query_parameter",
          "message": "cursor is malformed or was not issued by this endpoint",
          "request_id": "req_agent_400_cursor",
          "details": {
            "parameter": "cursor",
            "reason": "invalid_cursor"
          }
        }
      },
      "recovery": "Discard the cursor and restart the same traversal without cursor. Only reuse next_cursor with the exact endpoint, agent, sort, and filter shape that issued it."
    },
    "malformed_request": {
      "status": 400,
      "response": {
        "error": {
          "code": "invalid_json",
          "message": "request body is not valid JSON",
          "request_id": "req_agent_400"
        }
      },
      "recovery": "Correct JSON syntax and Content-Type, then retry. Reuse the same Idempotency-Key only when the corrected request represents the same logical intent; otherwise choose a new key."
    },
    "slug_conflict": {
      "status": 409,
      "response": {
        "error": {
          "code": "slug_taken",
          "message": "an agent with this slug already exists",
          "request_id": "req_agent_409",
          "details": {
            "field": "slug",
            "value": "billing_assistant"
          }
        }
      },
      "recovery": "Choose a different stable slug or GET /agents?q=billing_assistant and operate on the existing aggregate. Do not retry the unchanged create body."
    },
    "stale_aggregate": {
      "status": 412,
      "response_headers": {
        "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v6\""
      },
      "response": {
        "error": {
          "code": "precondition_failed",
          "message": "resource has changed",
          "request_id": "req_agent_412"
        }
      },
      "recovery": "GET the aggregate, reconcile the intended patch against its current representation, and retry with the response ETag. Never blindly substitute the 412 tag when the intervening change may conflict with the intent."
    },
    "stale_after_call": {
      "status": 412,
      "response_headers": {
        "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v2\""
      },
      "response": {
        "error": {
          "code": "precondition_failed",
          "message": "resource has changed",
          "request_id": "req_agent_after_call_412"
        }
      },
      "recovery": "GET the same after-call resource, reconcile its fields, and retry with that primary ETag. Do not use Sonus-Agent-ETag as the after-call If-Match; retain Sonus-Agent-ETag only for the next parent-agent lifecycle mutation."
    },
    "invalid_template": {
      "status": 422,
      "response": {
        "error": {
          "code": "validation_failed",
          "message": "request failed validation",
          "request_id": "req_agent_422_template",
          "details": {
            "fields": [
              {
                "path": "behavior.system_tools.transfer_cold[0].destination",
                "code": "template_scope_required",
                "message": "this field requires an explicit slots, vars, or system scope"
              }
            ]
          }
        }
      },
      "recovery": "Replace a bare transfer alias such as {{phone}} with a defined scoped reference such as {{slots.phone}}, then rerun estimate-baseline before saving."
    },
    "baseline_over_budget": {
      "status": 422,
      "response": {
        "error": {
          "code": "agent_baseline_too_large",
          "message": "agent baseline exceeds the configured headroom budget",
          "request_id": "req_agent_422_budget",
          "details": {
            "baseline_tokens": 27120,
            "max_model_len": 24576,
            "model_context_limit": 32768,
            "headroom_budget": 24576,
            "system_tokens": 13000,
            "tools_tokens": 14120
          }
        }
      },
      "recovery": "Remove or shorten prompt instructions and unneeded assigned tools until estimate-baseline reports baseline_tokens <= max_model_len, then save with the latest aggregate ETag."
    },
    "remove_unsupported_query_parameters": {
      "status": 400,
      "response": {
        "error": {
          "code": "unknown_query_parameter",
          "message": "one or more query parameters are not supported",
          "request_id": "req_agent_400_query",
          "details": {
            "parameters": [
              "limit"
            ],
            "allowed_parameters": []
          }
        }
      },
      "recovery": "Remove every parameter listed in details.parameters. Catalog reads such as GET /background-noises take no query parameters and return the full list in one response."
    }
  },
  "x-sonus-guardrail-recovery-examples": {
    "discard_invalid_cursor_and_restart_the_same_filtered_traversal": {
      "status": 400,
      "response": {
        "error": {
          "code": "invalid_query_parameter",
          "message": "cursor is malformed or was not issued by this endpoint",
          "request_id": "req_guardrail_cursor_400",
          "details": {
            "parameter": "cursor",
            "reason": "invalid_cursor"
          }
        }
      },
      "recovery": "Discard the cursor and restart without cursor. Preserve q, created_from, created_to, and archived while traversing; a cursor issued for any other filter set or endpoint is intentionally rejected."
    },
    "correct_all_validation_fields_or_choose_a_different_slug": {
      "cases": {
        "validation": {
          "status": 422,
          "response": {
            "error": {
              "code": "validation_failed",
              "message": "request failed validation",
              "request_id": "req_guardrail_create_422",
              "details": {
                "fields": [
                  {
                    "path": "definition.guardrails[0].instruction",
                    "code": "required",
                    "message": "instruction is required"
                  }
                ]
              }
            }
          }
        },
        "slug_conflict": {
          "status": 409,
          "response": {
            "error": {
              "code": "slug_taken",
              "message": "a guardrail set with this slug already exists in this workspace",
              "request_id": "req_guardrail_create_409",
              "details": {
                "field": "slug",
                "value": "payment_safety"
              }
            }
          }
        }
      },
      "recovery": "Correct every details.fields entry before retrying a 422. For slug_taken, choose a different immutable slug or list with q=payment_safety and operate on the existing set. Reuse the Idempotency-Key only for the same logical intent."
    },
    "patch_the_complete_definition_when_configuration_errors_is_present": {
      "status": 200,
      "condition": "The detail response contains configuration_errors.",
      "recovery": "Treat the returned normalized definition as a safe repair starting point, review every configuration_errors entry, then PATCH a complete corrected definition with the response ETag. Invalid omitted rules are not assumed to execute. A malformed or missing root/guardrails container, a stored definition above the 1,048,576-byte encoded limit, or an oversized normalized safe view can make the returned definition empty; do not infer that any stored rule still executes. When the errors report only an aggregate runtime-budget breach, every individually valid rule remains in definition; shorten or remove rules until every reported aggregate limit is met."
    },
    "reconcile_412_or_reduce_the_reported_agent_runtime_budget": {
      "cases": {
        "stale_etag": {
          "status": 412,
          "response_headers": {
            "ETag": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v4\""
          },
          "response": {
            "error": {
              "code": "precondition_failed",
              "message": "the resource changed since the supplied If-Match value was issued",
              "request_id": "req_guardrail_patch_412",
              "details": {
                "header": "If-Match",
                "current_etag": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v4\""
              }
            }
          }
        },
        "assigned_agent_budget": {
          "status": 422,
          "response": {
            "error": {
              "code": "validation_failed",
              "message": "request failed validation",
              "request_id": "req_guardrail_patch_422",
              "details": {
                "fields": [
                  {
                    "path": "definition",
                    "code": "assigned_agent_guardrail_instruction_budget_exceeded",
                    "message": "definition would exceed the guardrail runtime budget for agent \"billing_assistant\" production version: assigned LLM guardrail instructions contain 40001 characters; the per-agent limit is 40000"
                  }
                ]
              }
            }
          }
        }
      },
      "recovery": "For 412, GET and reconcile before retrying with the fresh ETag. For 422, use each field message to identify the active agent/stage, then reduce this definition or detach another set without exceeding any runtime aggregate."
    },
    "detach_every_reported_active_agent_version_then_retry": {
      "status": 409,
      "response": {
        "error": {
          "code": "guardrail_set_in_use",
          "message": "guardrail set cannot be archived while active agent versions reference it",
          "request_id": "req_guardrail_archive_409",
          "details": {
            "dependencies": [
              {
                "kind": "agent_version",
                "agent_id": "33333333-3333-4333-8333-333333333333",
                "agent_slug": "billing_assistant",
                "agent_name": "Billing Assistant",
                "agent_version_id": "44444444-4444-4444-8444-444444444444",
                "agent_version": null,
                "deployment_stage": "draft",
                "reference": "behavior.guardrails.guardrail_set_ids"
              }
            ],
            "dependency_count": 1
          }
        }
      },
      "recovery": "Remove the UUID from the listed draft. When staging or production is listed, promote/deploy replacement versions that do not reference it. Re-GET the set and retry DELETE with the fresh ETag only after every listed active pointer moved."
    }
  },
  "x-kejue-guardrail-recovery-examples": {
    "discard_invalid_cursor_and_restart_the_same_filtered_traversal": {
      "status": 400,
      "response": {
        "error": {
          "code": "invalid_query_parameter",
          "message": "cursor is malformed or was not issued by this endpoint",
          "request_id": "req_guardrail_cursor_400",
          "details": {
            "parameter": "cursor",
            "reason": "invalid_cursor"
          }
        }
      },
      "recovery": "Discard the cursor and restart without cursor. Preserve q, created_from, created_to, and archived while traversing; a cursor issued for any other filter set or endpoint is intentionally rejected."
    },
    "correct_all_validation_fields_or_choose_a_different_slug": {
      "cases": {
        "validation": {
          "status": 422,
          "response": {
            "error": {
              "code": "validation_failed",
              "message": "request failed validation",
              "request_id": "req_guardrail_create_422",
              "details": {
                "fields": [
                  {
                    "path": "definition.guardrails[0].instruction",
                    "code": "required",
                    "message": "instruction is required"
                  }
                ]
              }
            }
          }
        },
        "slug_conflict": {
          "status": 409,
          "response": {
            "error": {
              "code": "slug_taken",
              "message": "a guardrail set with this slug already exists in this workspace",
              "request_id": "req_guardrail_create_409",
              "details": {
                "field": "slug",
                "value": "payment_safety"
              }
            }
          }
        }
      },
      "recovery": "Correct every details.fields entry before retrying a 422. For slug_taken, choose a different immutable slug or list with q=payment_safety and operate on the existing set. Reuse the Idempotency-Key only for the same logical intent."
    },
    "patch_the_complete_definition_when_configuration_errors_is_present": {
      "status": 200,
      "condition": "The detail response contains configuration_errors.",
      "recovery": "Treat the returned normalized definition as a safe repair starting point, review every configuration_errors entry, then PATCH a complete corrected definition with the response ETag. Invalid omitted rules are not assumed to execute. A malformed or missing root/guardrails container, a stored definition above the 1,048,576-byte encoded limit, or an oversized normalized safe view can make the returned definition empty; do not infer that any stored rule still executes. When the errors report only an aggregate runtime-budget breach, every individually valid rule remains in definition; shorten or remove rules until every reported aggregate limit is met."
    },
    "reconcile_412_or_reduce_the_reported_agent_runtime_budget": {
      "cases": {
        "stale_etag": {
          "status": 412,
          "response_headers": {
            "ETag": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v4\""
          },
          "response": {
            "error": {
              "code": "precondition_failed",
              "message": "the resource changed since the supplied If-Match value was issued",
              "request_id": "req_guardrail_patch_412",
              "details": {
                "header": "If-Match",
                "current_etag": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v4\""
              }
            }
          }
        },
        "assigned_agent_budget": {
          "status": 422,
          "response": {
            "error": {
              "code": "validation_failed",
              "message": "request failed validation",
              "request_id": "req_guardrail_patch_422",
              "details": {
                "fields": [
                  {
                    "path": "definition",
                    "code": "assigned_agent_guardrail_instruction_budget_exceeded",
                    "message": "definition would exceed the guardrail runtime budget for agent \"billing_assistant\" production version: assigned LLM guardrail instructions contain 40001 characters; the per-agent limit is 40000"
                  }
                ]
              }
            }
          }
        }
      },
      "recovery": "For 412, GET and reconcile before retrying with the fresh ETag. For 422, use each field message to identify the active agent/stage, then reduce this definition or detach another set without exceeding any runtime aggregate."
    },
    "detach_every_reported_active_agent_version_then_retry": {
      "status": 409,
      "response": {
        "error": {
          "code": "guardrail_set_in_use",
          "message": "guardrail set cannot be archived while active agent versions reference it",
          "request_id": "req_guardrail_archive_409",
          "details": {
            "dependencies": [
              {
                "kind": "agent_version",
                "agent_id": "33333333-3333-4333-8333-333333333333",
                "agent_slug": "billing_assistant",
                "agent_name": "Billing Assistant",
                "agent_version_id": "44444444-4444-4444-8444-444444444444",
                "agent_version": null,
                "deployment_stage": "draft",
                "reference": "behavior.guardrails.guardrail_set_ids"
              }
            ],
            "dependency_count": 1
          }
        }
      },
      "recovery": "Remove the UUID from the listed draft. When staging or production is listed, promote/deploy replacement versions that do not reference it. Re-GET the set and retry DELETE with the fresh ETag only after every listed active pointer moved."
    }
  },
  "paths": {
    "/alerts": {
      "get": {
        "operationId": "list_alerts",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/alerts",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/alerts",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-sonus-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-kejue-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-sonus-required-permission": "alerts:read",
        "x-kejue-required-permission": "alerts:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List alerts",
        "description": "Team-scoped Alerts operation. Rule percentages use eligible invocations or processing attempts, not affected calls. An open incident emits one firing and one confirmed-recovery notification per selected member. Empty or stale windows never resolve an incident. Preview uses recent observations without notifications.",
        "tags": [
          "Alerts"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Alerts operation",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_alert",
        "x-sonus-request-example": {
          "method": "POST",
          "path": "/v1/alerts",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "POST",
          "path": "/v1/alerts",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 201,
          "body": "See the response schema."
        },
        "x-kejue-response-example": {
          "status": 201,
          "body": "See the response schema."
        },
        "x-sonus-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-kejue-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-sonus-required-permission": "alerts:create",
        "x-kejue-required-permission": "alerts:create",
        "x-sonus-required-entitlement": "alerts",
        "x-kejue-required-entitlement": "alerts",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "alert_limit_reached",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "alert_limit_reached",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create alert",
        "description": "Team-scoped Alerts operation. Rule percentages use eligible invocations or processing attempts, not affected calls. An open incident emits one firing and one confirmed-recovery notification per selected member. Empty or stale windows never resolve an incident. Preview uses recent observations without notifications.",
        "tags": [
          "Alerts"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "201": {
            "description": "Successful Alerts operation",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertCreateRequest"
              }
            }
          }
        }
      }
    },
    "/alerts/{id}": {
      "get": {
        "operationId": "get_alert",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/alerts/{id}",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/alerts/{id}",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-sonus-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-kejue-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-sonus-required-permission": "alerts:read",
        "x-kejue-required-permission": "alerts:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "alert_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "alert_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get alert",
        "description": "Team-scoped Alerts operation. Rule percentages use eligible invocations or processing attempts, not affected calls. An open incident emits one firing and one confirmed-recovery notification per selected member. Empty or stale windows never resolve an incident. Preview uses recent observations without notifications.",
        "tags": [
          "Alerts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Alerts operation",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_alert",
        "x-sonus-request-example": {
          "method": "PATCH",
          "path": "/v1/alerts/{id}",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "PATCH",
          "path": "/v1/alerts/{id}",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-sonus-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-kejue-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-sonus-required-permission": "alerts:update",
        "x-kejue-required-permission": "alerts:update",
        "x-sonus-required-entitlement": "alerts",
        "x-kejue-required-entitlement": "alerts",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "alert_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "alert_limit_reached"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "alert_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "alert_limit_reached"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update alert",
        "description": "Team-scoped Alerts operation. Rule percentages use eligible invocations or processing attempts, not affected calls. An open incident emits one firing and one confirmed-recovery notification per selected member. Empty or stale windows never resolve an incident. Preview uses recent observations without notifications.",
        "tags": [
          "Alerts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Alerts operation",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertUpdateRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "archive_alert",
        "x-sonus-request-example": {
          "method": "DELETE",
          "path": "/v1/alerts/{id}",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "DELETE",
          "path": "/v1/alerts/{id}",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 204,
          "body": "See the response schema."
        },
        "x-kejue-response-example": {
          "status": 204,
          "body": "See the response schema."
        },
        "x-sonus-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-kejue-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-sonus-required-permission": "alerts:delete",
        "x-kejue-required-permission": "alerts:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "alert_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "alert_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive alert",
        "description": "Team-scoped Alerts operation. Rule percentages use eligible invocations or processing attempts, not affected calls. An open incident emits one firing and one confirmed-recovery notification per selected member. Empty or stale windows never resolve an incident. Preview uses recent observations without notifications.",
        "tags": [
          "Alerts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Alerts operation",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/alerts/schema": {
      "get": {
        "operationId": "get_alert_schema",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/alerts/schema",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/alerts/schema",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-sonus-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-kejue-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-sonus-required-permission": "alerts:read",
        "x-kejue-required-permission": "alerts:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get alert schema",
        "description": "Team-scoped Alerts operation. Rule percentages use eligible invocations or processing attempts, not affected calls. An open incident emits one firing and one confirmed-recovery notification per selected member. Empty or stale windows never resolve an incident. Preview uses recent observations without notifications.",
        "tags": [
          "Alerts"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful Alerts operation",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertSchemaResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/alerts/recipients": {
      "get": {
        "operationId": "list_alert_recipients",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/alerts/recipients",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/alerts/recipients",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-sonus-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-kejue-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-sonus-required-permission": "alerts:create",
        "x-kejue-required-permission": "alerts:create",
        "x-sonus-required-entitlement": "alerts",
        "x-kejue-required-entitlement": "alerts",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List alert recipients",
        "description": "Team-scoped Alerts operation. Rule percentages use eligible invocations or processing attempts, not affected calls. An open incident emits one firing and one confirmed-recovery notification per selected member. Empty or stale windows never resolve an incident. Preview uses recent observations without notifications.",
        "tags": [
          "Alerts"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful Alerts operation",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRecipientsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/alerts/preview": {
      "post": {
        "operationId": "preview_alert",
        "x-sonus-request-example": {
          "method": "POST",
          "path": "/v1/alerts/preview",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "POST",
          "path": "/v1/alerts/preview",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-sonus-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-kejue-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-sonus-required-permission": "alerts:create",
        "x-kejue-required-permission": "alerts:create",
        "x-sonus-required-entitlement": "alerts",
        "x-kejue-required-entitlement": "alerts",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "alert_limit_reached",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "alert_limit_reached",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Preview alert",
        "description": "Team-scoped Alerts operation. Rule percentages use eligible invocations or processing attempts, not affected calls. An open incident emits one firing and one confirmed-recovery notification per selected member. Empty or stale windows never resolve an incident. Preview uses recent observations without notifications.",
        "tags": [
          "Alerts"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Alerts operation",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertPreviewResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertDefinition"
              }
            }
          }
        }
      }
    },
    "/alerts/incidents": {
      "get": {
        "operationId": "list_alert_incidents",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/alerts/incidents",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/alerts/incidents",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-sonus-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-kejue-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-sonus-required-permission": "alerts:read",
        "x-kejue-required-permission": "alerts:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List alert incidents",
        "description": "Team-scoped Alerts operation. Rule percentages use eligible invocations or processing attempts, not affected calls. An open incident emits one firing and one confirmed-recovery notification per selected member. Empty or stale windows never resolve an incident. Preview uses recent observations without notifications.",
        "tags": [
          "Alerts"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "rule_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Alerts operation",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertIncidentListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/alerts/incidents/{id}": {
      "get": {
        "operationId": "get_alert_incident",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/alerts/incidents/{id}",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/alerts/incidents/{id}",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the response schema."
        },
        "x-sonus-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-kejue-recovery-example": "Inspect error.code and correct the indicated request or Team entitlement.",
        "x-sonus-required-permission": "alerts:read",
        "x-kejue-required-permission": "alerts:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "alert_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "alert_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get alert incident",
        "description": "Team-scoped Alerts operation. Rule percentages use eligible invocations or processing attempts, not affected calls. An open incident emits one firing and one confirmed-recovery notification per selected member. Empty or stale windows never resolve an incident. Preview uses recent observations without notifications.",
        "tags": [
          "Alerts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Alerts operation",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertIncidentDetailResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/agent-versions/{vid}": {
      "get": {
        "operationId": "get_agent_version",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/agent-versions/33333333-3333-4333-8333-333333333333",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/agent-versions/33333333-3333-4333-8333-333333333333",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v5\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v5\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "invalid_path",
        "x-kejue-recovery-example": "invalid_path",
        "x-sonus-required-permission": "agents:read",
        "x-kejue-required-permission": "agents:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an agent version",
        "description": "Returns an exact draft or immutable snapshot together with the parent agent aggregate revision. The ETag versions the complete agent aggregate, not only this version row; use it on a subsequent agent mutation. It is not interchangeable with an after-call configuration ETag.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "vid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentVersionGetResponse"
                },
                "example": {
                  "agent_id": "11111111-1111-4111-8111-111111111111",
                  "revision": 5,
                  "version": {
                    "id": "33333333-3333-4333-8333-333333333333",
                    "version": 1,
                    "is_draft": false,
                    "name": "Initial production candidate",
                    "prompt": "Help {{lead_name}} resolve their billing question. Call {{system.call_id}} is handled in {{system.timezone.asia-dubai}}.",
                    "pipeline_topology": "two_stage_speechlm",
                    "pipeline_mode": "speech_model",
                    "endpointing_mode": "auto",
                    "created_by": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
                    "created_at": "2026-07-20T09:15:00Z"
                  }
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/agent-versions/{vid}/after-call": {
      "get": {
        "operationId": "get_agent_version_after_call",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/agent-versions/22222222-2222-4222-8222-222222222222/after-call",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/agent-versions/22222222-2222-4222-8222-222222222222/after-call",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v0\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v0\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "invalid_path",
        "x-kejue-recovery-example": "invalid_path",
        "x-sonus-required-permission": "agents:read",
        "x-kejue-required-permission": "agents:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an exact version's after-call configuration",
        "description": "Returns either the persisted configuration or an explicit virtual default with id, timestamps, and summary_prompt set to null and version 0. The strong ETag can be supplied to PATCH. This configuration has an independent revision domain; its ETag is not interchangeable with the parent agent aggregate ETag.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "vid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exact version configuration or its virtual default.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AfterCallConfig"
                },
                "example": {
                  "id": null,
                  "agent_version_id": "22222222-2222-4222-8222-222222222222",
                  "summary_enabled": true,
                  "summary_prompt": null,
                  "extraction_object_ids": [],
                  "webhook_config_ids": [],
                  "version": 0,
                  "created_at": null,
                  "updated_at": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_agent_version_after_call",
        "x-sonus-request-example": {
          "method": "PATCH",
          "path": "/v1/agent-versions/22222222-2222-4222-8222-222222222222/after-call",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"after-call-22222222-2222-4222-8222-222222222222-v0\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-kejue-request-example": {
          "method": "PATCH",
          "path": "/v1/agent-versions/22222222-2222-4222-8222-222222222222/after-call",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"after-call-22222222-2222-4222-8222-222222222222-v0\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v1\"",
            "Sonus-Agent-ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\"",
            "Kejue-Agent-ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v1\"",
            "Sonus-Agent-ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\"",
            "Kejue-Agent-ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "stale_after_call",
        "x-kejue-recovery-example": "stale_after_call",
        "x-sonus-required-permission": "agents:update",
        "x-kejue-required-permission": "agents:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "version_locked"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "version_locked"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Partially update a draft version's after-call configuration",
        "description": "Updates only fields supplied by the caller. The version must be the active mutable draft; numbered, staging, and production snapshots are immutable. Active extraction and webhook references are validated in the same transaction. Send summary_prompt as null or a blank string to restore the system prompt. Supply the after-call ETag, not the parent agent aggregate ETag. A changed configuration also advances the parent agent aggregate revision; Sonus-Agent-ETag returns the parent tag required by subsequent lifecycle mutations. A semantic no-op preserves both revision domains.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "vid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AfterCallPatchRequest"
              },
              "example": {
                "summary_enabled": true,
                "summary_prompt": "Summarize the caller's issue, resolution, and promised follow-up without adding facts.",
                "extraction_object_ids": [
                  "44444444-4444-4444-8444-444444444444"
                ],
                "webhook_config_ids": [
                  "55555555-5555-4555-8555-555555555555"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated configuration, or the unchanged representation for a semantic no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Sonus-Agent-ETag": {
                "$ref": "#/components/headers/SonusAgentETag"
              },
              "Kejue-Agent-ETag": {
                "$ref": "#/components/headers/SonusAgentETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AfterCallConfig"
                },
                "example": {
                  "id": "66666666-6666-4666-8666-666666666666",
                  "agent_version_id": "22222222-2222-4222-8222-222222222222",
                  "summary_enabled": true,
                  "summary_prompt": "Summarize the caller's issue, resolution, and promised follow-up without adding facts.",
                  "extraction_object_ids": [
                    "44444444-4444-4444-8444-444444444444"
                  ],
                  "webhook_config_ids": [
                    "55555555-5555-4555-8555-555555555555"
                  ],
                  "version": 1,
                  "created_at": "2026-07-20T09:10:00Z",
                  "updated_at": "2026-07-20T09:10:00Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/agents": {
      "get": {
        "operationId": "list_agents",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/agents?limit=25&mode=prompt&archived=exclude",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/agents?limit=25&mode=prompt&archived=exclude",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "invalid_cursor",
        "x-kejue-recovery-example": "invalid_cursor",
        "x-sonus-required-permission": "agents:read",
        "x-kejue-required-permission": "agents:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List agents",
        "description": "Returns a cursor-paginated organization-scoped page ordered by creation time and ID, newest first. Cursors are bound to this endpoint and filter set. Use archived=include or archived=only when an archived aggregate must remain discoverable. mode, pipeline_topology, and node_count are derived from the effective version in strict production→staging→draft precedence; they do not necessarily describe a newer unpromoted draft when production exists.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Case-insensitive substring search over agent slug and name."
          },
          {
            "name": "created_from",
            "in": "query",
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                }
              ]
            },
            "description": "Inclusive creation-time lower bound. A YYYY-MM-DD date is also accepted as midnight UTC."
          },
          {
            "name": "created_to",
            "in": "query",
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                }
              ]
            },
            "description": "Exclusive creation-time upper bound. Must be later than created_from."
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pathway",
                "prompt",
                "empty"
              ]
            }
          },
          {
            "name": "archived",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "exclude",
                "include",
                "only"
              ],
              "default": "exclude"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentListResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "11111111-1111-4111-8111-111111111111",
                      "slug": "billing_assistant",
                      "name": "Billing Assistant",
                      "revision": 5,
                      "updated_at": "2026-07-20T09:25:00Z",
                      "production_version_id": "33333333-3333-4333-8333-333333333333",
                      "production_version_number": 1,
                      "pipeline_topology": "two_stage_speechlm",
                      "mode": "prompt",
                      "created_at": "2026-07-20T09:00:00Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_agent",
        "x-sonus-request-example": {
          "method": "POST",
          "path": "/v1/agents",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "agent-create-billing-20260720"
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-kejue-request-example": {
          "method": "POST",
          "path": "/v1/agents",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "agent-create-billing-20260720"
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-sonus-response-example": {
          "status": 201,
          "headers": {
            "Location": "/v1/agents/11111111-1111-4111-8111-111111111111",
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v1\""
          },
          "body": "See the standard 201 application/json example."
        },
        "x-kejue-response-example": {
          "status": 201,
          "headers": {
            "Location": "/v1/agents/11111111-1111-4111-8111-111111111111",
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v1\""
          },
          "body": "See the standard 201 application/json example."
        },
        "x-sonus-recovery-example": "slug_conflict",
        "x-kejue-recovery-example": "slug_conflict",
        "x-sonus-required-permission": "agents:create",
        "x-kejue-required-permission": "agents:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "slug_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "agent_baseline_too_large",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "slug_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "agent_baseline_too_large",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create an agent and its mutable draft",
        "description": "Creates the aggregate at revision 1 and seeds exactly one mutable draft. Use the returned Location for the canonical agent representation and its ETag for conditional follow-up writes.",
        "tags": [
          "Agents"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentCreateRequest"
              },
              "example": {
                "slug": "billing_assistant",
                "name": "Billing Assistant",
                "mode": "prompt",
                "prompt": "Help {{lead_name}} resolve their billing question. Never request a secret; use call {{system.call_id}} for support correlation."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCreateResponse"
                },
                "example": {
                  "id": "11111111-1111-4111-8111-111111111111",
                  "slug": "billing_assistant",
                  "name": "Billing Assistant",
                  "mode": "prompt",
                  "draft_version_id": "22222222-2222-4222-8222-222222222222",
                  "revision": 1,
                  "updated_at": "2026-07-20T09:00:00Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/agents/{id}": {
      "delete": {
        "operationId": "archive_agent",
        "x-sonus-request-example": {
          "method": "DELETE",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v5\""
          }
        },
        "x-kejue-request-example": {
          "method": "DELETE",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v5\""
          }
        },
        "x-sonus-response-example": {
          "status": 204,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v6\""
          },
          "body": null
        },
        "x-kejue-response-example": {
          "status": 204,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v6\""
          },
          "body": null
        },
        "x-sonus-recovery-example": "stale_aggregate",
        "x-kejue-recovery-example": "stale_aggregate",
        "x-sonus-required-permission": "agents:delete",
        "x-kejue-required-permission": "agents:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive an agent",
        "description": "Soft-archives the aggregate. Repeating the operation is a semantic no-op and preserves the revision. Supply If-Match to prevent archiving a newer representation than the one your automation inspected.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Agent archived, or was already archived. The response has no body. Example result: status 204 with ETag \"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v6\"; a repeated archive with that tag remains 204 and preserves it.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_agent",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v5\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v5\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "invalid_path",
        "x-kejue-recovery-example": "invalid_path",
        "x-sonus-required-permission": "agents:read",
        "x-kejue-required-permission": "agents:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an agent aggregate",
        "description": "Returns metadata, mutable draft, deployment pointers, and compact immutable history from one coherent aggregate snapshot. Use the strong ETag on any subsequent agent mutation.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentDetail"
                },
                "example": {
                  "id": "11111111-1111-4111-8111-111111111111",
                  "slug": "billing_assistant",
                  "name": "Billing Assistant",
                  "revision": 5,
                  "updated_at": "2026-07-20T09:25:00Z",
                  "production_version_id": "33333333-3333-4333-8333-333333333333",
                  "production_version_number": 1,
                  "production_version": {
                    "id": "33333333-3333-4333-8333-333333333333",
                    "version": 1,
                    "is_draft": false,
                    "name": "Initial production candidate",
                    "prompt": "Help {{lead_name}} resolve their billing question.",
                    "pipeline_topology": "two_stage_speechlm",
                    "pipeline_mode": "speech_model",
                    "endpointing_mode": "auto",
                    "created_by": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
                    "created_at": "2026-07-20T09:15:00Z"
                  },
                  "staging_version_id": "33333333-3333-4333-8333-333333333333",
                  "staging_version": {
                    "id": "33333333-3333-4333-8333-333333333333",
                    "version": 1,
                    "is_draft": false,
                    "name": "Initial production candidate",
                    "prompt": "Help {{lead_name}} resolve their billing question.",
                    "pipeline_topology": "two_stage_speechlm",
                    "pipeline_mode": "speech_model",
                    "endpointing_mode": "auto",
                    "created_by": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
                    "created_at": "2026-07-20T09:15:00Z"
                  },
                  "draft_version_id": "22222222-2222-4222-8222-222222222222",
                  "draft_version": {
                    "id": "22222222-2222-4222-8222-222222222222",
                    "is_draft": true,
                    "prompt": "Help {{lead_name}} resolve their billing question.",
                    "pipeline_topology": "two_stage_speechlm",
                    "pipeline_mode": "speech_model",
                    "endpointing_mode": "auto",
                    "created_at": "2026-07-20T09:00:00Z"
                  },
                  "pipeline_topology": "two_stage_speechlm",
                  "mode": "prompt",
                  "created_at": "2026-07-20T09:00:00Z",
                  "versions": [
                    {
                      "id": "33333333-3333-4333-8333-333333333333",
                      "version": 1,
                      "is_draft": false,
                      "name": "Initial production candidate",
                      "pipeline_topology": "two_stage_speechlm",
                      "created_by": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
                      "created_at": "2026-07-20T09:15:00Z"
                    }
                  ],
                  "three_stage_allowed": false,
                  "all_stt_models_allowed": false
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_agent",
        "x-sonus-request-example": {
          "method": "PATCH",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v1\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-kejue-request-example": {
          "method": "PATCH",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v1\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v2\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v2\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "stale_aggregate",
        "x-kejue-recovery-example": "stale_aggregate",
        "x-sonus-required-permission": "agents:update",
        "x-kejue-required-permission": "agents:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "agent_state_changed"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "agent_state_changed"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update agent metadata",
        "description": "Renames the agent. Same-value patches are successful semantic no-ops and retain the current revision and ETag.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentPatchRequest"
              },
              "example": {
                "name": "Billing and Payments Assistant"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentPatchResponse"
                },
                "example": {
                  "id": "11111111-1111-4111-8111-111111111111",
                  "name": "Billing and Payments Assistant",
                  "updated": true,
                  "revision": 2,
                  "updated_at": "2026-07-20T09:05:00Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/agents/{id}/after-call": {
      "get": {
        "operationId": "get_agent_after_call",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/after-call",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/after-call",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v1\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v1\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "invalid_path",
        "x-kejue-recovery-example": "invalid_path",
        "x-sonus-required-permission": "agents:read",
        "x-kejue-required-permission": "agents:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "no_agent_version"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "no_agent_version"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get the effective after-call configuration for an agent",
        "description": "Resolves the draft first, then staging, then production. Use the version route when an exact version is required. The response ETag versions only this after-call configuration and is not interchangeable with the parent agent aggregate ETag.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Effective after-call configuration.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AfterCallConfig"
                },
                "example": {
                  "id": "66666666-6666-4666-8666-666666666666",
                  "agent_version_id": "22222222-2222-4222-8222-222222222222",
                  "summary_enabled": true,
                  "summary_prompt": null,
                  "extraction_object_ids": [],
                  "webhook_config_ids": [],
                  "version": 1,
                  "created_at": "2026-07-20T09:10:00Z",
                  "updated_at": "2026-07-20T09:10:00Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_agent_after_call",
        "x-sonus-request-example": {
          "method": "PATCH",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/after-call",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"after-call-22222222-2222-4222-8222-222222222222-v1\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-kejue-request-example": {
          "method": "PATCH",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/after-call",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"after-call-22222222-2222-4222-8222-222222222222-v1\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v2\"",
            "Sonus-Agent-ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v4\"",
            "Kejue-Agent-ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v4\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"after-call-22222222-2222-4222-8222-222222222222-v2\"",
            "Sonus-Agent-ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v4\"",
            "Kejue-Agent-ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v4\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "stale_after_call",
        "x-kejue-recovery-example": "stale_after_call",
        "x-sonus-required-permission": "agents:update",
        "x-kejue-required-permission": "agents:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "no_mutable_draft",
            "version_locked"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "no_mutable_draft",
            "version_locked"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Partially update an agent draft's after-call configuration",
        "description": "Always targets the mutable draft. It never silently changes a staging, production, or historical version. Supply the after-call configuration ETag, not the parent agent aggregate ETag. A changed configuration also advances the parent aggregate revision; Sonus-Agent-ETag returns the tag to use for promotion or any other agent mutation. A semantic no-op preserves both tags.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AfterCallPatchRequest"
              },
              "example": {
                "summary_enabled": true,
                "extraction_object_ids": [
                  "44444444-4444-4444-8444-444444444444"
                ],
                "webhook_config_ids": [
                  "55555555-5555-4555-8555-555555555555"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated configuration. A semantic no-op returns the unchanged representation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Sonus-Agent-ETag": {
                "$ref": "#/components/headers/SonusAgentETag"
              },
              "Kejue-Agent-ETag": {
                "$ref": "#/components/headers/SonusAgentETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AfterCallConfig"
                },
                "example": {
                  "id": "66666666-6666-4666-8666-666666666666",
                  "agent_version_id": "22222222-2222-4222-8222-222222222222",
                  "summary_enabled": true,
                  "summary_prompt": null,
                  "extraction_object_ids": [
                    "44444444-4444-4444-8444-444444444444"
                  ],
                  "webhook_config_ids": [
                    "55555555-5555-4555-8555-555555555555"
                  ],
                  "version": 2,
                  "created_at": "2026-07-20T09:10:00Z",
                  "updated_at": "2026-07-20T09:12:00Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/agents/{id}/clone": {
      "post": {
        "operationId": "clone_agent",
        "x-sonus-required-permission": "agents:create",
        "x-kejue-required-permission": "agents:create",
        "x-sonus-additional-required-permissions": [
          "agents:read"
        ],
        "x-sonus-required-entitlement": null,
        "x-kejue-additional-required-permissions": [
          "agents:read"
        ],
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store, no-transform",
        "x-kejue-cache-control": "no-store, no-transform",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "no_agent_version",
            "slug_taken"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "no_agent_version",
            "slug_taken"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-sonus-request-example": {
          "method": "POST",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/clone",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "billing-clone-1"
          },
          "body": {
            "name": "Billing_clone",
            "slug": "billing_clone",
            "source": "production"
          }
        },
        "x-sonus-response-example": {
          "status": 201,
          "body": "See the standard 201 application/json example."
        },
        "x-sonus-recovery-example": "slug_conflict",
        "x-kejue-request-example": {
          "method": "POST",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/clone",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "billing-clone-1"
          },
          "body": {
            "name": "Billing_clone",
            "slug": "billing_clone",
            "source": "production"
          }
        },
        "x-kejue-response-example": {
          "status": 201,
          "body": "See the standard 201 application/json example."
        },
        "x-kejue-recovery-example": "slug_conflict",
        "summary": "Clone an agent",
        "description": "Copies the selected draft, staging, or production version into the mutable draft of a new agent in the same team. Copies the prompt or workflow, models, voice, behavior, and after-call configuration. Shared resources retain their IDs. The new agent starts without deployments, phone assignments, call history, or version history. Its first promotion creates version 1. Requires agents:create and agents:read. Pathway clones require the pathways entitlement.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Source agent UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentCloneRequest"
              },
              "example": {
                "name": "Billing_clone",
                "slug": "billing_clone",
                "source": "production"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new agent.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentCreateResponse"
                },
                "example": {
                  "id": "44444444-4444-4444-8444-444444444444",
                  "slug": "billing_clone",
                  "name": "Billing_clone",
                  "mode": "prompt",
                  "draft_version_id": "55555555-5555-4555-8555-555555555555",
                  "revision": 1,
                  "updated_at": "2026-11-12T09:00:00Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/agents/{id}/deploy": {
      "post": {
        "operationId": "deploy_agent_to_production",
        "x-sonus-request-example": {
          "method": "POST",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/deploy",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Idempotency-Key": "agent-deploy-billing-v1-20260720",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v4\""
          },
          "body": null
        },
        "x-kejue-request-example": {
          "method": "POST",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/deploy",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Idempotency-Key": "agent-deploy-billing-v1-20260720",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v4\""
          },
          "body": null
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v5\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v5\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "baseline_over_budget",
        "x-kejue-recovery-example": "baseline_over_budget",
        "x-sonus-required-permission": "agents:deploy",
        "x-kejue-required-permission": "agents:deploy",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "request_body_read_failed",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "no_staging_version"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "agent_baseline_too_large",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "request_body_read_failed",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "no_staging_version"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "agent_baseline_too_large",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Deploy staging to production",
        "description": "Atomically points production at the current staging snapshot. The complete stored snapshot and its after-call dependencies are revalidated against the current catalog and baseline budget before activation, including for a semantic no-op. If production already references that snapshot, a valid request preserves the aggregate revision. Pair each new logical intent with a new Idempotency-Key and the latest agent If-Match value.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentDeployResponse"
                },
                "example": {
                  "agent_id": "11111111-1111-4111-8111-111111111111",
                  "production_version_id": "33333333-3333-4333-8333-333333333333",
                  "updated": true,
                  "revision": 5,
                  "updated_at": "2026-07-20T09:25:00Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/agents/{id}/draft": {
      "patch": {
        "operationId": "update_agent_draft",
        "x-sonus-request-example": {
          "method": "PATCH",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/draft",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v2\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-kejue-request-example": {
          "method": "PATCH",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/draft",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v2\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "invalid_template",
        "x-kejue-recovery-example": "invalid_template",
        "x-sonus-required-permission": "agents:update",
        "x-kejue-required-permission": "agents:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "agent_baseline_too_large",
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "agent_baseline_too_large",
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Partially update the mutable agent draft",
        "description": "Merge-patches one mutable draft. Omitted fields are preserved. Same-value patches return updated false and retain the aggregate revision. A stale If-Match fails before any persistence.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentDraftSaveRequest"
              },
              "example": {
                "prompt": "You are a billing-triage assistant. Keep answers concise for {{vars.customer_tier}} callers in call {{system.call_id}}.",
                "pipeline_topology": "two_stage_speechlm"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentDraftSaveResponse"
                },
                "example": {
                  "id": "22222222-2222-4222-8222-222222222222",
                  "agent_id": "11111111-1111-4111-8111-111111111111",
                  "updated": true,
                  "revision": 3,
                  "updated_at": "2026-07-20T09:08:00Z",
                  "draft": {
                    "id": "22222222-2222-4222-8222-222222222222",
                    "is_draft": true,
                    "prompt": "You are a billing-triage assistant. Keep answers concise for {{vars.customer_tier}} callers in call {{system.call_id}}.",
                    "pipeline_topology": "two_stage_speechlm",
                    "pipeline_mode": "speech_model",
                    "endpointing_mode": "auto",
                    "created_at": "2026-07-20T09:00:00Z"
                  }
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/agents/{id}/estimate-baseline": {
      "post": {
        "operationId": "estimate_agent_baseline",
        "x-sonus-request-example": {
          "method": "POST",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/estimate-baseline",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "agent-estimate-billing-candidate-20260720"
          },
          "body": "See the standard persisted_draft and prompt_candidate request examples."
        },
        "x-kejue-request-example": {
          "method": "POST",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/estimate-baseline",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "agent-estimate-billing-candidate-20260720"
          },
          "body": "See the standard persisted_draft and prompt_candidate request examples."
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "Cache-Control": "private, no-store",
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "Cache-Control": "private, no-store",
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "invalid_template",
        "x-kejue-recovery-example": "invalid_template",
        "x-sonus-required-permission": "agents:update",
        "x-kejue-required-permission": "agents:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "optional",
        "x-kejue-idempotency": "optional",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Estimate prompt and tool baseline token usage",
        "description": "Read-only admission-control preview for a complete candidate draft. The body is the same merge patch as PATCH /agents/{id}/draft: omitted fields come from the persisted draft, {} estimates it unchanged, and all normal authoring and reference validation runs. The operation never writes the draft, baseline_tokens, aggregate revision, or audit log. Compare baseline_tokens with max_model_len (the usable budget, 80% of model_context_limit); exceeding the budget is reported in the successful estimate so automation can reduce prompt or tool cost before attempting a save. The 200 ETag is the strong tag of the aggregate snapshot used to assemble the candidate; pass it as If-Match on the subsequent draft PATCH so any change after preflight fails with 412.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentBaselineEstimateRequest"
              },
              "examples": {
                "persisted_draft": {
                  "summary": "Estimate the current draft without changing any candidate field",
                  "value": {}
                },
                "prompt_candidate": {
                  "summary": "Merge a prompt-mode candidate in memory",
                  "value": {
                    "prompt": "Resolve {{account_id}} using caller {{system.caller_phone}} without exposing credentials.",
                    "behavior": {
                      "tools": {
                        "tool_ids": [
                          "88888888-8888-4888-8888-888888888888"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token estimate and configured headroom.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentBaselineEstimateResponse"
                },
                "example": {
                  "baseline_tokens": 4821,
                  "max_model_len": 24576,
                  "model_context_limit": 32768,
                  "headroom_budget": 24576,
                  "components": {
                    "system": 1210,
                    "tools": 3611
                  }
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Cache-Control": {
                "description": "The candidate and its derived token costs can contain or reveal sensitive authored configuration and must not be cached.",
                "schema": {
                  "type": "string",
                  "const": "private, no-store"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/agents/{id}/promote-staging": {
      "post": {
        "operationId": "promote_agent_draft_to_staging",
        "x-sonus-request-example": {
          "method": "POST",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/promote-staging",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "agent-promote-billing-v1-20260720",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-kejue-request-example": {
          "method": "POST",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/promote-staging",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "agent-promote-billing-v1-20260720",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v3\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-sonus-response-example": {
          "status": 201,
          "headers": {
            "Location": "/v1/agent-versions/33333333-3333-4333-8333-333333333333",
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v4\""
          },
          "body": "See the standard 201 application/json example."
        },
        "x-kejue-response-example": {
          "status": 201,
          "headers": {
            "Location": "/v1/agent-versions/33333333-3333-4333-8333-333333333333",
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v4\""
          },
          "body": "See the standard 201 application/json example."
        },
        "x-sonus-recovery-example": "baseline_over_budget",
        "x-kejue-recovery-example": "baseline_over_budget",
        "x-sonus-required-permission": "agents:promote",
        "x-kejue-required-permission": "agents:promote",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "draft_state_changed",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "no_draft"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "agent_baseline_too_large",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "draft_state_changed",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "no_draft"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "agent_baseline_too_large",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Snapshot draft to staging",
        "description": "Revalidates the locked mutable draft, its reusable catalog and transfer references, after-call dependencies, and baseline budget; snapshots it as the next immutable version; then points staging at it. A successful new logical intent always advances the aggregate revision; replaying the same Idempotency-Key returns the original response instead of creating another snapshot.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentPromoteDraftRequest"
              },
              "example": {
                "name": "Initial production candidate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentPromoteDraftResponse"
                },
                "example": {
                  "id": "33333333-3333-4333-8333-333333333333",
                  "agent_id": "11111111-1111-4111-8111-111111111111",
                  "staging_version_id": "33333333-3333-4333-8333-333333333333",
                  "version": 1,
                  "revision": 4,
                  "updated_at": "2026-07-20T09:15:00Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/agents/{id}/staging": {
      "put": {
        "operationId": "set_agent_staging_version",
        "x-sonus-request-example": {
          "method": "PUT",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/staging",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v7\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-kejue-request-example": {
          "method": "PUT",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/staging",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v7\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v8\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"agent-11111111-1111-4111-8111-111111111111-r1-cap-00-v8\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "stale_aggregate",
        "x-kejue-recovery-example": "stale_aggregate",
        "x-sonus-required-permission": "agents:promote",
        "x-kejue-required-permission": "agents:promote",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "agent_state_changed",
            "draft_not_promotable"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "agent_baseline_too_large",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "agent_state_changed",
            "draft_not_promotable"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "agent_baseline_too_large",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Point staging at a version",
        "description": "Points staging at an existing immutable version owned by this agent. Before changing the pointer, the server revalidates the complete stored agent and after-call configuration against the current active catalog, transfer targets, provider constraints, topology policy, and baseline budget. Validation also runs when selecting the current staging version; a valid semantic no-op preserves the aggregate revision.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentPromoteStagingRequest"
              },
              "example": {
                "version_id": "33333333-3333-4333-8333-333333333333"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentPromoteStagingResponse"
                },
                "example": {
                  "agent_id": "11111111-1111-4111-8111-111111111111",
                  "staging_version_id": "33333333-3333-4333-8333-333333333333",
                  "updated": true,
                  "revision": 8,
                  "updated_at": "2026-07-20T10:00:00Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/agents/{id}/versions": {
      "get": {
        "operationId": "list_agent_versions",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/versions?limit=50",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/agents/11111111-1111-4111-8111-111111111111/versions?limit=50",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "invalid_cursor",
        "x-kejue-recovery-example": "invalid_cursor",
        "x-sonus-required-permission": "agents:read",
        "x-kejue-required-permission": "agents:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List every immutable version of an agent",
        "description": "Cursor-paginated compact history without prompt, workflow, or behavior bodies. Rows are ordered by created_at descending, then UUID id descending. A page cursor encodes the last returned pair and the request scope; the next page contains only tuples strictly older than that pair. Use a cursor only with this same agent and query shape. Fetch a selected version for its full configuration.",
        "tags": [
          "Agents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/AgentVersionLimit"
          }
        ],
        "responses": {
          "200": {
            "description": "Page of immutable versions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentVersionListResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "99999999-9999-4999-8999-999999999999",
                      "version": 2,
                      "is_draft": false,
                      "name": "Safer billing transfer",
                      "pipeline_topology": "two_stage_speechlm",
                      "created_by": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
                      "created_at": "2026-07-20T09:45:00Z"
                    },
                    {
                      "id": "33333333-3333-4333-8333-333333333333",
                      "version": 1,
                      "is_draft": false,
                      "name": "Initial production candidate",
                      "pipeline_topology": "two_stage_speechlm",
                      "created_by": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
                      "created_at": "2026-07-20T09:15:00Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/analysis/boards": {
      "get": {
        "operationId": "list_analysis_boards",
        "x-sonus-required-permission": "boards:read",
        "x-kejue-required-permission": "boards:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List analysis boards",
        "description": "Returns board summaries newest first. Lists omit embedded insights; follow a board URL for the ordered definitions. Cursors are endpoint-scoped and cannot be replayed against another list operation.",
        "tags": [
          "Analytics boards"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Case-insensitive substring search of board names.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          }
        ],
        "responses": {
          "200": {
            "description": "Matching analysis-board page. next_cursor is always present and is null on the final page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoardListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_analysis_board",
        "x-sonus-required-permission": "boards:create",
        "x-kejue-required-permission": "boards:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "analysis_board_name_taken",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "analysis_board_name_taken",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create an analysis board",
        "description": "Creates an active board with no insights. Active board names are unique case-insensitively; archived boards do not reserve their names. Use Idempotency-Key for safe retries. A duplicate active name returns the stable 409 analysis_board_name_taken response without leaving a partial write or degrading idempotency persistence into a server error.",
        "tags": [
          "Analytics boards"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BoardCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Analysis board created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Board"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/analysis/boards/{id}": {
      "get": {
        "operationId": "get_analysis_board",
        "x-sonus-required-permission": "boards:read",
        "x-kejue-required-permission": "boards:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_board_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_board_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an analysis board",
        "description": "Returns the board and all saved insights ordered by position and ID. Archived boards remain readable. The board ETag changes when the board or any nested insight changes.",
        "tags": [
          "Analytics boards"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Analysis board with ordered insights.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Board"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_analysis_board",
        "x-sonus-required-permission": "boards:update",
        "x-kejue-required-permission": "boards:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_board_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "analysis_board_name_taken",
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_board_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "analysis_board_name_taken",
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update, archive, or restore an analysis board",
        "description": "Partially updates a board. Set archived=true to make its insight definitions read-only and hide it from the default list; set archived=false to restore it. Restoring can return 409 if another active board now uses the name. Use If-Match for optimistic concurrency.",
        "tags": [
          "Analytics boards"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BoardPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated board and its current ordered insights. A semantic no-op returns the unchanged ETag and writes a no-op audit entry.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Board"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/analysis/boards/{id}/export": {
      "get": {
        "operationId": "export_analysis_board",
        "x-sonus-required-permission": "boards:read",
        "x-kejue-required-permission": "boards:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_board_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "analysis_result_too_large",
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "analysis_export_failed",
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_board_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "analysis_result_too_large",
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "analysis_export_failed",
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Export an analysis board",
        "description": "Exports an analysis board from one consistent request transaction. CSV is the data behind the board - one row per call that any of the board's insights reads, using each insight's own time range, agent scope and filters (contact insights read contacts, not calls, and add no rows). The first row is a header. Fixed columns come first - call_id, call_url (the call's page in the dashboard), started_at, answered_at, ended_at and timezone, lifecycle_status, ended_reason, failure_code, failure_reason, direction, channel, handled_by, human_agent, agent_name, agent_id, agent_version, flow_name, group_name, group_member, campaign_name, campaign_id, caller_number, platform_number, contact_name, contact_company, ring_duration_sec, duration_sec (talk time, as boards measure it), total_duration_sec, turns, tool_calls_total, tool_calls_failed, guardrail_triggers, outcome, and board_insights (the insights that read the call) - then one column per extraction field, named \"<extraction object>: <field>\", for every extraction object the board's insights read (other extraction objects that ran on the same calls are not included). Rows are newest first; an export holding more than 50,000 calls fails with analysis_result_too_large (limit_kind calls) - narrow the window. PDF computes every insight and fails as a whole when any insight is invalid or exceeds the documented result limits; it never silently embeds a partial result. Successful exports are audited. Pass from and to to export the board over one board-wide window instead of each insight's saved range; for PDF the time granularity then follows the window (hourly up to 2 days, daily up to 92 days, weekly beyond). In CSV output, user-controlled text cells that spreadsheet software could interpret as formulas are prefixed with an apostrophe; consumers should preserve that prefix when opening the file in a spreadsheet. PDF is a branded visual report for sharing, not a data dump - a header with the board name, team, time range, generation time and the person or API key that generated it, then every insight drawn as its chart (number insights as headline figures with their previous-period change, table insights as a compact top-N list).",
        "tags": [
          "Analytics boards"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "csv",
                "pdf"
              ],
              "default": "csv"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start of a window (RFC3339, inclusive) that replaces each insight's saved time range for this request. Must be sent together with `to`. The saved insight is not changed.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End of the override window (RFC3339, exclusive). Must be after `from` and at most 400 days later. Time-grouped results are re-bucketed for the window's length — hourly up to 2 days, daily up to 92 days, weekly beyond.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "range_label",
            "in": "query",
            "required": false,
            "description": "Human name for the board-wide window, such as \"Last 30 days\", printed in the PDF header. Display only; requires from and to.",
            "schema": {
              "type": "string",
              "maxLength": 80
            }
          },
          {
            "name": "tz",
            "in": "query",
            "required": false,
            "description": "IANA time zone, such as Asia/Dubai, for the dates and times printed in the PDF and the CSV's call timestamps. Defaults to UTC. Does not change how insights are computed.",
            "schema": {
              "type": "string",
              "example": "Asia/Dubai"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete board export. Content-Disposition is an attachment with a sanitized board name and UTC generation date. CSV user-text cells are neutralized against spreadsheet-formula execution.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/analysis/boards/{id}/insights": {
      "post": {
        "operationId": "create_analysis_insight",
        "x-sonus-required-permission": "boards:create",
        "x-kejue-required-permission": "boards:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_board_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "analysis_board_archived",
            "analysis_board_capacity_reached",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_board_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "analysis_board_archived",
            "analysis_board_capacity_reached",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create an analysis insight",
        "description": "Adds a saved query to an active board. Omitted presentation fields receive documented defaults; omitted position appends after the highest current position. The complete normalized definition is returned. Use Idempotency-Key for safe retries.",
        "tags": [
          "Analytics boards"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InsightCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Insight created. The containing board's ETag also changes.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Insight"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/analysis/insights/{id}": {
      "get": {
        "operationId": "get_analysis_insight",
        "x-sonus-required-permission": "boards:read",
        "x-kejue-required-permission": "boards:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_insight_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_insight_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an analysis insight",
        "description": "Returns one normalized saved insight definition. It remains readable when its board is archived.",
        "tags": [
          "Analytics boards"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Saved insight definition.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Insight"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "delete_analysis_insight",
        "x-sonus-required-permission": "boards:delete",
        "x-kejue-required-permission": "boards:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_insight_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "analysis_board_archived",
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_insight_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "analysis_board_archived",
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Delete an analysis insight",
        "description": "Permanently deletes one insight definition from an active board. Underlying call, extraction, guardrail, tool-call, and contact data is unaffected. Use If-Match for optimistic concurrency.",
        "tags": [
          "Analytics boards"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Insight deleted. The response has no body and the containing board's ETag changes.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_analysis_insight",
        "x-sonus-required-permission": "boards:update",
        "x-kejue-required-permission": "boards:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_insight_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "analysis_board_archived",
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_insight_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "analysis_board_archived",
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Partially update an analysis insight",
        "description": "Replaces only supplied fields, then validates the complete merged definition. Updating an archived board's insight returns 409. A semantic no-op retains the current ETag. Use If-Match for optimistic concurrency.",
        "tags": [
          "Analytics boards"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InsightPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated normalized insight definition. The containing board's ETag also changes unless this was a no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Insight"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/analysis/insights/{id}/data": {
      "get": {
        "operationId": "get_analysis_insight_data",
        "x-sonus-required-permission": "boards:read",
        "x-kejue-required-permission": "boards:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_insight_not_found",
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "analysis_result_too_large",
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "analysis_insight_not_found",
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "analysis_result_too_large",
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Compute a saved analysis insight",
        "description": "Evaluates the current saved definition against live workspace data. Results are never cached and include generation time plus the enforced row, series, and cell limits. A result that exceeds a limit returns 422 analysis_result_too_large rather than a partial 200. Passing campaign_id pins every query in the insight to that campaign's calls; the scope is applied server-side on top of the stored configuration and cannot be expressed away by editing the insight. Passing from and to computes the insight over that window instead of its saved time range (the saved definition is unchanged), which is how a dashboard-wide date filter is applied; it composes with campaign_id.",
        "tags": [
          "Analytics boards"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "campaign_id",
            "in": "query",
            "required": false,
            "description": "Restrict the computation to calls fed by this campaign.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start of a window (RFC3339, inclusive) that replaces each insight's saved time range for this request. Must be sent together with `to`. The saved insight is not changed.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End of the override window (RFC3339, exclusive). Must be after `from` and at most 400 days later. Time-grouped results are re-bucketed for the window's length — hourly up to 2 days, daily up to 92 days, weekly beyond.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete computed result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryResult"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/analysis/preview": {
      "post": {
        "operationId": "preview_analysis",
        "x-sonus-required-permission": "boards:read",
        "x-kejue-required-permission": "boards:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "optional",
        "x-kejue-idempotency": "optional",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "analysis_result_too_large",
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "analysis_result_too_large",
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Preview an unsaved analysis insight",
        "description": "Evaluates a strict JSON insight specification without saving it. This is the canonical agent/CLI/MCP workflow; nested configuration is never placed in a URL. Successful previews are audited because they compute workspace data. Use Idempotency-Key when retrying a preview request through unreliable transport.",
        "tags": [
          "Analytics boards"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InsightPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Complete computed preview.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/analysis/schema": {
      "get": {
        "operationId": "get_analysis_schema",
        "x-sonus-required-permission": "boards:read",
        "x-kejue-required-permission": "boards:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Discover analysis query capabilities",
        "description": "Returns the complete machine-readable query vocabulary, per-column operations and filter operators, dynamic extraction-object fields, agent IDs, time bases, and hard result limits. Agents should read this endpoint instead of guessing which operation a column supports.",
        "tags": [
          "Analytics boards"
        ],
        "responses": {
          "200": {
            "description": "Current workspace-specific analysis schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalysisSchemaResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api-keys": {
      "get": {
        "operationId": "list_api_keys",
        "x-sonus-required-permission": "api-keys:read",
        "x-kejue-required-permission": "api-keys:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "summary": "List API keys",
        "description": "Lists safe credential metadata in reverse creation order. Secret and hash material are never returned. Follow `next_cursor` until null for a complete traversal.",
        "tags": [
          "Auth and API keys"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "Number of API keys to return."
          }
        ],
        "responses": {
          "200": {
            "description": "API keys, including revoked and expired keys.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyListResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_api_key",
        "x-sonus-required-permission": "api-keys:create",
        "x-kejue-required-permission": "api-keys:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "delegation_not_allowed",
            "forbidden",
            "permission_escalation",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "delegation_not_allowed",
            "forbidden",
            "permission_escalation",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "summary": "Create an API key",
        "description": "Creates a scoped credential. The `key` secret is returned in this response only and can never be retrieved again. Supplied scopes are canonicalized, and may not exceed the caller's own permissions.",
        "tags": [
          "Auth and API keys"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "API key metadata plus the one-time secret.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateApiKeyResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api-keys/{id}": {
      "get": {
        "operationId": "get_api_key",
        "x-sonus-required-permission": "api-keys:read",
        "x-kejue-required-permission": "api-keys:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "api_key_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "api_key_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "summary": "Get an API key",
        "description": "Returns safe metadata only; the credential secret is never retrievable. The strong ETag hashes the exact public JSON representation and therefore changes when last_used_at or any other emitted field changes.",
        "tags": [
          "Auth and API keys"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API key metadata.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKey"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "revoke_api_key",
        "x-sonus-required-permission": "api-keys:delete",
        "x-kejue-required-permission": "api-keys:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "api_key_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "api_key_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "summary": "Revoke an API key",
        "description": "Idempotently soft-revokes the credential. The metadata remains available for auditing. This operation accepts no request body.",
        "tags": [
          "Auth and API keys"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "The key is revoked; repeating the operation is a successful no-op.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/audit-log": {
      "get": {
        "operationId": "list_audit_log_entries",
        "x-sonus-required-permission": "audit-log:read",
        "x-kejue-required-permission": "audit-log:read",
        "x-sonus-required-entitlement": "audit_log_export",
        "x-kejue-required-entitlement": "audit_log_export",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List audit events",
        "description": "Returns an immutable, newest-first audit page. Exact filters combine with AND. `created_from` is inclusive and `created_to` is exclusive. Cursors are bound to this endpoint and the complete filter set.",
        "tags": [
          "Organization and audit"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Case-insensitive search across action, resource identity, actor identity, connected-app name, request ID, and client IP."
          },
          {
            "name": "created_from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Inclusive event timestamp as RFC3339 or YYYY-MM-DD."
          },
          {
            "name": "created_to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Exclusive event timestamp as RFC3339 or YYYY-MM-DD; must be after created_from."
          },
          {
            "name": "action",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 160
            }
          },
          {
            "name": "resource_kind",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          {
            "name": "resource_id",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "actor",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/AuditActorKind"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "actor_email",
            "in": "query",
            "description": "Filter by the acting user's email as recorded on the event. Matches the immutable per-event identity snapshot, so it selects actors whose home organization differs from this one — platform admins, account admins, and members of more than one organization.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 320
            }
          },
          {
            "name": "api_key_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "request_id",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "session_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "client_ip",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "via",
            "in": "query",
            "description": "Filter by delegation channel. `oauth` returns only events a person made through a connected app (an OAuth client such as Claude over MCP); `none` returns only events made directly.",
            "schema": {
              "type": "string",
              "enum": [
                "oauth",
                "none"
              ]
            }
          },
          {
            "name": "oauth_grant_id",
            "in": "query",
            "description": "Filter to the events made through one connected-app grant (the `via.grant_id` of an event or of an `/audit-log/actors` entry).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/audit-log/actors": {
      "get": {
        "operationId": "list_audit_log_actors",
        "x-sonus-required-permission": "audit-log:read",
        "x-kejue-required-permission": "audit-log:read",
        "x-sonus-required-entitlement": "audit_log_export",
        "x-kejue-required-entitlement": "audit_log_export",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List audit-log actors",
        "description": "Returns the distinct principals that appear in this organization's audit trail, most recently active first, so a client can offer a complete \"filter by actor\" control instead of guessing from a loaded page. Feed `email` back as the `actor_email` filter, or `api_key_id` as `api_key_id`. `truncated` is true when the organization has more distinct actors than a single response returns.",
        "tags": [
          "Organization and audit"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditActorsResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/auth/me": {
      "get": {
        "operationId": "get_auth_context",
        "x-sonus-required-permission": null,
        "x-kejue-required-permission": null,
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "entitlements_unavailable",
            "internal_error",
            "workspace_contract_unavailable"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "entitlements_unavailable",
            "internal_error",
            "workspace_contract_unavailable"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "summary": "Inspect the authenticated principal and workspace context",
        "description": "Returns one of two closed, discriminator-like shapes. API-key callers receive only the key-bound workspace and granted scopes; session callers receive their human identity, cross-workspace memberships, and optional account-admin context. Use `via_api_key` to narrow the response shape. Entitlement catalog keys and nullable contract fields are always emitted.",
        "tags": [
          "Auth and API keys"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthContextResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/background-noises": {
      "get": {
        "operationId": "list_background_noises",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/background-noises",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/background-noises",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "remove_unsupported_query_parameters",
        "x-kejue-recovery-example": "remove_unsupported_query_parameters",
        "x-sonus-required-permission": "agents:read",
        "x-kejue-required-permission": "agents:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List selectable background noises",
        "description": "Lists every ambience key this workspace may set as behavior.background_noise.sound on an agent: the bundled clips first, in fixed order, then the library sounds the platform operator uploaded and made available to this workspace, ordered by name. Takes no query parameters and is not paginated.",
        "tags": [
          "Agents"
        ],
        "responses": {
          "200": {
            "description": "Selectable background noises.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackgroundNoiseListResponse"
                },
                "example": {
                  "data": [
                    {
                      "key": "office",
                      "name": "Office ambience",
                      "description": "Room tone and distant activity",
                      "builtin": true,
                      "preview_available": false
                    },
                    {
                      "key": "call-centre-floor",
                      "name": "Call centre floor",
                      "description": null,
                      "builtin": false,
                      "preview_available": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/calls": {
      "get": {
        "operationId": "list_calls",
        "x-sonus-required-permission": "calls:read",
        "x-kejue-required-permission": "calls:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List non-eval calls",
        "description": "Returns a cursor page of call metadata. Eval-backed sessions and purged calls are excluded by default. Query parameters are closed and singleton except `ef` (up to 20), `agent_ids` (up to 120), and `channel_not` (up to six). Unknown or duplicate singleton parameters return 400 instead of being ignored. `next_cursor` is bound to the selected sort and direction.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/CallCursor"
          },
          {
            "$ref": "#/components/parameters/CallLimit"
          },
          {
            "name": "agent_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "agent_ids",
            "in": "query",
            "description": "Repeatable agent UUID scope. Matches any listed agent; ANDed with agent_id, agent_name and other filters. At most 120 values.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "minItems": 1,
              "maxItems": 120,
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "agent_name",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "campaign_id",
            "in": "query",
            "description": "Restrict to calls placed by one campaign.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "flow_id",
            "in": "query",
            "description": "Restrict to calls that ran inside one flow.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "group_id",
            "in": "query",
            "description": "Restrict to calls routed through one group (any member).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "completed"
              ]
            }
          },
          {
            "name": "call_id",
            "in": "query",
            "description": "Call-ID needle matched case-insensitively against the call UUID. `call_id_match` picks the mode and defaults to `starts_with`, so the 8-character short ID shown in the dashboard finds its call while a full UUID still matches.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "call_id_match",
            "in": "query",
            "description": "Match mode for `call_id`. Defaults to `starts_with`. Only read when `call_id` is present.",
            "schema": {
              "type": "string",
              "enum": [
                "contains",
                "is",
                "starts_with"
              ]
            }
          },
          {
            "name": "caller_number",
            "in": "query",
            "description": "Customer phone-number needle. `caller_match` picks the mode and defaults to a case-insensitive `contains`, so trailing digits still find the call. Only calls with a stored caller number match; purged and older calls have none.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "caller_match",
            "in": "query",
            "description": "Match mode for `caller_number`. Defaults to `contains`; `is` is an exact match. Only read when `caller_number` is present.",
            "schema": {
              "type": "string",
              "enum": [
                "contains",
                "is",
                "starts_with"
              ]
            }
          },
          {
            "name": "lifecycle_status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/CallLifecycleStatus"
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 160
            }
          },
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "inbound",
                "outbound"
              ]
            }
          },
          {
            "name": "handled_by",
            "in": "query",
            "description": "Restrict to AI-handled or ingested human-handled calls. Distinct from the session's channel, which records how the call reached the platform.",
            "schema": {
              "type": "string",
              "enum": [
                "ai",
                "human"
              ]
            }
          },
          {
            "name": "started_from",
            "in": "query",
            "description": "Inclusive RFC3339 start time.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "started_to",
            "in": "query",
            "description": "Exclusive RFC3339 end time; must be after started_from.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "duration_min",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0
            }
          },
          {
            "name": "duration_max",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0
            }
          },
          {
            "name": "total_duration_min",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0
            }
          },
          {
            "name": "total_duration_max",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0
            }
          },
          {
            "name": "turns_min",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2147483647
            }
          },
          {
            "name": "turns_max",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2147483647
            }
          },
          {
            "name": "has_recording",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "legal_hold",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "purged",
            "in": "query",
            "description": "true returns only purged tombstones; false returns only unpurged calls.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "include_purged",
            "in": "query",
            "description": "Include purged tombstones when purged is omitted.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "started_at",
                "duration",
                "total_duration",
                "segment_count",
                "outcome"
              ],
              "default": "started_at"
            }
          },
          {
            "name": "dir",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "ef",
            "in": "query",
            "description": "Repeatable base64url-encoded extraction-field filter object. Each encoded value is at most 4096 bytes; a request may contain at most 20. See CallExtractionFilter.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "maxItems": 20,
              "items": {
                "type": "string",
                "maxLength": 4096
              }
            }
          },
          {
            "name": "campaign_name",
            "in": "query",
            "description": "Exact-match campaign name (analysis-board drill-down). Matches every campaign with that display name.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "channel",
            "in": "query",
            "description": "How the call reached the platform. Null for rows predating the column's backfill, which therefore match no value.",
            "schema": {
              "type": "string",
              "enum": [
                "sip_inbound",
                "sip_outbound",
                "web_sdk",
                "web_test",
                "eval",
                "transfer_brief"
              ]
            }
          },
          {
            "name": "channel_not",
            "in": "query",
            "description": "Repeatable channel exclusion. Every exclusion is ANDed with other filters, including channel. Null channels do not match, consistent with analysis neq filters. At most six values.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "minItems": 1,
              "maxItems": 6,
              "items": {
                "type": "string",
                "enum": [
                  "sip_inbound",
                  "sip_outbound",
                  "web_sdk",
                  "web_test",
                  "eval",
                  "transfer_brief"
                ]
              }
            }
          },
          {
            "name": "failure_code",
            "in": "query",
            "description": "Exact-match failure code (analysis-board drill-down).",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          {
            "name": "human_agent",
            "in": "query",
            "description": "Exact-match human-agent label. Null for AI-handled calls.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "platform_number",
            "in": "query",
            "description": "Exact-match platform (our end) phone number.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "guardrail_name",
            "in": "query",
            "description": "Calls with a guardrail trigger of this name. Combined with the other guardrail_* parameters into a single existence test, so all of them must describe the SAME trigger.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "guardrail_id",
            "in": "query",
            "description": "Calls with a guardrail trigger of this id. See guardrail_name.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "guardrail_severity",
            "in": "query",
            "description": "Calls with a guardrail trigger of this severity. See guardrail_name.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "guardrail_set_slug",
            "in": "query",
            "description": "Calls with a guardrail trigger from this set. See guardrail_name.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "tool_slug",
            "in": "query",
            "description": "Calls that invoked this tool. Combined with the other tool_* parameters into a single existence test, so all of them must describe the SAME invocation.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "tool_name",
            "in": "query",
            "description": "Calls that invoked a tool with this display name. See tool_slug.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "tool_kind",
            "in": "query",
            "description": "Calls that invoked a tool of this kind. See tool_slug.",
            "schema": {
              "type": "string",
              "enum": [
                "catalog",
                "builtin",
                "mcp"
              ]
            }
          },
          {
            "name": "tool_ok",
            "in": "query",
            "description": "Calls with a succeeding (true) or failing (false) tool invocation. See tool_slug.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "tool_error_kind",
            "in": "query",
            "description": "Calls with a tool invocation that failed this way. See tool_slug.",
            "schema": {
              "type": "string",
              "enum": [
                "network",
                "timeout",
                "http_4xx",
                "http_5xx",
                "parse",
                "auth",
                "config",
                "other"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Call page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/calls/batch-delete": {
      "post": {
        "operationId": "batch_delete_calls",
        "x-sonus-required-permission": "calls:delete",
        "x-kejue-required-permission": "calls:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_org",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_org",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Purge content from up to 200 calls",
        "description": "Soft-deletes PHI and diagnostic content while retaining a tombstone, billing aggregates, and scrubbed audit evidence. Every input UUID receives one typed result. A 202 means one or more durable object-deletion jobs are still pending; wait for Retry-After, then poll each result's `poll_url` with GET and inspect `purge_cleanup`. Replaying the original idempotency key returns the original accepted response, not refreshed job state. Eval calls are reported as not_found.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallBatchDeleteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Every purge is complete or requires no external object deletion.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallBatchDeleteResponse"
                }
              }
            }
          },
          "202": {
            "description": "At least one call has durable external-object cleanup pending.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallBatchDeleteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/calls/transfer-capabilities": {
      "get": {
        "operationId": "get_transfer_capabilities",
        "x-sonus-required-permission": "agents:read",
        "x-kejue-required-permission": "agents:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get the SIP transfer capability matrix",
        "description": "Returns the allowed transfer kind/method pairs for the current SIP trunk provider values (`sip` and `twilio_automated`). Warm REFER is intentionally unsupported. The response is stable and privately cacheable for 24 hours.",
        "tags": [
          "Calls"
        ],
        "responses": {
          "200": {
            "description": "Provider capability matrix.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferCapabilitiesResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/calls/{id}/context": {
      "post": {
        "operationId": "inject_call_context",
        "x-sonus-required-permission": "calls:inject-context",
        "x-kejue-required-permission": "calls:inject-context",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "call_not_live",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limit_exceeded",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "context_encryption_failed",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_org",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "context_delivery_unconfigured",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "call_not_live",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limit_exceeded",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "context_encryption_failed",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_org",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "context_delivery_unconfigured",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Inject context into a live call",
        "description": "Encrypts and durably records one context message before scheduling delivery. On 202, wait for Retry-After and GET the Location call; match the returned message `id` in `data_messages` and poll `delivery_status` until `published` or `failed`.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallContextInjectRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Context was encrypted and durably queued for delivery.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallContextInjectResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/calls/{id}/hangup": {
      "post": {
        "operationId": "hangup_call",
        "x-sonus-request-example": {
          "method": "POST",
          "path": "/v1/calls/11111111-1111-4111-8111-111111111111/hangup",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Idempotency-Key": "hangup-call-11111111-20260720"
          }
        },
        "x-kejue-request-example": {
          "method": "POST",
          "path": "/v1/calls/11111111-1111-4111-8111-111111111111/hangup",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Idempotency-Key": "hangup-call-11111111-20260720"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "Cache-Control": "no-store",
            "Idempotency-Replayed": "false"
          },
          "body": {
            "call_id": "11111111-1111-4111-8111-111111111111",
            "status": "ended",
            "changed": true,
            "provider_confirmation": "confirmed",
            "reconciliation_status": "scheduled"
          }
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "Cache-Control": "no-store",
            "Idempotency-Replayed": "false"
          },
          "body": {
            "call_id": "11111111-1111-4111-8111-111111111111",
            "status": "ended",
            "changed": true,
            "provider_confirmation": "confirmed",
            "reconciliation_status": "scheduled"
          }
        },
        "x-sonus-required-permission": "calls:hangup",
        "x-kejue-required-permission": "calls:hangup",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "502": [
            "call_hangup_provider_failed"
          ],
          "503": [
            "authentication_unavailable",
            "call_hangup_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ],
          "504": [
            "call_hangup_outcome_unknown"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "502": [
            "call_hangup_provider_failed"
          ],
          "503": [
            "authentication_unavailable",
            "call_hangup_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ],
          "504": [
            "call_hangup_outcome_unknown"
          ]
        },
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "summary": "Hang up a live call",
        "description": "Durably records hangup intent, asks the call-bound provider to terminate the live call, and returns 200 only after provider confirmation or when the call is already terminal. A scheduled reconciliation heals the related outbound job and attempt after commit. Provider failures do not falsely mark the call ended; retryable 502, 503, and 504 errors may be retried with the same Idempotency-Key as directed by error.details. Evaluation calls and calls from another workspace are deliberately indistinguishable from missing calls.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The provider confirmed termination or the call was already terminal.",
            "headers": {
              "Cache-Control": {
                "description": "Hangup action results must not be stored by caches.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallHangupResponse"
                },
                "example": {
                  "call_id": "11111111-1111-4111-8111-111111111111",
                  "status": "ended",
                  "changed": true,
                  "provider_confirmation": "confirmed",
                  "reconciliation_status": "scheduled"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          }
        }
      }
    },
    "/calls/{id}": {
      "delete": {
        "operationId": "delete_call",
        "x-sonus-required-permission": "calls:delete",
        "x-kejue-required-permission": "calls:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "call_not_ended",
            "call_on_legal_hold",
            "call_processing_in_progress",
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_org",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "call_not_ended",
            "call_on_legal_hold",
            "call_processing_in_progress",
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_org",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Purge a call's content",
        "description": "Idempotently removes call content and queues durable deletion of recording, SIP-PCAP, and turn-audio blobs. The call must be ended, outside all post-call processing fences, and not under legal hold. A 202 means object cleanup remains pending; the response and subsequent GET expose pollable cleanup counts.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "Purge complete, already complete, or no external objects required deletion.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallDeleteResponse"
                }
              }
            }
          },
          "202": {
            "description": "Durable external-object cleanup is pending. Wait for Retry-After, then GET Location and inspect purge_cleanup.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallDeleteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_call",
        "x-sonus-required-permission": "calls:read",
        "x-kejue-required-permission": "calls:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "recording_not_found",
            "tool_invocation_not_found",
            "tool_io_raw_not_found",
            "transcript_not_found",
            "transcript_raw_not_found",
            "turn_audio_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "recording_decryption_failed",
            "stored_data_invalid",
            "tool_io_decryption_failed",
            "transcript_decryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "recording_storage_unavailable",
            "recording_unavailable",
            "tool_io_decryption_unavailable",
            "transcript_decryption_unavailable",
            "turn_audio_storage_unavailable",
            "turn_audio_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "recording_not_found",
            "tool_invocation_not_found",
            "tool_io_raw_not_found",
            "transcript_not_found",
            "transcript_raw_not_found",
            "turn_audio_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "recording_decryption_failed",
            "stored_data_invalid",
            "tool_io_decryption_failed",
            "transcript_decryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "recording_storage_unavailable",
            "recording_unavailable",
            "tool_io_decryption_unavailable",
            "transcript_decryption_unavailable",
            "turn_audio_storage_unavailable",
            "turn_audio_unavailable"
          ]
        },
        "summary": "Get a call and its redacted artifacts",
        "description": "Returns the call, redacted transcript/tool I/O, post-call results, recordings metadata, metrics, actions, context-delivery state, and retention state. Eval-backed sessions are indistinguishable from missing calls. Purged tombstones remain readable and expose `purge_cleanup` for asynchronous deletion polling. Retry-After is present while purge cleanup, context delivery, or an embedded webhook delivery remains nonterminal.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Call detail.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/calls/{id}/legal-hold": {
      "put": {
        "operationId": "set_call_legal_hold",
        "x-sonus-required-permission": "calls:legal-hold",
        "x-kejue-required-permission": "calls:legal-hold",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-conditional-entitlements": [
          {
            "entitlement": "legal_hold",
            "request_field": "held",
            "condition": "semantic_change"
          }
        ],
        "x-kejue-conditional-entitlements": [
          {
            "entitlement": "legal_hold",
            "request_field": "held",
            "condition": "semantic_change"
          }
        ],
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "call_already_purged",
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "entitlements_unavailable",
            "internal_error",
            "no_org",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "call_already_purged",
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "entitlements_unavailable",
            "internal_error",
            "no_org",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Set call legal hold",
        "description": "Idempotently places or lifts a legal hold. A semantic change requires the legal_hold entitlement; a same-state no-op does not. A held call cannot be manually or automatically purged. Legal hold cannot be changed after a purge. Supply If-Match to prevent overwriting a concurrent retention decision.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallLegalHoldRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current legal-hold state; `changed` is false for an idempotent no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallLegalHoldResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/calls/{id}/recording": {
      "get": {
        "operationId": "download_call_recording",
        "x-sonus-required-permission": "calls:download-recording",
        "x-kejue-required-permission": "calls:download-recording",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "recording_not_found",
            "tool_invocation_not_found",
            "tool_io_raw_not_found",
            "transcript_not_found",
            "transcript_raw_not_found",
            "turn_audio_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "recording_failed",
            "recording_not_ready"
          ],
          "410": [
            "recording_blob_missing",
            "turn_audio_expired"
          ],
          "416": [
            "invalid_range"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "recording_decryption_failed",
            "stored_data_invalid",
            "tool_io_decryption_failed",
            "transcript_decryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "recording_storage_unavailable",
            "recording_unavailable",
            "tool_io_decryption_unavailable",
            "transcript_decryption_unavailable",
            "turn_audio_storage_unavailable",
            "turn_audio_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "recording_not_found",
            "tool_invocation_not_found",
            "tool_io_raw_not_found",
            "transcript_not_found",
            "transcript_raw_not_found",
            "turn_audio_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "recording_failed",
            "recording_not_ready"
          ],
          "410": [
            "recording_blob_missing",
            "turn_audio_expired"
          ],
          "416": [
            "invalid_range"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "recording_decryption_failed",
            "stored_data_invalid",
            "tool_io_decryption_failed",
            "transcript_decryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "recording_storage_unavailable",
            "recording_unavailable",
            "tool_io_decryption_unavailable",
            "transcript_decryption_unavailable",
            "turn_audio_storage_unavailable",
            "turn_audio_unavailable"
          ]
        },
        "summary": "Download a call recording",
        "description": "Break-glass read of a KMS-encrypted recording. `reason`, when sent, is written to the audit log; see the parameter for when it is required. Select either one exact `recording_id`, or a role/leg/segment tuple; mixing these selectors returns 400. Supports exactly one HTTP byte range and always returns the canonical JSON error envelope on failure.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/PIIAccessReason"
          },
          {
            "name": "recording_id",
            "in": "query",
            "description": "Exact recording row. Mutually exclusive with role, leg, and segment_index.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "role",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "caller",
                "mixed"
              ],
              "default": "agent"
            }
          },
          {
            "name": "leg",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "caller",
                "brief"
              ],
              "default": "caller"
            }
          },
          {
            "name": "segment_index",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2147483647,
              "default": 0
            }
          },
          {
            "$ref": "#/components/parameters/Download"
          },
          {
            "$ref": "#/components/parameters/Range"
          }
        ],
        "responses": {
          "200": {
            "description": "Complete decrypted Ogg/Opus recording.",
            "content": {
              "audio/ogg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "206": {
            "description": "Requested byte interval of the decrypted recording.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "audio/ogg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "416": {
            "$ref": "#/components/responses/RangeNotSatisfiable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/calls/{id}/sip-pcap": {
      "get": {
        "operationId": "download_call_sip_pcap",
        "x-sonus-required-permission": "calls:read-sip-pcap",
        "x-kejue-required-permission": "calls:read-sip-pcap",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "sip_pcap_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "sip_pcap_failed",
            "sip_pcap_not_ready"
          ],
          "410": [
            "sip_pcap_blob_missing"
          ],
          "416": [
            "invalid_range"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error",
            "sip_pcap_decryption_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "pcap_not_configured",
            "pcap_unavailable",
            "sip_pcap_storage_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "sip_pcap_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "sip_pcap_failed",
            "sip_pcap_not_ready"
          ],
          "410": [
            "sip_pcap_blob_missing"
          ],
          "416": [
            "invalid_range"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error",
            "sip_pcap_decryption_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "pcap_not_configured",
            "pcap_unavailable",
            "sip_pcap_storage_unavailable"
          ]
        },
        "summary": "Download SIP PCAP",
        "description": "Break-glass download of the decrypted wire-level SIP packet capture. The reason is audited even when storage, decryption, integrity validation, or Range processing later fails. The artifact is structurally validated as a little-endian PCAP before any bytes are returned. Eval-backed calls are always hidden.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/BreakGlassReason"
          },
          {
            "$ref": "#/components/parameters/Range"
          }
        ],
        "responses": {
          "200": {
            "description": "Complete decrypted SIP packet capture.",
            "content": {
              "application/vnd.tcpdump.pcap": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "206": {
            "description": "Requested byte interval of the decrypted SIP packet capture.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/vnd.tcpdump.pcap": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "416": {
            "$ref": "#/components/responses/RangeNotSatisfiable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/calls/{id}/sip-pcap/summary": {
      "get": {
        "operationId": "get_call_sip_pcap_summary",
        "x-sonus-required-permission": "calls:read-sip-pcap",
        "x-kejue-required-permission": "calls:read-sip-pcap",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "sip_pcap_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable",
            "pcap_not_configured"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "sip_pcap_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable",
            "pcap_not_configured"
          ]
        },
        "summary": "Get SIP PCAP summary",
        "description": "Pollable artifact metadata; safe to call without break-glass audit because no packet bytes are returned.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current artifact state and size.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SipPcapSummaryResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/calls/{id}/tools/{toolId}/raw": {
      "get": {
        "operationId": "get_call_tool_io_raw",
        "x-sonus-required-permission": "pii-access:unmask",
        "x-kejue-required-permission": "pii-access:unmask",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "recording_not_found",
            "tool_invocation_not_found",
            "tool_io_raw_not_found",
            "transcript_not_found",
            "transcript_raw_not_found",
            "turn_audio_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "recording_decryption_failed",
            "stored_data_invalid",
            "tool_io_decryption_failed",
            "transcript_decryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "recording_storage_unavailable",
            "recording_unavailable",
            "tool_io_decryption_unavailable",
            "transcript_decryption_unavailable",
            "turn_audio_storage_unavailable",
            "turn_audio_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "recording_not_found",
            "tool_invocation_not_found",
            "tool_io_raw_not_found",
            "transcript_not_found",
            "transcript_raw_not_found",
            "turn_audio_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "recording_decryption_failed",
            "stored_data_invalid",
            "tool_io_decryption_failed",
            "transcript_decryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "recording_storage_unavailable",
            "recording_unavailable",
            "tool_io_decryption_unavailable",
            "transcript_decryption_unavailable",
            "turn_audio_storage_unavailable",
            "turn_audio_unavailable"
          ]
        },
        "summary": "Read raw tool request and response",
        "description": "Break-glass read of the KMS-encrypted, unredacted tool I/O. The tool invocation must belong to the call and the supplied reason is audited. Ordinary GET /calls/{id} returns only redacted tool payloads.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "toolId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/PIIAccessReason"
          }
        ],
        "responses": {
          "200": {
            "description": "Decrypted raw tool I/O. Never cache this response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RawToolIOResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/calls/{id}/transcript-raw": {
      "get": {
        "operationId": "get_call_transcript_raw",
        "x-sonus-required-permission": "pii-access:unmask",
        "x-kejue-required-permission": "pii-access:unmask",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "recording_not_found",
            "tool_invocation_not_found",
            "tool_io_raw_not_found",
            "transcript_not_found",
            "transcript_raw_not_found",
            "turn_audio_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "recording_decryption_failed",
            "stored_data_invalid",
            "tool_io_decryption_failed",
            "transcript_decryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "recording_storage_unavailable",
            "recording_unavailable",
            "tool_io_decryption_unavailable",
            "transcript_decryption_unavailable",
            "turn_audio_storage_unavailable",
            "turn_audio_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "recording_not_found",
            "tool_invocation_not_found",
            "tool_io_raw_not_found",
            "transcript_not_found",
            "transcript_raw_not_found",
            "turn_audio_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "recording_decryption_failed",
            "stored_data_invalid",
            "tool_io_decryption_failed",
            "transcript_decryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "recording_storage_unavailable",
            "recording_unavailable",
            "tool_io_decryption_unavailable",
            "transcript_decryption_unavailable",
            "turn_audio_storage_unavailable",
            "turn_audio_unavailable"
          ]
        },
        "summary": "Read raw transcript",
        "description": "Break-glass read of the newest KMS-encrypted unredacted transcript for one call leg. The reason is audited; ordinary GET /calls/{id} returns only the redacted transcript.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/PIIAccessReason"
          },
          {
            "name": "leg",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "caller",
                "brief"
              ],
              "default": "caller"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Decrypted raw transcript. Never cache this response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RawTranscriptResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/calls/{id}/timeline": {
      "get": {
        "operationId": "get_call_timeline",
        "x-sonus-required-permission": "calls:read",
        "x-kejue-required-permission": "calls:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get call timeline",
        "description": "Returns the call's event timeline on one clock (milliseconds since anchor) for debugging latency and failures. It merges the agent's recorded events (speech detection, transcription, endpointing and turn decisions, model and synthesis spans, tool calls, degraded modes and errors) with gateway model requests, tool invocations, per-turn latency, the redacted transcript and transfer events. Calls handled before the agent recorded timelines return the gateway, tool, turn and transcript evidence only. Missing, cross-org, and eval-backed calls all return the same call_not_found response.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The call timeline.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallTimeline"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/calls/{id}/summary": {
      "get": {
        "operationId": "get_call_summary",
        "x-sonus-required-permission": "calls:read",
        "x-kejue-required-permission": "calls:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "call_summary_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "call_summary_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get call summary",
        "description": "Returns the call's post-call summary on its own, without the transcript, extractions and tool invocations that get_call returns. The status is queued, running, done or error; read text only when status is done. A call whose summary has not been requested or created yet returns call_summary_not_found, so treat that as no summary available. Missing, cross-org, and eval-backed calls all return call_not_found.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The call summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallSummaryResult"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/calls/{id}/transfers": {
      "get": {
        "operationId": "list_call_transfers",
        "x-sonus-required-permission": "transfers:read",
        "x-kejue-required-permission": "transfers:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List call transfers",
        "description": "Returns every transfer attempt and its append-only event timeline. Event payloads use a fail-closed public key allowlist and signal payload_redacted when internal keys were removed. Raw provider error text is never exposed by the public API; operators can use the separately audited private diagnostic route. Missing, cross-org, and eval-backed calls all return the same call_not_found response.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ordered transfer attempts and events.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/calls/{id}/turn-audio": {
      "get": {
        "operationId": "download_call_turn_audio",
        "x-sonus-required-permission": "calls:download-recording",
        "x-kejue-required-permission": "calls:download-recording",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "recording_not_found",
            "tool_invocation_not_found",
            "tool_io_raw_not_found",
            "transcript_not_found",
            "transcript_raw_not_found",
            "turn_audio_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "410": [
            "recording_blob_missing",
            "turn_audio_expired"
          ],
          "416": [
            "invalid_range"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "recording_decryption_failed",
            "stored_data_invalid",
            "tool_io_decryption_failed",
            "transcript_decryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "recording_storage_unavailable",
            "recording_unavailable",
            "tool_io_decryption_unavailable",
            "transcript_decryption_unavailable",
            "turn_audio_storage_unavailable",
            "turn_audio_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "call_not_found",
            "recording_not_found",
            "tool_invocation_not_found",
            "tool_io_raw_not_found",
            "transcript_not_found",
            "transcript_raw_not_found",
            "turn_audio_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "410": [
            "recording_blob_missing",
            "turn_audio_expired"
          ],
          "416": [
            "invalid_range"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "recording_decryption_failed",
            "stored_data_invalid",
            "tool_io_decryption_failed",
            "transcript_decryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "recording_storage_unavailable",
            "recording_unavailable",
            "tool_io_decryption_unavailable",
            "transcript_decryption_unavailable",
            "turn_audio_storage_unavailable",
            "turn_audio_unavailable"
          ]
        },
        "summary": "Read one caller-turn audio clip",
        "description": "Reads a short-lived WAV clip for one archived caller turn. The server resolves the stored object key; client input is never used to construct a storage path. Access is audited and supports one byte range. For repeated warm consultations, select the segment_index returned in user_turn_audio; turn_index is local to each segment. Omitting segment_index selects zero.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "turn_index",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2147483647
            }
          },
          {
            "name": "leg",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "caller",
                "brief"
              ],
              "default": "caller"
            }
          },
          {
            "name": "segment_index",
            "in": "query",
            "description": "Zero-based consultation segment. For brief recordings this is the transfer attempt minus one. Legacy clips use zero.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2147483647,
              "default": 0
            }
          },
          {
            "$ref": "#/components/parameters/Download"
          },
          {
            "$ref": "#/components/parameters/PIIAccessReason"
          },
          {
            "$ref": "#/components/parameters/Range"
          }
        ],
        "responses": {
          "200": {
            "description": "Complete WAV clip.",
            "content": {
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "206": {
            "description": "Requested byte interval of the WAV clip.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Content-Range": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "416": {
            "$ref": "#/components/responses/RangeNotSatisfiable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/campaigns": {
      "get": {
        "operationId": "list_campaigns",
        "x-sonus-required-permission": "campaigns:read",
        "x-kejue-required-permission": "campaigns:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List campaigns",
        "description": "Lists campaigns in reverse creation order with their derived recipient counters. Reading campaigns needs only the permission — history stays visible to an organization whose campaigns entitlement was withdrawn.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Case-insensitive substring search of the campaign name."
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated campaign statuses. Duplicates are ignored; empty or unsupported values are rejected."
          }
        ],
        "responses": {
          "200": {
            "description": "Matching campaigns.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_campaign",
        "x-sonus-required-permission": "campaigns:create",
        "x-kejue-required-permission": "campaigns:create",
        "x-sonus-required-entitlement": "campaigns",
        "x-kejue-required-entitlement": "campaigns",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store, no-transform",
        "x-kejue-cache-control": "no-store, no-transform",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found",
            "analysis_board_not_found",
            "number_pool_not_found",
            "phone_number_not_found",
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "name_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "invalid_call_policy",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found",
            "analysis_board_not_found",
            "number_pool_not_found",
            "phone_number_not_found",
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "name_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "invalid_call_policy",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create a campaign",
        "description": "Creates a campaign in `draft`. A draft holds configuration only — it places no calls and does not need a caller-ID route yet. Import a recipient list, then launch. Calling windows, retry backoffs, and the timezone mode come from `policy_overrides` on top of the organization's outbound policy.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Campaign created as a draft.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/campaigns/{id}": {
      "get": {
        "operationId": "get_campaign",
        "x-sonus-required-permission": "campaigns:read",
        "x-kejue-required-permission": "campaigns:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache, no-transform",
        "x-kejue-cache-control": "private, no-cache, no-transform",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a campaign",
        "description": "Returns one campaign with its derived recipient counters. Poll this while a campaign runs — `status`, `paused_reason`, and `counters` are the whole monitoring surface. The ETag it returns is the concurrency token for PATCH and DELETE.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The campaign.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_campaign",
        "x-sonus-required-permission": "campaigns:update",
        "x-kejue-required-permission": "campaigns:update",
        "x-sonus-required-entitlement": "campaigns",
        "x-kejue-required-entitlement": "campaigns",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "no-store, no-transform",
        "x-kejue-cache-control": "no-store, no-transform",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found",
            "analysis_board_not_found",
            "campaign_not_found",
            "number_pool_not_found",
            "phone_number_not_found",
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict",
            "name_taken"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "invalid_call_policy",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found",
            "analysis_board_not_found",
            "campaign_not_found",
            "number_pool_not_found",
            "phone_number_not_found",
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict",
            "name_taken"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "invalid_call_policy",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update a campaign",
        "description": "Partially updates a campaign. Configuration is editable only while the campaign is `draft` or `paused` — anything else returns `campaign_state_invalid`, so pause before correcting pacing or windows and the change applies to the unfed remainder. Explicit `null` clears a nullable field. A request containing only `board_id` may attach, replace, or detach an analysis board in any campaign status; it does not change dialing configuration. Use If-Match for optimistic concurrency.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated campaign.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "delete_campaign",
        "x-sonus-required-permission": "campaigns:delete",
        "x-kejue-required-permission": "campaigns:delete",
        "x-sonus-required-entitlement": "campaigns",
        "x-kejue-required-entitlement": "campaigns",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Delete a campaign",
        "description": "Archives a campaign. Only a `draft`, `completed`, or `stopped` campaign can be deleted — stop a live one first, which is what keeps a delete from silently abandoning queued calls. Calls the campaign already placed are unaffected and remain in call history. Use If-Match for optimistic concurrency.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Campaign archived. The response has no body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/campaigns/{id}/clone": {
      "post": {
        "operationId": "clone_campaign",
        "x-sonus-required-permission": "campaigns:create",
        "x-kejue-required-permission": "campaigns:create",
        "x-sonus-required-entitlement": "campaigns",
        "x-kejue-required-entitlement": "campaigns",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store, no-transform",
        "x-kejue-cache-control": "no-store, no-transform",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "name_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "name_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Clone a campaign",
        "description": "Copies a campaign's configuration into a new `draft`. Schedule fields deliberately do not copy — when a run happens is a per-run decision, and inheriting a past `end_at` would make the clone unlaunchable. Without `name` the clone is named \"<name> (copy)\", uniquified. With `include_recipients` the list copies in file order as fresh `pending` rows; excluded rows carry their reason so the error report survives, and no job linkage is copied.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignCloneRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The cloned draft campaign.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/campaigns/{id}/launch": {
      "post": {
        "operationId": "launch_campaign",
        "x-sonus-required-permission": "campaigns:update",
        "x-kejue-required-permission": "campaigns:update",
        "x-sonus-required-entitlement": "campaigns",
        "x-kejue-required-entitlement": "campaigns",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store, no-transform",
        "x-kejue-cache-control": "no-store, no-transform",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found",
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "campaign_no_recipients",
            "no_production_version",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found",
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "campaign_no_recipients",
            "no_production_version",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Launch a campaign",
        "description": "Starts a draft campaign. Becomes `running`, or `scheduled` when `start_at` is in the future. Beyond `campaigns:update` this also requires `calls:place-outbound` — a campaign places calls, and must not be a side door around that permission. Refuses a campaign with no caller-ID route, no pending recipients, a past `end_at`, or an agent with no deployable version.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The campaign after launch.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/campaigns/{id}/pause": {
      "post": {
        "operationId": "pause_campaign",
        "x-sonus-required-permission": "campaigns:update",
        "x-kejue-required-permission": "campaigns:update",
        "x-sonus-required-entitlement": "campaigns",
        "x-kejue-required-entitlement": "campaigns",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store, no-transform",
        "x-kejue-cache-control": "no-store, no-transform",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Pause a campaign",
        "description": "Stops feeding new calls and cancels the campaign's queued and waiting jobs, returning those recipients to `pending`. Calls that are already dialing or connected are never touched — a pause never kills a live call. A job whose dial fails after the pause is canceled instead of retried, and its recipient also returns to `pending`. Pausing an already-paused campaign is a no-op that returns 200.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The campaign after pausing.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/campaigns/{id}/recipients": {
      "get": {
        "operationId": "list_campaign_recipients",
        "x-sonus-required-permission": "campaigns:read",
        "x-kejue-required-permission": "campaigns:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List campaign recipients",
        "description": "Lists the campaign's recipient rows in file order, each with its dial status and — once fed — the outbound job it produced. Excluded rows (rejected at import, or blocked by the do-not-call register at dial time) are included and carry an `exclusion_reason`.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/CampaignRecipientStatus"
            },
            "description": "Return only recipients in this status."
          }
        ],
        "responses": {
          "200": {
            "description": "Matching recipients.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignRecipientListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/campaigns/{id}/recipients/errors.csv": {
      "get": {
        "operationId": "export_campaign_recipient_errors",
        "x-sonus-required-permission": "campaigns:read",
        "x-kejue-required-permission": "campaigns:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Download the recipient error report",
        "description": "Returns every excluded recipient as CSV — `row_number`, `phone`, `reason` — so a rejected row can be traced back to its line in the uploaded file, corrected, and re-imported.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The excluded-recipient report. Content-Disposition is an attachment.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/campaigns/{id}/recipients/import": {
      "post": {
        "operationId": "import_campaign_recipients",
        "x-sonus-required-permission": "campaigns:update",
        "x-kejue-required-permission": "campaigns:update",
        "x-sonus-required-entitlement": "campaigns",
        "x-kejue-required-entitlement": "campaigns",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_multipart",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_recipient_file",
            "invalid_request_id",
            "invalid_uuid",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "campaign_recipients_invalid",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_multipart",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_recipient_file",
            "invalid_request_id",
            "invalid_uuid",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "campaign_recipients_invalid",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Import campaign recipients",
        "description": "Uploads a recipient list as multipart/form-data — a required `file` part (CSV or XLSX, at most 10 MiB) and an optional `mapping` JSON part. The parser is chosen from the file's content, not its name. Every column that is not the phone column becomes a prompt variable for that recipient. Rows that are duplicates, unusable numbers, or carry invalid variables are rejected as a whole with `campaign_recipients_invalid` unless `mapping.skip_invalid` is set, in which case they are stored as `excluded` and retrievable from the error report. Imports are allowed only while the campaign is a draft, and repeat imports append.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRecipientUpload"
              },
              "encoding": {
                "file": {
                  "contentType": "text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/octet-stream"
                },
                "mapping": {
                  "contentType": "application/json"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import result and the campaign's refreshed counters.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignRecipientImportResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/campaigns/{id}/recipients/preview": {
      "post": {
        "operationId": "preview_campaign_recipients",
        "x-sonus-required-permission": "campaigns:update",
        "x-kejue-required-permission": "campaigns:update",
        "x-sonus-required-entitlement": "campaigns",
        "x-kejue-required-entitlement": "campaigns",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_multipart",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_recipient_file",
            "invalid_request_id",
            "invalid_uuid",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_multipart",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_recipient_file",
            "invalid_request_id",
            "invalid_uuid",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Preview a recipient upload",
        "description": "Parses an upload and reports what an import would do — detected headers, the inferred phone column, per-row validation, and a sample — without storing anything. Same multipart shape as the import. When no phone column can be inferred the response returns the headers with a null `phone_column` so the caller can choose one and preview again.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/CampaignRecipientUpload"
              },
              "encoding": {
                "file": {
                  "contentType": "text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/octet-stream"
                },
                "mapping": {
                  "contentType": "application/json"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What an import of this file would do.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignRecipientPreviewResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/campaigns/{id}/resume": {
      "post": {
        "operationId": "resume_campaign",
        "x-sonus-required-permission": "campaigns:update",
        "x-kejue-required-permission": "campaigns:update",
        "x-sonus-required-entitlement": "campaigns",
        "x-kejue-required-entitlement": "campaigns",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store, no-transform",
        "x-kejue-cache-control": "no-store, no-transform",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Resume a paused campaign",
        "description": "Returns a paused campaign to `running`, or to `scheduled` when `start_at` is still in the future. Like launch, this also requires `calls:place-outbound`. A campaign the platform paused itself — out of minutes, calls disabled, or the entitlement withdrawn — can be resumed once that condition clears; the feeder pauses it again otherwise. Resuming an already-running campaign is a no-op that returns 200.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The campaign after resuming.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/campaigns/{id}/stop": {
      "post": {
        "operationId": "stop_campaign",
        "x-sonus-required-permission": "campaigns:update",
        "x-kejue-required-permission": "campaigns:update",
        "x-sonus-required-entitlement": "campaigns",
        "x-kejue-required-entitlement": "campaigns",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store, no-transform",
        "x-kejue-cache-control": "no-store, no-transform",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "campaign_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "campaign_state_invalid",
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Stop a campaign",
        "description": "Ends a campaign for good. Queued jobs are canceled and every recipient that will never dial becomes `canceled`; calls already in flight are left alone and settle to their real outcome. Unlike pause this is terminal — a stopped campaign cannot be resumed, only cloned. Stopping an already-stopped campaign is a no-op that returns 200.",
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "The campaign after stopping.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/connected-apps": {
      "get": {
        "operationId": "list_connected_apps",
        "x-sonus-required-permission": "connected-apps:read",
        "x-kejue-required-permission": "connected-apps:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "summary": "List connected apps with access to this team",
        "description": "Lists the active OAuth grants (Claude and other MCP clients connected by members) that include this team, newest first — including grants a current member approved for all of their teams (`all_teams`). Each entry names the member who connected it, the client, and the permission scopes they approved. A grant acts as that member, limited by their current role in this team and the approved scopes. Follow `next_cursor` until null.",
        "tags": [
          "Connected apps (MCP)"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "Number of connected apps to return."
          }
        ],
        "responses": {
          "200": {
            "description": "Connected apps reaching this team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectedAppListResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/connected-apps/{id}": {
      "delete": {
        "operationId": "remove_connected_app_team_access",
        "x-sonus-required-permission": "connected-apps:delete",
        "x-kejue-required-permission": "connected-apps:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "connected_app_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "connected_app_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "summary": "Remove this team from a connected app",
        "description": "Removes this team from the grant, immediately. The member's other teams are unaffected; a grant left with no team is revoked entirely and its tokens stop refreshing. A grant approved for all teams (`all_teams`) is never revoked this way — it keeps working in the member's other and future teams, and this team stays excluded from it. The member can reconnect later if the team still allows AI connectors. This operation accepts no request body.",
        "tags": [
          "Connected apps (MCP)"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Connected app (grant) ID from list_connected_apps."
          }
        ],
        "responses": {
          "204": {
            "description": "This team was removed from the grant.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/contacts": {
      "get": {
        "operationId": "list_contacts",
        "x-sonus-required-permission": "contacts:read",
        "x-kejue-required-permission": "contacts:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List contacts",
        "description": "Returns contacts ordered by most recent contact activity, then ID. Repeated `tag_id` values use AND semantics. Use exact `e164` lookup when an agent must resolve one canonical contact deterministically; percent-encode the leading plus sign.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Case-insensitive substring search across E.164, display name, and company.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "e164",
            "in": "query",
            "description": "Exact E.164 match. In a raw URL, encode `+` as `%2B`.",
            "schema": {
              "$ref": "#/components/schemas/ContactE164"
            }
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "name": "tag_id",
            "in": "query",
            "description": "Repeat up to 20 times. A returned contact must have every supplied tag.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "maxItems": 20,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching contact page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_contact",
        "x-sonus-required-permission": "contacts:create",
        "x-kejue-required-permission": "contacts:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "contact_e164_conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "contact_e164_conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create a contact",
        "description": "Creates a directory contact and can atomically assign existing tags. The E.164 number is immutable because it is the stable key used to associate call history and memory. Use Idempotency-Key for safe retries.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Contact created with hydrated tags and activity counts.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/contacts/tags": {
      "get": {
        "operationId": "list_contact_tags",
        "x-sonus-required-permission": "contacts:read",
        "x-kejue-required-permission": "contacts:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List contact tags",
        "description": "Returns the organization tag catalog newest first. `usage_count` is the current number of assigned contacts.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Case-insensitive substring search of tag names.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          }
        ],
        "responses": {
          "200": {
            "description": "Matching contact-tag page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactTagListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_contact_tag",
        "x-sonus-required-permission": "contacts:create",
        "x-kejue-required-permission": "contacts:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "contact_tag_name_conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "contact_tag_name_conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create a contact tag",
        "description": "Creates one case-insensitively unique tag. Color defaults to `slate`. Use Idempotency-Key for safe retries.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactTagCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Contact tag created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactTag"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/contacts/tags/{id}": {
      "get": {
        "operationId": "get_contact_tag",
        "x-sonus-required-permission": "contacts:read",
        "x-kejue-required-permission": "contacts:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_tag_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_tag_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a contact tag",
        "description": "Returns current tag configuration and assignment count.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact tag.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactTag"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "delete_contact_tag",
        "x-sonus-required-permission": "contacts:delete",
        "x-kejue-required-permission": "contacts:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_tag_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_tag_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Delete a contact tag",
        "description": "Permanently deletes the tag and removes all assignments. Contacts and their call history remain. Use If-Match to prevent deleting a concurrently changed tag.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Contact tag deleted. The response has no body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_contact_tag",
        "x-sonus-required-permission": "contacts:update",
        "x-kejue-required-permission": "contacts:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_tag_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "contact_tag_name_conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_tag_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "contact_tag_name_conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update a contact tag",
        "description": "Updates name and/or color. The name remains case-insensitively unique. Embedded tag data and ETags on assigned contacts change atomically only for an effective change. A semantic no-op preserves the tag and contact ETags and records `contact_tag.update.noop`.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactTagPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated contact tag.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactTag"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/contacts/{id}": {
      "get": {
        "operationId": "get_contact",
        "x-sonus-required-permission": "contacts:read",
        "x-kejue-required-permission": "contacts:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a contact",
        "description": "Returns the canonical contact, hydrated tags, current call count, and mutable notes. The ETag changes when contact fields or tag representations change.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact detail.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_contact",
        "x-sonus-required-permission": "contacts:update",
        "x-kejue-required-permission": "contacts:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update a contact",
        "description": "Replaces only supplied mutable fields. Set a field to an empty string to clear it. E.164 is intentionally immutable; create a different contact for a different number. Use If-Match to reject a stale read-modify-write cycle. A semantic no-op preserves `updated_at` and ETag and records `contact.update.noop`.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated contact detail.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "delete_contact",
        "x-sonus-required-permission": "contacts:delete",
        "x-kejue-required-permission": "contacts:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Delete a contact",
        "description": "Permanently deletes the directory contact, its tag assignments, and contact memory. Existing call records remain addressable and retain their original caller number. Use If-Match to reject deletion after a concurrent change.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Contact deleted. The response has no body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/contacts/{id}/calls": {
      "get": {
        "operationId": "list_contact_calls",
        "x-sonus-required-permission": "contacts:read",
        "x-kejue-required-permission": "contacts:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List calls associated with a contact",
        "description": "Returns calls whose caller number exactly matches the contact's immutable E.164 number, newest first. Deleting the contact does not delete these call records.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact call page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactCallListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/contacts/{id}/memory": {
      "get": {
        "operationId": "get_contact_memory",
        "x-sonus-required-permission": "contacts:read",
        "x-kejue-required-permission": "contacts:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get contact memory",
        "description": "Returns the durable cross-call memory text for a contact. A contact with no memory returns an empty content string and a null updated_at, not 404.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current contact memory.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactMemory"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "put": {
        "operationId": "set_contact_memory",
        "x-sonus-required-permission": "contacts:manage-memory",
        "x-kejue-required-permission": "contacts:manage-memory",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Replace contact memory",
        "description": "Replaces the complete durable memory document after trimming surrounding whitespace. A changed write creates one manual revision; an identical write is an idempotent no-op with changed=false and revision_id=null. Use If-Match to reject a stale replacement.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactMemorySetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Memory replacement result.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactMemoryWriteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/contacts/{id}/memory/revisions": {
      "get": {
        "operationId": "list_contact_memory_revisions",
        "x-sonus-required-permission": "contacts:read",
        "x-kejue-required-permission": "contacts:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List contact-memory revisions",
        "description": "Returns immutable memory changes newest first. Manual writes and extraction-driven updates share one history so an agent can explain exactly how current memory was produced.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "Limit results to manual API/UI edits or extraction-driven runtime updates.",
            "schema": {
              "type": "string",
              "enum": [
                "manual",
                "extraction"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          }
        ],
        "responses": {
          "200": {
            "description": "Contact-memory revision page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactMemoryRevisionListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/contacts/{id}/tags/{tagId}": {
      "put": {
        "operationId": "assign_contact_tag",
        "x-sonus-required-permission": "contacts:update",
        "x-kejue-required-permission": "contacts:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found",
            "contact_tag_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found",
            "contact_tag_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Assign a tag to a contact",
        "description": "Ensures the contact has this tag. Repeating the same request is a successful no-op, which makes the endpoint safe for declarative agents and retries. The request has no body.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Contact ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tagId",
            "in": "path",
            "required": true,
            "description": "Contact-tag ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Tag is assigned. The response has no body, including when it was already assigned.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "unassign_contact_tag",
        "x-sonus-required-permission": "contacts:update",
        "x-kejue-required-permission": "contacts:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found",
            "contact_tag_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "contact_not_found",
            "contact_tag_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Unassign a tag from a contact",
        "description": "Ensures the contact does not have this tag. Repeating the same request is a successful no-op. The contact and tag must both exist, and the request has no body.",
        "tags": [
          "Contacts"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Contact ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tagId",
            "in": "path",
            "required": true,
            "description": "Contact-tag ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Tag is unassigned. The response has no body, including when no assignment existed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-calls": {
      "get": {
        "operationId": "list_eval_calls",
        "x-sonus-required-permission": "eval-runs:read",
        "x-kejue-required-permission": "eval-runs:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List eval calls",
        "description": "Returns a reverse-chronological, cursor-paginated page of per-scenario results with sanitized error fields. Use run_id to enumerate calls for one batch. q matches suite, pathway, scenario id, and scenario label; status is all, error, timed_out, passed, or failed.",
        "tags": [
          "Eval results"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "name": "run_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Restrict results to one eval run."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "error",
                "timed_out",
                "passed",
                "failed"
              ]
            },
            "description": "Derived public result classification."
          }
        ],
        "responses": {
          "200": {
            "description": "Eval call page with opaque next cursor.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalCallListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-calls/{id}": {
      "get": {
        "operationId": "get_eval_call",
        "x-sonus-required-permission": "eval-runs:read",
        "x-kejue-required-permission": "eval-runs:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_call_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_call_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an eval call",
        "description": "Returns one authorized eval result including the stored structured transcript, pathway events, metrics, rubric results, and model metadata. These nested values may contain model- or tool-generated content. Worker and provider exceptions are never exposed; error and error_code contain only stable sanitized values.",
        "tags": [
          "Eval results"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete eval call with stored result content and sanitized error fields.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalCall"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-generation-jobs/{id}": {
      "get": {
        "operationId": "get_eval_generation_job",
        "x-sonus-required-permission": "eval-suites:read",
        "x-kejue-required-permission": "eval-suites:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_generation_job_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_generation_job_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an eval scenario generation job",
        "description": "Poll this resource after generate_eval_scenarios. queued and running responses carry Retry-After: 2. Failed jobs expose only eval_generation_failed and a sanitized message.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current generation job state.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalGenerationJob"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-checks": {
      "get": {
        "operationId": "list_eval_checks",
        "x-sonus-required-permission": "eval-checks:read",
        "x-kejue-required-permission": "eval-checks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List eval checks",
        "description": "Returns a page ordered by last edit, newest first, with cursors bound to q, kind, the creation and update bounds, and the archived filter. Config bodies are omitted from list items; fetch one check to read its config.",
        "tags": [
          "Eval checks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "judge",
                "tool",
                "flow"
              ]
            },
            "description": "Return only judge, tool or flow checks."
          },
          {
            "name": "updated_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only checks last edited at or after this instant. RFC3339 or YYYY-MM-DD."
          },
          {
            "name": "updated_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only checks last edited before this instant. RFC3339 or YYYY-MM-DD."
          }
        ],
        "responses": {
          "200": {
            "description": "Eval check page.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalCheckListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_eval_check",
        "x-sonus-required-permission": "eval-checks:create",
        "x-kejue-required-permission": "eval-checks:create",
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_check_slug_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_check_slug_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create an eval check",
        "description": "Creates a reusable check in the workspace library. kind (judge, tool or flow) and slug are fixed after creation; slug is workspace-unique (409 eval_check_slug_taken). config is required and validated against the kind and, for tool and flow checks, the config's rule — see EvalCheckConfig for every rule's keys; an unknown, missing or mistyped key is 422 validation_failed with its field path. template_key only records provenance: copy the template's config into config. The encoded config is limited to 131072 bytes and the complete request body to 262144 bytes. Attach the check to a suite or scenario to run it.",
        "tags": [
          "Eval checks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalCheckCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Check created; Location names it.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalCheck"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-checks/templates": {
      "get": {
        "operationId": "list_eval_check_templates",
        "x-sonus-required-permission": "eval-checks:read",
        "x-kejue-required-permission": "eval-checks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List eval check templates",
        "description": "Returns the shipped starter check library. Read-only and workspace-independent: creating a check from a template copies it, after which the check is independent, so editing a template never mutates checks already made from it.",
        "tags": [
          "Eval checks"
        ],
        "responses": {
          "200": {
            "description": "The shipped starter check library.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalCheckTemplateListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-checks/{id}": {
      "delete": {
        "operationId": "archive_eval_check",
        "x-sonus-required-permission": "eval-checks:delete",
        "x-kejue-required-permission": "eval-checks:delete",
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_check_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_check_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive an eval check",
        "description": "Soft-archives the check: it leaves the library list (archived=exclude) and can no longer be attached, while recorded verdicts and existing reads keep working. Archiving a check that is already archived returns 404 eval_check_not_found.",
        "tags": [
          "Eval checks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Check archived; response body is empty.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_eval_check",
        "x-sonus-required-permission": "eval-checks:read",
        "x-kejue-required-permission": "eval-checks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_check_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_check_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an eval check",
        "description": "Returns one check, active or archived, with its full config.",
        "tags": [
          "Eval checks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete eval check.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalCheck"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_eval_check",
        "x-sonus-required-permission": "eval-checks:update",
        "x-kejue-required-permission": "eval-checks:update",
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_check_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "eval_check_archived"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_check_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "eval_check_archived"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update an eval check",
        "description": "Replaces only the supplied mutable fields (name, description, config); the edit is live on the next run. A supplied config replaces the stored one and is validated in full. kind, slug and template_key are immutable — sending one returns 422 validation_failed with field code immutable; create a new check instead. The encoded config is limited to 131072 bytes and the complete request body to 262144 bytes.",
        "tags": [
          "Eval checks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalCheckPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated check.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalCheck"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-runs": {
      "get": {
        "operationId": "list_eval_runs",
        "x-sonus-required-permission": "eval-runs:read",
        "x-kejue-required-permission": "eval-runs:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List eval runs",
        "description": "Returns active runs newest first with a cursor bound to the exact q, date, status, and mode filters. The default limit is 25 and maximum is 100.",
        "tags": [
          "Eval runs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "Number of runs to return."
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "running",
                "done",
                "failed",
                "cancelled"
              ]
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "audio",
                "text"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Eval run page.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalRunListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_eval_run",
        "x-sonus-required-permission": "eval-runs:create",
        "x-kejue-required-permission": "eval-runs:create",
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found",
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_suite_empty",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "no_agent_version"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found",
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_suite_empty",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "no_agent_version"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create a dry-run or mocked eval run",
        "description": "Queues an asynchronous batch. API-key clients cannot request tool_policy=live here; use create_live_eval_run with the additional live-tool scope. The maximum encoded request body is 262144 bytes. Poll Location after Retry-After. Replaying the same Idempotency-Key returns the original run without queuing a duplicate.",
        "tags": [
          "Eval runs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalRunCreateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Run accepted and queued.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalRunCreateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-runs/grade-calls": {
      "post": {
        "operationId": "grade_calls",
        "x-sonus-required-permission": "eval-runs:create",
        "x-kejue-required-permission": "eval-runs:create",
        "x-sonus-additional-required-permissions": [
          "calls:read"
        ],
        "x-kejue-additional-required-permissions": [
          "calls:read"
        ],
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_suite_empty",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_suite_empty",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Grade calls that already happened",
        "description": "Queues a run that scores finished production calls against the checks attached to a suite, rather than simulating new conversations. Nothing is dispatched and no upstream tool is invoked, so this needs no live-tool permission — but it reads call content and therefore also requires calls:read. Supply call_ids or call_filter; ids win when both are given. The selection is resolved at request time, so an empty match is a 409 here rather than a failed run later. At most 5000 calls per run. Checks whose evidence is not persisted on a finished call abstain rather than pass. Poll Location after Retry-After.",
        "tags": [
          "Eval runs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalGradeCallsRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Grading run accepted and queued.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalGradeCallsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-runs/live": {
      "post": {
        "operationId": "create_live_eval_run",
        "x-sonus-required-permission": "eval-runs:create",
        "x-kejue-required-permission": "eval-runs:create",
        "x-sonus-additional-required-permissions": [
          "eval-runs:execute-live-tools"
        ],
        "x-kejue-additional-required-permissions": [
          "eval-runs:execute-live-tools"
        ],
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found",
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_suite_empty",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "no_agent_version"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found",
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_suite_empty",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "no_agent_version"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create a live-tool eval run",
        "description": "Queues an eval whose agent may invoke real external tools. This endpoint always stores tool_policy=live and requires both eval-runs:create and eval-runs:execute-live-tools. The maximum encoded request body is 262144 bytes. Poll Location after Retry-After.",
        "tags": [
          "Eval runs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LiveEvalRunCreateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Live-tool run accepted and queued.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalRunCreateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-runs/{id}": {
      "delete": {
        "operationId": "archive_eval_run",
        "x-sonus-required-permission": "eval-runs:delete",
        "x-kejue-required-permission": "eval-runs:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_run_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_run_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive an eval run",
        "description": "Soft-archives the run. Queued or running work is cancelled. A repeated archive returns eval_run_not_found; no run data is returned.",
        "tags": [
          "Eval runs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Run archived; response body is empty.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_eval_run",
        "x-sonus-required-permission": "eval-runs:read",
        "x-kejue-required-permission": "eval-runs:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_run_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_run_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an eval run",
        "description": "Returns the batch, its selected scenarios, and sanitized call summaries. queued and running runs carry Retry-After: 2; terminal runs do not require further polling.",
        "tags": [
          "Eval runs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Eval run detail and current child calls.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalRun"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-runs/{id}/cancel": {
      "post": {
        "operationId": "cancel_eval_run",
        "x-sonus-required-permission": "eval-runs:update",
        "x-kejue-required-permission": "eval-runs:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_run_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_run_not_cancelable",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_run_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_run_not_cancelable",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Cancel an eval run",
        "description": "Requests cooperative cancellation. Queued runs become cancelled immediately; running runs finish in-flight calls and skip remaining scenarios. Only queued or running runs are cancelable.",
        "tags": [
          "Eval runs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancellation state after the request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalRunCancelResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-suites": {
      "get": {
        "operationId": "list_eval_suites",
        "x-sonus-required-permission": "eval-suites:read",
        "x-kejue-required-permission": "eval-suites:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List eval suites",
        "description": "Returns a reverse-chronological page with cursors bound to q, creation bounds, and archived filter. Definition bodies are omitted from list items.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          }
        ],
        "responses": {
          "200": {
            "description": "Eval suite page.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalSuiteListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_eval_suite",
        "x-sonus-required-permission": "eval-suites:create",
        "x-kejue-required-permission": "eval-suites:create",
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_suite_slug_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_suite_slug_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create an eval suite",
        "description": "Creates a versioned suite. slug is immutable and workspace-unique. definition is optional (defaults to {}) and carries only legacy v1 suite fields (start_node, rubric, assertions, personas) up to 1048576 encoded bytes; the complete encoded request body is limited to 1114112 bytes. Legacy definition.personas entries are mirrored into first-class scenarios. New suites add scenarios and attach checks through their own endpoints.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalSuiteCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Suite created with a strong ETag.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalSuite"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-suites/{id}": {
      "delete": {
        "operationId": "archive_eval_suite",
        "x-sonus-required-permission": "eval-suites:delete",
        "x-kejue-required-permission": "eval-suites:delete",
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive an eval suite",
        "description": "Soft-archives the suite. The optional If-Match protects against concurrent changes. Repeating the archive for an already archived suite is a successful 204 no-op and preserves the current ETag.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Suite archived, or already archived; response body is empty.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_eval_suite",
        "x-sonus-required-permission": "eval-suites:read",
        "x-kejue-required-permission": "eval-suites:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an eval suite",
        "description": "Returns the full definition for an active or archived suite together with its strong version ETag.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete eval suite.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalSuite"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_eval_suite",
        "x-sonus-required-permission": "eval-suites:update",
        "x-kejue-required-permission": "eval-suites:update",
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "eval_suite_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "eval_suite_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update an eval suite",
        "description": "Replaces only supplied mutable fields. The complete encoded request body is limited to 1114112 bytes. If-Match is optional but strongly recommended; stale tags return 412 with the current ETag. Semantic no-ops return the unchanged version.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalSuitePatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated or unchanged suite.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalSuite"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-suites/{id}/generate": {
      "post": {
        "operationId": "generate_eval_scenarios",
        "x-sonus-required-permission": "eval-suites:update",
        "x-kejue-required-permission": "eval-suites:update",
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Generate eval scenarios",
        "description": "Creates an asynchronous generation job for 1 to 5000 scenarios and publishes it to the queue. The complete encoded request body is limited to 65536 bytes. Poll Location after Retry-After. context_text is optional and limited to 20000 encoded bytes.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalGenerationRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Generation job accepted.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalGenerationAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-suites/{id}/checks": {
      "get": {
        "operationId": "list_eval_suite_checks",
        "x-sonus-required-permission": "eval-suites:read",
        "x-kejue-required-permission": "eval-suites:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List checks attached to a suite",
        "description": "Returns every library check attached to the suite, with the weight and blocking flag that apply here and the check's config. Every attached check scores.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The attached checks, in the order a run resolves them.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalCheckAttachmentListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "put": {
        "operationId": "set_eval_suite_checks",
        "x-sonus-required-permission": "eval-suites:update",
        "x-kejue-required-permission": "eval-suites:update",
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_check_not_found",
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "eval_suite_archived"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_check_not_found",
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "eval_suite_archived"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Replace the checks attached to a suite",
        "description": "Replaces the whole attachment set atomically. Omitting a check detaches it. weight defaults to 100 and blocking to false. Editing a check takes effect on the next run. At most 100 checks.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalCheckAttachmentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The attachments as they now stand.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalCheckAttachmentListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-suites/{id}/scenarios": {
      "get": {
        "operationId": "list_eval_scenarios",
        "x-sonus-required-permission": "eval-suites:read",
        "x-kejue-required-permission": "eval-suites:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List eval scenarios",
        "description": "Returns a cursor-paginated page scoped to one suite. q matches slug, label, scenario text, and scenario text; archived controls lifecycle visibility.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          }
        ],
        "responses": {
          "200": {
            "description": "Scenario page. offset is always zero for public cursor pagination.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalScenarioListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_eval_scenario",
        "x-sonus-required-permission": "eval-suites:update",
        "x-kejue-required-permission": "eval-suites:update",
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_scenario_slug_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_suite_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "eval_scenario_slug_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create an eval scenario",
        "description": "Adds one active scenario to a suite. slug is immutable and unique within the suite. The complete encoded request body is limited to 327680 bytes; assertions is an optional JSON object limited to 262144 encoded bytes and interpreted by the eval worker.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalScenarioCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Scenario created with a strong ETag.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalScenario"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-suites/{id}/scenarios/{scenario_id}": {
      "delete": {
        "operationId": "archive_eval_scenario",
        "x-sonus-required-permission": "eval-suites:update",
        "x-kejue-required-permission": "eval-suites:update",
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_scenario_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_scenario_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive an eval scenario",
        "description": "Soft-archives the scenario. If-Match is optional but protects against concurrent edits. Repeating the archive is a successful 204 no-op and preserves the current ETag.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Scenario archived, or already archived; response body is empty.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_eval_scenario",
        "x-sonus-required-permission": "eval-suites:update",
        "x-kejue-required-permission": "eval-suites:update",
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_scenario_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "eval_scenario_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_scenario_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "eval_scenario_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update an eval scenario",
        "description": "Replaces only supplied mutable fields. The complete encoded request body is limited to 327680 bytes and assertions to 262144 encoded bytes. slug, source, generation_job_id, and position are immutable. Semantic no-ops return the unchanged ETag.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalScenarioPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated or unchanged scenario.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalScenario"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/eval-suites/{id}/scenarios/{scenario_id}/checks": {
      "get": {
        "operationId": "list_eval_scenario_checks",
        "x-sonus-required-permission": "eval-suites:read",
        "x-kejue-required-permission": "eval-suites:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_scenario_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_scenario_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List checks attached to one scenario",
        "description": "Scenario-level attachments layer on top of the suite's. Where both attach the same check the scenario's weight and blocking flag win, so one scenario can be stricter without forking the check.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The attached checks, in the order a run resolves them.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalCheckAttachmentListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "put": {
        "operationId": "set_eval_scenario_checks",
        "x-sonus-required-permission": "eval-suites:update",
        "x-kejue-required-permission": "eval-suites:update",
        "x-sonus-required-entitlement": "evals",
        "x-kejue-required-entitlement": "evals",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_check_not_found",
            "eval_scenario_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "eval_suite_archived"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "eval_check_not_found",
            "eval_scenario_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "eval_suite_archived"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Replace the checks attached to one scenario",
        "description": "Replaces this scenario's attachment set atomically. These are additions and overrides on top of the suite's checks, not a replacement for them.",
        "tags": [
          "Eval suites"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalCheckAttachmentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The attachments as they now stand.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalCheckAttachmentListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/extraction-objects": {
      "get": {
        "operationId": "list_extraction_objects",
        "x-sonus-required-permission": "extraction-objects:read",
        "x-kejue-required-permission": "extraction-objects:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List extraction objects",
        "description": "Returns a cursor-paginated metadata page newest first. Field definitions are omitted by default; set expand=fields for schema discovery without issuing one request per object. Objects owned by a group (managed through /v1/groups) are not listed.",
        "tags": [
          "Extraction objects"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          },
          {
            "name": "expand",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "const": "fields"
            },
            "description": "Include each object's complete normalized fields array. Omit for compact metadata-only list items."
          }
        ],
        "responses": {
          "200": {
            "description": "One page of extraction-object metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtractionObjectListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_extraction_object",
        "x-sonus-required-permission": "extraction-objects:create",
        "x-kejue-required-permission": "extraction-objects:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "extraction_object_name_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "encoding_failed",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "extraction_object_name_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "encoding_failed",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create an extraction object",
        "description": "Creates a reusable structured-output schema. Attach its id to an agent version's after-call configuration to produce schema-validated JSON for future calls. Names are unique per workspace, including archived objects.",
        "tags": [
          "Extraction objects"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtractionObjectCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Extraction object created. The response contains the fully normalized schema.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtractionObjectDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/extraction-objects/{id}": {
      "delete": {
        "operationId": "archive_extraction_object",
        "x-sonus-required-permission": "extraction-objects:delete",
        "x-kejue-required-permission": "extraction-objects:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "extraction_object_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "extraction_object_in_use",
            "extraction_object_managed_by_group"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "extraction_object_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "extraction_object_in_use",
            "extraction_object_managed_by_group"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive an extraction object",
        "description": "Soft-archives an object. The operation is idempotent, but returns 409 while an active draft, staging, or production agent version references it; detach it from every dependency listed in the error first. Historical call results retain their snapshotted schema and data. An object owned by a group returns 409 extraction_object_managed_by_group; it is archived with its group.",
        "tags": [
          "Extraction objects"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Object archived, or it was already archived.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_extraction_object",
        "x-sonus-required-permission": "extraction-objects:read",
        "x-kejue-required-permission": "extraction-objects:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "extraction_object_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "extraction_object_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an extraction object",
        "description": "Returns the complete normalized field definition. Archived objects remain addressable by id for audit and historical interpretation.",
        "tags": [
          "Extraction objects"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Extraction-object detail.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtractionObjectDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_extraction_object",
        "x-sonus-required-permission": "extraction-objects:update",
        "x-kejue-required-permission": "extraction-objects:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "extraction_object_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "extraction_object_archived",
            "extraction_object_managed_by_group",
            "extraction_object_name_taken"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "encoding_failed",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "extraction_object_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "extraction_object_archived",
            "extraction_object_managed_by_group",
            "extraction_object_name_taken"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "encoding_failed",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update an extraction object",
        "description": "Replaces any supplied top-level field. Supplying fields replaces the entire ordered schema. Archived objects cannot be changed. If-Match prevents lost updates; a semantic no-op returns the unchanged object and ETag. An object owned by a group (see /v1/groups) returns 409 extraction_object_managed_by_group; change the group's metrics instead.",
        "tags": [
          "Extraction objects"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtractionObjectPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated object, or the unchanged object for a semantic no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtractionObjectDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/flows": {
      "get": {
        "operationId": "list_flows",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/flows?limit=50&archived=exclude&q=support",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/flows?limit=50&archived=exclude&q=support",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "discard_invalid_cursor_and_restart_the_same_filtered_traversal",
        "x-kejue-recovery-example": "discard_invalid_cursor_and_restart_the_same_filtered_traversal",
        "x-sonus-required-permission": "flows:read",
        "x-kejue-required-permission": "flows:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List flows",
        "description": "Returns organization-scoped flows ordered by created_at then id, both descending. Each element carries the whole graph plus its derived agent_count and handoff_count, so a list page can show each flow's shape without a second request. The opaque cursor is bound to this endpoint and to the exact q, created_from, created_to, and archived filters that issued it. Search q is a case-insensitive literal substring over slug, name, and description. Reading flows needs only the permission; the flows entitlement is required to create or change one. Supplying any request body is a 400 unexpected_body error.",
        "tags": [
          "Flows"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "Number of flows to return. The server fetches one extra row only to determine next_cursor."
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "name": "created_from",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                }
              ]
            },
            "description": "Inclusive created_at lower bound. A YYYY-MM-DD value means midnight UTC."
          },
          {
            "name": "created_to",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                }
              ]
            },
            "description": "Exclusive created_at upper bound. It must be later than created_from; a YYYY-MM-DD value means midnight UTC."
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          }
        ],
        "responses": {
          "200": {
            "description": "One deterministic page of flows. An empty result is data=[] and next_cursor=null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowListResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "33333333-3333-4333-8333-333333333333",
                      "org_id": "44444444-4444-4444-8444-444444444444",
                      "slug": "support-front-door",
                      "name": "Support front door",
                      "start_agent_id": "11111111-1111-4111-8111-111111111111",
                      "graph": {
                        "nodes": [
                          {
                            "id": "triage",
                            "agent_id": "11111111-1111-4111-8111-111111111111",
                            "x": 0,
                            "y": 0
                          },
                          {
                            "id": "billing",
                            "agent_id": "22222222-2222-4222-8222-222222222222",
                            "x": 320,
                            "y": -120
                          }
                        ],
                        "edges": [
                          {
                            "id": "triage-to-billing",
                            "source": "triage",
                            "target": "billing",
                            "label": "billing",
                            "condition": "the caller asks about an invoice or a payment"
                          }
                        ]
                      },
                      "agent_count": 2,
                      "handoff_count": 1,
                      "summary_enabled": true,
                      "extraction_object_ids": [],
                      "webhook_config_ids": [],
                      "resource_version": 1,
                      "created_at": "2026-09-15T09:00:00Z",
                      "updated_at": "2026-09-15T09:00:00Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_flow",
        "x-sonus-request-example": {
          "method": "POST",
          "path": "/v1/flows",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "flow-create-support-front-door-20260915"
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-kejue-request-example": {
          "method": "POST",
          "path": "/v1/flows",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "flow-create-support-front-door-20260915"
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-sonus-response-example": {
          "status": 201,
          "headers": {
            "Location": "/v1/flows/33333333-3333-4333-8333-333333333333",
            "ETag": "\"flow-33333333-3333-4333-8333-333333333333-v1\""
          },
          "body": "See the standard 201 application/json example."
        },
        "x-kejue-response-example": {
          "status": 201,
          "headers": {
            "Location": "/v1/flows/33333333-3333-4333-8333-333333333333",
            "ETag": "\"flow-33333333-3333-4333-8333-333333333333-v1\""
          },
          "body": "See the standard 201 application/json example."
        },
        "x-sonus-recovery-example": "correct_all_validation_fields_or_choose_a_different_slug",
        "x-kejue-recovery-example": "correct_all_validation_fields_or_choose_a_different_slug",
        "x-sonus-required-permission": "flows:create",
        "x-kejue-required-permission": "flows:create",
        "x-sonus-required-entitlement": "flows",
        "x-kejue-required-entitlement": "flows",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "flow_slug_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "flow_slug_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create a flow",
        "description": "Creates a flow from a graph of agents you already have. Only name is required — a flow can be created empty and wired up later — and an omitted slug is derived from the name. Every node must name a deployed agent in the same workspace and may appear at most once; every edge must join two distinct nodes and carry a non-empty condition, because that text is what the assistant reads when it decides whether to hand the call over. A start_agent_id, when given, must be one of the agents on the canvas. Validation failures list every offending field with its graph path. Requires the flows entitlement.",
        "tags": [
          "Flows"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowCreateRequest"
              },
              "example": {
                "slug": "support-front-door",
                "name": "Support front door",
                "start_agent_id": "11111111-1111-4111-8111-111111111111",
                "graph": {
                  "nodes": [
                    {
                      "id": "triage",
                      "agent_id": "11111111-1111-4111-8111-111111111111",
                      "x": 0,
                      "y": 0
                    },
                    {
                      "id": "billing",
                      "agent_id": "22222222-2222-4222-8222-222222222222",
                      "x": 320,
                      "y": -120
                    }
                  ],
                  "edges": [
                    {
                      "id": "triage-to-billing",
                      "source": "triage",
                      "target": "billing",
                      "label": "billing",
                      "condition": "the caller asks about an invoice or a payment"
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created flow, with its graph enriched by each node's agent slug and name.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flow"
                },
                "example": {
                  "id": "33333333-3333-4333-8333-333333333333",
                  "org_id": "44444444-4444-4444-8444-444444444444",
                  "slug": "support-front-door",
                  "name": "Support front door",
                  "start_agent_id": "11111111-1111-4111-8111-111111111111",
                  "graph": {
                    "nodes": [
                      {
                        "id": "triage",
                        "agent_id": "11111111-1111-4111-8111-111111111111",
                        "x": 0,
                        "y": 0,
                        "agent_slug": "triage",
                        "agent_name": "Triage"
                      },
                      {
                        "id": "billing",
                        "agent_id": "22222222-2222-4222-8222-222222222222",
                        "x": 320,
                        "y": -120,
                        "agent_slug": "billing",
                        "agent_name": "Billing"
                      }
                    ],
                    "edges": [
                      {
                        "id": "triage-to-billing",
                        "source": "triage",
                        "target": "billing",
                        "label": "billing",
                        "condition": "the caller asks about an invoice or a payment"
                      }
                    ]
                  },
                  "agent_count": 2,
                  "handoff_count": 1,
                  "summary_enabled": true,
                  "extraction_object_ids": [],
                  "webhook_config_ids": [],
                  "resource_version": 1,
                  "created_at": "2026-09-15T09:00:00Z",
                  "updated_at": "2026-09-15T09:00:00Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/flows/{id}": {
      "delete": {
        "operationId": "archive_flow",
        "x-sonus-request-example": {
          "method": "DELETE",
          "path": "/v1/flows/33333333-3333-4333-8333-333333333333",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "If-Match": "\"flow-33333333-3333-4333-8333-333333333333-v3\""
          }
        },
        "x-kejue-request-example": {
          "method": "DELETE",
          "path": "/v1/flows/33333333-3333-4333-8333-333333333333",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "If-Match": "\"flow-33333333-3333-4333-8333-333333333333-v3\""
          }
        },
        "x-sonus-response-example": {
          "status": 204,
          "body": null
        },
        "x-kejue-response-example": {
          "status": 204,
          "body": null
        },
        "x-sonus-recovery-example": "repoint_every_reported_phone_number_then_retry",
        "x-kejue-recovery-example": "repoint_every_reported_phone_number_then_retry",
        "x-sonus-required-permission": "flows:delete",
        "x-kejue-required-permission": "flows:delete",
        "x-sonus-required-entitlement": "flows",
        "x-kejue-required-entitlement": "flows",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "flow_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "flow_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "flow_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "flow_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive a flow",
        "description": "Soft-archives the flow. Calls that already ran through it stay readable with the graph they used, and the member agents are untouched. The request is rejected with 409 flow_in_use while any non-archived phone number still points at this flow; the error details list every blocking number, so repoint them and retry. Repeating DELETE after archive is an audited 204 no-op. If-Match is optional: omission archives unconditionally, * accepts the current representation, and a stale strong tag returns 412 with the current ETag. Any request body returns 400 unexpected_body.",
        "tags": [
          "Flows"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Flow archived, or it was already archived.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_flow",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/flows/33333333-3333-4333-8333-333333333333",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/flows/33333333-3333-4333-8333-333333333333",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"flow-33333333-3333-4333-8333-333333333333-v3\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"flow-33333333-3333-4333-8333-333333333333-v3\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "refetch_the_flow_and_reapply_the_change_with_the_new_etag",
        "x-kejue-recovery-example": "refetch_the_flow_and_reapply_the_change_with_the_new_etag",
        "x-sonus-required-permission": "flows:read",
        "x-kejue-required-permission": "flows:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "flow_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "flow_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a flow",
        "description": "Returns one flow with its whole graph, its after-call override and a strong ETag. Each node is enriched with the current slug and name of the agent it points at, so a stale canvas never renders a name that no longer exists. Send the ETag back in If-Match on the next PATCH. Archived flows remain readable. Supplying any request body is a 400 unexpected_body error.",
        "tags": [
          "Flows"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The flow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flow"
                },
                "example": {
                  "id": "33333333-3333-4333-8333-333333333333",
                  "org_id": "44444444-4444-4444-8444-444444444444",
                  "slug": "support-front-door",
                  "name": "Support front door",
                  "start_agent_id": "11111111-1111-4111-8111-111111111111",
                  "graph": {
                    "nodes": [
                      {
                        "id": "triage",
                        "agent_id": "11111111-1111-4111-8111-111111111111",
                        "x": 0,
                        "y": 0,
                        "agent_slug": "triage",
                        "agent_name": "Triage"
                      }
                    ],
                    "edges": []
                  },
                  "agent_count": 1,
                  "handoff_count": 0,
                  "summary_enabled": true,
                  "extraction_object_ids": [],
                  "webhook_config_ids": [],
                  "resource_version": 3,
                  "created_at": "2026-09-15T09:00:00Z",
                  "updated_at": "2026-09-15T10:12:00Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_flow",
        "x-sonus-request-example": {
          "method": "PATCH",
          "path": "/v1/flows/33333333-3333-4333-8333-333333333333",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"flow-33333333-3333-4333-8333-333333333333-v3\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-kejue-request-example": {
          "method": "PATCH",
          "path": "/v1/flows/33333333-3333-4333-8333-333333333333",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"flow-33333333-3333-4333-8333-333333333333-v3\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"flow-33333333-3333-4333-8333-333333333333-v4\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"flow-33333333-3333-4333-8333-333333333333-v4\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "refetch_the_flow_and_reapply_the_change_with_the_new_etag",
        "x-kejue-recovery-example": "refetch_the_flow_and_reapply_the_change_with_the_new_etag",
        "x-sonus-required-permission": "flows:update",
        "x-kejue-required-permission": "flows:update",
        "x-sonus-required-entitlement": "flows",
        "x-kejue-required-entitlement": "flows",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "flow_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "flow_archived",
            "flow_slug_taken"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "flow_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "flow_archived",
            "flow_slug_taken"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update a flow",
        "description": "Partially updates a flow. Omitted fields keep their values; explicit null clears description, start_agent_id and summary_prompt and empties the two after-call id lists. Supplying graph REPLACES the whole canvas — send it whole, not as a delta. Cross-field rules are evaluated against the merged result, so a patch that only moves the start agent must still name an agent the stored graph contains. Changes take effect on the next call; calls already in progress keep the graph they began with. If-Match is optional but recommended, and a stale strong tag returns 412 with the current ETag. Archived flows reject updates with 409 flow_archived. Requires the flows entitlement.",
        "tags": [
          "Flows"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowPatchRequest"
              },
              "example": {
                "name": "Support front door",
                "graph": {
                  "nodes": [
                    {
                      "id": "triage",
                      "agent_id": "11111111-1111-4111-8111-111111111111",
                      "x": 0,
                      "y": 0
                    }
                  ],
                  "edges": []
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated flow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flow"
                },
                "example": {
                  "id": "33333333-3333-4333-8333-333333333333",
                  "org_id": "44444444-4444-4444-8444-444444444444",
                  "slug": "support-front-door",
                  "name": "Support front door",
                  "start_agent_id": "11111111-1111-4111-8111-111111111111",
                  "graph": {
                    "nodes": [
                      {
                        "id": "triage",
                        "agent_id": "11111111-1111-4111-8111-111111111111",
                        "x": 0,
                        "y": 0,
                        "agent_slug": "triage",
                        "agent_name": "Triage"
                      }
                    ],
                    "edges": []
                  },
                  "agent_count": 1,
                  "handoff_count": 0,
                  "summary_enabled": true,
                  "extraction_object_ids": [],
                  "webhook_config_ids": [],
                  "resource_version": 4,
                  "created_at": "2026-09-15T09:00:00Z",
                  "updated_at": "2026-09-15T10:20:00Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/flows/{id}/clone": {
      "post": {
        "operationId": "clone_flow",
        "x-sonus-required-permission": "flows:create",
        "x-kejue-required-permission": "flows:create",
        "x-sonus-additional-required-permissions": [
          "flows:read"
        ],
        "x-sonus-required-entitlement": "flows",
        "x-kejue-additional-required-permissions": [
          "flows:read"
        ],
        "x-kejue-required-entitlement": "flows",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store, no-transform",
        "x-kejue-cache-control": "no-store, no-transform",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "flow_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "flow_archived",
            "flow_slug_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "flow_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "flow_archived",
            "flow_slug_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Clone a flow",
        "description": "Copies the current saved flow into a new flow in the same team at resource revision 1. Copies the graph, start agent, description, and after-call configuration. Member agents and shared after-call resources retain their IDs. The clone starts without phone assignments or call history. Requires flows:create and flows:read.",
        "tags": [
          "Flows"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Source flow UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowCloneRequest"
              },
              "example": {
                "name": "Billing_clone",
                "slug": "billing-clone"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new flow.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flow"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/groups": {
      "get": {
        "operationId": "list_groups",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/groups?limit=50&archived=exclude&q=collection",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/groups?limit=50&archived=exclude&q=collection",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "discard_invalid_cursor_and_restart_the_same_filtered_traversal",
        "x-kejue-recovery-example": "discard_invalid_cursor_and_restart_the_same_filtered_traversal",
        "x-sonus-required-permission": "groups:read",
        "x-kejue-required-permission": "groups:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List groups",
        "description": "Returns organization-scoped groups ordered by created_at then id, both descending. Each element carries its live members (with each member's traffic share and whether its agent can take calls right now), its custom metrics and how many live phone numbers and campaigns point at it, so a list page needs no second request. The used_by_detail lists are only returned by the single-group endpoints. The opaque cursor is bound to this endpoint and to the exact q, created_from, created_to, and archived filters that issued it. Search q is a case-insensitive literal substring over the group name. Reading groups needs only the permission; the groups entitlement is required to create or change one. Supplying any request body is a 400 unexpected_body error.",
        "tags": [
          "Groups"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "Number of groups to return. The server fetches one extra row only to determine next_cursor."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Case-insensitive literal substring search over the group name. The supplied and trimmed value must contain 1–200 Unicode characters; blank values and every Unicode control character are rejected. Percent, underscore, and backslash are literal characters, not LIKE syntax."
          },
          {
            "name": "created_from",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                }
              ]
            },
            "description": "Inclusive created_at lower bound. A YYYY-MM-DD value means midnight UTC."
          },
          {
            "name": "created_to",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                }
              ]
            },
            "description": "Exclusive created_at upper bound. It must be later than created_from; a YYYY-MM-DD value means midnight UTC."
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          }
        ],
        "responses": {
          "200": {
            "description": "One deterministic page of groups. An empty result is data=[] and next_cursor=null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupListResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "55555555-5555-4555-8555-555555555555",
                      "org_id": "44444444-4444-4444-8444-444444444444",
                      "name": "Debt collection A/B",
                      "overall_enabled": true,
                      "routing_strategy": "sticky",
                      "members": [
                        {
                          "id": "66666666-6666-4666-8666-666666666666",
                          "agent_id": "11111111-1111-4111-8111-111111111111",
                          "agent_name": "Noura",
                          "agent_slug": "noura",
                          "label": "A",
                          "weight": 50,
                          "position": 0,
                          "share": 50,
                          "dispatchable": true,
                          "created_at": "2026-10-20T09:00:00Z"
                        },
                        {
                          "id": "77777777-7777-4777-8777-777777777777",
                          "agent_id": "22222222-2222-4222-8222-222222222222",
                          "agent_name": "Omar",
                          "agent_slug": "omar",
                          "label": "B",
                          "weight": 50,
                          "position": 1,
                          "share": 50,
                          "dispatchable": true,
                          "created_at": "2026-10-20T09:00:00Z"
                        }
                      ],
                      "metrics": [
                        {
                          "name": "payment_promised",
                          "type": "boolean",
                          "description": "Did the customer promise to pay?"
                        }
                      ],
                      "extraction_object_id": "88888888-8888-4888-8888-888888888888",
                      "used_by": {
                        "phone_numbers": 1,
                        "campaigns": 0
                      },
                      "resource_version": 1,
                      "created_at": "2026-10-20T09:00:00Z",
                      "updated_at": "2026-10-20T09:00:00Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_group",
        "x-sonus-request-example": {
          "method": "POST",
          "path": "/v1/groups",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "group-create-debt-collection-ab-20261020"
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-kejue-request-example": {
          "method": "POST",
          "path": "/v1/groups",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "group-create-debt-collection-ab-20261020"
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-sonus-response-example": {
          "status": 201,
          "headers": {
            "Location": "/v1/groups/55555555-5555-4555-8555-555555555555",
            "ETag": "\"group-55555555-5555-4555-8555-555555555555-v1\""
          },
          "body": "See the standard 201 application/json example."
        },
        "x-kejue-response-example": {
          "status": 201,
          "headers": {
            "Location": "/v1/groups/55555555-5555-4555-8555-555555555555",
            "ETag": "\"group-55555555-5555-4555-8555-555555555555-v1\""
          },
          "body": "See the standard 201 application/json example."
        },
        "x-sonus-recovery-example": "correct_all_validation_fields_or_choose_a_different_name",
        "x-kejue-recovery-example": "correct_all_validation_fields_or_choose_a_different_name",
        "x-sonus-required-permission": "groups:create",
        "x-kejue-required-permission": "groups:create",
        "x-sonus-required-entitlement": "groups",
        "x-kejue-required-entitlement": "groups",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "group_name_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "group_name_taken",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create a group",
        "description": "Creates a group from agents you already have, so live calls can be split across them by weight and the agents compared on real traffic. name and members are required. Every member must name an un-archived agent in the same workspace with a production version; a group holds 1–10 agents, each at most once, with weights 0–100 and at least one weight above 0. Members are labelled A, B, C… in the order given. overall_enabled (default true) measures every call on the platform's Overall performance fields (overall_score 1–10 and outcome); metrics adds up to 20 custom fields. Both are written into one group-owned extraction object (extraction_object_id) that runs after every call routed through the group, on top of the answering agent's own after-call extractions. That object is hidden from GET /v1/extraction-objects and can only be changed here. Validation failures list every offending field with its path. Requires the groups entitlement.",
        "tags": [
          "Groups"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupCreateRequest"
              },
              "example": {
                "name": "Debt collection A/B",
                "description": "Noura's empathetic opener against Omar's direct one.",
                "overall_enabled": true,
                "routing_strategy": "sticky",
                "members": [
                  {
                    "agent_id": "11111111-1111-4111-8111-111111111111",
                    "weight": 50
                  },
                  {
                    "agent_id": "22222222-2222-4222-8222-222222222222",
                    "weight": 50
                  }
                ],
                "metrics": [
                  {
                    "name": "payment_promised",
                    "type": "boolean",
                    "description": "Did the customer promise to pay?"
                  },
                  {
                    "name": "sentiment",
                    "type": "enum",
                    "enum_values": [
                      "positive",
                      "neutral",
                      "negative"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created group, including the (empty) used_by_detail lists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Group"
                },
                "example": {
                  "id": "55555555-5555-4555-8555-555555555555",
                  "org_id": "44444444-4444-4444-8444-444444444444",
                  "name": "Debt collection A/B",
                  "description": "Noura's empathetic opener against Omar's direct one.",
                  "overall_enabled": true,
                  "routing_strategy": "sticky",
                  "members": [
                    {
                      "id": "66666666-6666-4666-8666-666666666666",
                      "agent_id": "11111111-1111-4111-8111-111111111111",
                      "agent_name": "Noura",
                      "agent_slug": "noura",
                      "label": "A",
                      "weight": 50,
                      "position": 0,
                      "share": 50,
                      "dispatchable": true,
                      "created_at": "2026-10-20T09:00:00Z"
                    },
                    {
                      "id": "77777777-7777-4777-8777-777777777777",
                      "agent_id": "22222222-2222-4222-8222-222222222222",
                      "agent_name": "Omar",
                      "agent_slug": "omar",
                      "label": "B",
                      "weight": 50,
                      "position": 1,
                      "share": 50,
                      "dispatchable": true,
                      "created_at": "2026-10-20T09:00:00Z"
                    }
                  ],
                  "metrics": [
                    {
                      "name": "payment_promised",
                      "type": "boolean",
                      "description": "Did the customer promise to pay?"
                    },
                    {
                      "name": "sentiment",
                      "type": "enum",
                      "enum_values": [
                        "positive",
                        "neutral",
                        "negative"
                      ]
                    }
                  ],
                  "extraction_object_id": "88888888-8888-4888-8888-888888888888",
                  "used_by": {
                    "phone_numbers": 0,
                    "campaigns": 0
                  },
                  "used_by_detail": {
                    "phone_numbers": [],
                    "campaigns": []
                  },
                  "resource_version": 1,
                  "created_at": "2026-10-20T09:00:00Z",
                  "updated_at": "2026-10-20T09:00:00Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/groups/{id}": {
      "delete": {
        "operationId": "archive_group",
        "x-sonus-request-example": {
          "method": "DELETE",
          "path": "/v1/groups/55555555-5555-4555-8555-555555555555",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "If-Match": "\"group-55555555-5555-4555-8555-555555555555-v3\""
          }
        },
        "x-kejue-request-example": {
          "method": "DELETE",
          "path": "/v1/groups/55555555-5555-4555-8555-555555555555",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "If-Match": "\"group-55555555-5555-4555-8555-555555555555-v3\""
          }
        },
        "x-sonus-response-example": {
          "status": 204,
          "body": null
        },
        "x-kejue-response-example": {
          "status": 204,
          "body": null
        },
        "x-sonus-recovery-example": "repoint_every_reported_phone_number_and_campaign_then_retry",
        "x-kejue-recovery-example": "repoint_every_reported_phone_number_and_campaign_then_retry",
        "x-sonus-required-permission": "groups:delete",
        "x-kejue-required-permission": "groups:delete",
        "x-sonus-required-entitlement": "groups",
        "x-kejue-required-entitlement": "groups",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "group_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "group_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "group_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "group_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive a group",
        "description": "Soft-archives the group and its group-owned extraction object. Calls that already ran through it stay readable with their group and member attribution, results stay available, and the member agents are untouched. The request is rejected with 409 group_in_use while any non-archived phone number or campaign still points at this group; details.phone_numbers lists the blocking E.164 numbers and details.campaigns the blocking campaign names, so re-point them at an agent, a flow or another group and retry. Repeating DELETE after archive is a 204 no-op. If-Match is optional: omission archives unconditionally, * accepts the current representation, and a stale strong tag returns 412 with the current ETag. Any request body returns 400 unexpected_body.",
        "tags": [
          "Groups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Group archived, or it was already archived.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_group",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/groups/55555555-5555-4555-8555-555555555555",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/groups/55555555-5555-4555-8555-555555555555",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"group-55555555-5555-4555-8555-555555555555-v3\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"group-55555555-5555-4555-8555-555555555555-v3\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "refetch_the_group_and_reapply_the_change_with_the_new_etag",
        "x-kejue-recovery-example": "refetch_the_group_and_reapply_the_change_with_the_new_etag",
        "x-sonus-required-permission": "groups:read",
        "x-kejue-required-permission": "groups:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "group_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "group_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a group",
        "description": "Returns one group with its live members, metrics, a strong ETag, and used_by_detail: every live phone number and campaign that points at it (the same lists DELETE reports when it refuses). Send the ETag back in If-Match on the next PATCH. Archived groups remain readable. Supplying any request body is a 400 unexpected_body error.",
        "tags": [
          "Groups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The group.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Group"
                },
                "example": {
                  "id": "55555555-5555-4555-8555-555555555555",
                  "org_id": "44444444-4444-4444-8444-444444444444",
                  "name": "Debt collection A/B",
                  "overall_enabled": true,
                  "routing_strategy": "sticky",
                  "members": [
                    {
                      "id": "66666666-6666-4666-8666-666666666666",
                      "agent_id": "11111111-1111-4111-8111-111111111111",
                      "agent_name": "Noura",
                      "agent_slug": "noura",
                      "label": "A",
                      "weight": 70,
                      "position": 0,
                      "share": 70,
                      "dispatchable": true,
                      "created_at": "2026-10-20T09:00:00Z"
                    },
                    {
                      "id": "77777777-7777-4777-8777-777777777777",
                      "agent_id": "22222222-2222-4222-8222-222222222222",
                      "agent_name": "Omar",
                      "agent_slug": "omar",
                      "label": "B",
                      "weight": 30,
                      "position": 1,
                      "share": 30,
                      "dispatchable": true,
                      "created_at": "2026-10-20T09:00:00Z"
                    }
                  ],
                  "metrics": [],
                  "extraction_object_id": "88888888-8888-4888-8888-888888888888",
                  "used_by": {
                    "phone_numbers": 1,
                    "campaigns": 1
                  },
                  "used_by_detail": {
                    "phone_numbers": [
                      {
                        "id": "99999999-9999-4999-8999-999999999999",
                        "e164": "+97145550100",
                        "label": "Collections line"
                      }
                    ],
                    "campaigns": [
                      {
                        "id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
                        "name": "October arrears",
                        "status": "running"
                      }
                    ]
                  },
                  "resource_version": 3,
                  "created_at": "2026-10-20T09:00:00Z",
                  "updated_at": "2026-10-22T11:30:00Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_group",
        "x-sonus-request-example": {
          "method": "PATCH",
          "path": "/v1/groups/55555555-5555-4555-8555-555555555555",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"group-55555555-5555-4555-8555-555555555555-v3\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-kejue-request-example": {
          "method": "PATCH",
          "path": "/v1/groups/55555555-5555-4555-8555-555555555555",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"group-55555555-5555-4555-8555-555555555555-v3\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"group-55555555-5555-4555-8555-555555555555-v4\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"group-55555555-5555-4555-8555-555555555555-v4\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "refetch_the_group_and_reapply_the_change_with_the_new_etag",
        "x-kejue-recovery-example": "refetch_the_group_and_reapply_the_change_with_the_new_etag",
        "x-sonus-required-permission": "groups:update",
        "x-kejue-required-permission": "groups:update",
        "x-sonus-required-entitlement": "groups",
        "x-kejue-required-entitlement": "groups",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "group_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "group_archived",
            "group_name_taken"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "group_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "group_archived",
            "group_name_taken"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update a group",
        "description": "Partially updates a group. Omitted fields keep their values; explicit null clears description and empties metrics, while name, overall_enabled and members reject null. Supplying members REPLACES the live member set, matched by agent_id: an agent already in the group keeps its member id and label, a new agent gets the next unused label, and an agent left out is removed (its past calls keep their attribution). Array order sets position. Any member or weight change is recorded in GET /v1/groups/{id}/changes and shown on the results timeline. Supplying metrics REPLACES the custom metric list. The group-owned extraction object is rewritten on every save. Changes take effect on the next call. If-Match is optional but recommended, and a stale strong tag returns 412 with the current ETag. Archived groups reject updates with 409 group_archived. Requires the groups entitlement.",
        "tags": [
          "Groups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupPatchRequest"
              },
              "example": {
                "routing_strategy": "prefer_new",
                "members": [
                  {
                    "agent_id": "11111111-1111-4111-8111-111111111111",
                    "weight": 70
                  },
                  {
                    "agent_id": "22222222-2222-4222-8222-222222222222",
                    "weight": 30
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated group.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Group"
                },
                "example": {
                  "id": "55555555-5555-4555-8555-555555555555",
                  "org_id": "44444444-4444-4444-8444-444444444444",
                  "name": "Debt collection A/B",
                  "overall_enabled": true,
                  "routing_strategy": "prefer_new",
                  "members": [
                    {
                      "id": "66666666-6666-4666-8666-666666666666",
                      "agent_id": "11111111-1111-4111-8111-111111111111",
                      "agent_name": "Noura",
                      "agent_slug": "noura",
                      "label": "A",
                      "weight": 70,
                      "position": 0,
                      "share": 70,
                      "dispatchable": true,
                      "created_at": "2026-10-20T09:00:00Z"
                    },
                    {
                      "id": "77777777-7777-4777-8777-777777777777",
                      "agent_id": "22222222-2222-4222-8222-222222222222",
                      "agent_name": "Omar",
                      "agent_slug": "omar",
                      "label": "B",
                      "weight": 30,
                      "position": 1,
                      "share": 30,
                      "dispatchable": true,
                      "created_at": "2026-10-20T09:00:00Z"
                    }
                  ],
                  "metrics": [],
                  "extraction_object_id": "88888888-8888-4888-8888-888888888888",
                  "used_by": {
                    "phone_numbers": 1,
                    "campaigns": 0
                  },
                  "used_by_detail": {
                    "phone_numbers": [
                      {
                        "id": "99999999-9999-4999-8999-999999999999",
                        "e164": "+97145550100"
                      }
                    ],
                    "campaigns": []
                  },
                  "resource_version": 4,
                  "created_at": "2026-10-20T09:00:00Z",
                  "updated_at": "2026-10-22T11:45:00Z"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/groups/{id}/results": {
      "get": {
        "operationId": "get_group_results",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/groups/55555555-5555-4555-8555-555555555555/results?from=2026-10-01&to=2026-10-25",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/groups/55555555-5555-4555-8555-555555555555/results?from=2026-10-01&to=2026-10-25",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "narrow_the_window_to_at_most_366_days_with_from_before_to",
        "x-kejue-recovery-example": "narrow_the_window_to_at_most_366_days_with_from_before_to",
        "x-sonus-required-permission": "groups:read",
        "x-kejue-required-permission": "groups:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "group_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "group_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Compare a group's members",
        "description": "Compares the group's members on the calls routed through the group in one time window (default: the last 30 days; at most 366 days). members lists every member that was live or took a call in the window, including removed ones (removed=true). builtin carries the platform's call metrics — calls, answer_rate (outbound calls only), avg_duration_sec, transfer_rate, failure_rate, tool_failure_rate, early_hangup_rate (answered and shorter than 10 s) and p50_latency_ms — and metrics the group's Overall performance fields (source overall) and custom metrics (source custom), read from the group-owned extraction. Every rate carries a Wilson 95% interval and every mean a normal 95% interval; enum metrics report a distribution instead of a value. Each metric's verdict is insufficient_data while fewer than two members have traffic or any member with traffic has fewer than 30 calls, otherwise leader (the best two differ at p < 0.05) or no_difference. trend is a per-day, per-member series and changes the member/weight snapshots inside the window, so a shift in the numbers can be lined up with the edit that caused it. Archived groups remain readable. Supplying any request body is a 400 unexpected_body error.",
        "tags": [
          "Groups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                }
              ]
            },
            "description": "Inclusive window start, an RFC 3339 timestamp or a YYYY-MM-DD date (midnight UTC). Defaults to 30 days before `to`. Must be before `to`, and the window can span at most 366 days."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                }
              ]
            },
            "description": "Exclusive window end, an RFC 3339 timestamp or a YYYY-MM-DD date (midnight UTC). Defaults to now."
          }
        ],
        "responses": {
          "200": {
            "description": "The per-member comparison for the window.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupResults"
                },
                "example": {
                  "group_id": "55555555-5555-4555-8555-555555555555",
                  "from": "2026-10-01T00:00:00Z",
                  "to": "2026-10-25T00:00:00Z",
                  "members": [
                    {
                      "member_id": "66666666-6666-4666-8666-666666666666",
                      "label": "A",
                      "agent_id": "11111111-1111-4111-8111-111111111111",
                      "agent_name": "Noura",
                      "weight": 50,
                      "removed": false
                    },
                    {
                      "member_id": "77777777-7777-4777-8777-777777777777",
                      "label": "B",
                      "agent_id": "22222222-2222-4222-8222-222222222222",
                      "agent_name": "Omar",
                      "weight": 50,
                      "removed": false
                    }
                  ],
                  "builtin": [
                    {
                      "key": "transfer_rate",
                      "label": "Transferred",
                      "kind": "rate",
                      "unit": null,
                      "higher_is_better": false,
                      "values": [
                        {
                          "member_id": "66666666-6666-4666-8666-666666666666",
                          "n": 412,
                          "value": 0.08,
                          "ci_low": 0.058,
                          "ci_high": 0.11
                        },
                        {
                          "member_id": "77777777-7777-4777-8777-777777777777",
                          "n": 398,
                          "value": 0.15,
                          "ci_low": 0.118,
                          "ci_high": 0.189
                        }
                      ],
                      "verdict": {
                        "status": "leader",
                        "member_id": "66666666-6666-4666-8666-666666666666",
                        "confidence": 0.997
                      }
                    }
                  ],
                  "metrics": [
                    {
                      "name": "sentiment",
                      "label": "Sentiment",
                      "type": "enum",
                      "source": "custom",
                      "enum_values": [
                        "positive",
                        "neutral",
                        "negative"
                      ],
                      "higher_is_better": null,
                      "values": [
                        {
                          "member_id": "66666666-6666-4666-8666-666666666666",
                          "n": 401,
                          "value": null,
                          "ci_low": null,
                          "ci_high": null,
                          "distribution": {
                            "positive": 210,
                            "neutral": 150,
                            "negative": 41
                          }
                        },
                        {
                          "member_id": "77777777-7777-4777-8777-777777777777",
                          "n": 390,
                          "value": null,
                          "ci_low": null,
                          "ci_high": null,
                          "distribution": {
                            "positive": 160,
                            "neutral": 170,
                            "negative": 60
                          }
                        }
                      ],
                      "verdict": {
                        "status": "no_difference"
                      }
                    }
                  ],
                  "trend": {
                    "bucket": "day",
                    "points": [
                      {
                        "date": "2026-10-01",
                        "member_id": "66666666-6666-4666-8666-666666666666",
                        "calls": 41,
                        "overall_score": 7.2
                      }
                    ]
                  },
                  "changes": [
                    {
                      "changed_at": "2026-10-01T08:00:00Z",
                      "members": [
                        {
                          "member_id": "66666666-6666-4666-8666-666666666666",
                          "agent_id": "11111111-1111-4111-8111-111111111111",
                          "label": "A",
                          "weight": 50
                        },
                        {
                          "member_id": "77777777-7777-4777-8777-777777777777",
                          "agent_id": "22222222-2222-4222-8222-222222222222",
                          "label": "B",
                          "weight": 50
                        }
                      ]
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/groups/{id}/changes": {
      "get": {
        "operationId": "list_group_changes",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/groups/55555555-5555-4555-8555-555555555555/changes",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/groups/55555555-5555-4555-8555-555555555555/changes",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "refetch_the_group_to_confirm_it_exists",
        "x-kejue-recovery-example": "refetch_the_group_to_confirm_it_exists",
        "x-sonus-required-permission": "groups:read",
        "x-kejue-required-permission": "groups:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "group_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "group_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List a group's member changes",
        "description": "Returns the history of the group's live member set, oldest first: one snapshot per save that added or removed a member or changed a weight (including the initial create), with each member's label and weight at that moment. At most the 500 oldest snapshots are returned. Archived groups remain readable. Supplying any request body is a 400 unexpected_body error.",
        "tags": [
          "Groups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The member/weight snapshots, oldest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupChangeListResponse"
                },
                "example": {
                  "data": [
                    {
                      "changed_at": "2026-10-20T09:00:00Z",
                      "changed_by": "bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb",
                      "members": [
                        {
                          "member_id": "66666666-6666-4666-8666-666666666666",
                          "agent_id": "11111111-1111-4111-8111-111111111111",
                          "label": "A",
                          "weight": 50
                        },
                        {
                          "member_id": "77777777-7777-4777-8777-777777777777",
                          "agent_id": "22222222-2222-4222-8222-222222222222",
                          "label": "B",
                          "weight": 50
                        }
                      ]
                    },
                    {
                      "changed_at": "2026-10-22T11:45:00Z",
                      "changed_by": "bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb",
                      "members": [
                        {
                          "member_id": "66666666-6666-4666-8666-666666666666",
                          "agent_id": "11111111-1111-4111-8111-111111111111",
                          "label": "A",
                          "weight": 70
                        },
                        {
                          "member_id": "77777777-7777-4777-8777-777777777777",
                          "agent_id": "22222222-2222-4222-8222-222222222222",
                          "label": "B",
                          "weight": 30
                        }
                      ]
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/guardrail-sets": {
      "get": {
        "operationId": "list_guardrail_sets",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/guardrail-sets?limit=50&archived=exclude&q=payment",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/guardrail-sets?limit=50&archived=exclude&q=payment",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "discard_invalid_cursor_and_restart_the_same_filtered_traversal",
        "x-kejue-recovery-example": "discard_invalid_cursor_and_restart_the_same_filtered_traversal",
        "x-sonus-required-permission": "guardrail-sets:read",
        "x-kejue-required-permission": "guardrail-sets:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List guardrail sets",
        "description": "Returns organization-scoped metadata ordered by created_at then id, both descending. Definitions are deliberately omitted; GET the selected UUID to read its ordered rules. The opaque cursor is bound to this endpoint and the exact q, created_from, created_to, and archived filters that issued it. Search q must be nonblank and control-free, and both its raw and trimmed values are limited to 200 Unicode characters. Search is a case-insensitive literal substring over slug, name, and description, so %, _, and backslash are not wildcard syntax. Supplying any request body is a 400 unexpected_body error.",
        "tags": [
          "Guardrails"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "Number of metadata rows to return. The server fetches one extra row only to determine next_cursor."
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "name": "created_from",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                }
              ]
            },
            "description": "Inclusive created_at lower bound. A YYYY-MM-DD value means midnight UTC."
          },
          {
            "name": "created_to",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "string",
                  "format": "date"
                }
              ]
            },
            "description": "Exclusive created_at upper bound. It must be later than created_from; a YYYY-MM-DD value means midnight UTC."
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          }
        ],
        "responses": {
          "200": {
            "description": "One deterministic page of guardrail-set metadata. An empty result is data=[] and next_cursor=null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardrailSetListResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "11111111-1111-4111-8111-111111111111",
                      "slug": "payment_safety",
                      "name": "Payment safety",
                      "description": "Prevent collection of payment credentials.",
                      "archived_at": null,
                      "created_at": "2026-07-20T09:00:00Z",
                      "updated_at": "2026-07-20T09:00:00Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_guardrail_set",
        "x-sonus-request-example": {
          "method": "POST",
          "path": "/v1/guardrail-sets",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "guardrail-create-payment-safety-20260720"
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-kejue-request-example": {
          "method": "POST",
          "path": "/v1/guardrail-sets",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "Idempotency-Key": "guardrail-create-payment-safety-20260720"
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-sonus-response-example": {
          "status": 201,
          "headers": {
            "Location": "/v1/guardrail-sets/11111111-1111-4111-8111-111111111111",
            "ETag": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v1\""
          },
          "body": "See the standard 201 application/json example."
        },
        "x-kejue-response-example": {
          "status": 201,
          "headers": {
            "Location": "/v1/guardrail-sets/11111111-1111-4111-8111-111111111111",
            "ETag": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v1\""
          },
          "body": "See the standard 201 application/json example."
        },
        "x-sonus-recovery-example": "correct_all_validation_fields_or_choose_a_different_slug",
        "x-kejue-recovery-example": "correct_all_validation_fields_or_choose_a_different_slug",
        "x-sonus-required-permission": "guardrail-sets:create",
        "x-kejue-required-permission": "guardrail-sets:create",
        "x-sonus-required-entitlement": "guardrails",
        "x-kejue-required-entitlement": "guardrails",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "slug_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "slug_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create a guardrail set",
        "description": "Creates one reusable ordered set. Omitted definition or omitted definition.guardrails normalizes to {\"guardrails\":[]}. For each rule, authored whitespace is normalized as described by its schema and an omitted kind means llm; the response always emits canonical kind. Idempotency-Key is required for API-key clients. Replaying the identical logical request returns the original 201 status, body, Location, ETag, and Cache-Control with Idempotency-Replayed:true and creates no second resource or audit event. Reusing the key with different method, path, query, security context, or body is a 409.",
        "tags": [
          "Guardrails"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GuardrailSetCreateRequest"
              },
              "example": {
                "slug": "payment_safety",
                "name": "Payment safety",
                "description": "Prevent collection of payment credentials.",
                "definition": {
                  "guardrails": [
                    {
                      "id": "never-request-card",
                      "name": "Do not collect cards",
                      "severity": "high",
                      "instruction": "Never ask the caller to read a complete payment-card number, CVV, PIN, password, or one-time passcode."
                    },
                    {
                      "id": "prohibited-phrases",
                      "name": "Block credential prompts",
                      "severity": "block",
                      "kind": "static",
                      "phrases": [
                        "read me your password",
                        "tell me the one time passcode"
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Guardrail set created and returned in canonical form.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/GuardrailSetLocation"
              },
              "ETag": {
                "$ref": "#/components/headers/GuardrailSetETag"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardrailSetDetail"
                },
                "example": {
                  "id": "11111111-1111-4111-8111-111111111111",
                  "slug": "payment_safety",
                  "name": "Payment safety",
                  "description": "Prevent collection of payment credentials.",
                  "archived_at": null,
                  "created_at": "2026-07-20T09:00:00Z",
                  "updated_at": "2026-07-20T09:00:00Z",
                  "definition": {
                    "guardrails": [
                      {
                        "id": "never-request-card",
                        "name": "Do not collect cards",
                        "severity": "high",
                        "kind": "llm",
                        "instruction": "Never ask the caller to read a complete payment-card number, CVV, PIN, password, or one-time passcode."
                      },
                      {
                        "id": "prohibited-phrases",
                        "name": "Block credential prompts",
                        "severity": "block",
                        "kind": "static",
                        "phrases": [
                          "read me your password",
                          "tell me the one time passcode"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/GuardrailValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/guardrail-sets/{id}": {
      "delete": {
        "operationId": "archive_guardrail_set",
        "x-sonus-request-example": {
          "method": "DELETE",
          "path": "/v1/guardrail-sets/11111111-1111-4111-8111-111111111111",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "If-Match": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v3\""
          }
        },
        "x-kejue-request-example": {
          "method": "DELETE",
          "path": "/v1/guardrail-sets/11111111-1111-4111-8111-111111111111",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "If-Match": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v3\""
          }
        },
        "x-sonus-response-example": {
          "status": 204,
          "headers": {
            "ETag": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v4\""
          },
          "body": null
        },
        "x-kejue-response-example": {
          "status": 204,
          "headers": {
            "ETag": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v4\""
          },
          "body": null
        },
        "x-sonus-recovery-example": "detach_every_reported_active_agent_version_then_retry",
        "x-kejue-recovery-example": "detach_every_reported_active_agent_version_then_retry",
        "x-sonus-required-permission": "guardrail-sets:delete",
        "x-kejue-required-permission": "guardrail-sets:delete",
        "x-sonus-required-entitlement": "guardrails",
        "x-kejue-required-entitlement": "guardrails",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "guardrail_set_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "guardrail_set_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "guardrail_set_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "guardrail_set_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive a guardrail set",
        "description": "Soft-archives the set without deleting its audit/history identity. The request is rejected with 409 guardrail_set_in_use while any non-archived agent's active draft, staging, or production pointer references this UUID. Error details list every blocking pointer in deterministic agent-slug then draft/staging/production order. Remove the UUID from a new draft and advance the required staging and production pointers before retrying. Inactive historical versions do not block archive. Repeating DELETE after archive is an audited 204 no-op. If-Match is optional: omission performs an unconditional archive, * accepts the current representation, and one or a comma-separated list of strong tags is accepted when any tag matches. A malformed/weak validator returns 400, and stale strong tags return 412 with the current ETag. Any request body returns 400 unexpected_body.",
        "tags": [
          "Guardrails"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Set archived, or it was already archived.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/GuardrailSetETag"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/GuardrailSetInUse"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_guardrail_set",
        "x-sonus-request-example": {
          "method": "GET",
          "path": "/v1/guardrail-sets/11111111-1111-4111-8111-111111111111",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-kejue-request-example": {
          "method": "GET",
          "path": "/v1/guardrail-sets/11111111-1111-4111-8111-111111111111",
          "headers": {
            "Authorization": "Bearer <api-key>"
          }
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v3\""
          },
          "body": "See the canonical or legacy-repair 200 example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v3\""
          },
          "body": "See the canonical or legacy-repair 200 example."
        },
        "x-sonus-recovery-example": "patch_the_complete_definition_when_configuration_errors_is_present",
        "x-kejue-recovery-example": "patch_the_complete_definition_when_configuration_errors_is_present",
        "x-sonus-required-permission": "guardrail-sets:read",
        "x-kejue-required-permission": "guardrail-sets:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "guardrail_set_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "guardrail_set_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a guardrail set",
        "description": "Returns the complete canonical ordered definition, including archived sets. Canonical API-authored rows omit configuration_errors. A legacy or out-of-band invalid row is made response-schema-safe with precise configuration_errors: invalid individual rules are omitted when the containing definition is representable, while a malformed or missing root/guardrails container, a stored definition above the 1,048,576-byte encoded limit, or an oversized normalized safe view returns the canonical empty definition. Replace the complete definition in one PATCH to repair it. The strong ETag versions the stored resource, not the normalized view, and must be treated as opaque. Supplying any request body is a 400 unexpected_body error.",
        "tags": [
          "Guardrails"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Guardrail-set metadata and its normalized ordered definition.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/GuardrailSetETag"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardrailSetDetail"
                },
                "examples": {
                  "canonical": {
                    "summary": "Current canonical set",
                    "value": {
                      "id": "11111111-1111-4111-8111-111111111111",
                      "slug": "payment_safety",
                      "name": "Payment safety",
                      "description": "Prevent collection of payment credentials.",
                      "archived_at": null,
                      "created_at": "2026-07-20T09:00:00Z",
                      "updated_at": "2026-07-20T09:20:00Z",
                      "definition": {
                        "guardrails": [
                          {
                            "id": "never-request-card",
                            "severity": "high",
                            "kind": "llm",
                            "instruction": "Never request complete payment credentials."
                          },
                          {
                            "id": "prohibited-phrases",
                            "severity": "block",
                            "kind": "static",
                            "phrases": [
                              "read me your password"
                            ]
                          }
                        ]
                      }
                    }
                  },
                  "legacy_repair_required": {
                    "summary": "Safe view of a legacy row with one invalid rule omitted",
                    "value": {
                      "id": "22222222-2222-4222-8222-222222222222",
                      "slug": "legacy_safety",
                      "name": "Legacy safety",
                      "description": null,
                      "archived_at": null,
                      "created_at": "2025-01-01T00:00:00Z",
                      "updated_at": "2025-01-01T00:00:00Z",
                      "definition": {
                        "guardrails": []
                      },
                      "configuration_errors": [
                        {
                          "path": "definition.guardrails[0].instruction",
                          "code": "required",
                          "message": "instruction is required"
                        }
                      ]
                    }
                  },
                  "legacy_definition_unrepresentable": {
                    "summary": "Safe empty view of an oversized legacy definition",
                    "value": {
                      "id": "22222222-2222-4222-8222-222222222223",
                      "slug": "legacy_oversized_safety",
                      "name": "Legacy oversized safety",
                      "description": null,
                      "archived_at": null,
                      "created_at": "2025-01-01T00:00:00Z",
                      "updated_at": "2025-01-01T00:00:00Z",
                      "definition": {
                        "guardrails": []
                      },
                      "configuration_errors": [
                        {
                          "path": "definition",
                          "code": "too_large",
                          "message": "stored definition exceeds the 1048576-byte encoded limit"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_guardrail_set",
        "x-sonus-request-example": {
          "method": "PATCH",
          "path": "/v1/guardrail-sets/11111111-1111-4111-8111-111111111111",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v3\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-kejue-request-example": {
          "method": "PATCH",
          "path": "/v1/guardrail-sets/11111111-1111-4111-8111-111111111111",
          "headers": {
            "Authorization": "Bearer <api-key>",
            "Content-Type": "application/json",
            "If-Match": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v3\""
          },
          "body": "See the standard requestBody application/json example."
        },
        "x-sonus-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v4\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-kejue-response-example": {
          "status": 200,
          "headers": {
            "ETag": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v4\""
          },
          "body": "See the standard 200 application/json example."
        },
        "x-sonus-recovery-example": "reconcile_412_or_reduce_the_reported_agent_runtime_budget",
        "x-kejue-recovery-example": "reconcile_412_or_reduce_the_reported_agent_runtime_budget",
        "x-sonus-required-permission": "guardrail-sets:update",
        "x-kejue-required-permission": "guardrail-sets:update",
        "x-sonus-required-entitlement": "guardrails",
        "x-kejue-required-entitlement": "guardrails",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "guardrail_set_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "guardrail_set_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "guardrail_set_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "guardrail_set_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update a guardrail set",
        "description": "Replaces any supplied name, description, or complete definition; omitted fields are unchanged, null or blank description clears it, and slug is immutable. Archived sets return 409. A definition change is also measured across every active draft/staging/production agent version that references this set. A 422 validation_failed response identifies each affected agent/stage and assigned_agent_configuration_invalid when an existing assignment must first be repaired, or one of the assigned_agent_guardrail_rule_budget_exceeded, assigned_agent_guardrail_instruction_budget_exceeded, assigned_agent_guardrail_phrase_budget_exceeded, or assigned_agent_guardrail_phrase_character_budget_exceeded field codes; detach a set or reduce the candidate definition before retrying. If-Match is optional: omission is an unconditional write, * accepts the current representation, and one or a comma-separated list of strong tags is accepted when any tag matches. Malformed or weak tags return 400, and stale strong tags return 412 with the current ETag. A semantic no-op writes only a no-op audit event and preserves updated_at, resource version, response body, and ETag.",
        "tags": [
          "Guardrails"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GuardrailSetPatchRequest"
              },
              "example": {
                "description": "Credential collection and disclosure policy.",
                "definition": {
                  "guardrails": [
                    {
                      "id": "never-request-card",
                      "severity": "high",
                      "kind": "llm",
                      "instruction": "Never request or repeat complete payment credentials."
                    },
                    {
                      "id": "prohibited-phrases",
                      "severity": "block",
                      "kind": "static",
                      "phrases": [
                        "read me your password"
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated set, or the unchanged set for a semantic no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/GuardrailSetETag"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuardrailSetDetail"
                },
                "example": {
                  "id": "11111111-1111-4111-8111-111111111111",
                  "slug": "payment_safety",
                  "name": "Payment safety",
                  "description": "Credential collection and disclosure policy.",
                  "archived_at": null,
                  "created_at": "2026-07-20T09:00:00Z",
                  "updated_at": "2026-07-20T09:30:00Z",
                  "definition": {
                    "guardrails": [
                      {
                        "id": "never-request-card",
                        "severity": "high",
                        "kind": "llm",
                        "instruction": "Never request or repeat complete payment credentials."
                      },
                      {
                        "id": "prohibited-phrases",
                        "severity": "block",
                        "kind": "static",
                        "phrases": [
                          "read me your password"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/GuardrailValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/ingest/human-calls": {
      "get": {
        "operationId": "list_human_call_ingests",
        "x-sonus-required-permission": "human-calls:read",
        "x-kejue-required-permission": "human-calls:read",
        "x-sonus-required-entitlement": "human_call_ingest",
        "x-kejue-required-entitlement": "human_call_ingest",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List human-call ingests",
        "description": "Returns recent human-call ingests newest first, with each one's progress through transcription and analysis.",
        "tags": [
          "Human call imports"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/HumanCallIngestStatus"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of ingests.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HumanCallIngestListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_human_call_ingest",
        "x-sonus-required-permission": "human-calls:create",
        "x-kejue-required-permission": "human-calls:create",
        "x-sonus-required-entitlement": "human_call_ingest",
        "x-kejue-required-entitlement": "human_call_ingest",
        "x-sonus-idempotency": "optional",
        "x-kejue-idempotency": "optional",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "encoding_failed",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "encoding_failed",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Ingest a human-handled call",
        "description": "Accepts a recording, or an already-produced transcript, of a call that a human agent handled and queues it for the same post-call analysis an AI call receives: transcription, summary, and one extraction per requested extraction object. The result is an ordinary call with handled_by=human, so it appears in the calls list and can be compared against AI calls on any analysis board by grouping or filtering on handled_by. Supply exactly one of recording_url or transcript. Sending external_ref makes the request idempotent per workspace across redeliveries, which is the durable guarantee for a webhook that may retry days later; Idempotency-Key covers an immediate transport retry. Optional key_terms (names, brands, jargon) bias transcription of a recording_url toward those spellings, merged with the platform's default key terms. Key terms never fail an ingest: when the platform's human-call transcription model does not support them, or a transcript was supplied instead of a recording, the call is still accepted and analyzed, the terms are ignored, and the response carries a machine-readable entry in warnings (key_terms_unsupported or key_terms_not_applicable) that also stays on the ingest for later reads.",
        "tags": [
          "Human call imports"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HumanCallIngestRequest"
              },
              "example": {
                "recording_url": "https://recordings.example.com/calls/8842.wav",
                "human_agent": "alice.kowalski",
                "direction": "inbound",
                "started_at": "2026-08-12T09:14:00Z",
                "ended_at": "2026-08-12T09:21:30Z",
                "caller_number": "+447700900123",
                "external_ref": "zendesk-1234",
                "extraction_object_ids": [
                  "44444444-4444-4444-8444-444444444444"
                ],
                "key_terms": [
                  "Kejue",
                  "Kejue Voice Care Plus"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "An ingest with this external_ref already exists in the workspace; the original resource is returned unchanged.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HumanCallIngest"
                }
              }
            }
          },
          "202": {
            "description": "The call was accepted and queued. Poll the returned id to follow transcription and analysis.",
            "headers": {
              "Location": {
                "description": "URL of the created ingest.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HumanCallIngest"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/ingest/human-calls/{id}": {
      "get": {
        "operationId": "get_human_call_ingest",
        "x-sonus-required-permission": "human-calls:read",
        "x-kejue-required-permission": "human-calls:read",
        "x-sonus-required-entitlement": "human_call_ingest",
        "x-kejue-required-entitlement": "human_call_ingest",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get one human-call ingest",
        "description": "Returns the ingest's progress. status moves queued to transcribing to analyzing to done; error carries a stable, bounded reason and never a raw provider message.",
        "tags": [
          "Human call imports"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ingest.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HumanCallIngest"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/mcp-servers": {
      "get": {
        "operationId": "list_mcp_servers",
        "x-sonus-required-permission": "mcp-servers:read",
        "x-kejue-required-permission": "mcp-servers:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List MCP servers",
        "description": "Returns MCP server registrations in reverse creation order. Unknown, duplicate, or empty query parameters return 400 instead of being ignored.",
        "tags": [
          "MCP servers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          },
          {
            "name": "auth_mode",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/MCPAuthMode"
            },
            "description": "Return only registrations using this authentication mode."
          }
        ],
        "responses": {
          "200": {
            "description": "MCP server page. Nullable fields are emitted as JSON null and next_cursor is always present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPServerListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_mcp_server",
        "x-sonus-required-permission": "mcp-servers:create",
        "x-kejue-required-permission": "mcp-servers:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "mcp_server_slug_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "mcp_server_slug_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Register an MCP server",
        "description": "Registers a public HTTPS Streamable HTTP MCP endpoint. Credentials are referenced by stable secret names and are never stored inline. Tool discovery is an explicit follow-up introspection operation using MCP 2025-11-25 with negotiated 2025-06-18 compatibility.",
        "tags": [
          "MCP servers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MCPServerCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "MCP server registered. The complete safe configuration is returned.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPServerDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/mcp-servers/{id}": {
      "delete": {
        "operationId": "archive_mcp_server",
        "x-sonus-required-permission": "mcp-servers:delete",
        "x-kejue-required-permission": "mcp-servers:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "mcp_server_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "mcp_server_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "mcp_server_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "mcp_server_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive an MCP server",
        "description": "Idempotently soft-archives a registration. Returns 409 mcp_server_in_use while any active agent draft, staging, or production version references it.",
        "tags": [
          "MCP servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Archived, or already archived. No response body is returned.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_mcp_server",
        "x-sonus-required-permission": "mcp-servers:read",
        "x-kejue-required-permission": "mcp-servers:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "mcp_server_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "mcp_server_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an MCP server",
        "description": "Returns the safe registration, approved hash pins, latest observed hashes, and sanitized introspection status. Secret values are never returned.",
        "tags": [
          "MCP servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "MCP server configuration.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPServerDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_mcp_server",
        "x-sonus-required-permission": "mcp-servers:update",
        "x-kejue-required-permission": "mcp-servers:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "mcp_server_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "mcp_server_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "mcp_server_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "mcp_server_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update an MCP server",
        "description": "Applies a partial update to the resulting configuration. Changing connection or authentication fields clears observed introspection state but preserves approved pins, so unreviewed tools remain blocked. Changing auth_mode automatically clears fields belonging to the previous mode.",
        "tags": [
          "MCP servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MCPServerPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated configuration, or the unchanged configuration for a semantic no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPServerDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/mcp-servers/{id}/approve-drift": {
      "post": {
        "operationId": "approve_mcp_server_drift",
        "x-sonus-required-permission": "mcp-servers:update",
        "x-kejue-required-permission": "mcp-servers:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "mcp_server_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "mcp_server_archived",
            "no_observed_tool_state"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "mcp_server_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "mcp_server_archived",
            "no_observed_tool_state"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Approve MCP tool drift",
        "description": "Atomically replaces approved tool hashes with the most recently observed set. It never clears pins to create an unreviewed trust-on-first-use window. Introspect successfully before calling this operation.",
        "tags": [
          "MCP servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Drift approved, or an explicit no_drift no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPApproveDriftResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/mcp-servers/{id}/introspect": {
      "post": {
        "operationId": "introspect_mcp_server",
        "x-sonus-required-permission": "mcp-servers:update",
        "x-kejue-required-permission": "mcp-servers:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "mcp_server_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "mcp_server_archived",
            "resource_changed"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "502": [
            "provider_request_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ],
          "504": [
            "mcp_introspection_failed"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "mcp_server_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "mcp_server_archived",
            "resource_changed"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "502": [
            "provider_request_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ],
          "504": [
            "mcp_introspection_failed"
          ]
        },
        "summary": "Introspect MCP server tools",
        "description": "Connects from Kejue Voice using the stored authentication configuration, performs MCP initialize and paginated tools/list, sanitizes tool descriptions, computes stable hashes, and records the observed state. The first successful introspection establishes pins; later drift remains blocked until approved. Upstream bodies and credentials are never copied into errors.",
        "tags": [
          "MCP servers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Sanitized tool inventory and drift comparison.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPIntrospectResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          }
        }
      }
    },
    "/members": {
      "get": {
        "operationId": "list_members",
        "x-sonus-required-permission": "members:read",
        "x-kejue-required-permission": "members:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List members",
        "description": "Returns workspace memberships in reverse creation order. Invitations have their own cursor stream at `GET /members/invitations`; follow `next_cursor` until null for a complete traversal.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "Number of memberships to return."
          }
        ],
        "responses": {
          "200": {
            "description": "One page of current memberships.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "invite_member",
        "x-sonus-required-permission": "members:create",
        "x-kejue-required-permission": "members:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "delegation_not_allowed",
            "forbidden",
            "permission_escalation",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "member_already_exists",
            "member_invitation_conflict"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "delegation_not_allowed",
            "forbidden",
            "permission_escalation",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "member_already_exists",
            "member_invitation_conflict"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Invite a member",
        "description": "Creates a one-time invitation. Omitting role_id assigns the built-in viewer role. Reissuing an invitation revokes prior active invitations for the same email. The selected role cannot grant permissions the caller does not possess.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteMemberRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Invitation metadata plus its one-time invite URL and best-effort email delivery status.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteMemberResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/members/invitations": {
      "get": {
        "operationId": "list_member_invitations",
        "x-sonus-required-permission": "members:read",
        "x-kejue-required-permission": "members:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List unresolved member invitations",
        "description": "Lists invitations that have neither been accepted nor revoked, in reverse creation order. Results include both pending and expired records; accepted and revoked invitations remain addressable by ID while their role exists but are omitted from this collection. Follow `next_cursor` until null for a complete traversal.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "Number of unresolved invitation records to return."
          }
        ],
        "responses": {
          "200": {
            "description": "One page of unresolved member invitations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberInvitationListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/members/invitations/{id}": {
      "get": {
        "operationId": "get_member_invitation",
        "x-sonus-required-permission": "members:read",
        "x-kejue-required-permission": "members:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "member_invitation_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "member_invitation_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a member invitation",
        "description": "Returns pending, expired, accepted, or revoked invitation metadata. The one-time invite URL is never retrievable after creation.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invitation metadata.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberInvitation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      },
      "patch": {
        "operationId": "update_member_invitation",
        "x-sonus-required-permission": "members:update",
        "x-kejue-required-permission": "members:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "delegation_not_allowed",
            "forbidden",
            "permission_escalation",
            "team_not_connected"
          ],
          "404": [
            "member_invitation_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "member_invitation_accepted",
            "member_invitation_revoked"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "delegation_not_allowed",
            "forbidden",
            "permission_escalation",
            "team_not_connected"
          ],
          "404": [
            "member_invitation_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "member_invitation_accepted",
            "member_invitation_revoked"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Change a pending invitation's role",
        "description": "Retargets an unresolved invitation at a different workspace role, so a mis-addressed invite can be corrected instead of revoked and re-sent. The new role cannot exceed the caller's own permissions. Accepted invitations are immutable (change the member's role instead) and revoked invitations cannot be edited. A semantic no-op preserves the resource version and ETag.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchMemberInvitationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated invitation, or the unchanged invitation for a semantic no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberInvitation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      },
      "delete": {
        "operationId": "cancel_member_invitation",
        "x-sonus-required-permission": "members:delete",
        "x-kejue-required-permission": "members:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "member_invitation_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "member_invitation_accepted"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "member_invitation_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "member_invitation_accepted"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Cancel a member invitation",
        "description": "Idempotently revokes a pending, expired, or already-revoked invitation. Accepted invitations cannot be cancelled. This operation accepts no request body.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "The invitation is revoked; repeating cancellation of an already-revoked invitation is a successful no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/members/{id}": {
      "get": {
        "operationId": "get_member",
        "x-sonus-required-permission": "members:read",
        "x-kejue-required-permission": "members:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "member_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "member_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a member",
        "description": "Returns one workspace membership by membership UUID, including its safe user identity, assigned role, effective timestamps, and strong ETag. The path does not accept a user UUID, cross-workspace membership IDs are indistinguishable from missing IDs, and supplying any request body is rejected.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Canonical member record.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Member"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_member",
        "x-sonus-required-permission": "members:update",
        "x-kejue-required-permission": "members:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "delegation_not_allowed",
            "forbidden",
            "permission_escalation",
            "team_not_connected"
          ],
          "404": [
            "member_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "member_last_owner",
            "protected_member"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "delegation_not_allowed",
            "forbidden",
            "permission_escalation",
            "team_not_connected"
          ],
          "404": [
            "member_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "member_last_owner",
            "protected_member"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Change a member's role",
        "description": "Assigns a workspace role. The new role cannot exceed the caller's permissions, and the last owner cannot be demoted. A semantic no-op preserves the resource version and ETag.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchMemberRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated member, or the unchanged member for a semantic no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Member"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "remove_member",
        "x-sonus-required-permission": "members:delete",
        "x-kejue-required-permission": "members:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "member_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "member_last_owner",
            "protected_member"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "member_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "member_last_owner",
            "protected_member"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Remove a member",
        "description": "Removes the membership and revokes active sessions and API keys created by that user in this workspace. The last owner cannot be removed. This operation accepts no request body.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "Cleanup report for the removed membership.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberRemovalResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/orgs/current": {
      "get": {
        "operationId": "get_current_organization",
        "x-sonus-required-permission": "org:read",
        "x-kejue-required-permission": "org:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "organization_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "organization_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get the current organization",
        "description": "Returns the complete mutable settings document for the workspace selected by the authenticated principal.",
        "tags": [
          "Organization and audit"
        ],
        "responses": {
          "200": {
            "description": "Current organization settings.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurrentOrganization"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_current_organization",
        "x-sonus-required-permission": "org:update",
        "x-kejue-required-permission": "org:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-conditional-entitlements": [
          {
            "entitlement": "custom_retention",
            "request_field": "retention_days",
            "condition": "semantic_change"
          }
        ],
        "x-kejue-conditional-entitlements": [
          {
            "entitlement": "custom_retention",
            "request_field": "retention_days",
            "condition": "semantic_change"
          }
        ],
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "organization_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "entitlements_unavailable",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "organization_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "entitlements_unavailable",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update the current organization",
        "description": "Applies a true partial update. Omitted fields remain unchanged. Changing retention_days requires the custom_retention entitlement; omitting it or sending the stored value does not. A semantic no-op preserves the version and ETag. Use If-Match to prevent lost updates.",
        "tags": [
          "Organization and audit"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchOrgRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated organization, or the unchanged document for a semantic no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurrentOrganization"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/outbound-capacity": {
      "get": {
        "operationId": "get_outbound_capacity",
        "x-sonus-required-permission": "phone-numbers:read",
        "x-kejue-required-permission": "phone-numbers:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable"
          ]
        },
        "summary": "Inspect effective outbound capacity",
        "description": "Returns a point-in-time allocator snapshot for the organization, account, trunks, caller IDs, and shared capacity profiles. `active` and `available` are concurrency-only values from the lease store used for admission. CPS token-bucket limits are enforced separately and can reject a new attempt even when `available` is positive. This is an observability read; configure trunk and phone-number limits through their canonical PATCH operations.",
        "tags": [
          "Outbound capacity"
        ],
        "responses": {
          "200": {
            "description": "Current effective capacity and live lease usage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundCapacityOverview"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/outbound-capacity-profiles": {
      "get": {
        "operationId": "list_outbound_capacity_profiles",
        "x-sonus-required-permission": "sip-trunks:read",
        "x-kejue-required-permission": "sip-trunks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List shared outbound capacity profiles",
        "description": "Lists reusable provider-account, provider-profile, and campaign limits in reverse creation order. Runtime usage is exposed by `/outbound-capacity`, not this configuration list.",
        "tags": [
          "Outbound capacity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "name": "scope_type",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/OutboundCapacityScopeType"
            }
          },
          {
            "name": "sharing_mode",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/OutboundCapacitySharingMode"
            }
          },
          {
            "name": "capacity_mode",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/OutboundCapacityMode"
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/OutboundCapacityProfileSource"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching capacity profiles.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundCapacityProfileListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      },
      "post": {
        "operationId": "create_outbound_capacity_profile",
        "x-sonus-required-permission": "sip-trunks:create",
        "x-kejue-required-permission": "sip-trunks:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "outbound_capacity_profile_conflict",
            "outbound_capacity_profile_in_use"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "outbound_capacity_profile_conflict",
            "outbound_capacity_profile_in_use"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create a shared outbound capacity profile",
        "description": "Creates a reusable capacity limit. Attach its ID through a SIP trunk's `outbound_capacity_profile_id`. Supply Idempotency-Key for retry-safe automation.",
        "tags": [
          "Outbound capacity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OutboundCapacityProfileRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Capacity profile created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundCapacityProfile"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/outbound-capacity-profiles/{id}": {
      "get": {
        "operationId": "get_outbound_capacity_profile",
        "x-sonus-required-permission": "sip-trunks:read",
        "x-kejue-required-permission": "sip-trunks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_capacity_profile_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_capacity_profile_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a shared outbound capacity profile",
        "description": "Returns one workspace-scoped shared outbound-capacity profile and its strong ETag for replacement or deletion. The representation contains configuration, version, and assignment metadata but no provider credential material; cross-workspace IDs are indistinguishable from missing IDs and request bodies are rejected.",
        "tags": [
          "Outbound capacity"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Capacity profile configuration.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundCapacityProfile"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      },
      "delete": {
        "operationId": "delete_outbound_capacity_profile",
        "x-sonus-required-permission": "sip-trunks:delete",
        "x-kejue-required-permission": "sip-trunks:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_capacity_profile_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "outbound_capacity_profile_conflict",
            "outbound_capacity_profile_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_capacity_profile_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "outbound_capacity_profile_conflict",
            "outbound_capacity_profile_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Delete a shared outbound capacity profile",
        "description": "Permanently deletes an unattached profile. If an active SIP trunk still references it, returns 409 with `details.attached_trunk_count`.",
        "tags": [
          "Outbound capacity"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Capacity profile deleted. The response has no body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      },
      "put": {
        "operationId": "replace_outbound_capacity_profile",
        "x-sonus-required-permission": "sip-trunks:update",
        "x-kejue-required-permission": "sip-trunks:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_capacity_profile_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "outbound_capacity_profile_conflict",
            "outbound_capacity_profile_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_capacity_profile_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "outbound_capacity_profile_conflict",
            "outbound_capacity_profile_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Replace a shared outbound capacity profile",
        "description": "Replaces the entire writable configuration and changes a provider-discovered profile's source to manual. Use If-Match to prevent lost updates. A semantic no-op preserves the current ETag and records a no-op audit event.",
        "tags": [
          "Outbound capacity"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OutboundCapacityProfileRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replaced capacity profile.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundCapacityProfile"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/outbound-jobs": {
      "get": {
        "operationId": "list_outbound_jobs",
        "x-sonus-required-permission": "calls:read",
        "x-kejue-required-permission": "calls:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List durable outbound jobs",
        "description": "Lists queued and historical outbound intent in reverse creation order. A job may wait for contact hours or capacity without consuming an attempt.",
        "tags": [
          "Outbound calls"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Case-insensitive substring search of destination_e164."
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated outbound job statuses. Duplicates are ignored; empty or unsupported values are rejected."
          }
        ],
        "responses": {
          "200": {
            "description": "Matching outbound jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundJobListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_outbound_job",
        "x-sonus-required-permission": "calls:place-outbound",
        "x-kejue-required-permission": "calls:place-outbound",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "contact_not_found",
            "number_pool_not_found",
            "phone_number_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "no_staging_version"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "contact_number_mismatch",
            "invalid_call_policy",
            "no_production_version",
            "number_pool_unavailable",
            "phone_number_unavailable",
            "referenced_resource_missing",
            "route_mismatch",
            "transport_mismatch",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid",
            "stored_policy_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "contact_not_found",
            "number_pool_not_found",
            "phone_number_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "no_staging_version"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "contact_number_mismatch",
            "invalid_call_policy",
            "no_production_version",
            "number_pool_unavailable",
            "phone_number_unavailable",
            "referenced_resource_missing",
            "route_mismatch",
            "transport_mismatch",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid",
            "stored_policy_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Schedule a durable outbound job",
        "description": "Resolves and snapshots contact hours, retry policy, deployed agent version, destination, and caller-ID route in one transaction. Exactly one of `number_pool_id` or `phone_number_id` is required; exactly one of `contact_id` or `to_number` is sufficient. Use Idempotency-Key for safe retries. On acceptance, wait for Retry-After and poll Location until the status is terminal.",
        "tags": [
          "Outbound calls"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OutboundJobCreateRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Outbound job durably accepted. Poll the Location resource for state changes.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundJobAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/outbound-jobs/{id}": {
      "get": {
        "operationId": "get_outbound_job",
        "x-sonus-required-permission": "calls:read",
        "x-kejue-required-permission": "calls:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_job_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_job_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an outbound job and all attempts",
        "description": "Returns the current job and ordered attempts. Retry-After is present while status is scheduled, queued, claimed, reserving, dialing, ringing, active, retry_wait, or provider_unknown; it is absent for completed, failed, canceled, and expired jobs.",
        "tags": [
          "Outbound calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current job snapshot and attempts ordered by attempt_number.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundJobDetailResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/outbound-jobs/{id}/cancel": {
      "post": {
        "operationId": "cancel_outbound_job",
        "x-sonus-required-permission": "calls:place-outbound",
        "x-kejue-required-permission": "calls:place-outbound",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_job_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "outbound_job_already_started",
            "outbound_job_terminal"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_job_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "outbound_job_already_started",
            "outbound_job_terminal"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Cancel an outbound job before dialing starts",
        "description": "Cancels scheduled, queued, claimed, reserving, or retry-wait jobs. Repeating cancellation is a 200 no-op with `changed=false`, preserves the current ETag, and records an `outbound_job.cancel.noop` audit event. Once dialing may have begun, returns 409 and includes the linked call ID when known; end that call through the calls API instead.",
        "tags": [
          "Outbound calls"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OutboundJobCancelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job is canceled; `changed` distinguishes a transition from an idempotent no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundJobCancelResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/outbound-number-pools": {
      "get": {
        "operationId": "list_outbound_number_pools",
        "x-sonus-required-permission": "phone-numbers:read",
        "x-kejue-required-permission": "phone-numbers:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List outbound caller-ID pools",
        "description": "Lists pools in reverse creation order. Active pools are returned by default; use `status=archived` or `status=all` to inspect archived configuration.",
        "tags": [
          "Outbound capacity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "all"
              ],
              "default": "active"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching caller-ID pools with hydrated members.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundNumberPoolListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      },
      "post": {
        "operationId": "create_outbound_number_pool",
        "x-sonus-required-permission": "phone-numbers:create",
        "x-kejue-required-permission": "phone-numbers:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "outbound_number_pool_name_conflict"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "outbound_number_pool_name_conflict"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create an outbound caller-ID pool",
        "description": "Creates an active pool with one or more active outbound-capable phone numbers. Omitted member priority and weight both default to 100; explicit priority 0 is preserved. Supply Idempotency-Key for safe retries.",
        "tags": [
          "Outbound capacity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OutboundNumberPoolCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Caller-ID pool created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundNumberPool"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/outbound-number-pools/{id}": {
      "delete": {
        "operationId": "archive_outbound_number_pool",
        "x-sonus-required-permission": "phone-numbers:delete",
        "x-kejue-required-permission": "phone-numbers:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_number_pool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "outbound_number_pool_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_number_pool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "outbound_number_pool_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive an outbound caller-ID pool",
        "description": "Archives the pool and prevents new jobs from selecting it. Returns 409 while active jobs reference it. Repeating the archive is a 204 no-op.",
        "tags": [
          "Outbound capacity"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Pool is archived. The response has no body.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      },
      "get": {
        "operationId": "get_outbound_number_pool",
        "x-sonus-required-permission": "phone-numbers:read",
        "x-kejue-required-permission": "phone-numbers:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_number_pool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_number_pool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an outbound caller-ID pool",
        "description": "Returns active or archived pool configuration. Members contain stable phone-number IDs and selection settings; read the canonical phone-number and capacity resources for mutable routing and allocator state.",
        "tags": [
          "Outbound capacity"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Caller-ID pool.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundNumberPool"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      },
      "patch": {
        "operationId": "update_outbound_number_pool",
        "x-sonus-required-permission": "phone-numbers:update",
        "x-kejue-required-permission": "phone-numbers:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_number_pool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "outbound_number_pool_in_use",
            "outbound_number_pool_name_conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "outbound_number_pool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "outbound_number_pool_in_use",
            "outbound_number_pool_name_conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update an outbound caller-ID pool",
        "description": "Replaces supplied fields. Supplying `members` replaces the complete membership set. `status=active` restores an archived pool; `status=archived` follows the same active-job guard as DELETE. Use If-Match to prevent lost updates. A semantic no-op preserves the current ETag and records a no-op audit event.",
        "tags": [
          "Outbound capacity"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OutboundNumberPoolPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated caller-ID pool.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundNumberPool"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/outbound-policy": {
      "get": {
        "operationId": "get_outbound_policy",
        "x-sonus-required-permission": "org:read",
        "x-kejue-required-permission": "org:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get the organization outbound policy",
        "description": "Returns the explicit versioned organization policy, or the version-0 system default when no policy has been saved. The organization timezone is included because contact-timezone fallback depends on it.",
        "tags": [
          "Outbound capacity"
        ],
        "responses": {
          "200": {
            "description": "Effective organization policy document.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundPolicyDocument"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      },
      "put": {
        "operationId": "update_outbound_policy",
        "x-sonus-required-permission": "org:update",
        "x-kejue-required-permission": "org:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "invalid_outbound_policy",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "encode_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "invalid_outbound_policy",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "encode_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Replace the organization outbound policy",
        "description": "Atomically replaces the complete policy and organization timezone. Each changed component increments its own version; a semantic no-op preserves both versions and the composite ETag. Existing jobs retain their stored policy snapshots. `schema_version` is required and must equal 1; it is never defaulted. Use If-Match to prevent lost updates.",
        "tags": [
          "Outbound capacity"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OutboundPolicyUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Normalized replacement policy.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundPolicyDocument"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/phone-numbers": {
      "get": {
        "operationId": "list_phone_numbers",
        "x-sonus-required-permission": "phone-numbers:read",
        "x-kejue-required-permission": "phone-numbers:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List phone numbers",
        "description": "Returns phone numbers in deterministic reverse-creation order. Safe nullable fields are explicit nulls. Raw provider errors are never returned to API keys.",
        "tags": [
          "Phone numbers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/PhoneNumberStatus"
            },
            "description": "Exact status. status=archived requires archived=include or archived=only."
          },
          {
            "name": "direction",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/PhoneNumberDirection"
            }
          },
          {
            "name": "transport",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/PhoneNumberTransport"
            }
          },
          {
            "name": "trunk_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "agent_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "assignment",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "assigned",
                "unassigned"
              ]
            }
          },
          {
            "name": "outbound_draining",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A phone-number page. next_cursor is null on the terminal page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneNumberListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_phone_number",
        "x-sonus-required-permission": "phone-numbers:create",
        "x-kejue-required-permission": "phone-numbers:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "number_in_use",
            "number_taken",
            "trunk_busy",
            "trunk_not_active",
            "trunk_provider_not_ready"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "unsupported_transport",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "credential_service_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "reconciliation_service_unavailable",
            "twilio_native_unconfigured"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "number_in_use",
            "number_taken",
            "trunk_busy",
            "trunk_not_active",
            "trunk_provider_not_ready"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "unsupported_transport",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "credential_service_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "reconciliation_service_unavailable",
            "twilio_native_unconfigured"
          ]
        },
        "summary": "Connect a phone number",
        "description": "Creates a durable phone-number row and schedules provider routing after commit. Poll resource_url until status is active or error. Use Idempotency-Key so a retry cannot connect the same intent twice.",
        "tags": [
          "Phone numbers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhoneNumberCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The phone number was created and provider provisioning was scheduled.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Retry-After": {
                "description": "Suggested seconds before polling resource_url.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneNumberProvisioningResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/phone-numbers/{id}/rejections": {
      "get": {
        "operationId": "list_phone_number_rejections",
        "x-sonus-required-permission": "phone-numbers:read",
        "x-kejue-required-permission": "phone-numbers:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "phone_number_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "phone_number_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List phone number rejections",
        "description": "Lists recent calls to or from this number that were refused at the SIP layer before or instead of becoming a working call. SIP-level refusals with the SIP status, reason, stage (trunk_auth, no_trunk, no_dispatch_rule, admission, capacity, quota, unknown_number, carrier_rejected, registrar, other) and the captured INVITE / final response headers.",
        "tags": [
          "Phone numbers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recent rejections, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SIPRejectionListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/phone-numbers/{id}": {
      "delete": {
        "operationId": "archive_phone_number",
        "x-sonus-required-permission": "phone-numbers:delete",
        "x-kejue-required-permission": "phone-numbers:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "phone_number_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "trunk_busy"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "phone_number_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "trunk_busy"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive a phone number",
        "description": "Idempotently soft-archives the number, then removes LiveKit and Twilio routing after commit. This operation accepts no request body.",
        "tags": [
          "Phone numbers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "The phone number is archived. Repeating the operation is a successful no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_phone_number",
        "x-sonus-required-permission": "phone-numbers:read",
        "x-kejue-required-permission": "phone-numbers:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "phone_number_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "phone_number_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a phone number",
        "description": "Returns complete safe configuration, assignment, capacity, and provisioning state.",
        "tags": [
          "Phone numbers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The phone number.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneNumber"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_phone_number",
        "x-sonus-required-permission": "phone-numbers:update",
        "x-kejue-required-permission": "phone-numbers:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "phone_number_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "phone_number_provisioning"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "reconciliation_service_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "phone_number_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "phone_number_provisioning"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "reconciliation_service_unavailable"
          ]
        },
        "summary": "Update a phone number",
        "description": "Updates supplied fields only. Explicit null clears label, agent assignment, or a fixed capacity limit. Agent changes on LiveKit SIP numbers reconcile asynchronously and may temporarily return status=provisioning.",
        "tags": [
          "Phone numbers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhoneNumberPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated phone number.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneNumber"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/phone-numbers/{id}/reconcile": {
      "post": {
        "operationId": "reconcile_phone_number",
        "x-sonus-required-permission": "phone-numbers:update",
        "x-kejue-required-permission": "phone-numbers:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "phone_number_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "phone_number_archived",
            "phone_number_operation_in_progress"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "reconciliation_service_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "phone_number_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "phone_number_archived",
            "phone_number_operation_in_progress"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "reconciliation_service_unavailable"
          ]
        },
        "summary": "Reconcile a phone number",
        "description": "Retries failed or stale provider provisioning and repairs active routing from committed configuration. A recent operation returns 409 with Retry-After. This operation accepts no request body.",
        "tags": [
          "Phone numbers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "Reconciliation was accepted and continues asynchronously.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Retry-After": {
                "description": "Suggested seconds before polling resource_url.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneNumberProvisioningResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/pii-access-requests": {
      "get": {
        "operationId": "list_pii_access_requests",
        "x-sonus-required-permission": "pii-access:read",
        "x-kejue-required-permission": "pii-access:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List break-glass access requests",
        "description": "Returns a newest-first page of requests to read un-redacted call data. What you see depends on what you hold: a principal with `pii-access:approve` sees every request in the organization, and everyone else sees only the requests they raised themselves. Filters combine with AND and are applied in the database, so a match is found across the whole backlog rather than within the current page. Cursors are bound to this endpoint and the complete filter set. Voice API keys return call requests only and preserve the existing call response shape. The browser queue also includes Inference transcription-job requests. Job requests have null call_id and a non-null inference_job_id; call requests omit inference_job_id. Use the matching subject filter to find an existing grant.",
        "tags": [
          "PII access"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Case-insensitive search across requester email, requester display name, the stated reason, and the call ID."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/PIIAccessRequestStatus"
            },
            "description": "Filter by effective status. `expired` selects approvals whose lifetime has elapsed; those rows remain stored as `approved`."
          },
          {
            "name": "call_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only requests raised against this call."
          },
          {
            "name": "requested_by",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only requests raised by this user."
          },
          {
            "name": "inference_job_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Filter access requests by an Inference transcription job. Do not combine with call_id."
          }
        ],
        "responses": {
          "200": {
            "description": "One page of requests, newest first.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PIIAccessRequestList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/pii-access-requests/{id}/decision": {
      "post": {
        "operationId": "decide_pii_access_request",
        "x-sonus-required-permission": "pii-access:approve",
        "x-kejue-required-permission": "pii-access:approve",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "pii_access_self_decision_forbidden",
            "team_not_connected"
          ],
          "404": [
            "pii_access_request_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "pii_access_request_not_actionable"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "pii_access_self_decision_forbidden",
            "team_not_connected"
          ],
          "404": [
            "pii_access_request_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "pii_access_request_not_actionable"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Approve or reject a break-glass access request",
        "description": "Decides a pending request. Approving grants the requester standing access to that whole call — raw transcript, recordings, raw tool I/O, and per-turn audio — until it expires or is revoked; the lifetime is stamped from the organization's `pii_access_grant_days` at decision time, so shortening that setting later never cuts short an approval already granted. Approving your own request returns 403 whenever the organization has another holder of `pii-access:approve`; the sole approver is permitted and the decision is recorded as self-approved.",
        "tags": [
          "PII access"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PIIAccessDecisionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The decided request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PIIAccessRequest"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/pii-access-requests/{id}/revoke": {
      "post": {
        "operationId": "revoke_pii_access_request",
        "x-sonus-required-permission": "pii-access:approve",
        "x-kejue-required-permission": "pii-access:approve",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "pii_access_request_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "pii_access_request_not_actionable"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "pii_access_request_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "pii_access_request_not_actionable"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Revoke a granted break-glass access request",
        "description": "Withdraws an approval that has already been granted. The next sensitive read by that user on that call is refused; reads that already happened remain in the audit log, which is what the trail is for. Only a live approval can be revoked.",
        "tags": [
          "PII access"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PIIAccessRevokeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The revoked request.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PIIAccessRequest"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/pii-redaction-config": {
      "get": {
        "operationId": "get_pii_redaction_config",
        "x-sonus-cache-control": "private, no-cache",
        "x-kejue-cache-control": "private, no-cache",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-required-permission": "pii-config:read",
        "x-kejue-required-permission": "pii-config:read",
        "x-sonus-required-entitlement": "pii_redaction_config",
        "x-kejue-required-entitlement": "pii_redaction_config",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "summary": "Get the PII masking configuration",
        "description": "Returns the workspace's additive custom literal dictionary together with the immutable built-in security floor. A missing saved document is represented as version 0 with an empty custom list. A saved document that is malformed, non-canonical, or inconsistent with its strong ETag fails closed as 500 stored_data_invalid instead of being silently normalized.",
        "tags": [
          "PII access"
        ],
        "responses": {
          "200": {
            "description": "Normalized masking configuration.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Cache-Control": {
                "description": "Revalidation is required because the response contains the workspace masking dictionary.",
                "schema": {
                  "type": "string",
                  "const": "private, no-cache"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PiiConfigResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      },
      "put": {
        "operationId": "update_pii_redaction_config",
        "x-sonus-cache-control": "no-store",
        "x-kejue-cache-control": "no-store",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "encode_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "encode_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-required-permission": "pii-config:update",
        "x-kejue-required-permission": "pii-config:update",
        "x-sonus-required-entitlement": "pii_redaction_config",
        "x-kejue-required-entitlement": "pii_redaction_config",
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "summary": "Replace the PII masking configuration",
        "description": "Replaces the complete custom literal dictionary. Labels are unique, cannot shadow a built-in entity, and terms are trimmed, case-insensitively deduplicated, and sorted. Validation returns at most 100 deterministic field errors and never echoes a rejected term. A semantic no-op preserves the version and ETag. Non-canonical stored data fails closed without mutation.",
        "tags": [
          "PII access"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PiiConfigPutRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Normalized replacement, or the unchanged document for a semantic no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Cache-Control": {
                "description": "Mutation responses contain the workspace masking dictionary and must not be stored.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PiiConfigResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/pronunciation-tables": {
      "get": {
        "operationId": "list_pronunciation_tables",
        "x-sonus-required-permission": "pronunciation-tables:read",
        "x-kejue-required-permission": "pronunciation-tables:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List pronunciation tables",
        "description": "Returns pronunciation-table metadata newest first. Definitions are omitted; fetch a selected table by id.",
        "tags": [
          "Pronunciation"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "Number of tables to return."
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of pronunciation tables.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PronunciationTableListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_pronunciation_table",
        "x-sonus-required-permission": "pronunciation-tables:create",
        "x-kejue-required-permission": "pronunciation-tables:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "slug_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "slug_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create a pronunciation table",
        "description": "Creates an ordered set of TTS-only text substitutions. The stored definition is normalized in the response.",
        "tags": [
          "Pronunciation"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PronunciationTableCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Pronunciation table created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "description": "Relative URL of the created table.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PronunciationTableDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/pronunciation-tables/{id}": {
      "delete": {
        "operationId": "archive_pronunciation_table",
        "x-sonus-required-permission": "pronunciation-tables:delete",
        "x-kejue-required-permission": "pronunciation-tables:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "pronunciation_table_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "pronunciation_table_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "pronunciation_table_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "pronunciation_table_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive a pronunciation table",
        "description": "Soft-archives a table. The operation is idempotent; retrying an already archived table returns 204. A 409 pronunciation_table_in_use response lists every active draft, staging, and production agent-version pointer that must be detached before retrying. If legacy or out-of-band data nevertheless points at an archived table, call setup omits that table rather than executing stale substitutions.",
        "tags": [
          "Pronunciation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Table archived, or it was already archived.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_pronunciation_table",
        "x-sonus-required-permission": "pronunciation-tables:read",
        "x-kejue-required-permission": "pronunciation-tables:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "pronunciation_table_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "pronunciation_table_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a pronunciation table",
        "description": "Returns one pronunciation table, including archived tables, with its complete normalized ordered definition and strong ETag. Legacy stored values that cannot be emitted safely are represented with exact configuration_errors for one complete-definition repair PATCH. Supplying any request body is rejected.",
        "tags": [
          "Pronunciation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pronunciation-table metadata and its normalized ordered definition.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PronunciationTableDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_pronunciation_table",
        "x-sonus-required-permission": "pronunciation-tables:update",
        "x-kejue-required-permission": "pronunciation-tables:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "pronunciation_table_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "pronunciation_table_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "pronunciation_table_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "pronunciation_table_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update a pronunciation table",
        "description": "Replaces any supplied fields. Slug is immutable. Archived tables cannot be updated. Supplying If-Match prevents lost updates; a semantic no-op returns the unchanged ETag.",
        "tags": [
          "Pronunciation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PronunciationTablePatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated table, or the unchanged table for a semantic no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PronunciationTableDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/providers": {
      "get": {
        "operationId": "list_providers",
        "x-sonus-required-permission": "providers:read",
        "x-kejue-required-permission": "providers:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List the enabled inference catalog",
        "description": "Returns enabled providers with enabled models and voices in deterministic display order, each under its product name. Use a model's or voice's id to select it on an agent. Provider credentials, instance URLs, health errors, the upstream engine behind a product and the rest of the platform's integration detail are never exposed; what a transcriber supports is reported as capabilities in stt_capabilities.",
        "tags": [
          "Models and voices"
        ],
        "responses": {
          "200": {
            "description": "Safe picker-facing provider catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderListResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "private, max-age=60"
                },
                "description": "Catalog responses may be privately cached for 60 seconds."
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/rbac/catalog": {
      "get": {
        "operationId": "get_rbac_catalog",
        "x-sonus-required-permission": null,
        "x-kejue-required-permission": null,
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get the RBAC permission catalog",
        "description": "Returns the closed permission vocabulary used by roles and API-key scopes. api_key_scope_available is false for dashboard capabilities that are not part of the reviewed public API.",
        "tags": [
          "Members and roles"
        ],
        "responses": {
          "200": {
            "description": "Permission resources, actions, and explanations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RBACCatalogResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/roles": {
      "get": {
        "operationId": "list_roles",
        "x-sonus-required-permission": "roles:read",
        "x-kejue-required-permission": "roles:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List roles",
        "description": "Lists system and custom workspace roles with their effective permissions and current member counts in reverse creation order. Follow `next_cursor` until null for a complete traversal.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "Number of roles to return."
          }
        ],
        "responses": {
          "200": {
            "description": "One page of system and custom roles.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_role",
        "x-sonus-required-permission": "roles:create",
        "x-kejue-required-permission": "roles:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "delegation_not_allowed",
            "forbidden",
            "permission_escalation",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "role_name_conflict",
            "role_name_reserved"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "delegation_not_allowed",
            "forbidden",
            "permission_escalation",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "role_name_conflict",
            "role_name_reserved"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create a custom role",
        "description": "Creates a role from the closed RBAC vocabulary. Permissions are canonicalized and cannot exceed the caller's effective permissions. System-role names are reserved.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created custom role.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Role"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/roles/{id}": {
      "get": {
        "operationId": "get_role",
        "x-sonus-required-permission": "roles:read",
        "x-kejue-required-permission": "roles:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "role_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "role_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a role",
        "description": "Returns one system or custom workspace role by role UUID, including its exact permission set, lock state, member count, version metadata, and strong ETag. Cross-workspace role IDs are indistinguishable from missing IDs and supplying any request body is rejected.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Canonical role record.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Role"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_role",
        "x-sonus-required-permission": "roles:update",
        "x-kejue-required-permission": "roles:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "delegation_not_allowed",
            "forbidden",
            "permission_escalation",
            "system_role_immutable",
            "team_not_connected"
          ],
          "404": [
            "role_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "role_name_conflict",
            "role_name_reserved"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "delegation_not_allowed",
            "forbidden",
            "permission_escalation",
            "system_role_immutable",
            "team_not_connected"
          ],
          "404": [
            "role_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "role_name_conflict",
            "role_name_reserved"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update a custom role",
        "description": "Applies a partial update to a custom role. System roles are immutable, reserved names are rejected, and supplied permissions cannot exceed the caller's. A semantic no-op preserves the version and ETag.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RolePatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated role, or the unchanged role for a semantic no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Role"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "delete_role",
        "x-sonus-required-permission": "roles:delete",
        "x-kejue-required-permission": "roles:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "system_role_immutable",
            "team_not_connected"
          ],
          "404": [
            "role_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "role_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "system_role_immutable",
            "team_not_connected"
          ],
          "404": [
            "role_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "role_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Delete a custom role",
        "description": "Permanently deletes an unreferenced custom role. System roles are immutable. Reassign members and cancel active invitations first; terminal invitation rows are removed atomically while their audit events remain. This operation accepts no request body.",
        "tags": [
          "Members and roles"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Role deleted.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/secrets": {
      "get": {
        "operationId": "list_secrets",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-required-permission": "secrets:read",
        "x-kejue-required-permission": "secrets:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "summary": "List secrets",
        "description": "Lists write-only secret metadata. Plaintext, ciphertext, KMS key identifiers, and wrapped keys never appear in any response.",
        "tags": [
          "Secrets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          }
        ],
        "responses": {
          "200": {
            "description": "Secret metadata page. Nullable fields and next_cursor are always present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Cache-Control": {
                "description": "Secret catalog metadata must not be cached.",
                "schema": {
                  "type": "string",
                  "const": "private, no-store"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_secret",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "secret_name_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed",
            "secret_encryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "secret_name_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed",
            "secret_encryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-sonus-required-permission": "secrets:create",
        "x-kejue-required-permission": "secrets:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "summary": "Create a write-only secret",
        "description": "Encrypts the supplied value under the workspace data key. The value is accepted exactly once and is never returned; use PATCH to rotate it.",
        "tags": [
          "Secrets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecretCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Secret created. Only safe metadata is returned.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Cache-Control": {
                "description": "Secret catalog metadata must not be cached.",
                "schema": {
                  "type": "string",
                  "const": "private, no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/secrets/{id}": {
      "delete": {
        "operationId": "archive_secret",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "secret_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "secret_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "secret_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "secret_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-required-permission": "secrets:delete",
        "x-kejue-required-permission": "secrets:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "summary": "Archive a secret",
        "description": "Idempotently soft-archives a secret. Returns 409 secret_in_use while an active HTTP tool template or MCP authentication configuration references its stable name.",
        "tags": [
          "Secrets"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Archived, or already archived. No response body is returned.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_secret",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "secret_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "secret_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-required-permission": "secrets:read",
        "x-kejue-required-permission": "secrets:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "summary": "Get secret metadata",
        "description": "Returns metadata and a fingerprint suffix only. There is deliberately no reveal operation.",
        "tags": [
          "Secrets"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Safe secret metadata.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Cache-Control": {
                "description": "Secret catalog metadata must not be cached.",
                "schema": {
                  "type": "string",
                  "const": "private, no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_secret",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "secret_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "secret_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "secret_encryption_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "secret_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "secret_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "secret_encryption_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-required-permission": "secrets:update",
        "x-kejue-required-permission": "secrets:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "summary": "Update metadata or rotate a secret",
        "description": "Updates the nullable description and/or replaces the encrypted value. The stable secret name cannot be changed. A semantic no-op succeeds and is audited.",
        "tags": [
          "Secrets"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecretPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated safe metadata; the submitted value is never echoed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Cache-Control": {
                "description": "Secret catalog metadata must not be cached.",
                "schema": {
                  "type": "string",
                  "const": "private, no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/sip-trunks": {
      "get": {
        "operationId": "list_sip_trunks",
        "x-sonus-required-permission": "sip-trunks:read",
        "x-kejue-required-permission": "sip-trunks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List SIP trunks",
        "description": "Returns the workspace's SIP trunks in deterministic reverse-creation order. Raw provider error bodies are never returned to API keys; use last_error_code and last_error for recovery decisions.",
        "tags": [
          "SIP trunks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SipTrunkStatus"
            },
            "description": "Exact status filter. status=archived requires archived=include or archived=only."
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SipTrunkProvider"
            }
          },
          {
            "name": "sip_signaling_mode",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SipSignalingMode"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of SIP trunks. next_cursor is null when the page is terminal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SipTrunkListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_sip_trunk",
        "x-sonus-required-permission": "sip-trunks:create",
        "x-kejue-required-permission": "sip-trunks:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "name_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal",
            "internal_error",
            "kms_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "credential_service_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "name_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal",
            "internal_error",
            "kms_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "credential_service_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create a SIP trunk",
        "description": "Creates a durable trunk row and starts asynchronous provider provisioning. Poll resource_url until status is active or error. Supply Idempotency-Key so a network retry cannot create a duplicate provider trunk.",
        "tags": [
          "SIP trunks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SipTrunkCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The trunk was created and provisioning was scheduled.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SipTrunkProvisioningResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/sip-trunks/runtime-info": {
      "get": {
        "operationId": "get_sip_runtime_info",
        "x-sonus-required-permission": "sip-trunks:read",
        "x-kejue-required-permission": "sip-trunks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get SIP runtime info",
        "description": "Returns deployment network values needed to configure carrier allowlists and SIP registration. Unconfigured values are explicit nulls, never omitted.",
        "tags": [
          "SIP trunks"
        ],
        "responses": {
          "200": {
            "description": "Current SIP ingress, egress, and registration endpoints.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SipRuntimeInfo"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/sip-trunks/{id}/rejections": {
      "get": {
        "operationId": "list_sip_trunk_rejections",
        "x-sonus-required-permission": "sip-trunks:read",
        "x-kejue-required-permission": "sip-trunks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List SIP trunk rejections",
        "description": "Lists recent calls on this trunk that were refused at the SIP layer. SIP-level refusals with the SIP status, reason, stage (trunk_auth, no_trunk, no_dispatch_rule, admission, capacity, quota, unknown_number, carrier_rejected, registrar, other) and the captured INVITE / final response headers.",
        "tags": [
          "SIP trunks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recent rejections, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SIPRejectionListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/sip-trunks/{id}": {
      "delete": {
        "operationId": "archive_sip_trunk",
        "x-sonus-required-permission": "sip-trunks:delete",
        "x-kejue-required-permission": "sip-trunks:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "sip_trunk_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "sip_trunk_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive a SIP trunk",
        "description": "Idempotently soft-archives a trunk and schedules provider cleanup. Returns 409 while active phone numbers still reference it. Reassign or archive those numbers first.",
        "tags": [
          "SIP trunks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "The trunk is archived. Repeating the operation is a successful no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_sip_trunk",
        "x-sonus-required-permission": "sip-trunks:read",
        "x-kejue-required-permission": "sip-trunks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a SIP trunk",
        "description": "Returns the complete safe configuration and provisioning state. Nullable fields are emitted as JSON null and collection fields as arrays or objects, enabling lossless agent round trips.",
        "tags": [
          "SIP trunks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The SIP trunk.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SipTrunk"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_sip_trunk",
        "x-sonus-required-permission": "sip-trunks:update",
        "x-kejue-required-permission": "sip-trunks:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "name_taken",
            "sip_trunk_provisioning"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "credential_encryption_failed",
            "db_error",
            "internal",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "credential_service_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "name_taken",
            "sip_trunk_provisioning"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "credential_encryption_failed",
            "db_error",
            "internal",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "credential_service_unavailable"
          ]
        },
        "summary": "Partially update a SIP trunk",
        "description": "Updates only supplied fields. Explicit null clears nullable capacity and advanced settings. Provider-facing changes are asynchronously reconciled from stored encrypted configuration, so unchanged credentials do not need to be resent.",
        "tags": [
          "SIP trunks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SipTrunkPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated trunk. Provider-facing changes may temporarily return status=provisioning; poll this resource.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SipTrunk"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/sip-trunks/{id}/reconcile": {
      "post": {
        "operationId": "reconcile_sip_trunk",
        "x-sonus-required-permission": "sip-trunks:update",
        "x-kejue-required-permission": "sip-trunks:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "sip_trunk_archived",
            "sip_trunk_credentials_unavailable",
            "sip_trunk_operation_in_progress"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "credential_decryption_failed",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "credential_service_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "reconciliation_service_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "sip_trunk_archived",
            "sip_trunk_credentials_unavailable",
            "sip_trunk_operation_in_progress"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "credential_decryption_failed",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "credential_service_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "reconciliation_service_unavailable"
          ]
        },
        "summary": "Reconcile a SIP trunk",
        "description": "Repairs provider objects from the current committed configuration or retries a failed asynchronous provision. A recent provisioning attempt returns 409 with Retry-After; an operation older than two minutes is considered stale and can be replaced. This operation accepts no request body.",
        "tags": [
          "SIP trunks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "Reconciliation was accepted and will continue asynchronously.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Retry-After": {
                "description": "Suggested number of seconds before polling resource_url.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SipTrunkProvisioningResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/sip-trunks/{id}/twilio-numbers": {
      "get": {
        "operationId": "list_sip_trunk_twilio_numbers",
        "x-sonus-required-permission": "sip-trunks:read",
        "x-kejue-required-permission": "sip-trunks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "twilio_inventory_unavailable"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "credential_decryption_failed",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "502": [
            "provider_request_failed"
          ],
          "503": [
            "authentication_unavailable",
            "credential_service_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "sip_trunk_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "twilio_inventory_unavailable"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "credential_decryption_failed",
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "502": [
            "provider_request_failed"
          ],
          "503": [
            "authentication_unavailable",
            "credential_service_unavailable"
          ]
        },
        "summary": "List Twilio trunk numbers",
        "description": "Lists up to 1000 incoming phone numbers owned by the Twilio account behind an active twilio_automated trunk. Stored Twilio credentials are decrypted server-side and never returned.",
        "tags": [
          "SIP trunks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Twilio incoming-number inventory.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwilioNumberListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-hidden": true
      }
    },
    "/dates/resolve": {
      "post": {
        "operationId": "resolve_date",
        "x-sonus-required-permission": "tools:read",
        "x-kejue-required-permission": "tools:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "optional",
        "x-kejue-idempotency": "optional",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "analysis_result_too_large",
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "analysis_result_too_large",
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Resolve a calendar date",
        "description": "Deterministic Gregorian date arithmetic shared with the resolve_date built-in. Supply an IANA timezone. Empty date arguments return today in that zone at execution time. One anchor: date, day_of_month (optionally month/year), weekday, or today. weekday alongside a date checks the claim before offsets. next/previous weekdays exclude the reference day; on_or_after/on_or_before include it. Missing day/month/year components use the next (or past) valid occurrence including the reference date. Resolve anchor, add calendar months (clamping month-end), then add weeks and days. No booking or business-policy decisions. Clarify ambiguous dates before submitting. reference_date changes the arithmetic anchor; days_from_today still compares with local today.",
        "tags": [
          "Tools"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveDateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resolved date, or weekday_mismatch with a question. A mismatch is not a confirmed date; offsets are not applied.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveDateResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/tools": {
      "get": {
        "operationId": "list_tools",
        "x-sonus-required-permission": "tools:read",
        "x-kejue-required-permission": "tools:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List HTTP tools",
        "description": "Lists reusable outbound HTTP integrations in reverse creation order. Executable templates and parameter schemas are available on the detail operation.",
        "tags": [
          "Tools"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ToolMode"
            },
            "description": "Return only synchronous or asynchronous tools."
          },
          {
            "name": "phase",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ToolPhase"
            },
            "description": "Return only mid-call or pre-call tools."
          }
        ],
        "responses": {
          "200": {
            "description": "HTTP tool page. Nullable fields and next_cursor are always present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_tool",
        "x-sonus-required-permission": "tools:create",
        "x-kejue-required-permission": "tools:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "tool_slug_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "tool_slug_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create an HTTP tool",
        "description": "Creates a validated executable request template. URL authority is static and public; placeholders are allowed only in path/query and in documented template-bearing fields. Every referenced secret must already be active in this workspace.",
        "tags": [
          "Tools"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "HTTP tool created. The normalized complete tool is returned.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/tools/{id}": {
      "delete": {
        "operationId": "archive_tool",
        "x-sonus-required-permission": "tools:delete",
        "x-kejue-required-permission": "tools:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "tool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "tool_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "tool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "tool_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive an HTTP tool",
        "description": "Idempotently soft-archives a tool. Returns 409 tool_in_use while any active agent behavior or workflow references its UUID.",
        "tags": [
          "Tools"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Archived, or already archived. No response body is returned.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_tool",
        "x-sonus-required-permission": "tools:read",
        "x-kejue-required-permission": "tools:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "tool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "tool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get an HTTP tool",
        "description": "Returns the complete normalized request template. Secret placeholders remain references; plaintext secret values are never materialized.",
        "tags": [
          "Tools"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete HTTP tool.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_tool",
        "x-sonus-required-permission": "tools:update",
        "x-kejue-required-permission": "tools:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "tool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "tool_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "tool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "tool_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update an HTTP tool",
        "description": "Applies a partial update, validates the complete resulting request atomically, and returns the normalized tool. Slug is immutable. JSON null clears nullable description, body, and acknowledgment fields; null normalizes headers, parameters, and response_map to empty values.",
        "tags": [
          "Tools"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated tool, or the unchanged tool for a semantic no-op.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/tools/{id}/test": {
      "post": {
        "operationId": "test_tool",
        "x-sonus-required-permission": "tools:test",
        "x-kejue-required-permission": "tools:test",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "tool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "tool_archived"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "secret_resolution_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "tool_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "tool_archived"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "secret_resolution_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Test an HTTP tool against its live upstream",
        "description": "Executes the stored tool request exactly once with supplied parameter values. This is a real outbound call and may cause upstream side effects. Secrets are decrypted only for execution, masked in the echoed request, and redacted from captured response headers and body. DNS and redirects are checked against the public-network policy. Upstream HTTP statuses are returned inside a 200 test result; transport failures use stable error_code values in that result. Reuse the same Idempotency-Key to replay the recorded result without executing the upstream request again.",
        "tags": [
          "Tools"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolTestRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The upstream response or a sanitized transport failure. An upstream 4xx or 5xx remains a successful test operation and appears in response.status.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolTestResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/transfers/{id}": {
      "get": {
        "operationId": "get_transfer",
        "x-sonus-required-permission": "transfers:read",
        "x-kejue-required-permission": "transfers:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "transfer_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "transfer_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_context_missing",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a transfer",
        "description": "Returns the latest customer-safe state for one non-eval transfer. Raw provider text and infrastructure pod identity are never returned. Use the strong ETag with the cancel operation; active transfers also return Retry-After as a polling hint.",
        "tags": [
          "Transfers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current transfer state.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transfer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/transfers/{id}/cancel": {
      "post": {
        "operationId": "cancel_transfer",
        "x-sonus-required-permission": "transfers:cancel",
        "x-kejue-required-permission": "transfers:cancel",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "transfer_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "transfer_already_terminal"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_context_missing",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "502": [
            "transfer_cancel_provider_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "transfer_cancel_unavailable"
          ],
          "504": [
            "transfer_cancel_outcome_unknown"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "transfer_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "transfer_already_terminal"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_context_missing",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "502": [
            "transfer_cancel_provider_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "transfer_cancel_unavailable"
          ],
          "504": [
            "transfer_cancel_outcome_unknown"
          ]
        },
        "summary": "Cancel a transfer",
        "description": "Row-locks a non-terminal transfer and synchronously terminates an identified provider target leg before marking it failed with `admin_canceled`. The state change, transfer event, and audit record are atomic. A requested transfer with no target yet needs no provider cleanup; after dialing begins, missing target identity or unconfirmed provider outcome fails closed without changing saga state. Optional reason text is trimmed and, when present, must be 8–500 characters. Use Idempotency-Key for network retries and If-Match for concurrency control.",
        "tags": [
          "Transfers"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferCancelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated terminal transfer.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transfer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          }
        }
      }
    },
    "/usage-events": {
      "get": {
        "operationId": "list_usage_events",
        "x-sonus-required-permission": "usage:read",
        "x-kejue-required-permission": "usage:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List metered inference events",
        "description": "Returns newest-first metering records for this workspace — the same per-request detail the dashboard shows on a call. Exact filters combine with AND, created_to is exclusive, and cursors are bound to the complete filter set; q matches the request id and the branded service and model names. Raw upstream error bodies, unsanitized metadata, the upstream model and provider identifiers, and the serving instance are never returned.",
        "tags": [
          "Usage"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Case-insensitive search across model, provider, provider display name, and request ID."
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/UsageEventKind"
            }
          },
          {
            "name": "actor",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/UsageEventActorKind"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/UsageEventStatus"
            }
          },
          {
            "name": "session_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "turn_index",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Conversational turn index. Requires session_id. Exact speech and generation identities take precedence; unmatched legacy requests use a bounded timestamp estimate. Analysis is excluded."
          },
          {
            "name": "request_id",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          {
            "name": "streamed",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "http_status",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 599
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Safe usage-event page. Nullable fields and next_cursor are always present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageEventListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/usage/analytics": {
      "get": {
        "operationId": "get_usage_analytics",
        "x-sonus-required-permission": "usage:read",
        "x-kejue-required-permission": "usage:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found",
            "workspace_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found",
            "workspace_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get workspace usage analytics",
        "description": "Returns non-eval call, tool, webhook, and inference usage for the authenticated workspace. Defaults to the trailing 30 days. Supply range or from, never both; to is exclusive and cannot be in the future. Hour grain is limited to 45 days and every range is limited to 366 days. Series buckets are hour, day, week or month; week buckets start Monday. Custom from boundaries are exact, even when they fall inside a bucket. Call filters combine with AND across dimensions and OR within each comma-separated list (at most 50 values). Agent UUIDs include all historical versions. With call filters, tool/webhook counters and retained inference events are attributed through the selected sessions; unlinked requests and workspace-only request rollups are excluded. Phone filters cannot match anonymized calls after their phone fields are purged. Quota and live capacity endpoints always remain workspace-wide.",
        "tags": [
          "Usage"
        ],
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "24h",
                "7d",
                "30d",
                "90d",
                "12m"
              ],
              "default": "30d"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Inclusive RFC3339 timestamp or YYYY-MM-DD. Mutually exclusive with range."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Exclusive RFC3339 timestamp or YYYY-MM-DD. Defaults to now and cannot be in the future."
          },
          {
            "name": "grain",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "hour",
                "day",
                "week",
                "month"
              ]
            },
            "description": "Bucket size for the series. Defaults according to the selected range (hour, day or month); week is available but never chosen for you, so an existing integration's buckets do not change shape. Week buckets start Monday."
          },
          {
            "name": "agent_ids",
            "in": "query",
            "description": "Comma-separated agent UUIDs. Matches all versions of each agent.",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "maxItems": 50,
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "platform_numbers",
            "in": "query",
            "description": "Comma-separated exact platform phone numbers, including the leading plus.",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "maxItems": 50,
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              }
            }
          },
          {
            "name": "caller_number",
            "in": "query",
            "description": "Literal substring of the customer phone number; percent and underscore are not wildcards.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "directions",
            "in": "query",
            "description": "Comma-separated allowed values; OR within this dimension.",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "maxItems": 50,
              "items": {
                "type": "string",
                "enum": [
                  "inbound",
                  "outbound"
                ]
              }
            }
          },
          {
            "name": "channels",
            "in": "query",
            "description": "Comma-separated allowed values; OR within this dimension.",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "maxItems": 50,
              "items": {
                "type": "string",
                "enum": [
                  "sip_inbound",
                  "sip_outbound",
                  "web_sdk",
                  "web_test",
                  "transfer_brief"
                ]
              }
            }
          },
          {
            "name": "handled_by",
            "in": "query",
            "description": "Comma-separated allowed values; OR within this dimension.",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "maxItems": 50,
              "items": {
                "type": "string",
                "enum": [
                  "ai",
                  "human"
                ]
              }
            }
          },
          {
            "name": "statuses",
            "in": "query",
            "description": "Comma-separated allowed values; OR within this dimension.",
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "maxItems": 50,
              "items": {
                "type": "string",
                "enum": [
                  "ringing",
                  "queued",
                  "in_progress",
                  "ended",
                  "failed"
                ]
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Eval-free analytics totals and time series for this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgUsageAnalyticsResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/voice-attributes": {
      "get": {
        "operationId": "get_voice_attributes",
        "x-sonus-required-permission": "providers:read",
        "x-kejue-required-permission": "providers:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get the selectable voice attribute catalog",
        "description": "Returns the database-backed languages, genders, dialects, and optional sub-dialects accepted by current voice-management workflows. Values are stable machine identifiers; labels are presentation text. Use dialect.language to filter choices and sub_dialect.dialect to enforce the parent relationship.",
        "tags": [
          "Models and voices"
        ],
        "responses": {
          "200": {
            "description": "Enabled voice attributes in deterministic configured order.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "private, max-age=60"
                },
                "description": "Catalog responses may be privately cached for 60 seconds."
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceAttributeCatalog"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/web-calls": {
      "post": {
        "operationId": "create_web_call",
        "x-sonus-required-permission": "calls:start-web",
        "x-kejue-required-permission": "calls:start-web",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "agent_baseline_too_large",
            "no_production_version",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limit_exceeded",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_org",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "agent_not_found",
            "agent_version_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "agent_archived",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "agent_baseline_too_large",
            "no_production_version",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limit_exceeded",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_org",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "agent_capacity_exhausted",
            "authentication_unavailable",
            "capacity_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Start an embedded web call",
        "description": "Mints a short-lived token your browser front-end uses to talk to an agent over WebRTC, so you can embed a Kejue Voice agent in your own web app. Call this from your backend with your API key, then hand the returned token and ws_url to the browser; media flows directly between the browser and Kejue Voice and never traverses your servers. The token is valid only long enough to JOIN the room (see expires_at_ms) — it does not bound the call itself. The returned call_id is the same id the call appears under in GET /v1/calls, available immediately so you can correlate before the call connects. variables are rendered into the agent's prompt exactly like outbound call variables, which is how you pass your own end-user's identity or context into the conversation.",
        "tags": [
          "Calls"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebCallCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Token minted and the call row created. The call remains in ringing until the browser joins and the agent is dispatched.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebCallCreateResponse"
                },
                "example": {
                  "call_id": "33333333-3333-4333-8333-333333333333",
                  "token": "eyJhbGciOiJIUzI1NiJ9.eyJ2aWRlbyI6e319.signature",
                  "ws_url": "wss://agent.kejue.co",
                  "room_name": "call-billing_assistant-a1b2c3d4e5f6",
                  "agent_name": "sonus-prompt",
                  "agent_version_id": "22222222-2222-4222-8222-222222222222",
                  "expires_at_ms": 1786101420000,
                  "modality": "audio"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/webhook-deliveries": {
      "get": {
        "operationId": "list_webhook_deliveries",
        "x-sonus-required-permission": "webhooks:read",
        "x-kejue-required-permission": "webhooks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List webhook deliveries",
        "description": "Returns durable delivery attempts newest first. Request payloads and transcript content are deliberately excluded; fetch a delivery for its request digest, destination, bounded response preview, and stable error.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring search across delivery ID, webhook name, and event.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "name": "webhook_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "call_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/WebhookEvent"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/WebhookDeliveryStatus"
            }
          },
          {
            "name": "is_test",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delivery page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/webhook-deliveries/{id}": {
      "get": {
        "operationId": "get_webhook_delivery",
        "x-sonus-required-permission": "webhooks:read",
        "x-kejue-required-permission": "webhooks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_delivery_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_delivery_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a webhook delivery",
        "description": "Returns delivery state and safe diagnostics. The exact request body is never returned; use request_body_sha256 to correlate the immutable request snapshot. Retry-After is present while status is pending or running and absent after a terminal result.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delivery detail.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/webhook-deliveries/{id}/replay": {
      "post": {
        "operationId": "replay_webhook_delivery",
        "x-sonus-required-permission": "webhooks:update",
        "x-kejue-required-permission": "webhooks:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_delivery_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "webhook_archived",
            "webhook_delivery_in_progress",
            "webhook_delivery_payload_invalid",
            "webhook_delivery_payload_missing",
            "webhook_inactive",
            "webhook_missing",
            "webhook_secret_missing"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "payload_encoding_failed",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_delivery_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "webhook_archived",
            "webhook_delivery_in_progress",
            "webhook_delivery_payload_invalid",
            "webhook_delivery_payload_missing",
            "webhook_inactive",
            "webhook_missing",
            "webhook_secret_missing"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "payload_encoding_failed",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Replay a terminal webhook delivery",
        "description": "Creates a new pending delivery and leaves the source immutable. snapshot (default) reuses the prior payload with a new delivery_id/delivered_at/replayed_from_id; rebuild assembles current call results at dispatch time. Both modes use the webhook's current URL and current signing secret. Pending or running sources cannot be replayed.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookReplayRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Replay was durably created. Queue dispatch occurs only after the database commit; poll Location after Retry-After.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookReplayResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "list_webhooks",
        "x-sonus-required-permission": "webhooks:read",
        "x-kejue-required-permission": "webhooks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "List webhook configurations",
        "description": "Returns webhook configurations newest first. Signing secrets are never returned by list or get.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/CatalogLimit"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring search across webhook name and URL.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "$ref": "#/components/parameters/CreatedFrom"
          },
          {
            "$ref": "#/components/parameters/CreatedTo"
          },
          {
            "$ref": "#/components/parameters/ArchivedFilter"
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/WebhookEvent"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook configuration page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_webhook",
        "x-sonus-required-permission": "webhooks:create",
        "x-kejue-required-permission": "webhooks:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "webhook_name_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "webhook_secret_encryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "webhook_name_taken"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "webhook_secret_encryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Create a webhook configuration",
        "description": "Creates a public-HTTPS destination and returns its signing secret exactly once. Store the whsec_ value before discarding the response. Idempotent replay of the same POST may replay that original one-time response.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Webhook created; secret is shown only in this response (or an idempotent replay of it).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/webhooks/{id}": {
      "delete": {
        "operationId": "archive_webhook",
        "x-sonus-required-permission": "webhooks:delete",
        "x-kejue-required-permission": "webhooks:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "webhook_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "webhook_in_use"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Archive a webhook configuration",
        "description": "Idempotently archives the webhook. Active agent-version references or unexpired running deliveries return webhook_in_use. Pending and expired-lease deliveries are cancelled atomically when archival succeeds.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Archived, or already archived. Response body is empty.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_webhook",
        "x-sonus-required-permission": "webhooks:read",
        "x-kejue-required-permission": "webhooks:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "no_tx"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Get a webhook configuration",
        "description": "Returns one workspace webhook configuration, including archived resources, delivery-status metadata and a strong ETag, but never its signing secret or secret hash. Cross-workspace IDs are indistinguishable from missing IDs and supplying any request body is rejected.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook configuration without signing secret.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookConfig"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_webhook",
        "x-sonus-required-permission": "webhooks:update",
        "x-kejue-required-permission": "webhooks:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "webhook_archived",
            "webhook_name_taken"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "webhook_archived",
            "webhook_name_taken"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "summary": "Update a webhook configuration",
        "description": "Replaces only supplied fields. An unchanged patch is a successful no-op and retains its ETag.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated (or unchanged) configuration.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookConfig"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/webhooks/{id}/rotate-secret": {
      "post": {
        "operationId": "rotate_webhook_secret",
        "x-sonus-required-permission": "webhooks:update",
        "x-kejue-required-permission": "webhooks:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "webhook_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "webhook_secret_encryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "webhook_archived"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "webhook_secret_encryption_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Rotate webhook secret",
        "description": "Returns a new whsec_ signing secret exactly once and invalidates the prior secret for future sends.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Secret rotated and shown once.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "operationId": "test_webhook",
        "x-sonus-required-permission": "webhooks:update",
        "x-kejue-required-permission": "webhooks:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "webhook_archived",
            "webhook_inactive",
            "webhook_secret_missing"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_header",
            "invalid_idempotency_key",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "invalid_uuid",
            "unexpected_body",
            "unknown_query_parameter",
            "value_too_long"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "webhook_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "webhook_archived",
            "webhook_inactive",
            "webhook_secret_missing"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "422": [
            "referenced_resource_missing",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Send webhook test event",
        "description": "Durably creates a signed call.completed test delivery with test=true and call=null. Queue publication occurs only after the database commit, and the durable scanner recovers publication failures. Poll Location after Retry-After.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "description": "Test delivery created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/dncr-connections": {
      "get": {
        "operationId": "list_dncr_connections",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-required-permission": "dncr-connections:read",
        "x-kejue-required-permission": "dncr-connections:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "summary": "List dncr connections",
        "description": "Manage tenant-scoped Etisalat DNCR connections. Credentials are encrypted, write-only, and never returned. Archive is refused while a policy, pending job, or active campaign references the connection.",
        "tags": [
          "DNCR screening"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Safe DNCR connection metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DNCRConnectionListResponse"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Cache-Control": {
                "description": "DNCR credentials and metadata must not be cached.",
                "schema": {
                  "type": "string",
                  "const": "private, no-store"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_dncr_connection",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "dncr_configuration_invalid",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "dncr_configuration_invalid",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-sonus-required-permission": "dncr-connections:create",
        "x-kejue-required-permission": "dncr-connections:create",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "summary": "Create dncr connection",
        "description": "Manage tenant-scoped Etisalat DNCR connections. Credentials are encrypted, write-only, and never returned. Archive is refused while a policy, pending job, or active campaign references the connection.",
        "tags": [
          "DNCR screening"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DNCRConnectionCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Safe DNCR connection metadata.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Cache-Control": {
                "description": "DNCR credentials and metadata must not be cached.",
                "schema": {
                  "type": "string",
                  "const": "private, no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DNCRConnection"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/dncr-connections/{id}": {
      "delete": {
        "operationId": "archive_dncr_connection",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-required-permission": "dncr-connections:delete",
        "x-kejue-required-permission": "dncr-connections:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "summary": "Archive dncr connection",
        "description": "Manage tenant-scoped Etisalat DNCR connections. Credentials are encrypted, write-only, and never returned. Archive is refused while a policy, pending job, or active campaign references the connection.",
        "tags": [
          "DNCR screening"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Safe DNCR connection metadata.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "get_dncr_connection",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-required-permission": "dncr-connections:read",
        "x-kejue-required-permission": "dncr-connections:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "summary": "Get dncr connection",
        "description": "Manage tenant-scoped Etisalat DNCR connections. Credentials are encrypted, write-only, and never returned. Archive is refused while a policy, pending job, or active campaign references the connection.",
        "tags": [
          "DNCR screening"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Safe DNCR connection metadata.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Cache-Control": {
                "description": "DNCR credentials and metadata must not be cached.",
                "schema": {
                  "type": "string",
                  "const": "private, no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DNCRConnection"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "update_dncr_connection",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "dncr_configuration_invalid"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "empty_body",
            "invalid_header",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict"
          ],
          "412": [
            "precondition_failed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "dncr_configuration_invalid"
          ]
        },
        "x-sonus-required-permission": "dncr-connections:update",
        "x-kejue-required-permission": "dncr-connections:update",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "summary": "Update dncr connection",
        "description": "Manage tenant-scoped Etisalat DNCR connections. Credentials are encrypted, write-only, and never returned. Archive is refused while a policy, pending job, or active campaign references the connection.",
        "tags": [
          "DNCR screening"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DNCRConnectionUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Safe DNCR connection metadata.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Cache-Control": {
                "description": "DNCR credentials and metadata must not be cached.",
                "schema": {
                  "type": "string",
                  "const": "private, no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DNCRConnection"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/dncr-connections/{id}/test": {
      "post": {
        "operationId": "test_dncr_connection",
        "x-sonus-required-permission": "dncr-connections:test",
        "x-kejue-required-permission": "dncr-connections:test",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "optional",
        "x-kejue-idempotency": "optional",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "dncr_configuration_invalid",
            "dncr_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "dncr_enforced",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "no_tx",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "dncr_configuration_invalid",
            "dncr_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "summary": "Test dncr connection",
        "description": "Queries a UAE destination without dialing. Returns allowed or blocked registry evidence. Unknown status, authentication failure, timeout, or unavailable service returns 503. Organization enforcement applies to the selected connection.",
        "tags": [
          "DNCR screening"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/OptionalIdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DNCRConnectionTestRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Registry decision and evidence; no call is placed.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DNCRResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/inference/uploads": {
      "post": {
        "operationId": "create_inference_upload",
        "summary": "Create a resumable audio upload",
        "description": "Creates an organization-owned, bounded multipart upload. Send the original supported audio directly to the signed storage URLs, never through the API. Uploads expire after 24 hours. Use one stable Idempotency-Key for this upload; retrying the same payload returns its identity, while changing the payload conflicts. Outstanding upload count and byte budgets are checked before storage access is issued.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InferenceUploadCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Create a resumable audio upload",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceUpload"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:create",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "inference_job_limit"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "inference_async_disabled",
            "inference_model_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:create",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "required",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "inference_job_limit"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "inference_async_disabled",
            "inference_model_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/uploads/{id}": {
      "get": {
        "operationId": "get_inference_upload",
        "summary": "Read upload progress",
        "description": "Returns the authoritative stored-part inventory and upload expiry for this workspace. After reopening a browser, reselect the same source file and verify each existing part checksum before reusing it. The response contains no object keys or storage credentials.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read upload progress",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceUpload"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:create",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "410": [
            "inference_upload_expired"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:create",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "410": [
            "inference_upload_expired"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      },
      "delete": {
        "operationId": "delete_inference_upload",
        "summary": "Abort an unused audio upload",
        "description": "Revokes this workspace’s unused upload and schedules physical cleanup, including unfinished multipart parts. Once attached to a transcription job, delete the job instead. An unknown or another workspace’s upload has the same not-found response.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Abort an unused audio upload",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:create",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:create",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/uploads/{id}/parts": {
      "post": {
        "operationId": "sign_inference_upload_parts",
        "summary": "Sign audio upload parts",
        "description": "Signs at most four exact part numbers and base64 SHA-256 checksums. Part size is 16 MiB except the final remainder. URLs last at most 15 minutes and can be refreshed while the upload is valid. Bind each PUT to its returned headers and exact bytes. Browser JavaScript must let the browser provide Content-Length. Each refresh uses a new Idempotency-Key; never forward API authorization or cookies to storage.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InferenceUploadPartsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sign audio upload parts",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceSignedUploadParts"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:create",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "410": [
            "inference_upload_expired"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "inference_async_disabled",
            "inference_model_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:create",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "required",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "410": [
            "inference_upload_expired"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "inference_async_disabled",
            "inference_model_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/uploads/{id}/complete": {
      "post": {
        "operationId": "complete_inference_upload",
        "summary": "Complete an audio upload",
        "description": "Reconciles the server-side part inventory, completes multipart storage and verifies actual object size before marking the upload ready. Send an empty JSON object and one stable Idempotency-Key across retries. Caller-provided ETags and multipart ETags are not accepted as whole-file SHA-256 proofs. A ready upload can be attached to one transcription job.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Complete an audio upload",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceUpload"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:create",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "410": [
            "inference_upload_expired"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "inference_async_disabled",
            "inference_model_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:create",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "required",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "410": [
            "inference_upload_expired"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "inference_async_disabled",
            "inference_model_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/transcription-jobs": {
      "post": {
        "operationId": "create_inference_transcription_job",
        "summary": "Submit an asynchronous transcription job",
        "description": "Submits one ready upload to a published STT model with supports_async enabled. Accepted original audio is at most 18,000 seconds inclusive and 5 GiB, within the model’s separate limits. The server validates decoded samples before reserving the full duration in the STT wallet. Invalid audio is uncharged; insufficient credit enters awaiting_credits without GPU work. Jobs survive client disconnects and ordinary browser session expiry. Word timing is opt-in acoustic forced alignment in a qualified language, with explicit null timings for unaligned words. Use a stable Idempotency-Key for one logical job.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InferenceTranscriptionJobCreate"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Submit an asynchronous transcription job",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceTranscriptionJob"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:create",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found",
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "inference_job_limit"
          ],
          "410": [
            "inference_upload_expired"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "inference_unsupported_timestamps",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "inference_async_disabled",
            "inference_model_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:create",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "required",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found",
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed",
            "inference_job_limit"
          ],
          "410": [
            "inference_upload_expired"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "inference_unsupported_timestamps",
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "inference_async_disabled",
            "inference_model_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      },
      "get": {
        "operationId": "list_inference_transcription_jobs",
        "summary": "List transcription jobs",
        "description": "Lists this workspace’s durable job metadata, newest first. Follow next_cursor until null. Metadata contains state, progress, deadlines, charged request identity and result expiry without transcript content or storage references. Poll with backoff; completion time includes preparation, queueing, recognition and optional alignment.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "validating",
                "awaiting_credits",
                "queued",
                "processing",
                "finalizing",
                "completed",
                "failed",
                "cancelled"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List transcription jobs",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceTranscriptionJobs"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:read",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:read",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/transcription-jobs/{id}": {
      "get": {
        "operationId": "get_inference_transcription_job",
        "summary": "Read a transcription job",
        "description": "Reads workspace-scoped job status, preparation or processing phase, committed progress and result expiry. Unknown and unauthorized IDs both return not_found. Disabling admission does not remove existing job metadata, retained results, cancellation or deletion.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read a transcription job",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceTranscriptionJob"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:read",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:read",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      },
      "delete": {
        "operationId": "delete_inference_transcription_job",
        "summary": "Delete transcription content",
        "description": "Cancels outstanding work and immediately revokes access to source audio, intermediate audio and transcript content. Physical storage cleanup is durable and retried after logical deletion; unfinished uploads and abandoned generations are included. Authorized billing and audit metadata remain. Already downloaded content cannot be recalled.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Delete transcription content",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:delete",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:delete",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/transcription-jobs/{id}/result": {
      "get": {
        "operationId": "get_inference_transcription_result",
        "summary": "Read a transcription result",
        "description": "Retrieves an authorized, audited, decrypted transcript as JSON or plain text. Requires transcription read and sensitive-content access under the workspace policy. Only committed output can be returned: unfinished jobs may have an explicit partial result with gaps, never inferred content. Returns 409 before any output and 410 at expiry or logical deletion. Word offsets are integer milliseconds from the original audio start; unaligned words have null start/end, and chunk ranges are coarse audio ownership intervals. Retained transcript content expires seven days after termination, shortened by stricter workspace retention.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "text"
              ],
              "default": "json"
            }
          },
          {
            "name": "reason",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 500
            },
            "description": "Sensitive-content access justification when required by workspace policy."
          }
        ],
        "responses": {
          "200": {
            "description": "Read a transcription result",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceTranscriptionResult"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:read",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "pii_access_approval_required",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "inference_result_not_ready"
          ],
          "410": [
            "inference_content_expired"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "pii_access_mode_unavailable",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:read",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "pii_access_approval_required",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "inference_result_not_ready"
          ],
          "410": [
            "inference_content_expired"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "pii_access_mode_unavailable",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/transcription-jobs/{id}/resume": {
      "post": {
        "operationId": "resume_inference_transcription_job",
        "summary": "Retry a job credit reservation",
        "description": "Reattempts a full-duration STT wallet reservation for a prepared awaiting_credits job without reuploading. The original processing deadline still applies. Async holds share the STT balance but do not consume interactive session concurrency. Repeated state transitions cannot charge audio twice.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Retry a job credit reservation",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceTranscriptionJob"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:create",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "402": [
            "inference_quota_exhausted"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "inference_async_disabled",
            "inference_model_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:create",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "required",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "402": [
            "inference_quota_exhausted"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable",
            "inference_async_disabled",
            "inference_model_unavailable",
            "inference_storage_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/transcription-jobs/{id}/cancel": {
      "post": {
        "operationId": "cancel_inference_transcription_job",
        "summary": "Cancel remaining transcription work",
        "description": "Fences further dispatch and late results, then settles only unique committed audio intervals and releases the remaining reservation. Already committed partial results remain retrievable until expiry. Recognition or alignment retries never add another customer charge. Repeating cancellation is safe.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancel remaining transcription work",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceTranscriptionJob"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:create",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:create",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "required",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "conflict",
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/models": {
      "get": {
        "operationId": "list_inference_models",
        "summary": "List published Inference model names",
        "description": "List published Inference model names STT models advertise asynchronous file-job support, a separate maximum original-file size and audio duration, timestamp granularities, and qualified alignment languages. Check these capabilities before uploading long recordings.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "List published Inference model names",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InferenceModel"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-models:read",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-models:read",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/voices": {
      "get": {
        "operationId": "list_inference_voices",
        "summary": "List approved voices for a model",
        "description": "List approved voices for a model",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List approved voices for a model",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InferenceVoice"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-voices:read",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-voices:read",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/voices/{id}/sample": {
      "get": {
        "operationId": "get_inference_voice_sample",
        "summary": "Play a cached voice sample",
        "description": "Play a cached voice sample",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Play a cached voice sample",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-voices:read",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found",
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-voices:read",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found",
            "not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/limits": {
      "get": {
        "operationId": "get_inference_limits",
        "summary": "Read Inference balances and concurrency",
        "description": "Read Inference balances and concurrency",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Read Inference balances and concurrency",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InferenceWallet"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-usage:read",
        "x-sonus-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-usage:read",
        "x-kejue-required-entitlement": null,
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/usage": {
      "get": {
        "operationId": "get_inference_usage",
        "summary": "Read Inference usage and recent requests",
        "description": "Read Inference usage and recent requests",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                1,
                7,
                30
              ],
              "default": 7
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read Inference usage and recent requests",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceUsage"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-usage:read",
        "x-sonus-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-usage:read",
        "x-kejue-required-entitlement": null,
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/requests/{id}": {
      "get": {
        "operationId": "get_inference_request",
        "summary": "Read durable Inference request status",
        "description": "Read durable Inference request status",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read durable Inference request status",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceRequest"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-usage:read",
        "x-sonus-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-usage:read",
        "x-kejue-required-entitlement": null,
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store"
      }
    },
    "/inference/audio/speech": {
      "post": {
        "operationId": "generate_inference_speech",
        "summary": "Stream synthesized speech",
        "description": "Sends raw little-endian PCM16 mono at 16 kHz as audio is produced. Use a dedicated Inference key. The Idempotency-Key identifies one computation; a repeated key returns 409 without rerunning or replaying audio. Text to speech is charged by the input length in characters; the whole input is reserved at admission (402 if the balance is short) and charged once audio starts; nothing is charged if no audio is produced. Audio length never changes the charge. Output is capped by the model's audio limit and the optional max_audio_seconds, as a safety limit. Inspect X-Kejue-Inference-Status trailer (completed/error/cancelled) and GET /inference/requests/{id}; a 200 or EOF alone cannot prove completion. output_limit indicates output stopped at the audio cap. Audio content is never retained.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Stream synthesized speech",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Sample-Rate": {
                "description": "Audio sample rate in Hz.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              },
              "X-Kejue-Characters": {
                "description": "Input characters charged for this request.",
                "schema": {
                  "type": "string"
                }
              },
              "Trailer": {
                "description": "Declares X-Kejue-Inference-Status completion trailer.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "audio/pcm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "402": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "409": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "413": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "415": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "502": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-tts:create",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "request_identity",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "402": [
            "inference_quota_exhausted"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found",
            "inference_voice_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "inference_request_exists"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "inference_concurrency_exhausted",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "502": [
            "inference_upstream_failed"
          ],
          "503": [
            "authentication_unavailable",
            "inference_capacity_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-tts:create",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "request_identity",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "402": [
            "inference_quota_exhausted"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found",
            "inference_voice_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "inference_request_exists"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "inference_concurrency_exhausted",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "502": [
            "inference_upstream_failed"
          ],
          "503": [
            "authentication_unavailable",
            "inference_capacity_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InferenceSpeechInput"
              }
            }
          }
        }
      }
    },
    "/inference/audio/transcriptions": {
      "post": {
        "operationId": "create_inference_transcription",
        "summary": "Transcribe an audio file",
        "description": "Accepts PCM16 mono 16 kHz WAV audio up to the published model limit and at most 300 seconds. Accepted input duration is charged once dispatched, including partial failures; pre-dispatch refusals release the reservation. A repeated Idempotency-Key returns 409 without recomputation. Audio and transcript content are not retained by the usage ledger.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Transcribe an audio file",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceTranscription"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "402": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "409": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "413": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "415": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "502": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:create",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "request_identity",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "402": [
            "inference_quota_exhausted"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "inference_request_exists"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "inference_concurrency_exhausted",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "502": [
            "inference_upstream_failed"
          ],
          "503": [
            "authentication_unavailable",
            "inference_capacity_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:create",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "request_identity",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "402": [
            "inference_quota_exhausted"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "inference_request_exists"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "inference_concurrency_exhausted",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "502": [
            "inference_upstream_failed"
          ],
          "503": [
            "authentication_unavailable",
            "inference_capacity_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/InferenceTranscriptionInput"
              }
            }
          }
        }
      }
    },
    "/inference/realtime-tokens": {
      "post": {
        "operationId": "create_inference_realtime_token",
        "summary": "Mint a one-use live session token",
        "description": "Mint a token for browser clients without exposing a long-lived key. Backend clients can instead authenticate directly on either realtime WebSocket with an Inference API key in the Authorization Bearer header. Requires an Inference API key or an authorized browser session. The model decides the session. A speech-to-text model opens a live transcription socket (needs inference-stt:create), a TTS model a live speech socket (needs inference-tts:create and an approved voice). Returns a one-use token valid for 30 seconds and the absolute wss:// URL to connect to with ?token=…; never place a long-lived key in a WebSocket URL. Each successful POST mints a fresh token. Credit (audio minutes for speech to text, a character budget for text to speech) is reserved only when connecting.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Mint a one-use live transcription token",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceRealtimeToken"
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "413": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "415": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          }
        },
        "x-sonus-required-permission": null,
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "single_use",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found",
            "inference_voice_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": null,
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "single_use",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found",
            "inference_voice_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InferenceRealtimeInput"
              }
            }
          }
        }
      }
    },
    "/inference/audio/transcriptions/realtime": {
      "get": {
        "operationId": "connect_inference_realtime",
        "summary": "Connect a live transcription session",
        "description": "Connect directly from a backend with an Inference API key in the Authorization Bearer header and model, language (ar, en or auto; default ar), and max_audio_seconds (1–300; default 60, within the model limit) query parameters. Add turn_detection (semantic or vad) and optional td_* parameters for turn detection, the same option and ranges as the token body's turn_detection object (td_silence_ms is its silence_ms, and so on); with it max_audio_seconds is 1–525 (default 300). For browsers, mint a one-use token with POST /inference/realtime-tokens and connect using only the token query parameter. Do not combine token and Authorization or send a long-lived key in the URL. Send binary PCM16 mono 16 kHz frames (at most 64 KiB). Send {\"type\":\"commit\"} to finalize a segment or {\"type\":\"finish\"} to finalize and close. Events contain type ready/transcript/finished/error; transcript carries final text (refining interim hypotheses are not supported). With turn detection on (token or query parameters), stream audio continuously and the model ends turns itself. Extra events speech_started {segment, audio_start_ms} and speech_stopped {segment, audio_end_ms} (milliseconds of session audio) mark each turn, and each final transcript also carries end_of_turn {reason, probability, audio_end_ms, silence_ms} and no_speech true when the turn held no speech. reason is semantic, silence, max_silence, commit, idle or max_turn. Send commit before finish if a turn may still be open. A model build without turn detection answers with an error event, code turn_detection_unavailable. Accepted audio is charged, with the session bounded by reserved minutes and the published limit. A session that receives nothing for 30 seconds before finish gets an error event with code idle_timeout and closes with 1008. Close codes are 1000 after finished, 1008 for idle_timeout, audio_limit_reached or invalid_message, 1011 when the model fails. Sessions last at most 9 minutes. When using a token, it is consumed on the first connection attempt. Credentials, options, permissions, and available minutes are checked before the upgrade; each direct connection creates a new session.",
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "description": "One-use browser token. Omit when authenticating with an API key.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 43,
              "maxLength": 43
            }
          },
          {
            "name": "model",
            "in": "query",
            "description": "Published STT model alias. Required with API-key authentication; omit when using a token.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language",
            "in": "query",
            "description": "STT language with API-key authentication. Omit when using a token.",
            "schema": {
              "type": "string",
              "enum": [
                "ar",
                "en",
                "auto"
              ],
              "default": "ar"
            }
          },
          {
            "name": "max_audio_seconds",
            "in": "query",
            "description": "Audio reservation cap with API-key authentication. Omit when using a token. 1–300 (default 60) without turn detection; 1–525 (default 300) with turn_detection. Always within the model limit.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 525
            }
          },
          {
            "name": "turn_detection",
            "in": "query",
            "description": "Turn detection with API-key authentication (see InferenceTurnDetection). The model finds turns in a continuous stream and sends speech_started, speech_stopped and one final transcript per turn. Omit for the commit-driven session; omit when using a token.",
            "schema": {
              "type": "string",
              "enum": [
                "semantic",
                "vad"
              ]
            }
          },
          {
            "name": "td_silence_ms",
            "in": "query",
            "description": "Silence before a verdict (semantic) or before the turn ends (vad), in milliseconds. Requires turn_detection. API-key authentication only.",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 5000
            }
          },
          {
            "name": "td_max_silence_ms",
            "in": "query",
            "description": "Semantic backstop in milliseconds; at least td_silence_ms. Requires turn_detection. API-key authentication only.",
            "schema": {
              "type": "integer",
              "minimum": 200,
              "maximum": 10000
            }
          },
          {
            "name": "td_threshold",
            "in": "query",
            "description": "Turn-model completion probability (semantic). Requires turn_detection. API-key authentication only.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          {
            "name": "td_min_speech_ms",
            "in": "query",
            "description": "Voice needed before a turn opens, in milliseconds. Requires turn_detection. API-key authentication only.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2000
            }
          },
          {
            "name": "td_prefix_padding_ms",
            "in": "query",
            "description": "Audio kept from before the detected start of speech, in milliseconds. Requires turn_detection. API-key authentication only.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2000
            }
          },
          {
            "name": "td_vad_threshold",
            "in": "query",
            "description": "Speech probability above which a frame counts as voice. Requires turn_detection. API-key authentication only.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          {
            "name": "td_idle_ms",
            "in": "query",
            "description": "Ends an open turn when no audio arrives for this long; 0 turns it off. Requires turn_detection. API-key authentication only.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000
            }
          },
          {
            "name": "td_no_speech_logprob",
            "in": "query",
            "description": "Mean token log-probability below which a turn is reported as no speech. Requires turn_detection. API-key authentication only.",
            "schema": {
              "type": "number",
              "minimum": -10,
              "maximum": 0
            }
          },
          {
            "name": "td_incomplete_threshold",
            "in": "query",
            "description": "With semantic turn detection, an end-of-turn probability below this counts as clearly unfinished and extends the wait by td_incomplete_extend_ms; 0 turns it off. Must not exceed td_threshold. Requires turn_detection. API-key authentication only.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          {
            "name": "td_incomplete_extend_ms",
            "in": "query",
            "description": "Extra silence allowed after the speaker's last word when the end-of-turn model judges the sentence clearly unfinished. Requires turn_detection. API-key authentication only.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000
            }
          }
        ],
        "responses": {
          "101": {
            "description": "WebSocket upgraded. Client sends binary PCM16 mono 16 kHz; JSON controls commit or finish. Server events: ready, transcript (final text), finished, error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "402": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-stt:create",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "402": [
            "inference_quota_exhausted"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "inference_concurrency_exhausted",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_capacity_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-stt:create",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "402": [
            "inference_quota_exhausted"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "inference_concurrency_exhausted",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_capacity_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store",
        "security": [
          {
            "inferenceBearerAuth": []
          },
          {
            "inferenceRealtimeToken": []
          }
        ]
      }
    },
    "/inference/audio/speech/realtime": {
      "get": {
        "operationId": "connect_inference_speech_realtime",
        "summary": "Connect a live speech session",
        "description": "Connect directly from a backend with an Inference API key in the Authorization Bearer header and model, voice (approved UUID), and optionally max_characters (1–100000; default 10000) and max_audio_seconds (1–600; default 600) query parameters. For browsers, mint a one-use token with POST /inference/realtime-tokens and connect using only the token query parameter. Do not combine token and Authorization or send a long-lived key in the URL. TTS does not accept language. The model connection opens once, at connect, so every utterance skips connection setup. Send {\"type\":\"speak\",\"text\":…} (1–8000 characters) for each utterance; utterances may be pipelined and are spoken in order. Audio returns as binary PCM16 mono frames at the sample_rate in the ready event, followed by {\"type\":\"done\",\"segment\":n,\"audio_ms\":…} per utterance. {\"type\":\"cancel\"} drops every utterance not yet fully spoken and answers {\"type\":\"cancelled\",\"segments\":[…]}; {\"type\":\"keepalive\"} holds a quiet session open; {\"type\":\"finish\"} ends the session once queued speech is done, answered by {\"type\":\"finished\"}. Each speak message is charged by its characters when accepted, against the session's max_characters budget; a message that would pass it is refused with character_limit_reached and costs nothing. max_audio_seconds only caps the speech produced. With nothing queued and nothing received for 60 seconds the session gets an error event with code idle_timeout and closes with 1008. Close codes are 1000 after finished, 1008 for idle_timeout, audio_limit_reached, character_limit_reached or invalid_message, 1011 when the model fails. Sessions last at most 9 minutes. When using a token, it is consumed on the first connection attempt. Credentials, options, permissions, and available minutes are checked before the upgrade; each direct connection creates a new session.",
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "description": "One-use browser token. Omit when authenticating with an API key.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 43,
              "maxLength": 43
            }
          },
          {
            "name": "model",
            "in": "query",
            "description": "Published TTS model alias. Required with API-key authentication; omit when using a token.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "voice",
            "in": "query",
            "description": "Approved voice UUID. Required with API-key authentication; omit when using a token.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "max_characters",
            "in": "query",
            "description": "Character budget reserved for the session with API-key authentication. Omit when using a token.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000,
              "default": 10000
            }
          },
          {
            "name": "max_audio_seconds",
            "in": "query",
            "description": "Cap on the speech the session may produce, with API-key authentication. A safety limit; it does not change what is charged. Omit when using a token.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 600,
              "default": 600
            }
          }
        ],
        "responses": {
          "101": {
            "description": "WebSocket upgraded. Client sends JSON speak, cancel, keepalive and finish messages. Server sends binary PCM16 audio and JSON events: ready, done, cancelled, finished, error.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "401": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "402": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "X-Kejue-Request-Id": {
                "$ref": "#/components/headers/InferenceRequestID"
              }
            }
          },
          "403": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "404": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "408": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "422": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "429": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "500": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "503": {
            "description": "Machine-readable error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          }
        },
        "x-sonus-required-permission": "inference-tts:create",
        "x-sonus-required-entitlement": "inference",
        "x-sonus-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "402": [
            "inference_quota_exhausted"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found",
            "inference_voice_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "inference_concurrency_exhausted",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_capacity_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-required-permission": "inference-tts:create",
        "x-kejue-required-entitlement": "inference",
        "x-kejue-idempotency": "not_applicable",
        "x-kejue-error-codes": {
          "400": [
            "bad_request",
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "402": [
            "inference_quota_exhausted"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "entitlement_required",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "inference_model_not_found",
            "inference_voice_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "inference_concurrency_exhausted",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable",
            "inference_capacity_unavailable",
            "inference_model_unavailable"
          ]
        },
        "x-kejue-cache-control": "private, no-store",
        "security": [
          {
            "inferenceBearerAuth": []
          },
          {
            "inferenceRealtimeToken": []
          }
        ]
      }
    },
    "/inference/api-keys": {
      "get": {
        "operationId": "list_inference_api_keys",
        "x-sonus-required-permission": "inference-api-keys:read",
        "x-kejue-required-permission": "inference-api-keys:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "forbidden",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "summary": "List API keys",
        "description": "Inference-only credentials for this workspace. Lists safe credential metadata in reverse creation order. Secret and hash material are never returned. Follow `next_cursor` until null for a complete traversal.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "Number of API keys to return."
          }
        ],
        "responses": {
          "200": {
            "description": "API keys, including revoked and expired keys.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyListResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "create_inference_api_key",
        "x-sonus-required-permission": "inference-api-keys:create",
        "x-kejue-required-permission": "inference-api-keys:create",
        "x-sonus-required-entitlement": "inference",
        "x-kejue-required-entitlement": "inference",
        "x-sonus-idempotency": "required",
        "x-kejue-idempotency": "required",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "delegation_not_allowed",
            "entitlement_required",
            "forbidden",
            "permission_escalation",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_field",
            "duplicate_query_parameter",
            "empty_body",
            "idempotency_key_required",
            "invalid_idempotency_key",
            "invalid_json",
            "invalid_query_parameter",
            "invalid_request_id",
            "multiple_json_values",
            "request_body_read_failed",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "delegation_not_allowed",
            "entitlement_required",
            "forbidden",
            "permission_escalation",
            "team_not_connected"
          ],
          "408": [
            "request_timeout"
          ],
          "409": [
            "idempotency_conflict",
            "idempotency_in_progress",
            "idempotency_result_lost",
            "idempotency_security_context_changed"
          ],
          "413": [
            "request_too_large"
          ],
          "415": [
            "unsupported_media_type"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "idempotency_identity_unavailable",
            "idempotency_misconfigured",
            "idempotency_persistence_failed",
            "idempotency_unavailable",
            "internal_error",
            "response_buffer_failed"
          ],
          "503": [
            "authentication_unavailable",
            "idempotency_capacity_exceeded",
            "idempotency_result_unavailable",
            "idempotency_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "summary": "Create an API key",
        "description": "Inference-only credentials for this workspace. Creates a scoped credential. The `key` secret is returned in this response only and can never be retrieved again. Supplied scopes are canonicalized, and may not exceed the caller's own permissions.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "API key metadata plus the one-time secret.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateApiKeyResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/inference/api-keys/{id}": {
      "get": {
        "operationId": "get_inference_api_key",
        "x-sonus-required-permission": "inference-api-keys:read",
        "x-kejue-required-permission": "inference-api-keys:read",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "api_key_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "api_key_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "db_error",
            "internal_error",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "summary": "Get an API key",
        "description": "Inference-only credentials for this workspace. Returns safe metadata only; the credential secret is never retrievable. The strong ETag hashes the exact public JSON representation and therefore changes when last_used_at or any other emitted field changes.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API key metadata.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKey"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "revoke_inference_api_key",
        "x-sonus-required-permission": "inference-api-keys:delete",
        "x-kejue-required-permission": "inference-api-keys:delete",
        "x-sonus-required-entitlement": null,
        "x-kejue-required-entitlement": null,
        "x-sonus-idempotency": "not_applicable",
        "x-kejue-idempotency": "not_applicable",
        "x-sonus-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "api_key_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-kejue-error-codes": {
          "400": [
            "body_read_failed",
            "duplicate_query_parameter",
            "invalid_header",
            "invalid_path_parameter",
            "invalid_query_parameter",
            "invalid_request_id",
            "unexpected_body",
            "unknown_query_parameter"
          ],
          "401": [
            "unauthorized"
          ],
          "403": [
            "ai_connectors_disabled",
            "api_key_product_mismatch",
            "forbidden",
            "team_not_connected"
          ],
          "404": [
            "api_key_not_found"
          ],
          "408": [
            "request_timeout"
          ],
          "412": [
            "precondition_failed"
          ],
          "422": [
            "validation_failed"
          ],
          "429": [
            "authentication_rate_limited",
            "rate_limited"
          ],
          "500": [
            "audit_required",
            "db_error",
            "internal_error",
            "response_buffer_failed",
            "stored_data_invalid"
          ],
          "503": [
            "authentication_unavailable"
          ]
        },
        "x-sonus-cache-control": "private, no-store",
        "x-kejue-cache-control": "private, no-store",
        "summary": "Revoke an API key",
        "description": "Inference-only credentials for this workspace. Idempotently soft-revokes the credential. The metadata remains available for auditing. This operation accepts no request body.",
        "security": [
          {
            "inferenceBearerAuth": []
          }
        ],
        "tags": [
          "Inference"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "The key is revoked; repeating the operation is a successful no-op.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/PrivateNoStore"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestID"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/RequestTimeout"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "inferenceRealtimeToken": {
        "type": "apiKey",
        "in": "query",
        "name": "token",
        "description": "One-use browser session token minted by POST /inference/realtime-tokens. Valid for 30 seconds and consumed on the first connection attempt."
      },
      "inferenceBearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "A dedicated workspace Inference API key. Voice keys and OAuth tokens are rejected."
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key as `Authorization: Bearer kejue_<prefix>_<secret>`. Existing `sonus_<prefix>_<secret>` keys remain valid with the same scopes and lifecycle. A connected app can instead use an OAuth access token `sonus_oat_…`, which acts as the member and selects the team with the `Kejue-Org-Id` header (legacy `Sonus-Org-Id` remains accepted)."
      }
    },
    "parameters": {
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Opaque pagination cursor from a previous response's next_cursor."
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "description": "Page size (endpoint-bounded; typical default 25, max 100)."
      },
      "AgentVersionLimit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200,
          "default": 50
        },
        "description": "Number of immutable agent-version summaries to return."
      },
      "CallCursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Opaque keyset cursor returned as next_cursor. It is bound to this endpoint's sort and direction."
      },
      "CallLimit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200,
          "default": 50
        },
        "description": "Number of calls to return."
      },
      "CatalogLimit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200,
          "default": 50
        },
        "description": "Number of catalog resources to return. The server fetches one extra row internally to produce next_cursor."
      },
      "SearchQuery": {
        "name": "q",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "description": "Case-insensitive literal substring search across slug, name, and description. The supplied and trimmed values must each contain 1–200 Unicode characters; blank values and every Unicode control character are rejected. Percent, underscore, and backslash are literal characters, not LIKE syntax."
      },
      "CreatedFrom": {
        "name": "created_from",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Inclusive created_at lower bound as RFC3339 or YYYY-MM-DD (midnight UTC)."
      },
      "CreatedTo": {
        "name": "created_to",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Exclusive created_at upper bound as RFC3339 or YYYY-MM-DD (midnight UTC). Must be after created_from."
      },
      "ArchivedFilter": {
        "name": "archived",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "exclude",
            "include",
            "only"
          ],
          "default": "exclude"
        },
        "description": "Whether archived resources are excluded, included alongside active resources, or returned exclusively."
      },
      "IfMatch": {
        "name": "If-Match",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Optional strong ETag (or *) from a prior response. A stale tag returns 412 without changing the resource."
      },
      "BreakGlassReason": {
        "name": "reason",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 8,
          "maxLength": 500
        },
        "description": "Human audit justification. Leading/trailing whitespace is removed; control characters are rejected."
      },
      "PIIAccessReason": {
        "name": "reason",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "description": "Human audit justification, recorded on the access audit row whenever it is sent. Whether it is required depends on the workspace's sensitive-data access mode. In `reason` mode it is required (at least 8 characters) on the transcript, recording and tool-I/O reads, and omitting it returns 400. In `approval` mode a user reads under an approved access request instead (the approved request's reason is recorded), while an API key keeps the `reason` rule. In `open` mode it is optional. Per-turn audio never requires it in any mode. Control characters are rejected."
      },
      "Download": {
        "name": "download",
        "in": "query",
        "required": false,
        "schema": {
          "type": "boolean",
          "default": false
        },
        "description": "Use attachment rather than inline Content-Disposition."
      },
      "Range": {
        "name": "Range",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^bytes=(?:[0-9]+-[0-9]*|-[0-9]+)$"
        },
        "description": "One RFC 9110 byte interval. Multiple ranges are rejected with 416 and a JSON error envelope."
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "pattern": "^[A-Za-z0-9!#$%&'*+.^_`|~-]+$"
        },
        "description": "Required on every API-key POST except side-effect-free preview operations, which expose OptionalIdempotencyKey. Use a 1 to 255 character portable ASCII HTTP token and one stable, unique value for one logical intent. Reusing it with the same actor, authorization context, method, canonical resource path, query, If-Match value, and body replays the committed result; changing any of those inputs returns a deterministic conflict."
      },
      "OptionalIdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "pattern": "^[A-Za-z0-9!#$%&'*+.^_`|~-]+$"
        },
        "description": "Optional on this side-effect-free POST. When supplied, the normal durable replay and conflict semantics apply."
      }
    },
    "headers": {
      "InferenceRequestID": {
        "description": "Durable computation UUID, present after admission, including execution errors and repeated request identities.",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "ETag": {
        "description": "Strong version tag for conditional PATCH, POST, PUT, or DELETE requests against a versioned resource or aggregate. Treat it as opaque and copy it exactly, including quotes. Agent aggregate tags cover the persisted revision, an opaque representation-version component, and deployment capability bits. A representation normalization or capability rollout can therefore change the tag without changing revision or updated_at. Weak validators never satisfy If-Match.",
        "schema": {
          "type": "string"
        }
      },
      "GuardrailSetETag": {
        "description": "Strong opaque version tag for one guardrail set. Copy the complete quoted value into If-Match; do not parse or construct it. Every committed create, material update, or first archive receives a distinct tag. Semantic PATCH no-ops and repeated archive no-ops preserve the current tag. Weak validators are never accepted by If-Match.",
        "schema": {
          "type": "string",
          "pattern": "^\"guardrail-set-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}-r1-v[1-9][0-9]*\"$"
        },
        "example": "\"guardrail-set-11111111-1111-4111-8111-111111111111-r1-v3\""
      },
      "GuardrailSetLocation": {
        "description": "Canonical relative URL of the newly created guardrail set.",
        "schema": {
          "type": "string",
          "pattern": "^/v1/guardrail-sets/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "example": "/v1/guardrail-sets/11111111-1111-4111-8111-111111111111"
      },
      "PrivateNoStore": {
        "description": "The representation can contain authored safety policy and must not be stored by shared or private caches.",
        "schema": {
          "type": "string",
          "const": "private, no-store"
        }
      },
      "SonusAgentETag": {
        "description": "Strong tag for the complete parent agent aggregate when the primary ETag belongs to a nested independently versioned resource. A changed draft after-call configuration advances this tag; a semantic no-op preserves it. It is opaque and also incorporates the representation-version component and point-in-time deployment capability bits described by the aggregate ETag contract.",
        "schema": {
          "type": "string"
        }
      },
      "Location": {
        "description": "Relative URL of the newly created resource.",
        "schema": {
          "type": "string"
        }
      },
      "RetryAfter": {
        "description": "Whole seconds an automation client should wait before polling or retrying.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "IdempotencyReplayed": {
        "description": "Present with value true when this response was replayed from an earlier request with the same Idempotency-Key.",
        "schema": {
          "type": "string",
          "const": "true"
        }
      },
      "XRequestID": {
        "description": "Correlation identifier echoed from a valid X-Request-Id request header or generated by Kejue Voice.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[!-~]+$"
        }
      },
      "RateLimitLimit": {
        "description": "Configured request allowance for the current API-key minute window. Omitted for session traffic and for failures emitted before authentication and rate limiting run (for example invalid_request_id, unauthorized, authentication_rate_limited, or authentication_unavailable). During a Redis outage, a bounded per-pod emergency window supplies this value.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "RateLimitRemaining": {
        "description": "Requests remaining in the current API-key minute window. Omitted under the same pre-authentication and session conditions as X-RateLimit-Limit.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "RateLimitReset": {
        "description": "Unix timestamp in seconds when the current API-key minute window resets. Omitted under the same pre-authentication and session conditions as X-RateLimit-Limit.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "WWWAuthenticate": {
        "description": "RFC 6750 Bearer challenge returned when credentials are missing or invalid.",
        "schema": {
          "type": "string"
        },
        "example": "Bearer realm=\"sonus\", error=\"invalid_token\""
      }
    },
    "responses": {
      "GuardrailSetInUse": {
        "description": "The set remains referenced by one or more active agent-version pointers. The dependency list is complete for the transaction snapshot and sorted by agent_slug, then draft/staging/production, then agent-version creation/id. Remove the set UUID from replacement drafts, promote/deploy as needed to move every listed pointer, then retry DELETE against a fresh ETag.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "guardrail_set_in_use",
                "message": "guardrail set cannot be archived while active agent versions reference it",
                "request_id": "req_guardrail_archive_409",
                "details": {
                  "dependencies": [
                    {
                      "kind": "agent_version",
                      "agent_id": "33333333-3333-4333-8333-333333333333",
                      "agent_slug": "billing_assistant",
                      "agent_name": "Billing Assistant",
                      "agent_version_id": "44444444-4444-4444-8444-444444444444",
                      "agent_version": null,
                      "deployment_stage": "draft",
                      "reference": "behavior.guardrails.guardrail_set_ids"
                    },
                    {
                      "kind": "agent_version",
                      "agent_id": "33333333-3333-4333-8333-333333333333",
                      "agent_slug": "billing_assistant",
                      "agent_name": "Billing Assistant",
                      "agent_version_id": "55555555-5555-4555-8555-555555555555",
                      "agent_version": 2,
                      "deployment_stage": "production",
                      "reference": "behavior.guardrails.guardrail_set_ids"
                    }
                  ],
                  "dependency_count": 2
                }
              }
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "ETag": {
            "$ref": "#/components/headers/GuardrailSetETag"
          },
          "Cache-Control": {
            "$ref": "#/components/headers/PrivateNoStore"
          }
        }
      },
      "GuardrailValidationFailed": {
        "description": "The request is valid JSON but one or more metadata, rule, per-set runtime-budget, or referenced-agent aggregate-budget checks failed. More than 100 rules in one definition reports too_many_items at definition.guardrails before aggregate admission. A shape-valid definition can report the instruction, phrase-count, or phrase-character budget codes. Ordered multi-set assignment can additionally report guardrail_rule_budget_exceeded on the first guardrail_set_ids item that crosses the per-agent limit. A definition-changing PATCH reports the analogous assigned_agent_* code whose message names each affected agent and deployment stage. When PATCH reached that locked active-agent admission check, ETag contains the current Guardrail-set validator for the corrected retry; create and pre-resource input validation omit it. Correct every item in details.fields; no resource, version, or audit mutation is committed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "invalid_rule": {
                "value": {
                  "error": {
                    "code": "validation_failed",
                    "message": "request failed validation",
                    "request_id": "req_guardrail_validation_422",
                    "details": {
                      "fields": [
                        {
                          "path": "definition.guardrails[1].phrases[1]",
                          "code": "duplicate",
                          "message": "phrase duplicates definition.guardrails[1].phrases[0] after case-insensitive normalization"
                        }
                      ]
                    }
                  }
                }
              },
              "referenced_agent_budget": {
                "value": {
                  "error": {
                    "code": "validation_failed",
                    "message": "request failed validation",
                    "request_id": "req_guardrail_budget_422",
                    "details": {
                      "fields": [
                        {
                          "path": "definition",
                          "code": "assigned_agent_guardrail_instruction_budget_exceeded",
                          "message": "definition would exceed the guardrail runtime budget for agent \"billing_assistant\" production version: assigned LLM guardrail instructions contain 40001 characters; the per-agent limit is 40000"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "ETag": {
            "$ref": "#/components/headers/GuardrailSetETag"
          }
        }
      },
      "BadRequest": {
        "description": "Malformed request ID, path, query, conditional/idempotency header, JSON syntax/transport, duplicate field, multiple JSON values, or a body supplied to an operation that has no request body. Branch on error.code for the exact correction.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        }
      },
      "Unauthorized": {
        "description": "Missing or invalid credentials.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "WWW-Authenticate": {
            "$ref": "#/components/headers/WWWAuthenticate"
          }
        }
      },
      "Forbidden": {
        "description": "Insufficient scope/role, or session-only endpoint.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        }
      },
      "NotFound": {
        "description": "Resource not found or not visible to your org.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "ETag": {
            "description": "Current parent-aggregate tag when that aggregate was resolved before a nested resource lookup failed; otherwise omitted.",
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "Conflict": {
        "description": "The requested lifecycle transition conflicts with current resource state, or an Idempotency-Key is in progress, was reused for different intent/security context, or has lost its replay payload. Branch on error.code and follow the error catalog retry policy.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "ETag": {
            "description": "Current aggregate tag when the resource was resolved before the conflict; otherwise omitted.",
            "schema": {
              "type": "string"
            }
          },
          "Retry-After": {
            "description": "Seconds before retrying when the conflict is caused by an operation already in progress. Omitted for other conflicts.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Gone": {
        "description": "Durable metadata exists but the short-lived or external binary object is no longer available.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        }
      },
      "RangeNotSatisfiable": {
        "description": "Range is malformed, repeated, multipart, or does not intersect the representation.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "Content-Range": {
            "description": "Unsatisfied representation size in `bytes */N` form.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PreconditionFailed": {
        "description": "The resource changed since the supplied If-Match ETag was issued. The response ETag is current.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "ETag": {
            "$ref": "#/components/headers/ETag"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RequestTooLarge": {
        "description": "Request body exceeds the endpoint's encoded byte limit.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        }
      },
      "UnsupportedMediaType": {
        "description": "A JSON operation requires application/json or application/*+json.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        }
      },
      "ValidationFailed": {
        "description": "The body is syntactically valid but cannot be applied. validation_failed uses details.fields. agent_baseline_too_large requires the executable AgentBaselineTooLargeDetails shape; referenced_resource_missing can omit details. Consult x-sonus-error-catalog and branch on error.code.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "ETag": {
            "description": "Current aggregate tag when validation required resolving and locking that aggregate; otherwise omitted.",
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "InternalError": {
        "description": "A sanitized storage/dependency failure, recovered panic, audit invariant, response-buffer failure, or middleware configuration fault prevented a valid result. Retain request_id for support correlation. A retry is safe only when the emitted error code's catalog policy says so.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "ETag": {
            "description": "Current aggregate tag when it was resolved before the internal failure; otherwise omitted.",
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "BadGateway": {
        "description": "A configured upstream integration returned an invalid response or could not be reached.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        }
      },
      "GatewayTimeout": {
        "description": "A configured upstream integration exceeded its timeout.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        }
      },
      "ServiceUnavailable": {
        "description": "A required transient dependency, including authentication or the idempotency store, is unavailable. Wait for Retry-After; when the request uses Idempotency-Key, retry with that same value.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit exceeded; see Retry-After.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        }
      },
      "RequestTimeout": {
        "description": "The request body was not received before the server deadline. Retry with the same Idempotency-Key when one was supplied.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestID"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        }
      }
    },
    "schemas": {
      "InferenceUploadPart": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "part_number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 320
          },
          "etag": {
            "type": "string",
            "description": "Opaque S3 part ETag; this is not a whole-file checksum."
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 16777216
          },
          "checksum_sha256": {
            "type": "string",
            "description": "Base64 SHA-256 of this part, when returned by storage."
          }
        },
        "required": [
          "part_number",
          "etag",
          "size_bytes"
        ]
      },
      "InferenceUpload": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "initiating",
              "uploading",
              "completing",
              "ready",
              "aborted",
              "expired"
            ]
          },
          "filename": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5368709120
          },
          "part_size_bytes": {
            "type": "integer",
            "const": 16777216
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InferenceUploadPart"
            }
          }
        },
        "required": [
          "id",
          "status",
          "filename",
          "size_bytes",
          "part_size_bytes",
          "expires_at",
          "parts"
        ]
      },
      "InferenceUploadCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5368709120
          },
          "content_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "required": [
          "filename",
          "size_bytes",
          "content_type"
        ]
      },
      "InferenceUploadPartSign": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "part_number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 320
          },
          "checksum_sha256": {
            "type": "string",
            "pattern": "^[A-Za-z0-9+/]{43}=$",
            "description": "Base64 SHA-256 of the exact part bytes. Each URL binds the part, checksum and expected byte count."
          }
        },
        "required": [
          "part_number",
          "checksum_sha256"
        ]
      },
      "InferenceUploadPartsRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "parts": {
            "type": "array",
            "minItems": 1,
            "maxItems": 4,
            "items": {
              "$ref": "#/components/schemas/InferenceUploadPartSign"
            }
          }
        },
        "required": [
          "parts"
        ]
      },
      "InferenceSignedUploadPart": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "part_number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 320
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Short-lived upload-only URL. Send a PUT directly to this URL without API authorization or cookies."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Required storage request headers. Do not set Content-Length explicitly in browser JavaScript."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "part_number",
          "url",
          "headers",
          "expires_at"
        ]
      },
      "InferenceSignedUploadParts": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InferenceSignedUploadPart"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "InferenceTranscriptionJobCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "upload_id": {
            "type": "string",
            "format": "uuid"
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "language": {
            "type": "string",
            "enum": [
              "ar",
              "en",
              "auto"
            ],
            "default": "ar"
          },
          "timestamp_granularity": {
            "type": "string",
            "enum": [
              "none",
              "chunk",
              "word"
            ],
            "default": "none"
          },
          "webhook_config_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "upload_id",
          "model"
        ]
      },
      "InferenceTranscriptionProgress": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "total_chunks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "completed_chunks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "processed_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18000000
          }
        },
        "required": [
          "total_chunks",
          "completed_chunks",
          "processed_ms"
        ]
      },
      "InferenceTranscriptionJob": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "upload_id": {
            "type": "string",
            "format": "uuid"
          },
          "model": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "enum": [
              "ar",
              "en",
              "auto"
            ]
          },
          "timestamp_granularity": {
            "type": "string",
            "enum": [
              "none",
              "chunk",
              "word"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "validating",
              "awaiting_credits",
              "queued",
              "processing",
              "finalizing",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "phase": {
            "type": "string",
            "description": "Current preparation, capacity, recognition, alignment, finalization or terminal phase."
          },
          "duration_ms": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 18000000
              },
              {
                "type": "null"
              }
            ]
          },
          "progress": {
            "$ref": "#/components/schemas/InferenceTranscriptionProgress"
          },
          "request_id": {
            "oneOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "error_code": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "invalid_audio",
                  "audio_too_long",
                  "audio_too_large",
                  "preparation_failed",
                  "transcription_failed",
                  "alignment_failed",
                  "job_expired",
                  "access_revoked",
                  "model_changed",
                  "cancelled"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deadline_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "result_expires_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "content_expired": {
            "type": "boolean"
          },
          "has_partial_result": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "upload_id",
          "model",
          "language",
          "timestamp_granularity",
          "status",
          "phase",
          "duration_ms",
          "progress",
          "request_id",
          "error_code",
          "created_at",
          "updated_at",
          "deadline_at",
          "completed_at",
          "result_expires_at",
          "content_expired",
          "has_partial_result"
        ]
      },
      "InferenceTranscriptionJobs": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InferenceTranscriptionJob"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string",
                "description": "Opaque cursor for the next page; null at the end."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "InferenceTranscriptionChunk": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0
          },
          "start_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18000000
          },
          "end_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18000000
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "index",
          "start_ms",
          "end_ms",
          "text"
        ]
      },
      "InferenceTranscriptionWord": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0
          },
          "text": {
            "type": "string",
            "description": "Original displayed word with its spelling and punctuation preserved."
          },
          "start_ms": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 18000000
              },
              {
                "type": "null"
              }
            ]
          },
          "end_ms": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 18000000
              },
              {
                "type": "null"
              }
            ]
          },
          "alignment_status": {
            "type": "string",
            "enum": [
              "aligned",
              "unaligned"
            ]
          }
        },
        "required": [
          "index",
          "text",
          "start_ms",
          "end_ms",
          "alignment_status"
        ]
      },
      "InferenceTranscriptionAlignment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "complete",
              "partial"
            ]
          },
          "model_version": {
            "type": "string",
            "description": "Pinned alignment checkpoint and algorithm release."
          },
          "coverage": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "aligned_words": {
            "type": "integer",
            "minimum": 0
          },
          "total_words": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "status",
          "model_version",
          "coverage",
          "aligned_words",
          "total_words"
        ]
      },
      "InferenceTranscriptionResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "model": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "description": "The requested language, or backend language metadata; unklang is not reliable language identification."
          },
          "text": {
            "type": "string"
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18000000
          },
          "timestamp_granularity": {
            "type": "string",
            "enum": [
              "none",
              "chunk",
              "word"
            ]
          },
          "timestamp_source": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "forced_alignment",
                  "chunk"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "chunks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InferenceTranscriptionChunk"
            }
          },
          "words": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InferenceTranscriptionWord"
            }
          },
          "alignment": {
            "$ref": "#/components/schemas/InferenceTranscriptionAlignment"
          },
          "partial": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "model",
          "language",
          "text",
          "duration_ms",
          "timestamp_granularity",
          "timestamp_source",
          "partial"
        ]
      },
      "InferenceModel": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "tts",
              "stt"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "available": {
            "type": "boolean"
          },
          "max_audio_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 600,
            "description": "Longest audio one request may produce. For a TTS model this is an output safety cap; it is not what is charged."
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "sample_rate": {
            "type": "integer",
            "enum": [
              16000
            ]
          },
          "unit": {
            "type": "string",
            "enum": [
              "characters",
              "milliseconds"
            ],
            "description": "What usage of this model is counted in. Text to speech counts input characters (Unicode code points); speech to text counts audio milliseconds."
          },
          "est_chars_per_second": {
            "type": "number",
            "description": "Text to speech only. Estimated input characters per second of generated speech, used for audio-time estimates. It never affects what is charged."
          },
          "supports_async": {
            "type": "boolean",
            "description": "Whether this model currently accepts asynchronous file jobs."
          },
          "async_audio_formats": {
            "type": "array",
            "readOnly": true,
            "description": "Server-computed decoder formats for STT file jobs; empty for TTS. Not an editable mapping input.",
            "items": {
              "type": "string",
              "enum": [
                "wav",
                "rf64",
                "mp3",
                "flac",
                "aac",
                "m4a",
                "ogg",
                "opus"
              ]
            }
          },
          "max_async_audio_seconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18000
          },
          "max_async_upload_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5368709120
          },
          "timestamp_granularities": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "none",
                "chunk",
                "word"
              ]
            }
          },
          "alignment_languages": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "ar",
                "en"
              ]
            }
          },
          "backend_release": {
            "type": "string",
            "description": "Immutable release pinned by async jobs; empty when no release is configured."
          }
        },
        "required": [
          "id",
          "name",
          "display_name",
          "kind",
          "enabled",
          "available",
          "max_audio_seconds",
          "version",
          "sample_rate",
          "unit"
        ]
      },
      "InferenceVoice": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "language_label": {
            "type": "string"
          },
          "gender_label": {
            "type": "string"
          },
          "dialect_label": {
            "type": "string"
          },
          "sub_dialect_label": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "gender": {
            "type": "string"
          },
          "dialect": {
            "type": "string"
          },
          "sub_dialect": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "sample_available": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "language",
          "gender",
          "dialect",
          "sub_dialect",
          "description",
          "sample_available",
          "language_label",
          "gender_label",
          "dialect_label",
          "sub_dialect_label"
        ]
      },
      "InferenceWallet": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "tts",
              "stt"
            ]
          },
          "concurrency": {
            "type": "integer",
            "minimum": 1
          },
          "active": {
            "type": "integer",
            "minimum": 0
          },
          "unit": {
            "type": "string",
            "enum": [
              "characters",
              "milliseconds"
            ],
            "description": "Unit of monthly, balance and reserved. Text to speech is counted in input characters, speech to text in audio milliseconds."
          },
          "monthly": {
            "type": "integer",
            "minimum": 0,
            "description": "Monthly allowance, in `unit`."
          },
          "balance": {
            "type": "integer",
            "minimum": 0,
            "description": "Available credit, in `unit`."
          },
          "reserved": {
            "type": "integer",
            "minimum": 0,
            "description": "Held by running requests, in `unit`."
          },
          "monthly_ms": {
            "type": "integer",
            "minimum": 0,
            "description": "monthly as audio time. Exact for speech to text; an estimate for text to speech (see audio_is_estimate)."
          },
          "balance_ms": {
            "type": "integer",
            "minimum": 0,
            "description": "balance as audio time. Exact for speech to text; an estimate for text to speech (see audio_is_estimate)."
          },
          "reserved_ms": {
            "type": "integer",
            "minimum": 0,
            "description": "reserved as audio time. Exact for speech to text; an estimate for text to speech (see audio_is_estimate)."
          },
          "audio_is_estimate": {
            "type": "boolean",
            "description": "True when the *_ms fields are an estimate from est_chars_per_second (text to speech). Estimates are for display only; usage is counted in `unit`."
          },
          "est_chars_per_second": {
            "type": "number",
            "description": "The speech rate behind the estimate (text to speech only)."
          },
          "reset_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "kind",
          "unit",
          "concurrency",
          "active",
          "monthly",
          "balance",
          "reserved",
          "monthly_ms",
          "balance_ms",
          "reserved_ms",
          "audio_is_estimate",
          "reset_at"
        ]
      },
      "InferenceRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "org_id": {
            "type": "string",
            "format": "uuid"
          },
          "model": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "tts",
              "stt"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "api",
              "playground",
              "sample"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "completed",
              "error",
              "cancelled",
              "interrupted"
            ]
          },
          "unit": {
            "type": "string",
            "enum": [
              "characters",
              "milliseconds"
            ]
          },
          "charged": {
            "type": "integer",
            "minimum": 0,
            "description": "What the request cost, in `unit` (input characters for text to speech, audio milliseconds for speech to text)."
          },
          "audio_ms": {
            "type": "integer",
            "minimum": 0,
            "description": "Audio generated (text to speech). 0 for speech to text, whose charge is its audio duration."
          },
          "charged_ms": {
            "type": "integer",
            "minimum": 0,
            "description": "Deprecated. The charge as audio time. Speech to text, same as charged; text to speech, the audio generated (audio_ms)."
          },
          "first_output_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "latency_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "api_key_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "org_id",
          "model",
          "kind",
          "source",
          "status",
          "unit",
          "charged",
          "audio_ms",
          "charged_ms",
          "first_output_ms",
          "latency_ms",
          "error_code",
          "api_key_id",
          "created_at"
        ]
      },
      "InferenceUsageBucket": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "day": {
            "type": "string",
            "format": "date"
          },
          "kind": {
            "type": "string",
            "enum": [
              "tts",
              "stt"
            ]
          },
          "unit": {
            "type": "string",
            "enum": [
              "characters",
              "milliseconds"
            ]
          },
          "charged": {
            "type": "integer",
            "minimum": 0,
            "description": "Usage in `unit` (input characters for text to speech, audio milliseconds for speech to text)."
          },
          "characters": {
            "type": "integer",
            "minimum": 0,
            "description": "Input characters charged (text to speech; 0 for speech to text)."
          },
          "milliseconds": {
            "type": "integer",
            "minimum": 0,
            "description": "Audio time. Audio generated for text to speech; audio accepted for speech to text."
          },
          "requests": {
            "type": "integer",
            "minimum": 0
          },
          "errors": {
            "type": "integer",
            "minimum": 0
          },
          "first_output_p95_ms": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "day",
          "kind",
          "unit",
          "charged",
          "characters",
          "milliseconds",
          "requests",
          "errors",
          "first_output_p95_ms"
        ]
      },
      "InferenceConcurrencyPoint": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "bucket": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "type": "string",
            "enum": [
              "tts",
              "stt"
            ]
          },
          "peak": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "bucket",
          "kind",
          "peak"
        ]
      },
      "InferenceUsageTotal": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "tts",
              "stt"
            ]
          },
          "unit": {
            "type": "string",
            "enum": [
              "characters",
              "milliseconds"
            ]
          },
          "charged": {
            "type": "integer",
            "minimum": 0,
            "description": "Usage in `unit` (input characters for text to speech, audio milliseconds for speech to text)."
          },
          "characters": {
            "type": "integer",
            "minimum": 0,
            "description": "Input characters charged (text to speech; 0 for speech to text)."
          },
          "milliseconds": {
            "type": "integer",
            "minimum": 0,
            "description": "Audio time. Audio generated for text to speech; audio accepted for speech to text."
          },
          "requests": {
            "type": "integer",
            "minimum": 0
          },
          "errors": {
            "type": "integer",
            "minimum": 0
          },
          "first_output_p95_ms": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "unit",
          "charged",
          "characters",
          "milliseconds",
          "requests",
          "errors",
          "first_output_p95_ms"
        ]
      },
      "InferenceUsage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "days": {
            "type": "integer",
            "enum": [
              1,
              7,
              30
            ]
          },
          "buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InferenceUsageBucket"
            }
          },
          "totals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InferenceUsageTotal"
            }
          },
          "concurrency": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InferenceConcurrencyPoint"
            }
          },
          "concurrency_grain": {
            "type": "string",
            "enum": [
              "hour",
              "day"
            ]
          },
          "requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InferenceRequest"
            }
          },
          "requests_limit": {
            "type": "integer",
            "enum": [
              100
            ]
          }
        },
        "required": [
          "days",
          "buckets",
          "totals",
          "concurrency",
          "concurrency_grain",
          "requests",
          "requests_limit"
        ]
      },
      "InferenceSpeechInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "voice": {
            "type": "string",
            "format": "uuid"
          },
          "input": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8000,
            "description": "The text to speak. Charged by its length in Unicode characters (code points), counted as received, whitespace and punctuation included."
          },
          "max_audio_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 600,
            "description": "Optional cap on the audio produced, a safety limit for runaway output. It does not change what is charged (the input characters), and output cut by the cap is still charged in full once audio has started."
          }
        },
        "required": [
          "model",
          "voice",
          "input"
        ]
      },
      "InferenceTranscriptionInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "file": {
            "type": "string",
            "format": "binary",
            "description": "PCM16 mono 16 kHz WAV. Up to 300 seconds, bounded by the published model."
          },
          "language": {
            "type": "string",
            "enum": [
              "ar",
              "en",
              "auto"
            ],
            "default": "ar"
          }
        },
        "required": [
          "model",
          "file"
        ]
      },
      "InferenceTranscription": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "text": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "description": "Language the model reports. It echoes the requested language, and returns unklang when the request asked for auto."
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 1
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "model": {
            "type": "string"
          }
        },
        "required": [
          "text",
          "language",
          "duration_ms",
          "request_id",
          "model"
        ]
      },
      "InferenceRealtimeInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "language": {
            "description": "Speech-to-text models only; a TTS voice decides its own language.",
            "type": "string",
            "enum": [
              "ar",
              "en",
              "auto"
            ],
            "default": "ar"
          },
          "voice": {
            "type": "string",
            "format": "uuid",
            "description": "Required for a TTS model, refused for a speech-to-text model. An approved voice from GET /inference/voices."
          },
          "max_audio_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 600,
            "description": "Speech-to-text 1–300 (default 60, within the model limit) is the audio the session may accept and is what is reserved. With turn_detection the stream is continuous, so the range is 1–525 (default 300, within the model limit), which ends a real-time stream 15 seconds before the 9-minute session limit with audio_limit_reached; silence counts as audio. Text to speech 1–600 (default 600) is only a cap on the speech produced; it is not what is charged."
          },
          "max_characters": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000,
            "default": 10000,
            "description": "Text to speech only. The character budget reserved for the session, clamped to the available balance. Each speak message is charged by its characters; a message that would pass the budget ends the session with character_limit_reached."
          },
          "turn_detection": {
            "$ref": "#/components/schemas/InferenceTurnDetection"
          }
        },
        "required": [
          "model"
        ]
      },
      "InferenceTurnDetection": {
        "type": "object",
        "additionalProperties": false,
        "description": "Speech to text only. Turn detection lets the model find where each speaker turn starts and ends in a continuous stream, so you do not need your own voice activity detection. Stream audio continuously, silence included. The session sends speech_started and speech_stopped events and one final transcript per turn, with no commit needed; commit still ends the open turn at once. Omit the object to keep the commit-driven session. Unset fields use the model's defaults. Billing is unchanged, on all audio received, silence included. Because the stream is continuous, max_audio_seconds defaults to 300 and accepts up to 525 (within the model limit, so a real-time stream reaches audio_limit_reached before the 9-minute session limit) on a turn-detection session; that is what is reserved.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "semantic",
              "vad"
            ],
            "default": "semantic",
            "description": "semantic asks a turn model whether the speaker has finished once silence_ms of silence has passed, and ends the turn after max_silence_ms regardless. vad ends the turn after silence_ms of silence."
          },
          "silence_ms": {
            "type": "integer",
            "minimum": 100,
            "maximum": 5000,
            "description": "Silence before a verdict (semantic) or before the turn ends (vad)."
          },
          "max_silence_ms": {
            "type": "integer",
            "minimum": 200,
            "maximum": 10000,
            "description": "Semantic backstop. The turn ends after this much silence even if the turn model says the speaker has not finished. Must be at least silence_ms."
          },
          "threshold": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Probability at which the turn model treats the turn as complete (semantic)."
          },
          "min_speech_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2000,
            "description": "Voice needed before a turn opens. Raise it to ignore short noises."
          },
          "prefix_padding_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2000,
            "description": "Audio kept from before the detected start of speech, so the first syllable is not clipped."
          },
          "vad_threshold": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Speech probability above which a frame counts as voice."
          },
          "idle_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Ends an open turn when no audio arrives for this long in wall-clock time. 0 turns it off."
          },
          "no_speech_logprob": {
            "type": "number",
            "minimum": -10,
            "maximum": 0,
            "description": "A turn whose mean token log-probability is below this is reported as no speech, an empty final transcript with no_speech true."
          },
          "incomplete_threshold": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "With semantic turn detection, an end-of-turn probability below this counts as clearly unfinished, so the wait is extended by incomplete_extend_ms. 0 turns it off. Must not exceed threshold."
          },
          "incomplete_extend_ms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Extra silence allowed after the speaker's last word when the end-of-turn model judges the sentence clearly unfinished, for example mid-way through dictating a number."
          }
        }
      },
      "InferenceRealtimeToken": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "token": {
            "type": "string",
            "readOnly": true,
            "x-sonus-one-time-secret": true,
            "x-kejue-one-time-secret": true
          },
          "expires_in": {
            "type": "integer",
            "enum": [
              30
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "stt",
              "tts"
            ],
            "description": "The session the token opens, decided by the model."
          },
          "url": {
            "type": "string",
            "description": "Absolute wss:// URL of the live socket; append ?token=…"
          }
        },
        "required": [
          "token",
          "expires_in",
          "url",
          "kind"
        ]
      },
      "AlertDefinition": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "min_coverage_percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 80,
            "description": "Minimum successful processing coverage, in percent, for extraction result rules. Incomplete coverage cannot resolve incidents. 0 (or omitting the field) means the default of 80; a stored 0 is omitted from responses."
          },
          "metric": {
            "type": "string",
            "enum": [
              "tool_5xx",
              "tool_timeout",
              "tool_failure",
              "webhook_failure",
              "webhook_terminal",
              "webhook_backlog",
              "extraction_failure",
              "extraction_backlog",
              "extraction_result",
              "call_failure",
              "call_route_failure",
              "call_unanswered",
              "trunk_registration",
              "outbound_redial_loop",
              "campaign_auto_paused",
              "dncr_provider_failure",
              "dncr_rate_limited",
              "dncr_registered",
              "dncr_unresolved",
              "dncr_connection"
            ],
            "description": "Signal to watch. trunk_registration, outbound_redial_loop, campaign_auto_paused, dncr_unresolved, dncr_connection and the backlog signals support count aggregation only. For call, trunk and outbound signals resource_keys are SIP trunk IDs; DNCR and campaign signals take no resource_keys."
          },
          "campaign_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 20,
            "uniqueItems": true,
            "description": "Campaigns to watch. Only for call_failure, call_route_failure, call_unanswered, outbound_redial_loop, campaign_auto_paused and the dncr_ signals; omitted or empty means every campaign and non-campaign call."
          },
          "failure_codes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "provider_busy",
                "provider_no_answer",
                "provider_rejected",
                "provider_capacity",
                "provider_rate_limited",
                "provider_route_unavailable",
                "caller_id_invalid",
                "provider_authentication",
                "provider_unknown",
                "destination_invalid",
                "provider_forbidden",
                "agent_dispatch_timeout",
                "agent_crash",
                "media_pipeline_error",
                "caller_hangup_pre_answer",
                "unknown"
              ]
            },
            "maxItems": 16,
            "uniqueItems": true,
            "description": "Only for call_failure. Counts only failed calls with one of these failure codes; omitted or empty counts every failure."
          },
          "aggregation": {
            "type": "string",
            "enum": [
              "rate",
              "count"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "warning",
              "critical"
            ]
          },
          "resource_keys": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "maxItems": 20
          },
          "agent_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 20,
            "uniqueItems": true
          },
          "window_minutes": {
            "type": "integer",
            "enum": [
              5,
              10,
              15,
              30,
              60,
              180,
              1440
            ]
          },
          "threshold": {
            "type": "number",
            "minimum": 0
          },
          "recovery_threshold": {
            "type": "number",
            "minimum": 0
          },
          "min_samples": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "fire_for_minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 60
          },
          "recover_for_minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 60
          },
          "recipient_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "minItems": 1,
            "maxItems": 20,
            "uniqueItems": true
          },
          "include_tests": {
            "type": "boolean"
          },
          "field": {
            "type": "string",
            "maxLength": 120
          },
          "operator": {
            "type": "string",
            "enum": [
              "eq",
              "neq",
              "gt",
              "lt",
              "missing"
            ]
          },
          "expected": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          }
        },
        "required": [
          "metric",
          "aggregation",
          "severity",
          "resource_keys",
          "agent_ids",
          "window_minutes",
          "threshold",
          "recovery_threshold",
          "min_samples",
          "fire_for_minutes",
          "recover_for_minutes",
          "recipient_ids",
          "include_tests"
        ]
      },
      "AlertRule": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "org_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "definition": {
            "$ref": "#/components/schemas/AlertDefinition"
          },
          "enabled": {
            "type": "boolean"
          },
          "resource_version": {
            "type": "integer"
          },
          "state": {
            "type": "string",
            "enum": [
              "healthy",
              "pending",
              "firing",
              "recovering",
              "insufficient_data",
              "error",
              "paused"
            ]
          },
          "value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "numerator": {
            "type": "integer"
          },
          "denominator": {
            "type": "integer"
          },
          "breach_since": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "recovery_since": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "evaluated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "archived_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "org_id",
          "name",
          "definition",
          "enabled",
          "resource_version",
          "state",
          "value",
          "numerator",
          "denominator",
          "breach_since",
          "recovery_since",
          "evaluated_at",
          "last_error",
          "archived_at",
          "created_at",
          "updated_at"
        ]
      },
      "AlertCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "definition": {
            "$ref": "#/components/schemas/AlertDefinition"
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "definition"
        ]
      },
      "AlertUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "definition": {
            "$ref": "#/components/schemas/AlertDefinition"
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "minProperties": 1
      },
      "AlertListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertRule"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "AlertSample": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "numerator": {
            "type": "integer"
          },
          "denominator": {
            "type": "integer"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "at",
          "value",
          "numerator",
          "denominator",
          "state"
        ]
      },
      "AlertPreviewResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertSample"
            }
          },
          "coverage_note": {
            "type": "string"
          }
        },
        "required": [
          "data",
          "coverage_note"
        ]
      },
      "AlertRecipient": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          }
        },
        "required": [
          "id",
          "name",
          "email"
        ]
      },
      "AlertRecipientsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertRecipient"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "AlertTemplate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "metric": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "permission": {
            "type": "string"
          }
        },
        "required": [
          "metric",
          "label",
          "description",
          "source",
          "permission"
        ]
      },
      "AlertPreset": {
        "type": "object",
        "additionalProperties": false,
        "description": "A ready-made rule. Its definition has no recipients or scope; the caller adds them before creating the rule.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "definition": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "metric": {
                "type": "string"
              },
              "aggregation": {
                "type": "string",
                "enum": [
                  "rate",
                  "count"
                ]
              },
              "severity": {
                "type": "string",
                "enum": [
                  "warning",
                  "critical"
                ]
              },
              "resource_keys": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "maxItems": 0
              },
              "agent_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "maxItems": 0
              },
              "window_minutes": {
                "type": "integer"
              },
              "threshold": {
                "type": "number"
              },
              "recovery_threshold": {
                "type": "number"
              },
              "min_samples": {
                "type": "integer"
              },
              "fire_for_minutes": {
                "type": "integer"
              },
              "recover_for_minutes": {
                "type": "integer"
              },
              "recipient_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "maxItems": 0
              },
              "include_tests": {
                "type": "boolean"
              }
            },
            "required": [
              "metric",
              "aggregation",
              "severity",
              "window_minutes",
              "threshold",
              "recovery_threshold",
              "min_samples",
              "fire_for_minutes",
              "recover_for_minutes"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "definition"
        ]
      },
      "AlertSchemaResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertTemplate"
            }
          },
          "presets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertPreset"
            }
          },
          "failure_codes": {
            "type": "array",
            "description": "Call failure codes call_failure rules may be narrowed to.",
            "items": {
              "type": "string"
            }
          },
          "windows": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "max_rules": {
            "type": "integer"
          },
          "max_recipients": {
            "type": "integer"
          }
        },
        "required": [
          "templates",
          "presets",
          "failure_codes",
          "windows",
          "max_rules",
          "max_recipients"
        ]
      },
      "AlertIncident": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "rule_id": {
            "type": "string",
            "format": "uuid"
          },
          "rule_version": {
            "type": "integer"
          },
          "rule_snapshot": {
            "$ref": "#/components/schemas/AlertRule"
          },
          "opened_at": {
            "type": "string",
            "format": "date-time"
          },
          "closed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "close_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "initial_value": {
            "type": "number"
          },
          "peak_value": {
            "type": "number"
          },
          "numerator": {
            "type": "integer"
          },
          "denominator": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "rule_id",
          "rule_version",
          "rule_snapshot",
          "opened_at",
          "closed_at",
          "close_reason",
          "initial_value",
          "peak_value",
          "numerator",
          "denominator"
        ]
      },
      "AlertIncidentListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertIncident"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "AlertNotification": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "event": {
            "type": "string",
            "enum": [
              "firing",
              "resolved",
              "test"
            ]
          },
          "recipient_name": {
            "type": "string"
          },
          "recipient_email": {
            "type": "string"
          },
          "user_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "sending",
              "sent",
              "skipped",
              "failed"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "sent_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "event",
          "user_id",
          "recipient_name",
          "recipient_email",
          "status",
          "attempts",
          "error_code",
          "created_at",
          "sent_at"
        ]
      },
      "AlertIncidentDetailResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "incident": {
            "$ref": "#/components/schemas/AlertIncident"
          },
          "notifications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertNotification"
            }
          }
        },
        "required": [
          "incident",
          "notifications"
        ]
      },
      "Error": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message",
              "request_id"
            ],
            "properties": {
              "code": {
                "$ref": "#/components/schemas/ErrorCode"
              },
              "message": {
                "type": "string",
                "minLength": 1,
                "description": "Human-readable summary. Automation must branch on code, not this text."
              },
              "request_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "description": "Always equals the X-Request-Id response header."
              },
              "feature": {
                "type": "string",
                "description": "Compatibility mirror of details.feature, emitted only for entitlement_required."
              },
              "details": {
                "$ref": "#/components/schemas/PublicErrorDetails"
              }
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/AgentBaselineTooLargeErrorVariant"
              },
              {
                "$ref": "#/components/schemas/AgentSlugTakenErrorVariant"
              },
              {
                "$ref": "#/components/schemas/GuardrailSetInUseErrorVariant"
              },
              {
                "$ref": "#/components/schemas/GenericPublicErrorVariant"
              }
            ]
          }
        }
      },
      "AgentBaselineTooLargeErrorVariant": {
        "type": "object",
        "description": "Executable specialization selected only by code=agent_baseline_too_large.",
        "properties": {
          "code": {
            "type": "string",
            "const": "agent_baseline_too_large"
          },
          "details": {
            "$ref": "#/components/schemas/AgentBaselineTooLargeDetails"
          }
        },
        "required": [
          "code",
          "details"
        ]
      },
      "AgentBaselineTooLargeDetails": {
        "type": "object",
        "additionalProperties": false,
        "description": "Admission-control measurement at the rejected candidate. Reduce system prompt content or assigned/materialized tools until baseline_tokens is no greater than max_model_len (the usable budget), then retry with the latest aggregate ETag. system_tokens and tools_tokens are present when a draft save or activation is rejected; a call-start rejection (web call, test call, outbound) reads only the persisted total and omits them.",
        "properties": {
          "baseline_tokens": {
            "type": "integer",
            "minimum": 1
          },
          "max_model_len": {
            "type": "integer",
            "minimum": 0,
            "description": "Usable token budget for the system prompt plus tools — 80% of model_context_limit, the rest is reserved for the conversation. This is the number the dashboard shows."
          },
          "model_context_limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Raw deployment model context length the budget derives from."
          },
          "headroom_budget": {
            "type": "integer",
            "minimum": 0,
            "deprecated": true,
            "description": "Compatibility alias; always equals max_model_len."
          },
          "system_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "tools_tokens": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "baseline_tokens",
          "max_model_len",
          "model_context_limit",
          "headroom_budget"
        ]
      },
      "AgentSlugTakenErrorVariant": {
        "type": "object",
        "description": "Executable specialization selected only by code=slug_taken. The historical component name is retained for generated-client compatibility; the shape is shared by agent and JSON-catalog slugs, including guardrail sets.",
        "properties": {
          "code": {
            "type": "string",
            "const": "slug_taken"
          },
          "details": {
            "$ref": "#/components/schemas/AgentSlugTakenDetails"
          }
        },
        "required": [
          "code",
          "details"
        ]
      },
      "AgentSlugTakenDetails": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "field": {
            "type": "string",
            "const": "slug"
          },
          "value": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9_-]+$",
            "description": "Normalized slug that collided with an existing resource. Agent slugs use the narrower 48-character underscore-only subset; guardrail-set slugs can also contain hyphens and contain at most 64 characters."
          }
        },
        "required": [
          "field",
          "value"
        ]
      },
      "GenericPublicErrorVariant": {
        "type": "object",
        "description": "Every public error other than the two agent-specialized variants.",
        "properties": {
          "code": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ErrorCode"
              },
              {
                "not": {
                  "enum": [
                    "agent_baseline_too_large",
                    "guardrail_set_in_use",
                    "slug_taken"
                  ]
                }
              }
            ]
          }
        },
        "required": [
          "code"
        ]
      },
      "PIIAccessApprovalRequiredDetails": {
        "description": "Details for pii_access_approval_required. Exactly one subject is present. A call grant cannot authorize a transcription job or vice versa.",
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "call_id": {
                "type": "string",
                "format": "uuid"
              },
              "request_status": {
                "type": "string",
                "enum": [
                  "none",
                  "pending",
                  "approved",
                  "rejected",
                  "expired",
                  "revoked"
                ]
              },
              "request_id": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "call_id",
              "request_status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "inference_job_id": {
                "type": "string",
                "format": "uuid"
              },
              "request_status": {
                "type": "string",
                "enum": [
                  "none",
                  "pending",
                  "approved",
                  "rejected",
                  "expired",
                  "revoked"
                ]
              },
              "request_id": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "inference_job_id",
              "request_status"
            ]
          }
        ]
      },
      "PublicErrorDetails": {
        "type": "object",
        "additionalProperties": true,
        "description": "Code-specific structured details. The properties below cover every normalized middleware contract; domain codes marked optional_object or polymorphic_object in x-sonus-error-catalog can add documented fields. Use the catalog's details discriminator to select the applicable shape. For pii_access_approval_required, PIIAccessApprovalRequiredDetails documents the exact call-or-transcription subject union.",
        "properties": {
          "internal": {
            "type": "string",
            "maxLength": 2049,
            "description": "The underlying cause of the failure (upstream status and reason, database error class, provider message), scrubbed of credentials and personal data. Present on server errors and on any error whose cause is known. Intended for operators and support tickets; automation must branch on code."
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldError"
            }
          },
          "feature": {
            "type": "string"
          },
          "header": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "received": {
            "type": "string"
          },
          "parameter": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "retry_after_seconds": {
            "type": "integer",
            "minimum": 1
          },
          "retryable": {
            "type": "boolean"
          },
          "call_id": {
            "type": "string",
            "format": "uuid",
            "description": "Call subject for sensitive-content approval failures."
          },
          "inference_job_id": {
            "type": "string",
            "format": "uuid",
            "description": "Transcription job subject for sensitive-content approval failures; replaces call_id."
          },
          "request_status": {
            "type": "string",
            "description": "Approval request state when pii_access_approval_required is returned."
          },
          "request_id": {
            "type": "string",
            "description": "Existing sensitive-content access request identity, when one is available."
          }
        }
      },
      "FieldError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path",
          "code",
          "message"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ValidationDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "fields"
        ],
        "properties": {
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldError"
            }
          }
        }
      },
      "AIConnectorsMode": {
        "type": "string",
        "enum": [
          "enabled",
          "read_only",
          "disabled"
        ],
        "description": "Whether members may connect AI assistants (Claude and other MCP clients) to this team through OAuth. `enabled` — a connected app acts as the member, limited by their role and the scopes they approved; `read_only` — connected apps keep only read access; `disabled` — every connected-app request for this team is refused with `ai_connectors_disabled`. Teams with a signed BAA start `disabled`. Changing it requires `org:update`."
      },
      "OAuthScope": {
        "type": "string",
        "enum": [
          "read",
          "build",
          "deploy",
          "calls",
          "pii",
          "admin"
        ],
        "description": "Consent scope a member approved for a connected app. `read` — every read; `build` — create/edit agents, tools, evals and other resources, promote to staging; `deploy` — production deploys; `calls` — place calls, run tools against real systems, control live calls; `pii` — unmasked data; `admin` — team administration and destructive call operations. Effective access is always the member's current role in the team intersected with these scopes."
      },
      "ConnectedAppUser": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "display_name"
        ]
      },
      "ConnectedApp": {
        "type": "object",
        "additionalProperties": false,
        "description": "An OAuth grant that reaches this team.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "client_id": {
            "type": "string",
            "description": "OAuth client identifier — an https Client ID Metadata Document URL, or an identifier issued by dynamic registration."
          },
          "client_name": {
            "type": "string",
            "description": "Client name the member saw on the consent screen, e.g. Claude."
          },
          "client_uri": {
            "description": "Client home page, or null when the client did not publish one.",
            "oneOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "user": {
            "$ref": "#/components/schemas/ConnectedAppUser"
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OAuthScope"
            }
          },
          "all_teams": {
            "type": "boolean",
            "description": "True when the member approved all of their teams, including teams they join later. Such a grant reaches this team because the member belongs to it; removing this team keeps it excluded even if the member leaves and rejoins, while the grant keeps working in the member's other teams."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "description": "Last request made with this grant, or null when unused.",
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "client_id",
          "client_name",
          "client_uri",
          "user",
          "scopes",
          "all_teams",
          "created_at",
          "last_used_at"
        ]
      },
      "ConnectedAppListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConnectedApp"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cursor for the next page, or null after the final page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "AuthOAuthContextResponse": {
        "type": "object",
        "additionalProperties": false,
        "description": "Context visible to a connected app (OAuth access token). The app acts as the member; `memberships` lists only the teams the member approved for this app and still belongs to (for an all-teams grant, every team the member belongs to now, minus any a team admin removed and any whose single sign-on or two-factor requirement the member does not meet). Select a team per request with the `Sonus-Org-Id` header; without it the request runs in the default team.",
        "properties": {
          "principal": {
            "$ref": "#/components/schemas/AuthOAuthPrincipal"
          },
          "user": {
            "$ref": "#/components/schemas/ConnectedAppUser"
          },
          "org_id": {
            "type": "string",
            "format": "uuid",
            "description": "Team this request ran in."
          },
          "current_org": {
            "$ref": "#/components/schemas/AuthOAuthCurrentOrganization"
          },
          "permissions": {
            "$ref": "#/components/schemas/AuthPermissionList"
          },
          "memberships": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuthOAuthMembership"
            }
          },
          "tenancy_mode": {
            "$ref": "#/components/schemas/AuthTenancyMode"
          },
          "via_api_key": {
            "type": "boolean",
            "const": false
          },
          "entitlements": {
            "$ref": "#/components/schemas/AuthEntitlements"
          },
          "baa": {
            "$ref": "#/components/schemas/AuthBAAStatus"
          }
        },
        "required": [
          "principal",
          "user",
          "org_id",
          "current_org",
          "permissions",
          "memberships",
          "tenancy_mode",
          "via_api_key",
          "entitlements",
          "baa"
        ]
      },
      "AuthOAuthPrincipal": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "const": "oauth"
          },
          "grant_id": {
            "type": "string",
            "format": "uuid"
          },
          "client_id": {
            "type": "string"
          },
          "client_name": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OAuthScope"
            }
          },
          "all_teams": {
            "type": "boolean",
            "description": "True when the member approved all of their teams, including teams they join later. `memberships` then lists every team the member currently belongs to that the app may use, and changes as the member joins or leaves teams, without reconnecting."
          }
        },
        "required": [
          "type",
          "grant_id",
          "client_id",
          "client_name",
          "scopes",
          "all_teams"
        ]
      },
      "AuthOAuthCurrentOrganization": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "retention_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3650
          },
          "default_timezone": {
            "type": "string"
          },
          "pii_access_mode": {
            "type": "string",
            "enum": [
              "open",
              "reason",
              "approval"
            ]
          },
          "pii_access_grant_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365
          },
          "ai_connectors": {
            "$ref": "#/components/schemas/AIConnectorsMode"
          },
          "role": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "role_id": {
            "oneOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "retention_days",
          "default_timezone",
          "pii_access_mode",
          "pii_access_grant_days",
          "ai_connectors",
          "role",
          "role_id"
        ]
      },
      "AuthOAuthMembership": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "org_id": {
            "type": "string",
            "format": "uuid"
          },
          "org_name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "ai_connectors": {
            "$ref": "#/components/schemas/AIConnectorsMode"
          },
          "default": {
            "type": "boolean",
            "description": "True for the team requests run in without a Sonus-Org-Id header."
          }
        },
        "required": [
          "org_id",
          "org_name",
          "role",
          "ai_connectors",
          "default"
        ]
      },
      "AuthContextResponse": {
        "description": "Authentication and workspace context. `via_api_key` narrows API keys; a connected app (OAuth) carries `principal.type` = `oauth`.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/AuthAPIKeyContextResponse"
          },
          {
            "$ref": "#/components/schemas/AuthSessionContextResponse"
          },
          {
            "$ref": "#/components/schemas/AuthOAuthContextResponse"
          }
        ]
      },
      "AuthAPIKeyContextResponse": {
        "type": "object",
        "additionalProperties": false,
        "description": "Delegated context visible to an API key. Human memberships and administrative identity are intentionally absent.",
        "properties": {
          "principal": {
            "$ref": "#/components/schemas/AuthAPIKeyPrincipal"
          },
          "current_org": {
            "$ref": "#/components/schemas/AuthAPIKeyCurrentOrganization"
          },
          "org_id": {
            "type": "string",
            "format": "uuid",
            "description": "Workspace the API key is permanently bound to."
          },
          "permissions": {
            "$ref": "#/components/schemas/AuthPermissionList"
          },
          "scopes": {
            "$ref": "#/components/schemas/AuthPermissionList"
          },
          "tenancy_mode": {
            "$ref": "#/components/schemas/AuthTenancyMode"
          },
          "via_api_key": {
            "type": "boolean",
            "const": true
          },
          "entitlements": {
            "$ref": "#/components/schemas/AuthEntitlements"
          },
          "baa": {
            "$ref": "#/components/schemas/AuthBAAStatus"
          }
        },
        "required": [
          "principal",
          "current_org",
          "org_id",
          "permissions",
          "scopes",
          "tenancy_mode",
          "via_api_key",
          "entitlements",
          "baa"
        ]
      },
      "AuthSessionContextResponse": {
        "type": "object",
        "additionalProperties": false,
        "description": "Human session context, including memberships across workspaces.",
        "properties": {
          "user": {
            "$ref": "#/components/schemas/AuthUser"
          },
          "current_org": {
            "$ref": "#/components/schemas/AuthSessionCurrentOrganization"
          },
          "permissions": {
            "$ref": "#/components/schemas/AuthPermissionList"
          },
          "memberships": {
            "type": "array",
            "description": "All workspaces the user can switch to, sorted by workspace name.",
            "items": {
              "$ref": "#/components/schemas/AuthMembership"
            }
          },
          "tenancy_mode": {
            "$ref": "#/components/schemas/AuthTenancyMode"
          },
          "via_api_key": {
            "type": "boolean",
            "const": false
          },
          "entitlements": {
            "$ref": "#/components/schemas/AuthEntitlements"
          },
          "baa": {
            "$ref": "#/components/schemas/AuthBAAStatus"
          },
          "account_admin": {
            "description": "Account-level administration context, or null when the user is not an account administrator.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/AuthAccountAdmin"
              },
              {
                "type": "null"
              }
            ]
          },
          "mfa": {
            "$ref": "#/components/schemas/AuthMFAContext"
          },
          "must_change_password": {
            "type": "boolean",
            "description": "True when an administrator set a temporary password for this user. The session is confined to the change-password endpoint (every other route answers 403 `password_change_required`) until they choose their own password."
          }
        },
        "required": [
          "user",
          "current_org",
          "permissions",
          "memberships",
          "tenancy_mode",
          "via_api_key",
          "entitlements",
          "baa",
          "account_admin",
          "mfa",
          "must_change_password"
        ]
      },
      "AuthMFAContext": {
        "type": "object",
        "additionalProperties": false,
        "description": "The signed-in user's second-factor state, so a client can route to enrollment and render security settings without another round trip.",
        "properties": {
          "enrolled": {
            "type": "boolean",
            "description": "True when the user has a CONFIRMED authenticator. An enrollment that was started but never confirmed is not enrolled."
          },
          "policy": {
            "type": "string",
            "enum": [
              "off",
              "optional",
              "required"
            ],
            "description": "The current workspace's second-factor requirement."
          },
          "enrollment_required": {
            "type": "boolean",
            "description": "True when this session is confined to the enrollment endpoints because the workspace requires a factor the user has not set up yet. Every other route answers 403 `mfa_enrollment_required`."
          }
        },
        "required": [
          "enrolled",
          "policy",
          "enrollment_required"
        ]
      },
      "AuthAPIKeyPrincipal": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "const": "api_key"
          },
          "api_key_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Human label assigned when the key was created."
          },
          "prefix": {
            "type": "string",
            "description": "Non-secret key prefix safe to log and display."
          },
          "expires_at": {
            "description": "Expiration instant, or null for a non-expiring key.",
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_by_user_id": {
            "description": "Creating user, or null for a legacy or system-created key.",
            "oneOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "type",
          "api_key_id",
          "name",
          "prefix",
          "expires_at",
          "created_by_user_id"
        ]
      },
      "AuthAPIKeyCurrentOrganization": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "retention_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3650
          },
          "default_timezone": {
            "type": "string",
            "description": "IANA timezone used when an outbound workflow omits its timezone."
          },
          "pii_access_mode": {
            "type": "string",
            "enum": [
              "open",
              "reason",
              "approval"
            ],
            "description": "Friction in front of un-redacted reads of call data, so the dashboard knows whether to prompt for a reason, open a request, or reveal outright before any call is opened."
          },
          "pii_access_grant_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365,
            "description": "Lifetime in days of an approved break-glass request; 0 never expires."
          }
        },
        "required": [
          "id",
          "name",
          "retention_days",
          "default_timezone",
          "pii_access_mode",
          "pii_access_grant_days"
        ]
      },
      "AuthSessionCurrentOrganization": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "retention_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3650
          },
          "default_timezone": {
            "type": "string",
            "description": "IANA timezone used when an outbound workflow omits its timezone."
          },
          "pii_access_mode": {
            "type": "string",
            "enum": [
              "open",
              "reason",
              "approval"
            ],
            "description": "Friction in front of un-redacted reads of call data, so the dashboard knows whether to prompt for a reason, open a request, or reveal outright before any call is opened."
          },
          "pii_access_grant_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365,
            "description": "Lifetime in days of an approved break-glass request; 0 never expires."
          },
          "role": {
            "description": "Current membership role name, or null for an account/platform administrator without a workspace membership.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "role_id": {
            "description": "Current role resource ID, or null without a workspace membership.",
            "oneOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "retention_days",
          "default_timezone",
          "pii_access_mode",
          "pii_access_grant_days",
          "role",
          "role_id"
        ]
      },
      "AuthUser": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "display_name": {
            "type": "string"
          },
          "is_platform_admin": {
            "type": "boolean"
          },
          "disabled_at": {
            "description": "Disablement instant, or null while the user is active.",
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "disabled_reason": {
            "description": "Operator-provided reason, or null when none is recorded.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "email",
          "display_name",
          "is_platform_admin",
          "disabled_at",
          "disabled_reason"
        ]
      },
      "AuthMembership": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "org_id": {
            "type": "string",
            "format": "uuid"
          },
          "org_name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "System or custom role name in this workspace."
          }
        },
        "required": [
          "org_id",
          "org_name",
          "role"
        ]
      },
      "AuthPermissionList": {
        "type": "array",
        "maxItems": 256,
        "uniqueItems": true,
        "items": {
          "type": "string",
          "pattern": "^(\\*|[a-z][a-z0-9_-]*:(\\*|[a-z][a-z0-9_-]*))$"
        }
      },
      "AuthTenancyMode": {
        "type": "string",
        "enum": [
          "single",
          "multi"
        ]
      },
      "AuthEntitlements": {
        "type": "object",
        "additionalProperties": false,
        "description": "Complete stable entitlement catalog for the current workspace.",
        "properties": {
          "inference": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "alerts": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "audit_log_export": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "pii_redaction_config": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "legal_hold": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "custom_retention": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "llm_observability_content": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "mfa": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "pathways": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "evals": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "guardrails": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "human_call_ingest": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "campaigns": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "sso": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "flows": {
            "$ref": "#/components/schemas/AuthEntitlement"
          },
          "groups": {
            "$ref": "#/components/schemas/AuthEntitlement"
          }
        },
        "required": [
          "audit_log_export",
          "pii_redaction_config",
          "legal_hold",
          "custom_retention",
          "llm_observability_content",
          "mfa",
          "pathways",
          "evals",
          "guardrails",
          "human_call_ingest",
          "campaigns",
          "sso",
          "flows",
          "groups",
          "inference"
        ]
      },
      "AuthEntitlement": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "config": {
            "description": "Optional feature-specific JSON configuration. Its shape is defined by the named entitlement rather than interpreted generically."
          }
        },
        "required": [
          "enabled"
        ]
      },
      "AuthBAAStatus": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "signed": {
            "type": "boolean"
          },
          "signed_at": {
            "description": "Signature instant, or null when no BAA is recorded.",
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "ref": {
            "description": "Contract reference, or null when none is recorded.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "signed",
          "signed_at",
          "ref"
        ]
      },
      "AuthAccountAdmin": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "account_id",
          "name",
          "slug"
        ]
      },
      "ArchiveResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "status"
        ]
      },
      "CreatedResource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "status"
        ]
      },
      "AfterCallConfig": {
        "type": "object",
        "additionalProperties": false,
        "description": "Complete after-call behavior for one agent version. Nullable fields are always present. A virtual default has id, summary_prompt, created_at, and updated_at set to null and version 0.",
        "properties": {
          "id": {
            "description": "Persisted configuration ID, or null when the response is a virtual default.",
            "oneOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "agent_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "summary_enabled": {
            "type": "boolean"
          },
          "summary_prompt": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 50000
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom summary prompt, or null to use the system default."
          },
          "extraction_object_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "webhook_config_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "Strong resource version. Zero is reserved for a virtual default; persisted configurations start at one."
          },
          "created_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "agent_version_id",
          "summary_enabled",
          "summary_prompt",
          "extraction_object_ids",
          "webhook_config_ids",
          "version",
          "created_at",
          "updated_at"
        ]
      },
      "AfterCallPatchRequest": {
        "type": "object",
        "minProperties": 1,
        "additionalProperties": false,
        "properties": {
          "summary_enabled": {
            "type": "boolean"
          },
          "summary_prompt": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 50000
              },
              {
                "type": "null"
              }
            ],
            "description": "Whitespace is trimmed. Send null or an empty string to restore the system-default summary prompt."
          },
          "extraction_object_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 100,
            "uniqueItems": true,
            "description": "Complete set of active extraction objects to attach. Send [] to clear all."
          },
          "webhook_config_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 100,
            "uniqueItems": true,
            "description": "Complete set of non-archived webhook configurations to attach. Send [] to clear all."
          }
        }
      },
      "AgentBaselineEstimateRequest": {
        "description": "Read-only candidate patch with exactly the same closed authoring shape and merge semantics as PATCH /agents/{id}/draft. Omitted fields are loaded from the current persisted draft; therefore {} estimates that draft unchanged. When the agent has no draft, the request must supply prompt so a complete in-memory candidate can be assembled. The server performs the same template, catalog-reference, provider, transfer, topology, and baseline checks as a draft save but performs no write and emits no audit event.",
        "allOf": [
          {
            "$ref": "#/components/schemas/AgentDraftSaveRequest"
          }
        ]
      },
      "AgentBaselineEstimateResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "baseline_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "max_model_len": {
            "type": "integer",
            "minimum": 0,
            "description": "Usable token budget for the system prompt plus tools — 80% of model_context_limit, the rest is reserved for the conversation. A draft save is rejected when baseline_tokens exceeds it. This is the number the dashboard shows."
          },
          "model_context_limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Raw deployment model context length the budget derives from."
          },
          "headroom_budget": {
            "type": "integer",
            "minimum": 0,
            "deprecated": true,
            "description": "Compatibility alias; always equals max_model_len."
          },
          "components": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "system": {
                "type": "integer",
                "minimum": 0
              },
              "tools": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "system",
              "tools"
            ]
          }
        },
        "required": [
          "baseline_tokens",
          "max_model_len",
          "model_context_limit",
          "headroom_budget",
          "components"
        ]
      },
      "AgentPromptTemplate": {
        "type": "string",
        "maxLength": 500000,
        "description": "Prompt-mode runtime template. Each expression is one variable reference between balanced {{ and }} delimiters; whitespace immediately inside the delimiters is allowed. Bare aliases such as {{lead_name}} and explicit {{vars.lead_name}} references resolve from the same per-call variable map. Bare and vars names must match ^[A-Za-z_][A-Za-z0-9_]{0,63}$. Operator variables override the built-in bare aliases call_id, agent_slug, caller_phone, and caller_phone_number. {{system.NAME}} accepts a 1–128 character name whose first segment starts with a letter or underscore and whose non-empty dot-separated segments contain letters, digits, underscores, or hyphens. Stable system names are call_id, session_id, org_id, agent_id, agent_slug, agent_version_id, pathway_id, current_node_id, caller_phone, caller_phone_number, locale, lead_timezone, timestamp_iso, and timestamp_ms. Dynamic system.sip.* names expose SIP participant attributes, including system.sip.h.x-<header>; system.timezone.lead uses the valid IANA zone in the lead_timezone call variable; and system.timezone.<iana-slug> converts an IANA zone to lowercase hyphen form (Asia/Dubai becomes asia-dubai and + / - become plus / minus). Missing but syntactically valid vars/system values render as the empty string. {{tools.SLUG}} and {{tools.SLUG.NAME}} render the results of the agent's pre-call tools (behavior.tools.pre_call), which run once before the agent speaks: SLUG is the tool slug (a letter or underscore, then up to 47 letters, digits, or underscores) and NAME is a key of that tool's response mapping; bare {{tools.SLUG}} is the whole response body, JSON-encoded when structured. A tool that failed, did not run, or lacks the name renders the empty string. The same contract applies to behavior.opening.greeting.instructions, which is rendered per call before the opening line is generated. The tools scope is available in this prompt and in behavior.opening.greeting.instructions only. slots is unavailable in top-level prompt mode and in greeting instructions. params and secrets are forbidden, unknown scopes are rejected, and malformed or unmatched delimiters return 422 validation_failed."
      },
      "AgentWorkflowPromptTemplate": {
        "type": "string",
        "maxLength": 500000,
        "description": "Pathway prompt template for workflow.global_prompt and workflow.nodes[].prompt. It supports the complete AgentPromptTemplate contract plus {{slots.NAME}}. A slot reference name must match ^[A-Za-z_][A-Za-z0-9_]{0,127}$ and must be defined anywhere in the graph by nodes[].slots[].name, a wait.bind_to_slot, or a tool.response_bindings key; an undefined reference is rejected at authoring time. A defined slot that has no value yet renders as the empty string. Bare aliases and vars/system scopes behave exactly as in AgentPromptTemplate. params and secrets remain forbidden, and the pre-call tools scope is rejected because the pathway engine does not render it."
      },
      "AgentScopedWorkflowTemplate": {
        "type": "string",
        "description": "Scoped pathway runtime template used by transfer destination and announcement fields. Every expression must use slots.NAME, vars.NAME, or system.NAME; bare aliases are rejected here. Names, dynamic SIP/timezone behavior, missing-value rendering, balanced delimiters, and params/secrets restrictions are exactly those documented by AgentPromptTemplate and AgentWorkflowPromptTemplate. Referenced slots must be defined somewhere in the same graph before the workflow can be saved."
      },
      "AgentCloneRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "slug",
          "source"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Display name for the copy."
          },
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 48,
            "pattern": "^[a-z0-9_]+$",
            "description": "Unique routing identifier for the copy."
          },
          "source": {
            "type": "string",
            "enum": [
              "draft",
              "staging",
              "production"
            ],
            "description": "Version to copy. The request fails if the selected version is unavailable."
          }
        }
      },
      "AgentCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 48,
            "pattern": "^[a-z0-9_]+$",
            "description": "Stable routing identifier. It cannot be renamed after creation."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "mode": {
            "type": "string",
            "enum": [
              "prompt"
            ]
          },
          "prompt": {
            "$ref": "#/components/schemas/AgentPromptTemplate",
            "description": "Optional initial prompt template. Omit, send an empty string, or send only whitespace to seed the platform default. See AgentPromptTemplate for the complete variable contract."
          }
        },
        "required": [
          "slug",
          "name",
          "mode"
        ]
      },
      "AgentCreateResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "pathway",
              "prompt"
            ]
          },
          "draft_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "description": "Initial aggregate revision. Supply the response ETag rather than constructing one from this number."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "mode",
          "draft_version_id",
          "revision",
          "updated_at"
        ]
      },
      "AgentDeployResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "production_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "updated": {
            "type": "boolean",
            "description": "False when production already referenced the staging snapshot."
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Aggregate update timestamp corresponding to revision."
          }
        },
        "required": [
          "agent_id",
          "production_version_id",
          "updated",
          "revision",
          "updated_at"
        ]
      },
      "AgentDetail": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "description": "Monotonic persisted revision of the complete mutable agent aggregate. Never construct an ETag from this number: the opaque aggregate tag also covers a representation-version component and deployment capability bits."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Time of the latest externally visible aggregate change. Semantic no-ops preserve this value."
          },
          "production_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "production_version_number": {
            "type": "integer",
            "minimum": 1,
            "description": "Immutable version number currently deployed to production. Omitted until production_version_id is present; a staging-only snapshot is never reported as production."
          },
          "production_version": {
            "$ref": "#/components/schemas/AgentVersionDetail"
          },
          "pipeline_topology": {
            "type": "string",
            "enum": [
              "three_stage",
              "two_stage_speechlm"
            ],
            "description": "Topology of the effective version selected in strict production→staging→draft precedence. Omitted only when none of those pointers resolves to a version. Reported label derived from pipeline_mode: cascaded (STT → brain → TTS) reads three_stage, speech_model reads two_stage_speechlm; a legacy version stored on the three-stage engine also reads three_stage. It is not the runtime engine selector (every v2 version, cascaded included, runs the v2 turn engine), and writing three_stage back to a cascaded draft is a no-op."
          },
          "mode": {
            "type": "string",
            "enum": [
              "pathway",
              "prompt",
              "empty"
            ],
            "description": "Content mode of the same effective production→staging→draft version used for pipeline_topology and node_count. pathway means workflow is present, prompt means prompt is present, and empty means no effective runnable content/version exists. This is deployment-effective state, not necessarily the newest draft's mode."
          },
          "node_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of workflow.nodes in the effective production→staging→draft version. Omitted for prompt or versionless effective state."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "archived_at": {
            "type": "string",
            "format": "date-time"
          },
          "staging_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "draft_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "staging_version": {
            "$ref": "#/components/schemas/AgentVersionDetail"
          },
          "draft_version": {
            "$ref": "#/components/schemas/AgentVersionDetail"
          },
          "versions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentVersionSummary"
            },
            "maxItems": 200,
            "description": "At most 200 compact immutable snapshots, ordered by created_at descending and then UUID id descending. Drafts are excluded. Use /agents/{id}/versions to traverse the complete history with the same ordering."
          },
          "three_stage_allowed": {
            "type": "boolean",
            "description": "Point-in-time deployment capability. True means new draft authoring and lifecycle activation may select three_stage, subject to provider-specific compatibility. False means clients must author two_stage_speechlm; an old immutable three-stage snapshot remains readable but cannot be activated."
          },
          "all_stt_models_allowed": {
            "type": "boolean",
            "description": "Point-in-time deployment capability. True means agent authoring may select any enabled compatible STT catalog model; false means the server applies its curated STT allowlist. This flag is not an entitlement and can change between reads, so lifecycle operations always revalidate it."
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "revision",
          "updated_at",
          "mode",
          "created_at",
          "versions",
          "three_stage_allowed",
          "all_stt_models_allowed"
        ]
      },
      "AgentDraftSaveRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Merge-style patch of the one mutable draft. Omitted fields are preserved.",
        "properties": {
          "pathway_brain_provider_model_id": {
            "type": "string",
            "description": "Platform LLM catalog UUID for the pathway brain override. Omit to preserve; an empty string clears the override.",
            "anyOf": [
              {
                "format": "uuid"
              },
              {
                "const": ""
              }
            ]
          },
          "prompt": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AgentPromptTemplate"
              }
            ],
            "minLength": 1,
            "description": "Non-blank prompt template. Omit it to preserve current content; null is invalid and an empty string cannot erase runnable content."
          },
          "pipeline_topology": {
            "type": "string",
            "enum": [
              "three_stage",
              "two_stage_speechlm"
            ],
            "description": "Legacy engine selector; prefer pipeline_mode, which overrides it when both are sent. three_stage is accepted only when the deployment capability enables it, except that three_stage sent for a draft whose pipeline_mode is cascaded is the reported label being echoed back and is ignored. Most realtime STT integrations require two_stage_speechlm; the server validates the selected model's published capabilities."
          },
          "pipeline_mode": {
            "type": "string",
            "enum": [
              "speech_model",
              "cascaded"
            ],
            "description": "Source-of-truth runtime pipeline selector. speech_model feeds the brain raw caller audio; cascaded feeds a realtime STT transcript to a text brain then TTS. Both modes run on the v2 turn engine, so the stored engine selector stays two_stage_speechlm; reads report pipeline_topology three_stage for cascaded and two_stage_speechlm for speech_model. Omit to preserve the current value."
          },
          "endpointing_mode": {
            "type": "string",
            "enum": [
              "auto",
              "stt",
              "audio"
            ],
            "description": "Legacy version-level turn endpointing selector; prefer behavior.turn_taking.endpointing_mode. auto uses the engine's default endpointing; stt uses STT-driven turn endpointing, which takes effect only on a cascaded pipeline with a transcriber whose stt_capabilities.endpointing in GET /providers reports capable and reliable; otherwise it falls back to auto at runtime rather than being rejected. Ignored when the same request supplies behavior: the value is then derived from behavior.turn_taking.endpointing_mode (absent means auto). Omit to preserve the current value. `audio` always uses the agent's own audio endpointer; `auto` lets Kejue pick (on the self-hosted speech recognizer that is the recognizer's own turn detection)."
          },
          "stt_language": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9_-]*$"
          },
          "stt_language_hints": {
            "type": "array",
            "description": "Languages the caller is expected to speak, for transcribers whose auto-detection takes a hint list (providers with `stt_capabilities.language_hints: true` in GET /providers). Each entry is a 2–3 letter language code with an optional two-letter region, such as `ar`, `en`, or `pt-br`; the server trims, lower-cases, and de-duplicates the list and drops blank entries, and at most 10 distinct codes may remain (code too_many). Every code must be in the selected provider's `stt_capabilities.languages` catalog. Send an empty array to clear; omit to preserve. Setting a non-empty list on a transcriber without the capability is rejected with code incompatible_model; a stored list survives an STT switch and is simply not forwarded.",
            "items": {
              "type": "string"
            }
          },
          "stt_vocabulary": {
            "type": [
              "object",
              "null"
            ],
            "description": "Per-agent recognition vocabulary: custom terms, free-text context notes, key/value hints, and spoken-to-written translations the recognizer should favor. Accepted when the selected transcriber advertises `stt_capabilities.vocabulary: true` in GET /providers (already resolved for the selected model). Send null or an empty object to clear; omit to preserve. Rejected with code incompatible_model otherwise.",
            "additionalProperties": false,
            "properties": {
              "terms": {
                "type": "array",
                "maxItems": 1000,
                "items": {
                  "type": "string",
                  "maxLength": 200
                }
              },
              "notes": {
                "type": "string",
                "maxLength": 4000
              },
              "hints": {
                "type": "array",
                "maxItems": 200,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "key",
                    "value"
                  ],
                  "properties": {
                    "key": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "value": {
                      "type": "string",
                      "maxLength": 500
                    }
                  }
                }
              },
              "translations": {
                "type": "array",
                "maxItems": 1000,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "from",
                    "to"
                  ],
                  "properties": {
                    "from": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "to": {
                      "type": "string",
                      "maxLength": 200
                    }
                  }
                }
              }
            }
          },
          "behavior": {
            "$ref": "#/components/schemas/AgentBehavior"
          },
          "llm_provider_model_id": {
            "$ref": "#/components/schemas/NullableAgentReferenceInput"
          },
          "stt_provider_model_id": {
            "$ref": "#/components/schemas/NullableAgentReferenceInput"
          },
          "tts_provider_model_id": {
            "$ref": "#/components/schemas/NullableAgentReferenceInput"
          },
          "tts_voice_id": {
            "$ref": "#/components/schemas/NullableAgentReferenceInput",
            "description": "Enabled voice belonging to the selected TTS provider, or an empty string to clear it. Aria, ElevenLabs-compatible, and Fish Speech integrations require a voice and reject a resulting draft without one. If this or tts_provider_model_id changes while tts_voice_settings is omitted, the server clears the previous provider-specific override instead of carrying potentially incompatible settings into the new selection. Resend explicit settings to retain them."
          },
          "speechlm_provider_model_id": {
            "$ref": "#/components/schemas/NullableAgentReferenceInput"
          },
          "tts_voice_settings": {
            "$ref": "#/components/schemas/AgentProviderVoiceSettingsInput"
          }
        }
      },
      "AgentProviderVoiceSettingsInput": {
        "type": "object",
        "additionalProperties": false,
        "description": "Writable provider-specific override layered over the selected voice's catalog settings. The selected connector permits only its advertised subset and can impose narrower ranges; inspect voice_settings_schema in GET /providers before authoring. Send {} to clear every per-agent override. Dialect is intentionally absent because it belongs to the selected voice catalog entry.",
        "properties": {
          "speed": {
            "type": "number",
            "minimum": 0.5,
            "maximum": 2
          },
          "volume": {
            "type": "number",
            "minimum": -20,
            "maximum": 20
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "top_p": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "stability": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "expressiveness": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Intonation variation (Bland). Higher is more varied; lower is flatter. Provider default 0.6."
          },
          "model": {
            "type": "string",
            "deprecated": true,
            "description": "Legacy operator-only synthesis setting. Select a catalog model by its platform UUID for new configurations."
          },
          "similarity_boost": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "style": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "use_speaker_boost": {
            "type": "boolean"
          },
          "normalize_text": {
            "type": "boolean",
            "description": "Ask the provider to normalize numbers, dates and dialect spellings before synthesis (OpenAI-compatible TTS such as Sawtak)."
          }
        }
      },
      "AgentProviderVoiceSettings": {
        "type": "object",
        "additionalProperties": false,
        "description": "Provider-specific override layered over the selected voice's catalog settings. This closed object is the union of every currently public setting key. The selected connector permits only its subset and can impose narrower ranges; inspect voice_settings_schema plus the selected voice's settings in GET /providers before authoring. Send {} to clear every per-agent override.",
        "properties": {
          "speed": {
            "type": "number",
            "minimum": 0.5,
            "maximum": 2,
            "description": "Playback-speed multiplier. Provider discovery supplies the selected connector's narrower range and default."
          },
          "volume": {
            "type": "number",
            "minimum": -20,
            "maximum": 20,
            "description": "Output-gain control. Aria narrows this to a 0.25–2 multiplier; Fish Speech uses a -20..20 dB offset. Provider discovery supplies the selected connector's range and semantics."
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Sampling temperature. Aria expressive providers narrow the minimum to 0.8; Fish Speech permits the complete range."
          },
          "top_p": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Nucleus-sampling diversity (Fish Speech)."
          },
          "stability": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Voice stability. Aria expressive providers narrow the minimum to 0.8; ElevenLabs-compatible providers permit the complete range."
          },
          "dialect": {
            "type": "string",
            "readOnly": true,
            "deprecated": true,
            "enum": [
              "jordanian",
              "saudi",
              "hejazi",
              "najdi",
              "iraqi",
              "palestinian",
              "emirati",
              "hindi_english"
            ],
            "description": "Legacy stored per-agent dialect override. New writes reject this field: choose a voice with the required catalog dialect instead. It remains in responses so agents created before the catalog-driven workflow can be read and migrated safely."
          },
          "expressiveness": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Intonation variation (Bland). Higher is more varied; lower is flatter."
          },
          "similarity_boost": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "style": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "use_speaker_boost": {
            "type": "boolean"
          },
          "normalize_text": {
            "type": "boolean",
            "description": "Ask the provider to normalize numbers, dates and dialect spellings before synthesis (OpenAI-compatible TTS such as Sawtak)."
          }
        }
      },
      "AgentBehavior": {
        "type": "object",
        "additionalProperties": false,
        "description": "Complete version-scoped behavior document. Supplying behavior replaces the previous behavior document on the mutable draft; omitted behavior leaves it unchanged. Omitted blocks and fields use the runtime defaults documented on their schemas. New writes use only this canonical shape; supported legacy inactivity and transfer rows are normalized before public responses are emitted.",
        "properties": {
          "temperature": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 2,
            "description": "Agent-level sampling temperature. Null or omission inherits the engine default."
          },
          "silence_timeout_seconds": {
            "type": "number",
            "minimum": 0,
            "description": "End the call after this many seconds without agent speech while a caller is present (a stuck pipeline guard). 0 disables it. Omitted inherits the deployment default (300 seconds unless the deployment overrides it)."
          },
          "max_call_duration_seconds": {
            "type": "number",
            "minimum": 0,
            "description": "Hang up once the call has been answered for this many seconds. 0 means uncapped for this agent. Omitted inherits the workspace's call-duration cap when one is set, otherwise the product default of 600 seconds."
          },
          "wait_instruction": {
            "type": "string",
            "description": "Promptable endpointing. Freeform instruction that teaches the agent when to keep listening instead of answering: tell it to reply with the bare tag <WAIT/> when the caller clearly has not finished (for example while a number is dictated group by group). The caller never hears the tag — the agent simply holds the turn and answers once the caller is done. A non-empty value enables the mechanism for this agent and overrides the deployment default instruction."
          },
          "wait_rearm_ms": {
            "type": "integer",
            "minimum": 1000,
            "maximum": 30000,
            "description": "How long a held turn may stay silent (milliseconds) before the agent stops waiting and answers anyway. Omitted inherits the deployment default (5000)."
          },
          "opening": {
            "$ref": "#/components/schemas/AgentBehaviorOpening"
          },
          "connection": {
            "$ref": "#/components/schemas/AgentBehaviorConnection"
          },
          "recording": {
            "$ref": "#/components/schemas/AgentBehaviorRecording"
          },
          "background_noise": {
            "$ref": "#/components/schemas/AgentBehaviorBackgroundNoise"
          },
          "inactivity": {
            "$ref": "#/components/schemas/AgentBehaviorInactivity"
          },
          "guardrails": {
            "$ref": "#/components/schemas/AgentGuardrailAssignments"
          },
          "pronunciation": {
            "$ref": "#/components/schemas/AgentPronunciationAssignments"
          },
          "tools": {
            "$ref": "#/components/schemas/AgentToolAssignments"
          },
          "system_tools": {
            "$ref": "#/components/schemas/AgentBehaviorSystemTools"
          },
          "dtmf": {
            "$ref": "#/components/schemas/AgentBehaviorDTMF"
          },
          "turn_taking": {
            "$ref": "#/components/schemas/AgentBehaviorTurnTaking"
          },
          "memory": {
            "$ref": "#/components/schemas/AgentBehaviorMemory"
          },
          "gender_detection": {
            "$ref": "#/components/schemas/AgentBehaviorGenderDetection"
          },
          "resume": {
            "$ref": "#/components/schemas/AgentBehaviorResume"
          }
        }
      },
      "AgentBehaviorOpening": {
        "type": "object",
        "additionalProperties": false,
        "description": "Opening behavior. Pathway agents normally drive first speech from their start node; prompt agents use this block directly.",
        "properties": {
          "first_speaker": {
            "type": "string",
            "enum": [
              "agent",
              "caller"
            ],
            "default": "agent",
            "description": "Caller suppresses proactive first speech until the caller talks."
          },
          "greeting": {
            "$ref": "#/components/schemas/AgentBehaviorGreeting"
          }
        }
      },
      "AgentBehaviorGreeting": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "generate",
              "fixed"
            ],
            "default": "generate"
          },
          "text": {
            "type": "string",
            "description": "Fixed-mode opening line, spoken verbatim and literal (it is synthesized ahead of the call, so it cannot vary per call). Unlike `instructions`, which accepts templates, `text` rejects them — a {{ or }} here returns validation_failed/templates_not_allowed. To greet by name, use generate mode with instructions."
          },
          "instructions": {
            "type": "string",
            "description": "Accepts templates. Generate-mode guidance for the opening line, rendered per call before the line is generated. It follows the AgentPromptTemplate expression contract: bare aliases ({{lead_name}}), {{vars.NAME}}, {{system.NAME}} and {{tools.SLUG}} / {{tools.SLUG.NAME}} from pre-call tools resolve; missing values render as the empty string. {{slots.NAME}} is rejected (there is no pathway state at first speech), params and secrets are rejected, unknown scopes are rejected, and malformed or unmatched delimiters return 422 validation_failed. Prompt agents only — a pathway's start node owns first speech."
          },
          "allow_interruptions": {
            "type": "boolean",
            "default": true
          },
          "delay_seconds": {
            "type": "number",
            "minimum": 0,
            "default": 0,
            "description": "Delay before first speech; caller speech during the delay can suppress the greeting."
          }
        }
      },
      "AgentBehaviorConnection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "wait_for_participant_timeout_seconds": {
            "type": "number",
            "minimum": 0,
            "default": 60,
            "description": "Seconds to wait for a remote participant. Zero disables the timeout."
          }
        }
      },
      "AgentBehaviorRecording": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Explicit per-agent override. Omission follows deployment policy."
          }
        }
      },
      "AgentBehaviorBackgroundNoise": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean",
            "default": false
          },
          "sound": {
            "type": "string",
            "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$",
            "maxLength": 64,
            "default": "office",
            "description": "Key of the ambience loop. Either one of the bundled clips (office, keyboard, keyboard-soft, city, forest, crowded-room) or the key of a background noise uploaded to the library by the platform operator and made available to this workspace; GET /v1/background-noises lists every key the workspace may use. Saving a key the workspace cannot use fails validation with reference_not_found."
          },
          "volume": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Linear gain applied to the ambience track."
          }
        }
      },
      "AgentBehaviorInactivity": {
        "type": "object",
        "additionalProperties": false,
        "description": "Ordered caller-silence script. An absent or empty messages array is disabled; there is no separate enable flag.",
        "properties": {
          "messages": {
            "type": "array",
            "maxItems": 100,
            "default": [],
            "items": {
              "$ref": "#/components/schemas/AgentBehaviorInactivityStep"
            }
          }
        }
      },
      "AgentBehaviorInactivityStep": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "silence_seconds": {
            "type": "number",
            "minimum": 1,
            "default": 15,
            "description": "Caller silence since the prior caller activity or prior step."
          },
          "message": {
            "$ref": "#/components/schemas/AgentBehaviorInactivitySpeech"
          },
          "action": {
            "type": "string",
            "enum": [
              "none",
              "soft_hangup",
              "hard_hangup"
            ],
            "default": "none",
            "description": "Soft hangup is cancelled by caller barge-in; hard hangup is not."
          }
        }
      },
      "AgentBehaviorInactivitySpeech": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "empty",
              "fixed"
            ],
            "default": "empty"
          },
          "text": {
            "type": "string",
            "description": "Literal line for fixed mode. Runtime template expansion is not applied; either template delimiter is rejected."
          }
        }
      },
      "AgentGuardrailAssignments": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "guardrail_set_ids": {
            "type": "array",
            "maxItems": 50,
            "uniqueItems": true,
            "default": [],
            "description": "Ordered active guardrail-set UUIDs in this workspace. Missing, archived, and cross-workspace references return 422.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "AgentPronunciationAssignments": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "table_ids": {
            "type": "array",
            "maxItems": 50,
            "uniqueItems": true,
            "default": [],
            "description": "Ordered active pronunciation-table UUIDs. Table order controls precedence for overlapping substitutions. Missing, archived, and cross-workspace references return 422.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "AgentToolAssignments": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "tool_ids": {
            "type": "array",
            "maxItems": 50,
            "uniqueItems": true,
            "default": [],
            "description": "Ordered active HTTP-tool UUIDs in this workspace. Missing, archived, and cross-workspace references return 422.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "pre_call": {
            "type": "array",
            "maxItems": 10,
            "default": [],
            "description": "Tools that run once, concurrently, before the agent speaks. Every referenced tool must have `phase: pre_call`. Their responses become the {{tools.SLUG.NAME}} template scope, usable in the prompt, the greeting, and other tools' templates. Each tool runs under its own `timeout_ms` (times its retry attempts); a tool that overruns that deadline is abandoned and treated as a failure. On outbound this time elapses while the line rings; on inbound the caller hears it as silence, so keep each tool's timeout tight. Missing, archived, cross-workspace, duplicated, and wrong-phase references return 422.",
            "items": {
              "$ref": "#/components/schemas/ToolPreCallAttachment"
            }
          },
          "pre_call_timeout_ms": {
            "type": "integer",
            "deprecated": true,
            "description": "Deprecated and ignored. Pre-call deadlines are governed by each tool's own `timeout_ms`; there is no batch-level cap. The field is still accepted for backward compatibility but is discarded on save and never returned."
          },
          "mcp_server_ids": {
            "type": "array",
            "maxItems": 50,
            "uniqueItems": true,
            "default": [],
            "description": "Ordered active MCP-server UUIDs in this workspace. Missing, archived, cross-workspace, non-introspected, hash-unenforced, malformed, and aggregate-over-budget approved catalogs return indexed 422 errors.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "carry_across_calls": {
            "type": "object",
            "default": {},
            "description": "Per-attachment override of each tool's carry_across_calls flag, keyed by tool UUID. Keys must appear in tool_ids; unknown keys return 422. A tool without an entry uses its own flag. Controls whether the tool's latest successful result from a recent call is replayed into context when this agent resumes a dropped call.",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        }
      },
      "AgentBehaviorSystemTools": {
        "type": "object",
        "additionalProperties": false,
        "description": "Built-in tools materialized by the call runtime. Each transfer array is limited to 50 entries. Labels are converted into tool-name suffixes and must remain unique after that conversion.",
        "properties": {
          "resolve_date": {
            "$ref": "#/components/schemas/AgentBehaviorResolveDate"
          },
          "transfer_warm": {
            "type": "array",
            "maxItems": 50,
            "default": [],
            "items": {
              "$ref": "#/components/schemas/AgentBehaviorWarmTransfer"
            }
          },
          "transfer_cold": {
            "type": "array",
            "maxItems": 50,
            "default": [],
            "items": {
              "$ref": "#/components/schemas/AgentBehaviorColdTransfer"
            }
          },
          "transfer_agent": {
            "type": "array",
            "maxItems": 50,
            "default": [],
            "items": {
              "$ref": "#/components/schemas/AgentBehaviorAgentTransfer"
            }
          },
          "schedule_call": {
            "type": "array",
            "maxItems": 50,
            "default": [],
            "items": {
              "$ref": "#/components/schemas/AgentBehaviorScheduleCall"
            }
          },
          "wait": {
            "type": "array",
            "maxItems": 50,
            "default": [],
            "items": {
              "$ref": "#/components/schemas/AgentBehaviorWait"
            }
          },
          "end_call": {
            "$ref": "#/components/schemas/AgentBehaviorEndCall"
          }
        }
      },
      "AgentBehaviorWarmTransfer": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string",
            "description": "Optional human label used to derive the runtime tool name."
          },
          "destination": {
            "type": "string",
            "minLength": 1,
            "description": "Operator-controlled phone number or SIP URI. Supports {{system.*}}, {{vars.*}}, {{slots.*}} and {{params.*}} templates, rendered per call from context the model cannot author. Required when destination_mode is static; rejected when it is dynamic."
          },
          "destination_mode": {
            "type": "string",
            "enum": [
              "static",
              "dynamic"
            ],
            "default": "static",
            "description": "Who chooses the destination. static keeps it operator-controlled (a literal or a template). dynamic lets the assistant supply the number at call time and requires trunk_id, whose outbound allowlist bounds where it may dial; a dynamic entry on a trunk with no allowlist is rejected with dynamic_destination_requires_allowlist."
          },
          "trunk_id": {
            "$ref": "#/components/schemas/NullableEmptyAgentUUID"
          },
          "method": {
            "type": "string",
            "const": "bridge",
            "default": "bridge",
            "description": "Warm transfers support bridge only."
          },
          "announcement": {
            "type": "string",
            "description": "Stored for compatibility but ignored by the behavior-tool runtime; the calling model must provide a call-specific summary for warm transfer. Template delimiters are rejected."
          },
          "briefing_language": {
            "type": "string",
            "maxLength": 200,
            "description": "Language and dialect the briefing AI uses for the whole briefing call to the human, e.g. \"Arabic (Jordanian dialect)\". Empty or absent means English. It never switches, whatever language the human answers in. Supports {{system.*}}, {{vars.*}}, {{slots.*}} and {{params.*}} templates rendered at transfer time. Warm entries only."
          },
          "include_transcript": {
            "type": "boolean",
            "default": true,
            "description": "Whether the briefing AI's prompt carries the caller's full prior conversation alongside the model's call-specific summary. true (the default) briefs with summary plus full transcript; false briefs with the summary only, so the recipient never sees verbatim caller turns. Warm entries only."
          },
          "briefing_prompt": {
            "type": "string",
            "maxLength": 20000,
            "description": "Optional instructions for the briefing AI, i.e. what to tell or ask the transfer recipient, what to stress, and how to answer their questions. Used only on the briefing call to the recipient; the caller never hears it. It is added under the platform's built-in briefing rules (speak only to the recipient, keep messages short, end by connecting, declining, or reporting voicemail) and cannot override them. Rendered at transfer time with the same template syntax as the agent prompt (unscoped {{name}} call variables, {{vars.*}}, {{system.*}}, {{tools.*}} pre-call results, {{slots.*}}) plus briefing-only variables {{transfer.summary}} (the summary the agent passed when it started the transfer), {{transfer.label}}, {{transfer.destination}}, {{transfer.language}}, {{call.transcript}} (the conversation so far), {{call.last_caller_message}}, {{call.duration}} (e.g. \"3 minutes 12 seconds\") and {{call.duration_seconds}}. {{call.transcript}} and {{call.last_caller_message}} are empty when include_transcript is false. Missing values render as empty text; {{secrets.*}}, {{params.*}}, and unknown transfer/call names are rejected. Empty or absent keeps the default briefing. Warm entries only."
          }
        }
      },
      "AgentBehaviorColdTransfer": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string",
            "description": "Optional human label used to derive the runtime tool name."
          },
          "destination": {
            "type": "string",
            "minLength": 1,
            "description": "Operator-controlled phone number or SIP URI. Supports {{system.*}}, {{vars.*}}, {{slots.*}} and {{params.*}} templates, rendered per call from context the model cannot author. Required when destination_mode is static; rejected when it is dynamic."
          },
          "destination_mode": {
            "type": "string",
            "enum": [
              "static",
              "dynamic"
            ],
            "default": "static",
            "description": "Who chooses the destination. static keeps it operator-controlled (a literal or a template). dynamic lets the assistant supply the number at call time and requires trunk_id, whose outbound allowlist bounds where it may dial; a dynamic entry on a trunk with no allowlist is rejected with dynamic_destination_requires_allowlist."
          },
          "trunk_id": {
            "$ref": "#/components/schemas/NullableEmptyAgentUUID"
          },
          "method": {
            "type": "string",
            "enum": [
              "refer",
              "bridge"
            ],
            "default": "refer"
          },
          "announcement": {
            "type": "string",
            "description": "Literal context retained on the transfer record. The current behavior-tool runtime does not automatically speak it and does not expand prompt variables. Template delimiters are rejected."
          }
        }
      },
      "AgentBehaviorAgentTransfer": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string",
            "description": "Optional human label used to derive the runtime tool name."
          },
          "target": {
            "type": "string",
            "minLength": 2,
            "maxLength": 48,
            "pattern": "^[a-z0-9_]{2,48}$",
            "description": "Active target agent slug in this workspace. Required when target_mode is static; rejected when it is choice."
          },
          "target_mode": {
            "type": "string",
            "enum": [
              "static",
              "choice"
            ],
            "default": "static",
            "description": "Who chooses the receiving agent. static always hands off to target. choice lets the assistant pick, but only from allowed_targets — those slugs become an enum on the generated tool, so an unlisted agent cannot be named."
          },
          "allowed_targets": {
            "type": "array",
            "maxItems": 50,
            "default": [],
            "description": "Agent slugs the assistant may choose between. Required and non-empty when target_mode is choice; every slug must reference an active agent in this workspace.",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 48,
              "pattern": "^[a-z0-9_]{2,48}$"
            }
          },
          "announcement": {
            "type": "string",
            "description": "Stored for compatibility but ignored by the behavior-tool runtime; the calling model must provide a call-specific handoff summary. Template delimiters are rejected."
          }
        }
      },
      "AgentBehaviorScheduleCall": {
        "type": "object",
        "additionalProperties": false,
        "description": "Books a call for a LATER time as a durable outbound job rather than dialing immediately, and does not end the current call. The requested time is resolved in the contact's timezone and snapped into the organization's outbound contact-hours window, so the booked instant may differ from the one requested; the runtime reports the booked time back to the model. Two independent axes — who places the call (agent_mode) and who is called (destination_mode) — each with a mode-dependent required field.",
        "properties": {
          "label": {
            "type": "string",
            "description": "Optional human label used to derive the runtime tool name."
          },
          "agent_mode": {
            "type": "string",
            "enum": [
              "self",
              "fixed",
              "choice"
            ],
            "default": "self",
            "description": "Who places the scheduled call. self reuses the agent handling the current call (a plain callback). fixed always uses agent_target. choice lets the assistant pick from allowed_agents, which become an enum on the generated tool."
          },
          "agent_target": {
            "type": "string",
            "minLength": 2,
            "maxLength": 48,
            "pattern": "^[a-z0-9_]{2,48}$",
            "description": "Agent slug that will place the call. Required when agent_mode is fixed; must reference an active agent in this workspace."
          },
          "allowed_agents": {
            "type": "array",
            "maxItems": 50,
            "default": [],
            "description": "Agent slugs the assistant may choose between. Required and non-empty when agent_mode is choice; every slug must reference an active agent in this workspace.",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 48,
              "pattern": "^[a-z0-9_]{2,48}$"
            }
          },
          "destination_mode": {
            "type": "string",
            "enum": [
              "caller",
              "static",
              "dynamic"
            ],
            "default": "caller",
            "description": "Who is called. caller uses the number of the party on the current call, resolved server-side so the model never supplies it. static uses destination. dynamic lets the assistant supply the number and requires trunk_id, whose outbound allowlist bounds where it may dial; a dynamic entry on a trunk with no allowlist is rejected with dynamic_destination_requires_allowlist."
          },
          "destination": {
            "type": "string",
            "minLength": 1,
            "description": "Number to call. Required when destination_mode is static. Supports {{system.*}}, {{vars.*}}, {{slots.*}} and {{params.*}} templates, rendered per call from context the model cannot author."
          },
          "trunk_id": {
            "$ref": "#/components/schemas/NullableEmptyAgentUUID"
          },
          "number_pool_id": {
            "$ref": "#/components/schemas/NullableEmptyAgentUUID"
          },
          "max_attempts": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "Retry attempts for the scheduled call. 0 inherits the organization's outbound policy."
          },
          "priority": {
            "type": "integer",
            "default": 0,
            "description": "Higher values are dialed first when several scheduled calls come due together."
          },
          "carry_context": {
            "type": "boolean",
            "default": true,
            "description": "Pass the call's collected values plus an assistant-written summary into the scheduled job's variables, so whoever places the call retains the context this conversation gathered. When true the generated tool requires a summary argument."
          },
          "when_mode": {
            "type": "string",
            "enum": [
              "agent",
              "now",
              "relative",
              "absolute"
            ],
            "default": "agent",
            "description": "When the call happens. agent is the only mode that puts a `when` argument on the generated tool — the assistant resolves a spoken time into an absolute one. now books as soon as the outbound window allows, relative books call-time plus when_offset_minutes, and absolute books a fixed instant. In every mode except agent the assistant cannot influence the time at all."
          },
          "when_at": {
            "type": "string",
            "description": "Naive ISO-8601 date and time (YYYY-MM-DDTHH:MM:SS), read in the resolved timezone. Required when when_mode is absolute and must be in the future; a fixed instant that has passed is rejected on save and refused at call time rather than dialed immediately."
          },
          "when_offset_minutes": {
            "type": "integer",
            "minimum": 1,
            "description": "Minutes after the moment the assistant books it. Required (and at least 1) when when_mode is relative — 7205 is five days and five minutes. Zero would mean now, which is what when_mode now is for."
          },
          "timezone_mode": {
            "type": "string",
            "enum": [
              "organization",
              "custom",
              "agent"
            ],
            "default": "organization",
            "description": "Which timezone the time is read in. organization uses the workspace default, custom uses timezone below, and agent lets the assistant supply one — which is only accepted together with when_mode agent, since it cannot name a zone for a time it does not choose."
          },
          "timezone": {
            "type": "string",
            "minLength": 1,
            "description": "IANA timezone name, e.g. Asia/Dubai. Required when timezone_mode is custom."
          }
        }
      },
      "AgentBehaviorWait": {
        "type": "object",
        "additionalProperties": false,
        "description": "The wait built-in. When the caller asks for a moment (\"give me a few seconds, I'm logging in\"), the agent calls the tool and stays silent. The waited seconds do not count toward the inactivity messages or the silence timeout. The wait is always interruptible: the caller can speak at any time and is answered normally, which ends the wait. Each entry becomes one tool, named wait for a single unlabelled entry and wait__<label> otherwise. Its result does not trigger another reply.",
        "properties": {
          "label": {
            "type": "string",
            "description": "Optional human label used to derive the runtime tool name."
          },
          "duration_mode": {
            "type": "string",
            "enum": [
              "agent",
              "fixed"
            ],
            "default": "agent",
            "description": "Who decides how long to wait. agent gives the tool a seconds argument (1-120) that the assistant chooses per call. fixed uses the seconds below, and the tool takes no arguments."
          },
          "seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 120,
            "description": "How long to wait, in seconds. Required when duration_mode is fixed."
          },
          "on_timeout": {
            "type": "string",
            "enum": [
              "none",
              "say",
              "prompt"
            ],
            "default": "none",
            "description": "What happens when the wait runs out and the caller is still quiet. none says nothing, and the inactivity messages start counting from zero. say speaks message verbatim. prompt hands message to the assistant as an instruction, and the assistant writes the line. After either line the inactivity messages count as usual."
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "description": "The line (on_timeout say) or the instruction (on_timeout prompt). Required for both. A say line supports {{system.*}}, {{vars.*}} and {{slots.*}} templates, rendered per call. A prompt is plain prose, and template delimiters are rejected."
          }
        }
      },
      "AgentBehaviorEndCall": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean",
            "default": false
          },
          "type": {
            "type": "string",
            "enum": [
              "soft",
              "hard"
            ],
            "default": "soft",
            "description": "Soft lets caller barge-in cancel the farewell and hangup; hard always completes the hangup."
          },
          "farewell": {
            "type": "string",
            "description": "Optional literal TTS farewell. Runtime template expansion is not applied and template delimiters are rejected."
          }
        }
      },
      "AgentBehaviorDTMF": {
        "type": "object",
        "additionalProperties": false,
        "description": "Caller keypad (DTMF) settings. collect_enabled turns on free-flow keypad collection for the whole call: the caller may press digits at any moment and the runtime turns them into a caller turn — after collection.inter_digit_timeout_ms of silence since the last keypress, or immediately on the terminator. Spoken input always wins: a caller who speaks while digits are pending hands the turn to normal endpointing and the digits ride that turn's history. The model sees each entry as a caller turn prefixed with \"[Keypad]\" (for example \"[Keypad] 1234\"). Pathway wait nodes use their own configuration. The former collect_dtmf tool and its collect_defaults block are retired; sending collect_defaults returns 422 (unknown).",
        "properties": {
          "collect_enabled": {
            "type": "boolean",
            "default": false,
            "description": "Free-flow keypad collection for the whole call."
          },
          "collection": {
            "$ref": "#/components/schemas/AgentBehaviorDTMFCollection"
          },
          "send_enabled": {
            "type": "boolean",
            "default": false,
            "description": "Expose the send_dtmf_events tool (the agent presses keys on the line)."
          }
        }
      },
      "AgentBehaviorDTMFCollection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "inter_digit_timeout_ms": {
            "type": "integer",
            "minimum": 100,
            "maximum": 30000,
            "default": 2000,
            "description": "Silence after the caller's last keypress before the pending digits commit as a caller turn."
          },
          "terminator": {
            "type": "string",
            "enum": [
              "#",
              "*",
              ""
            ],
            "default": "#",
            "description": "Pressing it commits the pending digits immediately; it is never part of the digits. Empty string disables the terminator."
          },
          "interrupt_on_digit": {
            "type": "boolean",
            "default": false,
            "description": "Whether a keypress cuts the agent's in-flight reply (classic IVR type-ahead). false (default) = digits are buffered while the agent speaks and commit once it stops."
          }
        }
      },
      "AgentBehaviorTurnTaking": {
        "type": "object",
        "additionalProperties": false,
        "description": "Millisecond-authored VAD and turn-taking overrides. endpointing_delay_ms must not exceed turn_endpoint_delay_ms. Adaptive interruption is available only with two_stage_speechlm.",
        "properties": {
          "turn_endpoint_delay_ms": {
            "type": "integer",
            "minimum": 0,
            "default": 500
          },
          "min_turn_duration_ms": {
            "type": "integer",
            "minimum": 0,
            "default": 50
          },
          "min_interruption_ms": {
            "type": "integer",
            "minimum": 0,
            "default": 90
          },
          "adaptive_interruption": {
            "type": "boolean",
            "default": true
          },
          "endpointing_delay_ms": {
            "type": "integer",
            "minimum": 0,
            "default": 330
          },
          "frame_activation": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.35
          },
          "endpointing_mode": {
            "type": "string",
            "enum": [
              "auto",
              "stt",
              "audio"
            ],
            "default": "auto",
            "description": "Turn endpointing authority. auto uses the engine's audio endpointer; stt lets the speech recognizer's native endpoint end the caller's turn. stt takes effect only on a cascaded pipeline with a transcriber whose stt_capabilities.endpointing in GET /providers reports capable and reliable; on any other combination the runtime falls back to auto rather than failing. Writing it here also updates the version's top-level endpointing_mode. `audio` always uses the agent's own audio endpointer; `auto` lets Kejue pick (on the self-hosted speech recognizer that is the recognizer's own turn detection)."
          }
        }
      },
      "AgentBehaviorMemory": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "inject_enabled": {
            "type": "boolean",
            "default": false,
            "description": "Inject the matched contact's saved memory into the call."
          },
          "write_enabled": {
            "type": "boolean",
            "default": false,
            "description": "Extract and reconcile contact memory after the call."
          }
        }
      },
      "AgentBehaviorGenderDetection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean",
            "default": false,
            "description": "Sensitive voice-derived attribute; supported only by two_stage_speechlm."
          }
        }
      },
      "AgentBehaviorResume": {
        "type": "object",
        "additionalProperties": false,
        "description": "Continue a previous call instead of greeting from scratch. When the same caller number reaches this agent again — inbound or outbound — within window_minutes of their last call with it ending, the runtime loads that call's redacted transcript as context and opens by continuing the conversation. The resumed opening overrides opening.first_speaker and any fixed greeting for that call only: the agent always speaks first and always generates the line. Calls with no caller number (web and test calls) and calls whose previous transcript was purged never resume.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "default": false,
            "description": "Turn continue-previous-call on for this agent."
          },
          "window_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 120,
            "default": 30,
            "description": "How long after a call ends a call-back still counts as the same conversation. Measured from the previous call's end. Consecutive drops chain — each link is checked against this same window — up to three prior calls, and the replayed transcript is capped so a long history cannot crowd out the agent's own prompt."
          }
        }
      },
      "NullableEmptyAgentUUID": {
        "description": "UUID value, or an empty string to select the deployment/runtime default.",
        "oneOf": [
          {
            "type": "string",
            "format": "uuid"
          },
          {
            "type": "string",
            "const": ""
          }
        ]
      },
      "AgentWorkflow": {
        "type": "object",
        "additionalProperties": false,
        "description": "Complete pathway graph. Node ids are unique machine names; start_node and every route target must resolve within nodes. start_node must be non-global. Global nodes are entered only by global_trigger arbitration and cannot be targeted by next, edges, fallback_edge, or events. The runtime rejects more than 500 nodes, guard nesting beyond 16 levels, or more than 200 total guard clauses. Tool nodes reference catalog tools; embedded HTTP configuration is never accepted.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Optional graph identifier retained with the authored document."
          },
          "name": {
            "type": "string",
            "description": "Optional human-readable graph name."
          },
          "start_node": {
            "$ref": "#/components/schemas/AgentWorkflowNodeReference",
            "description": "Initial non-global node id. Global nodes are trigger-only entry points and cannot be selected here."
          },
          "nodes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/AgentWorkflowNode"
            }
          },
          "global_prompt": {
            "$ref": "#/components/schemas/AgentWorkflowPromptTemplate",
            "description": "System prompt composed into every node. It supports bare per-call aliases and explicit slots, vars, and system scopes under the AgentWorkflowPromptTemplate contract."
          }
        },
        "required": [
          "start_node",
          "nodes"
        ]
      },
      "AgentWorkflowNode": {
        "type": "object",
        "additionalProperties": false,
        "description": "One graph node. type defaults to prompt. next is shorthand for one unconditional edge and is mutually exclusive with edges. A branching node (two or more edges) requires a routing signal on every edge: when, description, examples, or guard.",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/AgentWorkflowMachineName"
          },
          "prompt": {
            "$ref": "#/components/schemas/AgentWorkflowPromptTemplate",
            "description": "Node instructions. It supports bare per-call aliases and explicit slots, vars, and system scopes under the AgentWorkflowPromptTemplate contract."
          },
          "slots": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/AgentWorkflowSlot"
            }
          },
          "next": {
            "$ref": "#/components/schemas/AgentWorkflowNodeReference"
          },
          "edges": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/AgentWorkflowEdge"
            }
          },
          "type": {
            "type": "string",
            "enum": [
              "prompt",
              "tool",
              "transfer",
              "wait",
              "end"
            ],
            "default": "prompt"
          },
          "title": {
            "type": "string"
          },
          "is_global": {
            "type": "boolean",
            "default": false
          },
          "global_trigger": {
            "type": "string",
            "minLength": 1,
            "description": "Natural-language trigger required only for global nodes."
          },
          "return_to_origin": {
            "type": "boolean",
            "default": false,
            "description": "For a global prompt node with no outgoing route, return to the interrupted node after speaking."
          },
          "temperature": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 2
          },
          "uninterruptible": {
            "type": "boolean",
            "default": false
          },
          "speaks_first": {
            "type": "string",
            "enum": [
              "agent",
              "caller"
            ],
            "default": "agent"
          },
          "speak_delay_ms": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "tool": {
            "$ref": "#/components/schemas/AgentWorkflowToolReference"
          },
          "transfer": {
            "$ref": "#/components/schemas/AgentWorkflowTransfer"
          },
          "wait": {
            "$ref": "#/components/schemas/AgentWorkflowWait"
          },
          "outcome": {
            "type": "string",
            "description": "End-node resolution tag persisted on the session."
          },
          "fallback_edge": {
            "$ref": "#/components/schemas/AgentWorkflowNodeReference"
          },
          "events": {
            "$ref": "#/components/schemas/AgentWorkflowEvents"
          },
          "decision": {
            "$ref": "#/components/schemas/AgentWorkflowDecision"
          }
        },
        "required": [
          "id"
        ],
        "allOf": [
          {
            "not": {
              "required": [
                "next",
                "edges"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "tool"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "required": [
                "tool"
              ],
              "oneOf": [
                {
                  "required": [
                    "next"
                  ]
                },
                {
                  "required": [
                    "edges"
                  ],
                  "properties": {
                    "edges": {
                      "minItems": 1,
                      "maxItems": 1
                    }
                  }
                }
              ]
            },
            "else": {
              "not": {
                "required": [
                  "tool"
                ]
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "transfer"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "required": [
                "transfer"
              ],
              "properties": {
                "edges": {
                  "maxItems": 1
                }
              }
            },
            "else": {
              "not": {
                "required": [
                  "transfer"
                ]
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "wait"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "required": [
                "wait"
              ],
              "properties": {
                "edges": {
                  "maxItems": 1
                }
              }
            },
            "else": {
              "not": {
                "required": [
                  "wait"
                ]
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "end"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "next"
                    ]
                  },
                  {
                    "required": [
                      "edges"
                    ]
                  }
                ]
              }
            },
            "else": {
              "not": {
                "required": [
                  "outcome"
                ]
              }
            }
          },
          {
            "if": {
              "properties": {
                "is_global": {
                  "const": true
                }
              },
              "required": [
                "is_global"
              ]
            },
            "then": {
              "required": [
                "global_trigger"
              ]
            },
            "else": {
              "not": {
                "required": [
                  "global_trigger"
                ]
              }
            }
          },
          {
            "if": {
              "properties": {
                "return_to_origin": {
                  "const": true
                }
              },
              "required": [
                "return_to_origin"
              ]
            },
            "then": {
              "required": [
                "is_global"
              ],
              "properties": {
                "is_global": {
                  "const": true
                },
                "type": {
                  "enum": [
                    "prompt"
                  ]
                }
              },
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "next"
                    ]
                  },
                  {
                    "required": [
                      "edges"
                    ]
                  }
                ]
              }
            }
          }
        ]
      },
      "AgentWorkflowMachineName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "pattern": "^[A-Za-z0-9_]{1,128}$",
        "description": "ASCII letters, digits, and underscores only."
      },
      "AgentWorkflowNodeReference": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AgentWorkflowMachineName"
          }
        ],
        "description": "Node id in the same workflow.nodes array."
      },
      "AgentWorkflowSlot": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "$ref": "#/components/schemas/AgentWorkflowMachineName"
          },
          "description": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "enum": [
              "user",
              "classifier"
            ],
            "default": "user"
          }
        },
        "required": [
          "name"
        ]
      },
      "AgentWorkflowEdge": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "to": {
            "$ref": "#/components/schemas/AgentWorkflowNodeReference"
          },
          "when": {
            "type": "string",
            "description": "Legacy natural-language route condition; description is preferred."
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "description": "Natural-language intent used by semantic routing."
          },
          "examples": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "negative_examples": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "guard": {
            "$ref": "#/components/schemas/AgentWorkflowGuard"
          },
          "threshold": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1
          },
          "criticality": {
            "type": "string",
            "enum": [
              "low",
              "med",
              "high"
            ],
            "default": "med"
          },
          "priority": {
            "type": "integer",
            "default": 0
          },
          "supervise": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "to"
        ]
      },
      "AgentWorkflowGuard": {
        "description": "Recursive deterministic condition. Groups may nest at most 16 levels and the complete guard may contain at most 200 clauses.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/AgentWorkflowGuardAll"
          },
          {
            "$ref": "#/components/schemas/AgentWorkflowGuardAny"
          },
          {
            "$ref": "#/components/schemas/AgentWorkflowGuardLeaf"
          }
        ]
      },
      "AgentWorkflowGuardAll": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "all": {
            "type": "array",
            "minItems": 1,
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/AgentWorkflowGuard"
            }
          }
        },
        "required": [
          "all"
        ]
      },
      "AgentWorkflowGuardAny": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "any": {
            "type": "array",
            "minItems": 1,
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/AgentWorkflowGuard"
            }
          }
        },
        "required": [
          "any"
        ]
      },
      "AgentWorkflowGuardLeaf": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "var": {
            "type": "string",
            "minLength": 1,
            "description": "Runtime value path resolved by the decision guard evaluator."
          },
          "op": {
            "type": "string",
            "enum": [
              "==",
              "!=",
              "<",
              "<=",
              ">",
              ">=",
              "exists",
              "not_exists",
              "contains",
              "not_contains"
            ]
          },
          "value": {
            "description": "Any JSON comparison value. Omit only for exists and not_exists."
          }
        },
        "required": [
          "var",
          "op"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "op": {
                  "enum": [
                    "==",
                    "!=",
                    "<",
                    "<=",
                    ">",
                    ">=",
                    "contains",
                    "not_contains"
                  ]
                }
              },
              "required": [
                "op"
              ]
            },
            "then": {
              "required": [
                "value"
              ]
            }
          }
        ]
      },
      "AgentWorkflowEvents": {
        "type": "object",
        "additionalProperties": false,
        "description": "Event routes must target non-global nodes in the same workflow.",
        "properties": {
          "no_input": {
            "$ref": "#/components/schemas/AgentWorkflowNodeReference"
          },
          "no_match": {
            "$ref": "#/components/schemas/AgentWorkflowNodeReference"
          },
          "tool_error": {
            "$ref": "#/components/schemas/AgentWorkflowNodeReference"
          }
        }
      },
      "AgentWorkflowDecision": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "stay_threshold": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.45,
            "description": "Must be greater than or equal to the effective unexpected_threshold, whose runtime default is 0.35."
          },
          "unexpected_threshold": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.35,
            "description": "Must be less than or equal to the effective stay_threshold, whose runtime default is 0.45. The ordering rule applies when either property is omitted as well as when both are authored."
          },
          "global_threshold": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.7
          },
          "cooldown_steps": {
            "type": "integer",
            "minimum": 0,
            "default": 2
          },
          "no_match_after": {
            "type": "integer",
            "minimum": 1,
            "default": 2
          }
        }
      },
      "AgentWorkflowToolReference": {
        "type": "object",
        "additionalProperties": false,
        "description": "Active HTTP-tool catalog reference. Inline method, URL, headers, and body configuration are rejected by the public API.",
        "properties": {
          "tool_id": {
            "type": "string",
            "format": "uuid"
          },
          "response_bindings": {
            "type": "object",
            "maxProperties": 100,
            "propertyNames": {
              "pattern": "^[A-Za-z0-9_]{1,128}$"
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 512,
              "pattern": "^\\$(?:\\.(?:[A-Za-z_][A-Za-z0-9_-]*|0|[1-9][0-9]*))*$"
            },
            "description": "Map destination slot names to JSON response paths in $.field.0 notation. These bindings run only after a successful tool response."
          }
        },
        "required": [
          "tool_id"
        ]
      },
      "AgentWorkflowTransfer": {
        "description": "Transfer configuration discriminated by mode. Inactive-mode fields are rejected rather than stored and ignored.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/AgentWorkflowColdTransfer"
          },
          {
            "$ref": "#/components/schemas/AgentWorkflowWarmTransfer"
          },
          {
            "$ref": "#/components/schemas/AgentWorkflowAgentTransfer"
          }
        ],
        "discriminator": {
          "propertyName": "mode"
        }
      },
      "AgentWorkflowColdTransfer": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "type": "string",
            "const": "cold"
          },
          "destination": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AgentScopedWorkflowTemplate"
              }
            ],
            "minLength": 1,
            "description": "E.164 number, SIP URI, or an explicitly scoped slots/vars/system template. Bare aliases, params, and secrets are rejected."
          },
          "trunk_id": {
            "$ref": "#/components/schemas/NullableEmptyAgentUUID"
          },
          "method": {
            "type": "string",
            "enum": [
              "refer",
              "bridge"
            ],
            "default": "refer"
          },
          "announcement": {
            "$ref": "#/components/schemas/AgentScopedWorkflowTemplate",
            "description": "Optional line spoken before transfer; requires explicit slots/vars/system references when templated."
          }
        },
        "required": [
          "mode",
          "destination"
        ]
      },
      "AgentWorkflowWarmTransfer": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "type": "string",
            "const": "warm"
          },
          "destination": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AgentScopedWorkflowTemplate"
              }
            ],
            "minLength": 1,
            "description": "E.164 number, SIP URI, or an explicitly scoped slots/vars/system template. Bare aliases, params, and secrets are rejected."
          },
          "trunk_id": {
            "$ref": "#/components/schemas/NullableEmptyAgentUUID"
          },
          "method": {
            "type": "string",
            "const": "bridge",
            "default": "bridge"
          },
          "announcement": {
            "$ref": "#/components/schemas/AgentScopedWorkflowTemplate",
            "description": "Consult announcement spoken to the human; requires explicit slots/vars/system references when templated."
          },
          "briefing_language": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AgentScopedWorkflowTemplate"
              }
            ],
            "maxLength": 200,
            "description": "Language and dialect the briefing AI uses for the whole briefing call to the human, e.g. \"Arabic (Jordanian dialect)\". Empty or absent means English; it never switches. Requires explicit slots/vars/system references when templated. Rejected on cold and agent transfer nodes."
          },
          "include_transcript": {
            "type": "boolean",
            "default": true,
            "description": "Whether the briefing AI's prompt carries the caller's full prior conversation alongside the model's call-specific summary. true (the default) briefs with summary plus full transcript; false briefs with the summary only. Rejected on cold and agent transfer nodes."
          },
          "briefing_prompt": {
            "type": "string",
            "maxLength": 20000,
            "description": "Optional instructions for the briefing AI, i.e. what to tell or ask the transfer recipient. Used only on the briefing call, never with the caller, and added under the platform's built-in briefing rules, which it cannot override. Uses node-prompt template syntax (unscoped {{name}} call variables, {{vars.*}}, {{system.*}}, and {{slots.*}} defined by this workflow) plus briefing-only variables {{transfer.summary}} (this node's rendered announcement), {{transfer.label}}, {{transfer.destination}}, {{transfer.language}}, {{call.transcript}}, {{call.last_caller_message}}, {{call.duration}}, and {{call.duration_seconds}}. The transcript variables are empty when include_transcript is false. Missing values render as empty text. Empty or absent keeps the default briefing. Rejected on cold and agent transfer nodes."
          }
        },
        "required": [
          "mode",
          "destination"
        ]
      },
      "AgentWorkflowAgentTransfer": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "type": "string",
            "const": "agent"
          },
          "target_agent": {
            "type": "string",
            "minLength": 2,
            "maxLength": 48,
            "pattern": "^[a-z0-9_]{2,48}$",
            "description": "Active target agent slug in the same workspace."
          },
          "announcement": {
            "$ref": "#/components/schemas/AgentScopedWorkflowTemplate",
            "description": "Handoff context passed to the target agent; requires explicit slots/vars/system references when templated."
          }
        },
        "required": [
          "mode",
          "target_agent"
        ]
      },
      "AgentWorkflowWait": {
        "type": "object",
        "additionalProperties": false,
        "description": "DTMF collection node. Authoring returns 422/not_available when DTMF is disabled. At least one non-null stop condition (max_digits or terminator) is required. on_timeout=stay is not implemented and is not part of the public shape.",
        "properties": {
          "mode": {
            "type": "string",
            "const": "dtmf"
          },
          "bind_to_slot": {
            "type": "string",
            "minLength": 1,
            "description": "Exact, case-sensitive runtime slot name to create or overwrite with the collected digits. It does not need to appear in a node slots array; wait collection creates the entry when it is absent."
          },
          "max_digits": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "terminator": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "#",
              "*",
              null
            ]
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 1,
            "default": 10000
          },
          "inter_digit_timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "on_timeout": {
            "type": "string",
            "const": "advance",
            "default": "advance"
          }
        },
        "required": [
          "mode",
          "bind_to_slot"
        ],
        "anyOf": [
          {
            "required": [
              "max_digits"
            ],
            "properties": {
              "max_digits": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          {
            "required": [
              "terminator"
            ],
            "properties": {
              "terminator": {
                "type": "string",
                "enum": [
                  "#",
                  "*"
                ]
              }
            }
          }
        ]
      },
      "NullableAgentReferenceInput": {
        "description": "UUID of an enabled compatible catalog resource, or an empty string to clear the optional reference.",
        "oneOf": [
          {
            "type": "string",
            "format": "uuid"
          },
          {
            "type": "string",
            "const": ""
          }
        ]
      },
      "AgentDraftSaveResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "updated": {
            "type": "boolean",
            "description": "False only when the patch was a semantic no-op."
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Aggregate update timestamp corresponding to revision."
          },
          "draft": {
            "$ref": "#/components/schemas/AgentVersionDetail"
          }
        },
        "required": [
          "id",
          "agent_id",
          "updated",
          "revision",
          "updated_at",
          "draft"
        ]
      },
      "AgentListItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "description": "Current persisted aggregate revision. Use the ETag returned by detail/mutation operations rather than deriving a conditional tag from this number; the tag also includes an opaque representation-version component and deployment capability bits."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last externally visible aggregate change; semantic no-ops preserve it."
          },
          "production_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "production_version_number": {
            "type": "integer",
            "minimum": 1,
            "description": "Immutable version number currently deployed to production. Omitted unless production_version_id is present."
          },
          "staging_version_id": {
            "type": "string",
            "format": "uuid",
            "description": "Version last promoted to staging; omitted when none is set."
          },
          "staging_version_number": {
            "type": "integer",
            "minimum": 1,
            "description": "Immutable version number currently on staging. Omitted unless staging_version_id is present."
          },
          "pipeline_topology": {
            "type": "string",
            "enum": [
              "three_stage",
              "two_stage_speechlm"
            ],
            "description": "Topology of the effective production→staging→draft version; omitted when no version pointer resolves. Reported label derived from pipeline_mode: cascaded (STT → brain → TTS) reads three_stage, speech_model reads two_stage_speechlm; a legacy version stored on the three-stage engine also reads three_stage. It is not the runtime engine selector (every v2 version, cascaded included, runs the v2 turn engine), and writing three_stage back to a cascaded draft is a no-op."
          },
          "mode": {
            "type": "string",
            "enum": [
              "pathway",
              "prompt",
              "empty"
            ],
            "description": "Content mode of the effective production→staging→draft version. It reflects deployed precedence, so draft edits do not change this value while a production version exists."
          },
          "node_count": {
            "type": "integer",
            "minimum": 0,
            "description": "workflow.nodes count for the effective production→staging→draft version; omitted for prompt or versionless state."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "archived_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "revision",
          "updated_at",
          "mode",
          "created_at"
        ]
      },
      "AgentListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "AgentPatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "name"
        ]
      },
      "AgentPatchResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "updated": {
            "type": "boolean",
            "description": "False when the trimmed name already matched."
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "updated",
          "revision",
          "updated_at"
        ]
      },
      "AgentPromoteDraftRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "description": "Optional human-readable snapshot label. When present, the trimmed value must contain at least one non-whitespace character; an empty or whitespace-only value returns 422 invalid_body with a field error for name rather than being treated as omitted."
          }
        }
      },
      "AgentPromoteDraftResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID of the immutable snapshot created from the draft."
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "staging_version_id": {
            "type": "string",
            "format": "uuid",
            "description": "New staging pointer; equal to id for this operation."
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Aggregate update timestamp corresponding to revision."
          }
        },
        "required": [
          "id",
          "agent_id",
          "staging_version_id",
          "version",
          "revision",
          "updated_at"
        ]
      },
      "AgentPromoteStagingRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "version_id"
        ]
      },
      "AgentPromoteStagingResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "staging_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "updated": {
            "type": "boolean",
            "description": "False when staging already referenced version_id."
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Aggregate update timestamp corresponding to revision."
          }
        },
        "required": [
          "agent_id",
          "staging_version_id",
          "updated",
          "revision",
          "updated_at"
        ]
      },
      "AgentVersionDetail": {
        "type": "object",
        "additionalProperties": false,
        "description": "Full draft or immutable snapshot. Drafts have is_draft=true and omit version; immutable snapshots have is_draft=false and require their positive version number. prompt and workflow are mutually exclusive. Modern runnable rows have exactly one of them; neither is allowed only so a versionless or migrated legacy empty row remains readable and can be repaired through draft authoring.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "is_draft": {
            "type": "boolean"
          },
          "name": {
            "type": "string",
            "maxLength": 120
          },
          "prompt": {
            "$ref": "#/components/schemas/AgentPromptTemplate"
          },
          "workflow": {
            "$ref": "#/components/schemas/AgentWorkflow"
          },
          "pipeline_topology": {
            "type": "string",
            "enum": [
              "three_stage",
              "two_stage_speechlm"
            ],
            "description": "Reported label derived from pipeline_mode: cascaded (STT → brain → TTS) reads three_stage, speech_model reads two_stage_speechlm; a legacy version stored on the three-stage engine also reads three_stage. It is not the runtime engine selector (every v2 version, cascaded included, runs the v2 turn engine), and writing three_stage back to a cascaded draft is a no-op."
          },
          "pipeline_mode": {
            "type": "string",
            "enum": [
              "speech_model",
              "cascaded"
            ],
            "description": "Source-of-truth runtime pipeline selector. speech_model feeds the brain raw caller audio; cascaded feeds a realtime STT transcript to a text brain then TTS. Both run on the v2 turn engine; pipeline_topology reports three_stage for cascaded and two_stage_speechlm for speech_model."
          },
          "endpointing_mode": {
            "type": "string",
            "enum": [
              "auto",
              "stt",
              "audio"
            ],
            "description": "Turn endpointing selector. auto uses the engine's default endpointing; stt uses STT-driven turn endpointing, valid only for a cascaded pipeline on an endpoint-capable STT integration. `audio` always uses the agent's own audio endpointer; `auto` lets Kejue pick (on the self-hosted speech recognizer that is the recognizer's own turn detection)."
          },
          "stt_language": {
            "type": "string",
            "maxLength": 64,
            "description": "Explicit STT language hint projected from the legacy storage column. Omitted means provider auto-detection."
          },
          "stt_language_hints": {
            "type": "array",
            "maxItems": 10,
            "description": "Expected caller languages projected from storage (see the save-request field of the same name). Omitted when none is set.",
            "items": {
              "type": "string"
            }
          },
          "stt_vocabulary": {
            "type": "object",
            "description": "Per-agent recognition vocabulary projected from storage (see the save-request field of the same name). Omitted when none is set.",
            "properties": {
              "terms": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "notes": {
                "type": "string"
              },
              "hints": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  }
                }
              },
              "translations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "pathway_brain_provider_model_id": {
            "type": "string",
            "format": "uuid",
            "description": "Platform catalog reference for the selected pathway brain. Omitted when the platform default is used or a saved legacy override is no longer available."
          },
          "pathway_brain_override_set": {
            "type": "boolean",
            "description": "Whether a saved override exists, including a legacy selection that is no longer in the available catalog."
          },
          "tts_voice_settings": {
            "$ref": "#/components/schemas/AgentProviderVoiceSettings"
          },
          "behavior": {
            "$ref": "#/components/schemas/AgentBehavior"
          },
          "configuration_errors": {
            "type": "array",
            "minItems": 1,
            "description": "Present only when a legacy or corrupted stored authored field could not be safely normalized. The unreadable top-level field is omitted from this response, and each entry reports its precise JSON path and validation failure so the draft can be repaired with PATCH /agents/{id}. Immutable snapshots are not mutated in place; repair them by correcting and promoting the agent draft. This property is absent for valid modern rows.",
            "items": {
              "$ref": "#/components/schemas/FieldError"
            }
          },
          "llm_provider_model_id": {
            "type": "string",
            "format": "uuid"
          },
          "stt_provider_model_id": {
            "type": "string",
            "format": "uuid"
          },
          "tts_provider_model_id": {
            "type": "string",
            "format": "uuid"
          },
          "tts_voice_id": {
            "type": "string",
            "format": "uuid"
          },
          "speechlm_provider_model_id": {
            "type": "string",
            "format": "uuid"
          },
          "created_by": {
            "type": "string",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "is_draft",
          "pipeline_topology",
          "pipeline_mode",
          "endpointing_mode",
          "created_at"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/AgentDraftVersionInvariant"
          },
          {
            "$ref": "#/components/schemas/AgentImmutableVersionInvariant"
          }
        ],
        "not": {
          "required": [
            "prompt",
            "workflow"
          ]
        }
      },
      "AgentDraftVersionInvariant": {
        "type": "object",
        "description": "Draft discriminator branch for AgentVersionDetail.",
        "properties": {
          "is_draft": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "is_draft"
        ],
        "not": {
          "required": [
            "version"
          ]
        }
      },
      "AgentImmutableVersionInvariant": {
        "type": "object",
        "description": "Immutable discriminator branch for AgentVersionDetail.",
        "properties": {
          "is_draft": {
            "type": "boolean",
            "const": false
          }
        },
        "required": [
          "is_draft",
          "version"
        ]
      },
      "AgentVersionSummary": {
        "type": "object",
        "additionalProperties": false,
        "description": "Compact immutable-version representation used in history lists. It omits the potentially large prompt, workflow, and behavior documents; fetch /agent-versions/{version_id} for the complete snapshot.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "is_draft": {
            "type": "boolean",
            "const": false
          },
          "name": {
            "type": "string",
            "maxLength": 120
          },
          "pipeline_topology": {
            "type": "string",
            "enum": [
              "three_stage",
              "two_stage_speechlm"
            ]
          },
          "created_by": {
            "type": "string",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "version",
          "is_draft",
          "pipeline_topology",
          "created_at"
        ]
      },
      "AgentVersionGetResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "description": "Parent aggregate revision corresponding to the response ETag."
          },
          "version": {
            "$ref": "#/components/schemas/AgentVersionDetail"
          }
        },
        "required": [
          "agent_id",
          "revision",
          "version"
        ]
      },
      "AgentVersionListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentVersionSummary"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque cursor for the next strictly older (created_at, id) tuple. Null means the traversal is complete. A non-null value is bound to this agent, endpoint, sort order, and query shape and must not be edited or reused on another list operation."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "AnalysisSource": {
        "type": "string",
        "enum": [
          "call",
          "extraction",
          "guardrail",
          "tool_call",
          "contact"
        ],
        "description": "Data family queried by one series. Call, extraction, guardrail, and tool_call queries are session-rooted and may be scoped with agent_ids. Contact queries are contact-rooted and reject agent_ids."
      },
      "AnalysisOperation": {
        "type": "string",
        "enum": [
          "count",
          "sum",
          "avg",
          "min",
          "max"
        ],
        "description": "Aggregation applied to the selected column. Read /analysis/schema for the operations supported by each column."
      },
      "AnalysisFilterOperator": {
        "type": "string",
        "enum": [
          "eq",
          "neq",
          "gt",
          "gte",
          "lt",
          "lte",
          "contains",
          "starts_with",
          "ends_with",
          "is_null",
          "not_null"
        ]
      },
      "AnalysisColumnType": {
        "type": "string",
        "enum": [
          "string",
          "enum",
          "uuid",
          "integer",
          "number",
          "boolean",
          "array"
        ]
      },
      "AnalysisChartType": {
        "type": "string",
        "description": "How the insight renders. Several types constrain the query shape and are rejected at write time when the config cannot draw them: pie and donut need a categorical group_by; scatter needs exactly two queries; heatmap needs a secondary group-by; number and number_delta need group_by=none; area_percent needs at least two series. The machine readable form of these rules is constraints.chart_rules on GET /v1/analysis/schema.",
        "enum": [
          "bar",
          "line",
          "area",
          "area_percent",
          "pie",
          "donut",
          "scatter",
          "heatmap",
          "table",
          "number",
          "number_delta"
        ]
      },
      "AnalysisTimeRange": {
        "type": "string",
        "description": "The window the insight reads. custom takes its bounds from config.range_from and config.range_to.",
        "enum": [
          "24h",
          "7d",
          "30d",
          "90d",
          "all",
          "custom"
        ]
      },
      "AnalysisBucket": {
        "type": "string",
        "description": "Time-axis granularity. hour is available only for the 24h, 7d, and custom ranges; a coarser bucket is required for longer windows.",
        "enum": [
          "hour",
          "day",
          "week",
          "month"
        ]
      },
      "AnalysisValueFormat": {
        "type": "string",
        "enum": [
          "number",
          "percent",
          "duration",
          "currency"
        ]
      },
      "AnalysisStackMode": {
        "type": "string",
        "enum": [
          "none",
          "stack",
          "normalize"
        ]
      },
      "AnalysisOrientation": {
        "type": "string",
        "enum": [
          "vertical",
          "horizontal"
        ]
      },
      "AnalysisInsightLayout": {
        "type": "object",
        "additionalProperties": false,
        "description": "Placement on the board's 12-column grid. A row unit is 40px in the dashboard. All four fields are supplied together; x + w must not exceed 12 columns.",
        "properties": {
          "x": {
            "type": "integer",
            "minimum": 0,
            "maximum": 11
          },
          "y": {
            "type": "integer",
            "minimum": 0,
            "maximum": 999
          },
          "w": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "h": {
            "type": "integer",
            "minimum": 1,
            "maximum": 24
          }
        },
        "required": [
          "x",
          "y",
          "w",
          "h"
        ]
      },
      "AnalysisInsightDisplay": {
        "type": "object",
        "additionalProperties": false,
        "description": "Presentation options. Never affects which rows the query returns, so an unsupported combination changes how a chart looks and never what it measures.",
        "properties": {
          "series_colors": {
            "type": "object",
            "description": "Series (or slice) name to a Kejue Voice design token. Colors are restricted to var(--sonus-*) custom properties; hex literals and arbitrary CSS are rejected.",
            "maxProperties": 60,
            "additionalProperties": {
              "type": "string",
              "pattern": "^var\\(--sonus-[a-z0-9-]{1,40}\\)$"
            }
          },
          "legend": {
            "type": "boolean"
          },
          "value_format": {
            "$ref": "#/components/schemas/AnalysisValueFormat"
          },
          "stack_mode": {
            "$ref": "#/components/schemas/AnalysisStackMode"
          },
          "orientation": {
            "$ref": "#/components/schemas/AnalysisOrientation"
          },
          "goal": {
            "type": [
              "number",
              "null"
            ],
            "description": "Dashed reference line on the value axis."
          },
          "lower_is_better": {
            "type": "boolean",
            "description": "Inverts delta coloring for metrics where down is good."
          }
        }
      },
      "AnalysisGroupBy": {
        "type": "string",
        "enum": [
          "none",
          "time",
          "agent",
          "value"
        ]
      },
      "AnalysisSecondaryGroupBy": {
        "type": "string",
        "enum": [
          "time",
          "agent",
          "value"
        ]
      },
      "AnalysisValueDimension": {
        "type": "object",
        "additionalProperties": false,
        "description": "Column used when the primary or secondary grouping is value. Omit to group by the metric column. Call and extraction can group by either source; other sources must match the metric. Requires exactly one query and a declared extraction field when source is extraction.",
        "properties": {
          "source": {
            "$ref": "#/components/schemas/AnalysisSource"
          },
          "column": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
          }
        },
        "required": [
          "source",
          "column"
        ]
      },
      "AnalysisFilter": {
        "type": "object",
        "additionalProperties": false,
        "description": "A typed filter. value is required for every operator except is_null and not_null, for which value must be omitted. Numeric, boolean, UUID, and fixed-enum values are validated against the selected column before SQL runs.",
        "properties": {
          "source": {
            "$ref": "#/components/schemas/AnalysisSource",
            "description": "Omit to inherit the metric source. Call and extraction filters may be combined within the same query; other sources must match the metric."
          },
          "column": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
          },
          "op": {
            "$ref": "#/components/schemas/AnalysisFilterOperator"
          },
          "value": {
            "type": "string",
            "maxLength": 500,
            "description": "A typed value encoded as a string. Literal wildcard characters in text filters are escaped."
          }
        },
        "required": [
          "column",
          "op"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "op": {
                  "enum": [
                    "is_null",
                    "not_null"
                  ]
                }
              },
              "required": [
                "op"
              ]
            },
            "then": {
              "not": {
                "required": [
                  "value"
                ]
              }
            },
            "else": {
              "required": [
                "value"
              ]
            }
          }
        ]
      },
      "AnalysisQueryInput": {
        "type": "object",
        "additionalProperties": false,
        "description": "One input series. Omitted names normalize to A, B, C, and so on; filters and agent_ids normalize to empty arrays. Optional group_by selects a value dimension independently of the metric column, for example average call duration by an extracted category. All extraction queries in one insight must reference the same extraction object. A contact query cannot supply agent_ids, and one insight cannot mix contact with session-rooted sources.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,31}$",
            "description": "Unique formula identifier within this insight. Defaults by position when omitted."
          },
          "source": {
            "$ref": "#/components/schemas/AnalysisSource"
          },
          "group_by": {
            "$ref": "#/components/schemas/AnalysisValueDimension"
          },
          "extraction_object_id": {
            "type": "string",
            "format": "uuid",
            "description": "Required whenever the metric, grouping, or a filter references extraction fields. All extraction references in an insight must use the same object. Rejected when no extraction field is referenced."
          },
          "column": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
          },
          "operation": {
            "$ref": "#/components/schemas/AnalysisOperation"
          },
          "filters": {
            "type": "array",
            "maxItems": 10,
            "default": [],
            "items": {
              "$ref": "#/components/schemas/AnalysisFilter"
            }
          },
          "agent_ids": {
            "type": "array",
            "maxItems": 20,
            "uniqueItems": true,
            "default": [],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "source",
          "column",
          "operation"
        ],
        "allOf": [
          {
            "if": {
              "anyOf": [
                {
                  "properties": {
                    "source": {
                      "const": "extraction"
                    }
                  },
                  "required": [
                    "source"
                  ]
                },
                {
                  "properties": {
                    "group_by": {
                      "properties": {
                        "source": {
                          "const": "extraction"
                        }
                      },
                      "required": [
                        "source"
                      ]
                    }
                  },
                  "required": [
                    "group_by"
                  ]
                },
                {
                  "properties": {
                    "filters": {
                      "contains": {
                        "properties": {
                          "source": {
                            "const": "extraction"
                          }
                        },
                        "required": [
                          "source"
                        ]
                      }
                    }
                  },
                  "required": [
                    "filters"
                  ]
                }
              ]
            },
            "then": {
              "required": [
                "extraction_object_id"
              ]
            },
            "else": {
              "not": {
                "required": [
                  "extraction_object_id"
                ]
              }
            }
          }
        ]
      },
      "AnalysisQuery": {
        "type": "object",
        "additionalProperties": false,
        "description": "A normalized saved query. Defaulted name, filters, and agent_ids are always emitted.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,31}$"
          },
          "source": {
            "$ref": "#/components/schemas/AnalysisSource"
          },
          "group_by": {
            "$ref": "#/components/schemas/AnalysisValueDimension"
          },
          "extraction_object_id": {
            "type": "string",
            "format": "uuid"
          },
          "column": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
          },
          "operation": {
            "$ref": "#/components/schemas/AnalysisOperation"
          },
          "filters": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/AnalysisFilter"
            }
          },
          "agent_ids": {
            "type": "array",
            "maxItems": 20,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "name",
          "source",
          "column",
          "operation",
          "filters",
          "agent_ids"
        ],
        "allOf": [
          {
            "if": {
              "anyOf": [
                {
                  "properties": {
                    "source": {
                      "const": "extraction"
                    }
                  },
                  "required": [
                    "source"
                  ]
                },
                {
                  "properties": {
                    "group_by": {
                      "properties": {
                        "source": {
                          "const": "extraction"
                        }
                      },
                      "required": [
                        "source"
                      ]
                    }
                  },
                  "required": [
                    "group_by"
                  ]
                },
                {
                  "properties": {
                    "filters": {
                      "contains": {
                        "properties": {
                          "source": {
                            "const": "extraction"
                          }
                        },
                        "required": [
                          "source"
                        ]
                      }
                    }
                  },
                  "required": [
                    "filters"
                  ]
                }
              ]
            },
            "then": {
              "required": [
                "extraction_object_id"
              ]
            },
            "else": {
              "not": {
                "required": [
                  "extraction_object_id"
                ]
              }
            }
          }
        ]
      },
      "AnalysisSchemaField": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "$ref": "#/components/schemas/AnalysisColumnType"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "required": {
            "type": "boolean",
            "description": "Whether a dynamic extraction field is required in extracted output. Fixed source columns return false."
          },
          "enum_values": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Allowed machine values for a fixed or dynamic enum column; otherwise an empty array."
          },
          "item_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "string",
              "integer",
              "number",
              null
            ],
            "description": "Array element type for extraction fields; otherwise null."
          },
          "supported_operations": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/AnalysisOperation"
            }
          },
          "filter_operators": {
            "type": "array",
            "minItems": 2,
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/AnalysisFilterOperator"
            }
          }
        },
        "required": [
          "name",
          "label",
          "type",
          "description",
          "required",
          "enum_values",
          "item_type",
          "supported_operations",
          "filter_operators"
        ]
      },
      "AnalysisSchemaSource": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "source": {
            "$ref": "#/components/schemas/AnalysisSource"
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "extraction_object_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The dynamic object ID for extraction sources; null for fixed sources."
          },
          "extraction_object_name": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 120,
            "description": "The extraction object's name; null for fixed sources."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000,
            "description": "The extraction object's description; null for fixed sources."
          },
          "supports_agent_scope": {
            "type": "boolean"
          },
          "time_basis": {
            "type": "string",
            "enum": [
              "session.started_at",
              "tool_call.occurred_at",
              "contact.created_at"
            ]
          },
          "columns": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/AnalysisSchemaField"
            }
          }
        },
        "required": [
          "source",
          "label",
          "extraction_object_id",
          "extraction_object_name",
          "description",
          "supports_agent_scope",
          "time_basis",
          "columns"
        ]
      },
      "AnalysisSchemaAgent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "has_data": {
            "type": "boolean",
            "description": "True when at least one call exists for any version of the agent."
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "has_data"
        ]
      },
      "AnalysisSchemaConstraints": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "chart_types": {
            "type": "array",
            "minItems": 11,
            "maxItems": 11,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/AnalysisChartType"
            }
          },
          "time_ranges": {
            "type": "array",
            "minItems": 6,
            "maxItems": 6,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/AnalysisTimeRange"
            }
          },
          "buckets": {
            "type": "array",
            "minItems": 4,
            "maxItems": 4,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/AnalysisBucket"
            }
          },
          "group_bys": {
            "type": "array",
            "minItems": 4,
            "maxItems": 4,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/AnalysisGroupBy"
            }
          },
          "secondary_group_bys": {
            "type": "array",
            "minItems": 3,
            "maxItems": 3,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/AnalysisSecondaryGroupBy"
            }
          },
          "maximum_queries": {
            "type": "integer",
            "const": 6
          },
          "maximum_filters_per_query": {
            "type": "integer",
            "const": 10
          },
          "maximum_agent_ids_per_query": {
            "type": "integer",
            "const": 20
          },
          "maximum_result_rows": {
            "type": "integer",
            "const": 500
          },
          "maximum_result_series": {
            "type": "integer",
            "const": 50
          },
          "maximum_result_cells": {
            "type": "integer",
            "const": 10000
          },
          "value_formats": {
            "type": "array",
            "minItems": 4,
            "maxItems": 4,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/AnalysisValueFormat"
            }
          },
          "stack_modes": {
            "type": "array",
            "minItems": 3,
            "maxItems": 3,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/AnalysisStackMode"
            }
          },
          "orientations": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/AnalysisOrientation"
            }
          },
          "chart_rules": {
            "type": "object",
            "description": "Per-chart-type query-shape rules, keyed by chart type. Only types that constrain the config appear. The dashboard renders these as editor constraints; the server enforces the same rules, so a client that respects them never sees a shape rejection.",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "queries": {
                  "type": "integer",
                  "description": "Exact number of queries the chart requires."
                },
                "minimum_series": {
                  "type": "integer"
                },
                "group_bys": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "$ref": "#/components/schemas/AnalysisGroupBy"
                  }
                },
                "requires_secondary_group_by": {
                  "type": "boolean"
                },
                "forbids_secondary_group_by": {
                  "type": "boolean"
                },
                "forbidden_time_ranges": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "$ref": "#/components/schemas/AnalysisTimeRange"
                  }
                }
              }
            }
          },
          "grid_columns": {
            "type": "integer",
            "const": 12
          },
          "maximum_custom_range_days": {
            "type": "integer",
            "const": 400
          }
        },
        "required": [
          "chart_types",
          "time_ranges",
          "buckets",
          "group_bys",
          "secondary_group_bys",
          "maximum_queries",
          "maximum_filters_per_query",
          "maximum_agent_ids_per_query",
          "maximum_result_rows",
          "maximum_result_series",
          "maximum_result_cells",
          "value_formats",
          "stack_modes",
          "orientations",
          "chart_rules",
          "grid_columns",
          "maximum_custom_range_days"
        ]
      },
      "AnalysisSchemaResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "schema_version": {
            "type": "string",
            "const": "2.0",
            "description": "2.0 publishes every source's columns once, under sources[]. The 1.x top-level call_columns / guardrail_columns / tool_call_columns / contact_columns and extraction_objects duplicated them and were removed."
          },
          "operations": {
            "type": "array",
            "minItems": 5,
            "maxItems": 5,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/AnalysisOperation"
            }
          },
          "filter_operators": {
            "type": "array",
            "minItems": 11,
            "maxItems": 11,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/AnalysisFilterOperator"
            }
          },
          "sources": {
            "type": "array",
            "minItems": 4,
            "description": "The queryable sources and their columns: the fixed call, guardrail, tool_call and contact sources, then one extraction source per active extraction object (identified by extraction_object_id).",
            "items": {
              "$ref": "#/components/schemas/AnalysisSchemaSource"
            }
          },
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalysisSchemaAgent"
            }
          },
          "constraints": {
            "$ref": "#/components/schemas/AnalysisSchemaConstraints"
          }
        },
        "required": [
          "schema_version",
          "operations",
          "filter_operators",
          "sources",
          "agents",
          "constraints"
        ]
      },
      "ApiKey": {
        "type": "object",
        "additionalProperties": false,
        "description": "Safe API-key metadata. Secret and hash material are never present.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "prefix": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "scopes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 256,
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "created_by_user_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "created_by_api_key_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "prefix",
          "name",
          "scopes",
          "status",
          "created_by_user_id",
          "created_by_api_key_id",
          "last_used_at",
          "expires_at",
          "revoked_at",
          "version",
          "created_at",
          "updated_at"
        ]
      },
      "ApiKeyListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKey"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cursor for the next page, or null after the final page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "AuditActorKind": {
        "type": "string",
        "enum": [
          "user",
          "api_key",
          "system",
          "agent",
          "eval"
        ]
      },
      "AuditPublicMetadata": {
        "type": "object",
        "additionalProperties": false,
        "description": "Versioned, fail-closed public projection of internal audit metadata. Only the fields declared here can be returned. Unknown, free-form, malformed, or unsafe source fields are omitted; source objects that cannot be safely decoded are replaced by a redacted status object.",
        "properties": {
          "public_schema_version": {
            "type": "integer",
            "const": 1
          },
          "metadata_status": {
            "type": "string",
            "enum": [
              "complete",
              "filtered",
              "redacted"
            ]
          },
          "dropped_fields_count": {
            "type": "integer",
            "minimum": 1,
            "description": "Present when metadata_status is filtered."
          },
          "reason_code": {
            "type": "string",
            "enum": [
              "source_too_large",
              "invalid_json",
              "invalid_shape"
            ],
            "description": "Present when metadata_status is redacted."
          },
          "source_bytes": {
            "type": "integer",
            "minimum": 1,
            "description": "Source size when known for a redacted object."
          },
          "account_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "board_id": {
            "type": "string",
            "format": "uuid"
          },
          "call_id": {
            "type": "string",
            "format": "uuid"
          },
          "contact_id": {
            "type": "string",
            "format": "uuid"
          },
          "delivery_id": {
            "type": "string",
            "format": "uuid"
          },
          "document_id": {
            "type": "string",
            "format": "uuid"
          },
          "draft_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "extraction_object_id": {
            "type": "string",
            "format": "uuid"
          },
          "guardrail_id": {
            "type": "string",
            "format": "uuid"
          },
          "invitation_id": {
            "type": "string",
            "format": "uuid"
          },
          "job_id": {
            "type": "string",
            "format": "uuid"
          },
          "kb_id": {
            "type": "string",
            "format": "uuid"
          },
          "mcp_server_id": {
            "type": "string",
            "format": "uuid"
          },
          "organization_id": {
            "type": "string",
            "format": "uuid"
          },
          "pcap_id": {
            "type": "string",
            "format": "uuid"
          },
          "phone_number_id": {
            "type": "string",
            "format": "uuid"
          },
          "policy_id": {
            "type": "string",
            "format": "uuid"
          },
          "pool_id": {
            "type": "string",
            "format": "uuid"
          },
          "production_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "recording_id": {
            "type": "string",
            "format": "uuid"
          },
          "replay_delivery_id": {
            "type": "string",
            "format": "uuid"
          },
          "replay_of_delivery_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision_id": {
            "type": "string",
            "format": "uuid"
          },
          "role_id": {
            "type": "string",
            "format": "uuid"
          },
          "secret_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_delivery_id": {
            "type": "string",
            "format": "uuid"
          },
          "staging_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "suite_id": {
            "type": "string",
            "format": "uuid"
          },
          "tag_id": {
            "type": "string",
            "format": "uuid"
          },
          "tool_id": {
            "type": "string",
            "format": "uuid"
          },
          "transfer_id": {
            "type": "string",
            "format": "uuid"
          },
          "trunk_id": {
            "type": "string",
            "format": "uuid"
          },
          "user_id": {
            "type": "string",
            "format": "uuid"
          },
          "version_id": {
            "type": "string",
            "format": "uuid"
          },
          "webhook_config_id": {
            "type": "string",
            "format": "uuid"
          },
          "active_job_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "attached_trunk_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "attempt_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "attempts": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "byte_size": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "call_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "cancelled_delivery_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "consumed_attempt_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "dependency_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "entity_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "external_objects_scheduled": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "field_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "invitation_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "max_attempts": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "member_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "packet_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "policy_version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "organization_version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "position": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "resource_version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "tag_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "tool_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "ttl_seconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "turn_index": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "usage_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "allow_call_overrides": {
            "type": "boolean"
          },
          "allowlist_edit": {
            "type": "boolean"
          },
          "archived": {
            "type": "boolean"
          },
          "changed": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "pcap_enabled": {
            "type": "boolean"
          },
          "provider_edit": {
            "type": "boolean"
          },
          "outcome_unknown": {
            "type": "boolean"
          },
          "reassigned_agent": {
            "type": "boolean"
          },
          "renamed": {
            "type": "boolean"
          },
          "rotated_creds": {
            "type": "boolean"
          },
          "retryable": {
            "type": "boolean"
          },
          "set_extraction_object_ids": {
            "type": "boolean"
          },
          "set_summary_enabled": {
            "type": "boolean"
          },
          "set_summary_prompt": {
            "type": "boolean"
          },
          "set_webhook_config_ids": {
            "type": "boolean"
          },
          "content_hash": {
            "type": "string",
            "pattern": "^[0-9A-Fa-f]{64}$"
          },
          "definition_hash": {
            "type": "string",
            "pattern": "^[0-9A-Fa-f]{64}$"
          },
          "destination_sha256": {
            "type": "string",
            "pattern": "^[0-9A-Fa-f]{64}$"
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "ringing",
              "in_progress",
              "ended",
              "failed",
              null
            ]
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "ringing",
              "in_progress",
              "ended",
              "failed",
              null
            ]
          },
          "failure_code": {
            "type": "string",
            "enum": [
              "caller_hangup_pre_answer",
              "caller_hangup_during_queue",
              "agent_dispatch_timeout",
              "provider_busy",
              "provider_no_answer",
              "provider_rejected",
              "provider_capacity",
              "provider_rate_limited",
              "provider_route_unavailable",
              "caller_id_invalid",
              "provider_authentication",
              "provider_unknown",
              "destination_invalid",
              "provider_forbidden",
              "agent_crash",
              "media_pipeline_error",
              "admin_canceled",
              "dncr_blocked",
              "dncr_unavailable",
              "dncr_configuration_invalid",
              "unknown"
            ]
          },
          "end_reason": {
            "type": "string",
            "enum": [
              "caller_hangup_pre_answer",
              "caller_hangup_during_queue",
              "agent_dispatch_timeout",
              "provider_busy",
              "provider_no_answer",
              "provider_rejected",
              "provider_capacity",
              "provider_rate_limited",
              "provider_route_unavailable",
              "caller_id_invalid",
              "provider_authentication",
              "provider_unknown",
              "destination_invalid",
              "provider_forbidden",
              "agent_crash",
              "media_pipeline_error",
              "admin_canceled",
              "dncr_blocked",
              "dncr_unavailable",
              "dncr_configuration_invalid",
              "unknown",
              "agent_hungup",
              "agent_silence_watchdog",
              "api_hangup",
              "customer_hungup",
              "caller_disconnected",
              "twilio_completed"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "inbound",
              "outbound"
            ]
          },
          "leg": {
            "type": "string",
            "enum": [
              "caller",
              "agent"
            ]
          },
          "transport": {
            "type": "string",
            "enum": [
              "udp",
              "tcp",
              "tls"
            ]
          },
          "selection_policy": {
            "type": "string",
            "enum": [
              "sticky_least_loaded",
              "least_loaded",
              "weighted_round_robin"
            ]
          },
          "provider_cleanup": {
            "type": "string",
            "enum": [
              "scheduled",
              "confirmed",
              "not_required",
              "reconciliation_required"
            ]
          },
          "provider": {
            "type": "string",
            "enum": [
              "livekit",
              "twilio",
              "unknown"
            ]
          },
          "provider_confirmation": {
            "type": "string",
            "enum": [
              "confirmed",
              "already_terminal"
            ]
          },
          "provider_status": {
            "type": "string",
            "enum": [
              "accepted",
              "queued",
              "ringing",
              "in-progress",
              "completed",
              "canceled",
              "busy",
              "failed",
              "no-answer",
              "deleted",
              "not_found"
            ]
          },
          "result": {
            "type": "string",
            "enum": [
              "already_terminal"
            ]
          },
          "livekit_delete": {
            "type": "string",
            "enum": [
              "scheduled"
            ]
          },
          "dependency_kind": {
            "type": "string",
            "enum": [
              "agent",
              "phone_number",
              "sip_trunk",
              "tool",
              "webhook"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/AuditPublicStatusCode"
          },
          "previous_status": {
            "$ref": "#/components/schemas/AuditPublicStatusCode"
          },
          "delivery_status": {
            "type": "string",
            "enum": [
              "pending",
              "leased",
              "delivered",
              "failed",
              "failed_permanent"
            ]
          },
          "deployment_stage": {
            "type": "string",
            "enum": [
              "draft",
              "staging",
              "production"
            ]
          },
          "reconciliation": {
            "type": "string",
            "enum": [
              "scheduled",
              "required",
              "complete"
            ]
          },
          "reconciliation_code": {
            "type": "string",
            "enum": [
              "provider_result_ambiguous",
              "provider_state_unknown"
            ]
          }
        },
        "required": [
          "public_schema_version",
          "metadata_status"
        ]
      },
      "AuditPublicStatusCode": {
        "type": "string",
        "enum": [
          "active",
          "archived",
          "canceled",
          "cancelled",
          "completed",
          "delivered",
          "disabled",
          "done",
          "draft",
          "ended",
          "error",
          "expired",
          "failed",
          "failed_permanent",
          "in_progress",
          "inactive",
          "leased",
          "pending",
          "provisioning",
          "published",
          "queued",
          "ready",
          "rejected",
          "retrying",
          "ringing",
          "running",
          "scheduled",
          "skipped",
          "staging",
          "succeeded"
        ]
      },
      "AuditVia": {
        "type": "object",
        "additionalProperties": false,
        "description": "The connected app a person acted through. The event's actor fields still name the human (actor_kind `user`); this records the app that made the request on their behalf, so the event reads \"<user> via <client_name>\".",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "oauth"
            ],
            "description": "Delegation channel. `oauth` is an OAuth connected app (MCP client such as Claude)."
          },
          "client_name": {
            "type": "string",
            "minLength": 1,
            "description": "The app's name as shown on the consent screen when the grant was approved (a snapshot, like the actor email)."
          },
          "grant_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The connected-app grant that made the request; use it with the list `oauth_grant_id` filter. Null only for events whose writer recorded the app name without a grant."
          }
        },
        "required": [
          "kind",
          "client_name",
          "grant_id"
        ]
      },
      "AuditLogListItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "ts": {
            "type": "string",
            "format": "date-time"
          },
          "actor_kind": {
            "$ref": "#/components/schemas/AuditActorKind"
          },
          "user_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "user_email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "user_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "api_key_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "api_key_prefix": {
            "type": [
              "string",
              "null"
            ]
          },
          "api_key_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "action": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "resource_kind": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "resource_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 512
          },
          "resource_label": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "The resource's human name, resolved at read time within the caller's own organization. Null when the resource kind has no name, the row has since been deleted, or the identifier is not a UUID — the client then displays `resource_id`."
          },
          "client_ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 256
          },
          "session_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "via": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AuditVia"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when the actor acted through a connected app (OAuth client such as Claude over MCP); null for direct actions."
          },
          "metadata": {
            "$ref": "#/components/schemas/AuditPublicMetadata"
          }
        },
        "required": [
          "id",
          "ts",
          "actor_kind",
          "user_id",
          "user_email",
          "user_name",
          "api_key_id",
          "api_key_prefix",
          "api_key_name",
          "action",
          "resource_kind",
          "resource_id",
          "resource_label",
          "client_ip",
          "request_id",
          "session_id",
          "via",
          "metadata"
        ]
      },
      "AuditLogListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditLogListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "AuditActor": {
        "type": "object",
        "additionalProperties": false,
        "description": "One distinct principal appearing in the audit trail. At most one identity block is populated — a human (user_id/email/display_name) or an API key (api_key_id/api_key_name/api_key_prefix). Both are null for the system, agent, and eval writers, which have no principal; select those with the `actor` filter instead. A person who also acted through a connected app appears once more per connection, with `via` set — select those events with the list's `oauth_grant_id` filter.",
        "properties": {
          "actor_kind": {
            "$ref": "#/components/schemas/AuditActorKind"
          },
          "user_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "api_key_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "api_key_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "api_key_prefix": {
            "type": [
              "string",
              "null"
            ]
          },
          "via": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AuditVia"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set on the entry for a person's actions through one connected app; null on their direct entry and on every non-human entry."
          },
          "event_count": {
            "type": "integer",
            "minimum": 1
          },
          "last_seen": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "actor_kind",
          "user_id",
          "email",
          "display_name",
          "api_key_id",
          "api_key_name",
          "api_key_prefix",
          "via",
          "event_count",
          "last_seen"
        ]
      },
      "AuditActorsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditActor"
            }
          },
          "truncated": {
            "type": "boolean",
            "description": "True when the organization has more distinct actors than this response carries. Never a silent truncation — the client must surface that the picker is not exhaustive."
          }
        },
        "required": [
          "data",
          "truncated"
        ]
      },
      "Board": {
        "type": "object",
        "additionalProperties": false,
        "description": "A complete analysis board. Insights are always present and ordered by position, then ID.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "insights": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Insight"
            }
          }
        },
        "required": [
          "id",
          "name",
          "archived_at",
          "created_at",
          "updated_at",
          "insights"
        ]
      },
      "BoardSummary": {
        "type": "object",
        "additionalProperties": false,
        "description": "List representation. Embedded insight definitions are intentionally omitted.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "insight_count": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "archived_at",
          "insight_count",
          "created_at",
          "updated_at"
        ]
      },
      "BoardCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Trimmed display name. Active names are unique case-insensitively."
          }
        },
        "required": [
          "name"
        ]
      },
      "BoardListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BoardSummary"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque endpoint-scoped cursor, or null on the final page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "BoardPatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "archived": {
            "type": "boolean",
            "description": "True archives the board; false restores it."
          }
        }
      },
      "CallBatchDeleteRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 200,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "ids"
        ]
      },
      "CallPurgeCleanup": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "not_required",
              "pending",
              "complete"
            ]
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "deleted": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pending": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        },
        "required": [
          "status",
          "total",
          "deleted",
          "pending"
        ]
      },
      "CallBatchDeleteResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "purged",
              "purging",
              "already_purged",
              "legal_hold",
              "active",
              "processing",
              "not_found"
            ]
          },
          "cleanup": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CallPurgeCleanup"
              },
              {
                "type": "null"
              }
            ]
          },
          "poll_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "GET this relative API URL after retry_after_seconds when status is purging; null for every other status."
          }
        },
        "required": [
          "id",
          "status",
          "cleanup",
          "poll_url"
        ]
      },
      "CallBatchDeleteResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallBatchDeleteResult"
            }
          },
          "deleted": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "cleanup_pending": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "skipped_legal_hold": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "skipped_active": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "skipped_processing": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "not_found": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "already_purged": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "retry_after_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Matches Retry-After when any result is purging; null when no polling is required."
          }
        },
        "required": [
          "results",
          "deleted",
          "cleanup_pending",
          "skipped_legal_hold",
          "skipped_active",
          "skipped_processing",
          "not_found",
          "already_purged",
          "retry_after_seconds"
        ]
      },
      "CallDeleteResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "object": {
            "type": "string",
            "const": "call"
          },
          "status": {
            "type": "string",
            "enum": [
              "purged",
              "purging",
              "already_purged"
            ]
          },
          "deleted": {
            "type": "boolean",
            "description": "True only when this request performed the database purge."
          },
          "purged_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "cleanup": {
            "$ref": "#/components/schemas/CallPurgeCleanup"
          },
          "records_deleted": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          }
        },
        "required": [
          "id",
          "object",
          "status",
          "deleted",
          "purged_at",
          "updated_at",
          "cleanup",
          "records_deleted"
        ]
      },
      "CallContextInjectRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Queues an encrypted system-context message for a live call. The message is committed before delivery and retried for transient message-bus or subscriber-readiness failures. `content` is limited to 4096 UTF-8 bytes; newlines are allowed, blank-only content and NUL are rejected.",
        "properties": {
          "content": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "role": {
            "type": "string",
            "enum": [
              "system"
            ],
            "default": "system"
          },
          "urgency": {
            "type": "string",
            "enum": [
              "immediate",
              "soon",
              "later"
            ],
            "default": "soon"
          }
        },
        "required": [
          "content"
        ]
      },
      "CallContextInjectResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "call_id": {
            "type": "string",
            "format": "uuid"
          },
          "role": {
            "type": "string",
            "enum": [
              "system"
            ]
          },
          "urgency": {
            "type": "string",
            "enum": [
              "immediate",
              "soon",
              "later"
            ]
          },
          "delivery_status": {
            "type": "string",
            "enum": [
              "pending"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "call_id",
          "role",
          "urgency",
          "delivery_status",
          "created_at"
        ]
      },
      "CallHangupResponse": {
        "type": "object",
        "additionalProperties": false,
        "description": "Closed action result for a confirmed hangup or terminal no-op.",
        "properties": {
          "call_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "ended",
              "failed"
            ]
          },
          "changed": {
            "type": "boolean",
            "description": "True only when this request transitioned the call to ended."
          },
          "provider_confirmation": {
            "type": "string",
            "enum": [
              "confirmed",
              "already_terminal"
            ]
          },
          "reconciliation_status": {
            "type": "string",
            "enum": [
              "not_applicable",
              "scheduled"
            ],
            "description": "Scheduled means durable outbound job and attempt healing continues after commit."
          }
        },
        "required": [
          "call_id",
          "status",
          "changed",
          "provider_confirmation",
          "reconciliation_status"
        ]
      },
      "CallDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CallCore"
          },
          {
            "type": "object",
            "properties": {
              "contact_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "transcript": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TranscriptSegment"
                }
              },
              "live_transcript": {
                "description": "Current redacted live transcript snapshot, or null when unavailable."
              },
              "transcript_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "redacted_entities": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": true
              },
              "has_encrypted_raw": {
                "type": "boolean"
              },
              "pathway_state": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/PathwayState"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tool_invocations": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CallToolInvocation"
                }
              },
              "actions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CallAction"
                }
              },
              "data_messages": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CallDataMessage"
                }
              },
              "summary": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CallSummaryResult"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "extractions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CallExtractionResult"
                }
              },
              "webhook_deliveries": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CallWebhookDelivery"
                }
              },
              "recordings": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RecordingSummary"
                }
              },
              "recording_enabled": {
                "type": "boolean",
                "description": "True when the deployment stores call recordings and the call had audio. Always false for text-modality web calls."
              },
              "turn_metrics": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CallTurnMetric"
                }
              },
              "metrics_rollup": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CallMetricsRollup"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "user_turn_audio": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UserTurnAudio"
                }
              },
              "purge_cleanup": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CallPurgeCleanup"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "failure_reason_internal": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 2049,
                "description": "Operator-only failure diagnostics. Customer responses return null and expose the classified failure_code and failure_reason instead."
              },
              "sip_failure": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CallSIPFailure"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sip_messages": {
                "type": "array",
                "description": "Captured SIP messages for the call's setup (first INVITE, auth challenge, final response), oldest first.",
                "items": {
                  "$ref": "#/components/schemas/CallSIPMessage"
                }
              },
              "sip_rejections": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CallSIPRejection"
                }
              },
              "timeline_available": {
                "type": "boolean",
                "description": "True when GET /v1/calls/{id}/timeline has evidence beyond the session's own start/answer/end markers — the agent event log, model requests, tool calls, turn metrics, transcript, transfer or SIP events, or a ready recording. The timeline's sources array names which of them it was assembled from."
              }
            },
            "required": [
              "contact_id",
              "transcript",
              "live_transcript",
              "transcript_id",
              "redacted_entities",
              "has_encrypted_raw",
              "pathway_state",
              "tool_invocations",
              "actions",
              "data_messages",
              "summary",
              "extractions",
              "webhook_deliveries",
              "recordings",
              "recording_enabled",
              "turn_metrics",
              "metrics_rollup",
              "user_turn_audio",
              "purge_cleanup",
              "failure_reason_internal",
              "sip_failure",
              "sip_messages",
              "sip_rejections",
              "timeline_available"
            ]
          }
        ],
        "unevaluatedProperties": false
      },
      "CallTimeline": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "call_id",
          "version",
          "anchor",
          "duration_ms",
          "sources",
          "truncated",
          "recording",
          "events",
          "turns",
          "transcript",
          "models"
        ],
        "properties": {
          "call_id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "const": 1
          },
          "anchor": {
            "type": "string",
            "format": "date-time",
            "description": "Time zero of the timeline; every event's t is milliseconds since this instant."
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0
          },
          "sources": {
            "type": "array",
            "description": "Producers that contributed events (agent, usage_events, tool_invocations, turn_metrics, transcript, transfers).",
            "items": {
              "type": "string"
            }
          },
          "truncated": {
            "type": "boolean",
            "description": "True when an event cap was reached and some events were dropped."
          },
          "recording": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CallTimelineRecording"
              },
              {
                "type": "null"
              }
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallTimelineEvent"
            }
          },
          "turns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallTimelineTurn"
            }
          },
          "transcript": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallTimelineUtterance"
            }
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallTimelineModelUsage"
            }
          }
        }
      },
      "CallTimelineRecording": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "recording_id",
          "offset_ms",
          "duration_ms",
          "channels",
          "has_peaks"
        ],
        "properties": {
          "recording_id": {
            "type": "string",
            "format": "uuid"
          },
          "offset_ms": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Recording start relative to the anchor; null when unknown."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "channels": {
            "type": [
              "integer",
              "null"
            ]
          },
          "has_peaks": {
            "type": "boolean"
          }
        }
      },
      "CallTimelineEvent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "t",
          "d",
          "track",
          "kind",
          "turn",
          "speech_id",
          "level",
          "label",
          "source",
          "attrs"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "t": {
            "type": "integer",
            "description": "Start in milliseconds since the anchor (may be negative for events before the agent joined)."
          },
          "d": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Duration in milliseconds; null for an instant marker."
          },
          "track": {
            "type": "string",
            "description": "Lane, for example call, sip, caller_speech, agent_speech, vad, stt, endpoint, turn, llm, tts, tool, decision, state, guardrail, transfer, dtmf, error, degraded."
          },
          "kind": {
            "type": "string"
          },
          "turn": {
            "type": [
              "integer",
              "null"
            ]
          },
          "speech_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "level": {
            "type": "string",
            "enum": [
              "info",
              "warn",
              "error"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "agent",
              "gateway",
              "tool",
              "session",
              "transfer",
              "sip"
            ]
          },
          "attrs": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CallTimelineTurn": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "index",
          "speech_id",
          "t",
          "response_ms",
          "endpoint_ms",
          "transcription_ms",
          "model_ttft_ms",
          "model_duration_ms",
          "tts_ttfb_ms",
          "tts_duration_ms",
          "tool_ms",
          "outcome",
          "model_role",
          "response_measurement"
        ],
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0
          },
          "speech_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "t": {
            "type": "integer"
          },
          "response_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "endpoint_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "transcription_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "model_ttft_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "model_duration_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "tts_ttfb_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "tts_duration_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "tool_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ]
          },
          "model_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "response_measurement": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CallTimelineUtterance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "t",
          "speaker",
          "text",
          "speech_id",
          "kind",
          "is_error",
          "leg"
        ],
        "properties": {
          "t": {
            "type": "integer"
          },
          "speaker": {
            "type": "string"
          },
          "text": {
            "type": "string",
            "description": "Redacted transcript text."
          },
          "speech_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_error": {
            "type": "boolean"
          },
          "leg": {
            "type": "string"
          }
        }
      },
      "CallTimelineModelUsage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "provider",
          "requests",
          "errors",
          "avg_ttft_ms"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "requests": {
            "type": "integer",
            "minimum": 0
          },
          "errors": {
            "type": "integer",
            "minimum": 0
          },
          "avg_ttft_ms": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "SIPRejectionListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallSIPRejection"
            }
          }
        }
      },
      "CallSIPFailure": {
        "type": "object",
        "additionalProperties": false,
        "description": "Structured SIP outcome of a failed call leg.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "integer",
            "minimum": 100,
            "maximum": 699
          },
          "status_text": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "disconnect_reason": {
            "type": "string"
          },
          "call_id": {
            "type": "string",
            "description": "Carrier-visible SIP Call-ID header."
          },
          "class": {
            "type": "string",
            "description": "Call failure code derived from the SIP status."
          },
          "q850_cause": {
            "type": "integer",
            "minimum": 1,
            "maximum": 127,
            "description": "ITU-T Q.850 cause number from the final response's Reason header, when the far end sent one (for example 34, no circuit available). Omitted when there was none."
          },
          "q850_text": {
            "type": "string",
            "description": "Plain-language meaning of q850_cause. Kejue Voice's own wording for the cause number, never the far end's free text."
          },
          "source": {
            "type": "string",
            "enum": [
              "capture"
            ],
            "description": "capture when the outcome was read from the captured SIP messages rather than reported by the SIP service. Omitted otherwise."
          }
        }
      },
      "CallSIPMessage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "seq",
          "sip_call_id",
          "direction",
          "kind",
          "method",
          "status_code",
          "reason",
          "headers",
          "ts",
          "hop",
          "src",
          "dst",
          "transport"
        ],
        "properties": {
          "seq": {
            "type": "integer",
            "minimum": 0
          },
          "sip_call_id": {
            "type": "string"
          },
          "direction": {
            "type": "string",
            "enum": [
              "sent",
              "received"
            ],
            "description": "Relative to the sender named by hop; sent means towards the carrier."
          },
          "hop": {
            "type": "string",
            "enum": [
              "sonus",
              "edge"
            ],
            "description": "Which Kejue Voice component exchanged the message. sonus is the SIP service; for a trunk that signals through the SIP edge its messages go to the edge, and edge messages are what the carrier actually received and sent."
          },
          "src": {
            "type": [
              "string",
              "null"
            ],
            "description": "Source host:port as on the wire, when known (edge messages)."
          },
          "dst": {
            "type": [
              "string",
              "null"
            ],
            "description": "Destination host:port as on the wire, when known (edge messages)."
          },
          "transport": {
            "type": [
              "string",
              "null"
            ],
            "description": "udp, tcp or tls, when known (edge messages)."
          },
          "kind": {
            "type": "string",
            "enum": [
              "request",
              "response"
            ]
          },
          "method": {
            "type": [
              "string",
              "null"
            ]
          },
          "status_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "headers": {
            "type": "string",
            "description": "Start line and header block, CRLF-separated, body removed and credentials redacted."
          },
          "ts": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CallSIPRejection": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "session_id",
          "occurred_at",
          "direction",
          "stage",
          "sip_status",
          "sip_reason",
          "caller_number",
          "called_number",
          "sip_trunk_id",
          "phone_number_id",
          "sip_call_id",
          "source_ip",
          "detail_internal",
          "messages"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "session_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          },
          "direction": {
            "type": "string",
            "enum": [
              "inbound",
              "outbound"
            ]
          },
          "stage": {
            "type": "string",
            "description": "Where the call was refused (trunk_auth, no_trunk, no_dispatch_rule, admission, capacity, quota, unknown_number, carrier_rejected, registrar, other)."
          },
          "sip_status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sip_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "caller_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "called_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "sip_trunk_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "phone_number_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "sip_call_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "detail_internal": {
            "type": [
              "string",
              "null"
            ]
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallSIPMessage"
            }
          }
        }
      },
      "CallExtractionResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "extraction_object_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "fields": {
            "type": "object",
            "additionalProperties": true,
            "description": "Free-form JSON object."
          },
          "result": {
            "type": "object",
            "additionalProperties": true,
            "description": "Free-form JSON object."
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "extraction_object_id",
          "name",
          "status",
          "model",
          "fields",
          "result",
          "error",
          "started_at",
          "completed_at"
        ]
      },
      "CallExtractionFilter": {
        "type": "object",
        "additionalProperties": false,
        "description": "Decoded JSON object carried by one `ef` query parameter on GET /calls. Serialize this object as UTF-8 JSON, then encode it with strict unpadded base64url (RFC 4648 URL alphabet). The encoded value may not exceed 4096 bytes, and no request may contain more than 20 `ef` parameters.\n\nThe referenced extraction object and field must be visible in the current workspace. Operators are selected from the field's declared type:\n* `enum`: `is`, `is_not`, `any_of`\n* `string` or `array`: `is`, `is_not`, `contains`, `starts_with`\n* `integer` or `number`: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `between`\n* `boolean`: `is_true`, `is_false`\n\n`value` is required except for boolean predicates, where it must be omitted. String-like scalar values must be JSON strings of at most 2048 encoded bytes. `any_of` takes 1–100 strings, each at most 2048 encoded bytes. Numeric comparisons accept a finite JSON number or numeric string. `between` takes exactly `{ \"from\": number|string, \"to\": number|string }`, with `from <= to`.",
        "properties": {
          "object": {
            "type": "string",
            "format": "uuid",
            "description": "Extraction-object ID."
          },
          "field": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
            "description": "Declared field name on the referenced extraction object."
          },
          "op": {
            "type": "string",
            "enum": [
              "is",
              "is_not",
              "contains",
              "starts_with",
              "any_of",
              "eq",
              "ne",
              "gt",
              "gte",
              "lt",
              "lte",
              "between",
              "is_true",
              "is_false"
            ]
          },
          "value": {
            "description": "Operator-specific JSON value. Omit for is_true and is_false."
          }
        },
        "required": [
          "object",
          "field",
          "op"
        ]
      },
      "CallLegalHoldRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "held": {
            "type": "boolean"
          }
        },
        "required": [
          "held"
        ]
      },
      "CallLegalHoldResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "object": {
            "type": "string",
            "const": "call"
          },
          "legal_hold": {
            "type": "boolean"
          },
          "changed": {
            "type": "boolean"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "object",
          "legal_hold",
          "changed",
          "updated_at"
        ]
      },
      "CallCore": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "room_name": {
            "type": "string"
          },
          "agent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "agent_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "agent_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "agent_version_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "agent_version": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Published version number. Null when the call ran the agent's unpublished draft (see agent_version_is_draft) or has no agent."
          },
          "agent_version_is_draft": {
            "type": "boolean",
            "description": "True when agent_version_id is the agent's draft — dashboard and API test calls usually run the draft, which has no version number."
          },
          "channel": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "sip_inbound",
              "sip_outbound",
              "web_sdk",
              "web_test",
              "eval",
              "transfer_brief",
              null
            ],
            "description": "How the call reached the platform: sip_inbound / sip_outbound telephony, web_sdk (POST /v1/web-calls), web_test (dashboard test call), transfer_brief (warm-transfer consult leg). Null for ingested human-handled calls. For web channels metadata.source is web_call / test_call rather than real_call."
          },
          "direction": {
            "type": "string",
            "enum": [
              "inbound",
              "outbound"
            ],
            "description": "Direction-normalized side of the call. Web and test calls are inbound (the browser user calls the agent). For outbound calls caller_number is the dialed destination and platform_number the caller ID presented."
          },
          "flow_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The flow this call ran inside, or null for an ordinary single-agent call. agent_slug and agent_name stay the agent that OPENED the call; later hops appear as handoff markers in the transcript."
          },
          "flow_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "flow_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "group_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The group this call was routed through, or null. agent_slug and agent_name are then the agent of the member the call was assigned to."
          },
          "group_member_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The group member the call was assigned to, or null."
          },
          "group_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "group_member_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "The assigned member's label (A, B, …), or null."
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "answered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duration_sec": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "ring_duration_sec": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "talk_duration_sec": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "total_duration_sec": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "live",
              "completed"
            ]
          },
          "lifecycle_status": {
            "$ref": "#/components/schemas/CallLifecycleStatus"
          },
          "display_status": {
            "type": "string",
            "enum": [
              "ringing",
              "queued",
              "in_progress",
              "ended",
              "failed"
            ]
          },
          "failure_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "failure_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "ended_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "segment_count": {
            "type": "integer",
            "minimum": 0
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "legal_hold": {
            "type": "boolean"
          },
          "purged_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "purge_kind": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "retention",
              null
            ]
          },
          "caller_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The external party, direction-normalized: the caller for inbound calls, the dialed destination for outbound calls. Null for web, test and older calls."
          },
          "platform_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The platform's DID or trunk number: the number dialed for inbound calls, the caller ID presented for outbound calls."
          },
          "handled_by": {
            "type": "string",
            "description": "Who was on the platform's end of the call: ai for calls a Kejue Voice agent handled, human for an ingested recording of a human-handled call. Human calls carry metadata.human_agent and have no agent version. This is a different axis from the session's channel (sip_inbound, web_sdk, ...), which records how the call reached the platform: a human-handled call that arrived over a SIP trunk is still sip_inbound.",
            "enum": [
              "ai",
              "human"
            ]
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "room_name",
          "agent_id",
          "agent_slug",
          "agent_name",
          "agent_version_id",
          "agent_version",
          "agent_version_is_draft",
          "channel",
          "direction",
          "flow_id",
          "flow_slug",
          "flow_name",
          "group_id",
          "group_member_id",
          "group_name",
          "group_member_label",
          "started_at",
          "answered_at",
          "ended_at",
          "duration_sec",
          "ring_duration_sec",
          "talk_duration_sec",
          "total_duration_sec",
          "outcome",
          "status",
          "lifecycle_status",
          "display_status",
          "failure_code",
          "failure_reason",
          "ended_reason",
          "segment_count",
          "metadata",
          "legal_hold",
          "purged_at",
          "purge_kind",
          "caller_number",
          "platform_number",
          "handled_by",
          "updated_at"
        ]
      },
      "CallListItem": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CallCore"
          }
        ],
        "unevaluatedProperties": false
      },
      "CallListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "CallLifecycleStatus": {
        "type": "string",
        "enum": [
          "ringing",
          "in_progress",
          "ended",
          "failed"
        ]
      },
      "CallSummaryResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "text": {
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "status",
          "text",
          "model",
          "error",
          "started_at",
          "completed_at"
        ]
      },
      "CallToolInvocation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tool_kind": {
            "type": "string"
          },
          "tool_slug": {
            "type": "string"
          },
          "tool_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ok": {
            "type": "boolean"
          },
          "http_status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "error_kind": {
            "type": [
              "string",
              "null"
            ]
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          },
          "request_redacted": {
            "description": "Redacted JSON request, or null for legacy/no-payload rows."
          },
          "response_redacted": {
            "description": "Redacted JSON response, or null for legacy/no-payload rows."
          },
          "has_raw_io": {
            "type": "boolean"
          },
          "phase": {
            "type": "string",
            "enum": [
              "in_call",
              "pre_call"
            ],
            "description": "pre_call for tools that ran before the greeting to fill call variables; in_call for tools the agent called during the conversation."
          }
        },
        "required": [
          "id",
          "tool_kind",
          "tool_slug",
          "tool_name",
          "ok",
          "http_status",
          "error_kind",
          "duration_ms",
          "occurred_at",
          "request_redacted",
          "response_redacted",
          "has_raw_io",
          "phase"
        ]
      },
      "CallAction": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string"
          },
          "target_kind": {
            "type": [
              "string",
              "null"
            ]
          },
          "target_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "summary": {
            "type": "string"
          },
          "detail": {
            "description": "Action-specific redacted JSON detail."
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "kind",
          "target_kind",
          "target_id",
          "summary",
          "detail",
          "occurred_at"
        ]
      },
      "CallDataMessage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "call_id": {
            "type": "string",
            "format": "uuid"
          },
          "role": {
            "type": "string",
            "enum": [
              "system"
            ]
          },
          "urgency": {
            "type": "string",
            "enum": [
              "immediate",
              "soon",
              "later"
            ]
          },
          "content_redacted": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "actor_kind": {
            "type": "string",
            "enum": [
              "user",
              "api_key",
              "system"
            ]
          },
          "user_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "api_key_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "subscriber_count": {
            "type": "integer",
            "minimum": 0
          },
          "delivered": {
            "type": "boolean"
          },
          "delivery_status": {
            "type": "string",
            "enum": [
              "pending",
              "publishing",
              "retrying",
              "published",
              "failed"
            ]
          },
          "delivery_attempts": {
            "type": "integer",
            "minimum": 0
          },
          "delivery_error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "next_delivery_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "call_id",
          "role",
          "urgency",
          "content_redacted",
          "source",
          "actor_kind",
          "user_id",
          "api_key_id",
          "subscriber_count",
          "delivered",
          "delivery_status",
          "delivery_attempts",
          "delivery_error_code",
          "next_delivery_at",
          "published_at",
          "created_at",
          "updated_at"
        ]
      },
      "CallWebhookDelivery": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "webhook_config_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "webhook_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "webhook_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "event": {
            "type": "string"
          },
          "attempt": {
            "type": "integer",
            "minimum": 0
          },
          "max_attempts": {
            "type": "integer",
            "minimum": 1
          },
          "status": {
            "type": "string"
          },
          "scheduled_at": {
            "type": "string",
            "format": "date-time"
          },
          "next_retry_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "response_status": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 100,
            "maximum": 599
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "webhook_config_id",
          "webhook_name",
          "webhook_url",
          "event",
          "attempt",
          "max_attempts",
          "status",
          "scheduled_at",
          "next_retry_at",
          "started_at",
          "completed_at",
          "response_status",
          "error"
        ]
      },
      "CallTurnMetric": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "model_generation_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "model_ttft_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "model_duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "pipeline_mode": {
            "type": [
              "string",
              "null"
            ]
          },
          "model_family": {
            "type": [
              "string",
              "null"
            ],
            "deprecated": true,
            "description": "Internal model-family diagnostics are omitted from customer responses."
          },
          "model_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Catalog display name for the model, or null when no unambiguous public name is available."
          },
          "model_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "response_measurement": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "measured",
              "composed",
              null
            ]
          },
          "turn_outcome": {
            "type": [
              "string",
              "null"
            ]
          },
          "turn_index": {
            "type": "integer",
            "minimum": 0
          },
          "speech_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "ts": {
            "type": "string",
            "format": "date-time"
          },
          "response_latency_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "eou_delay_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "transcription_delay_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "stt_duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "slm_ttft_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "slm_duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "tts_ttfb_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "tts_duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "tts_audio_duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "tool_latency_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "tool_call_count": {
            "type": "integer",
            "minimum": 0
          },
          "transcribe_wait_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Latency breakdown. Time the reply waited for the final transcript after the turn ended."
          },
          "model_first_token_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Latency breakdown. Model time to first token on the reply's critical path."
          },
          "model_hidden_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Model time that ran speculatively before the turn ended. Not part of the reply sum."
          },
          "tool_wait_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Latency breakdown. Tool-calling generation and tool run before the follow-up reply. Null on turns without one."
          },
          "first_chunk_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Latency breakdown. Model first token until the speech engine received its first request (first-sentence buffering)."
          },
          "tts_first_audio_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Latency breakdown. Speech engine request until its first audio."
          },
          "handoff_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Latency breakdown. Remaining time before the audio played (guardrails, framework, output)."
          },
          "breakdown_version": {
            "type": [
              "integer",
              "null"
            ],
            "description": "1 when every breakdown segment is known. Then eou_delay_ms + transcribe_wait_ms + model_first_token_ms + tool_wait_ms + first_chunk_ms + tts_first_audio_ms + handoff_ms equals response_latency_ms (null segments count as 0). Null otherwise."
          }
        },
        "required": [
          "turn_index",
          "speech_id",
          "ts",
          "response_latency_ms",
          "eou_delay_ms",
          "transcription_delay_ms",
          "stt_duration_ms",
          "slm_ttft_ms",
          "slm_duration_ms",
          "tts_ttfb_ms",
          "tts_duration_ms",
          "tts_audio_duration_ms",
          "tool_latency_ms",
          "tool_call_count"
        ]
      },
      "CallMetricsRollup": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "avg_model_ttft_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "p50_model_ttft_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "p95_model_ttft_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "avg_model_duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "turn_count": {
            "type": "integer",
            "minimum": 0
          },
          "duty_cycle": {
            "type": [
              "number",
              "null"
            ]
          },
          "p50_response_latency_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "p95_response_latency_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "p99_response_latency_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "avg_response_latency_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "avg_eou_delay_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "p50_eou_delay_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "p95_eou_delay_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "avg_slm_ttft_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "p50_slm_ttft_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "p95_slm_ttft_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "avg_slm_duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "avg_tts_ttfb_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "p50_tts_ttfb_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "p95_tts_ttfb_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "avg_tts_duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "avg_stt_duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "avg_tool_latency_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          }
        },
        "required": [
          "turn_count",
          "duty_cycle",
          "p50_response_latency_ms",
          "p95_response_latency_ms",
          "p99_response_latency_ms",
          "avg_response_latency_ms",
          "avg_eou_delay_ms",
          "p50_eou_delay_ms",
          "p95_eou_delay_ms",
          "avg_slm_ttft_ms",
          "p50_slm_ttft_ms",
          "p95_slm_ttft_ms",
          "avg_slm_duration_ms",
          "avg_tts_ttfb_ms",
          "p50_tts_ttfb_ms",
          "p95_tts_ttfb_ms",
          "avg_tts_duration_ms",
          "avg_stt_duration_ms",
          "avg_tool_latency_ms"
        ]
      },
      "UserTurnAudio": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "segment_index": {
            "type": "integer",
            "minimum": 0,
            "description": "Zero-based consultation segment; for brief rows this is transfer.attempt minus one. Missing on older transcript rows means zero."
          },
          "turn_index": {
            "type": "integer",
            "minimum": 0
          },
          "leg": {
            "type": "string",
            "enum": [
              "caller",
              "brief"
            ]
          }
        },
        "required": [
          "segment_index",
          "turn_index",
          "leg"
        ]
      },
      "ContactE164": {
        "type": "string",
        "pattern": "^(\\+[1-9][0-9]{7,14}|[0-9*#]{1,20})$",
        "description": "An E.164 number with a non-zero country code and 7 to 15 digits, or a bare internal number/extension of 1 to 20 [0-9*#] characters (e.g. 103, 2770124)."
      },
      "ContactTagColor": {
        "type": "string",
        "enum": [
          "slate",
          "blue",
          "green",
          "amber",
          "red",
          "purple",
          "teal",
          "pink"
        ]
      },
      "ContactTagRef": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "color": {
            "$ref": "#/components/schemas/ContactTagColor"
          }
        },
        "required": [
          "id",
          "name",
          "color"
        ]
      },
      "ContactTag": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "color": {
            "$ref": "#/components/schemas/ContactTagColor"
          },
          "usage_count": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "color",
          "usage_count",
          "created_at",
          "updated_at"
        ]
      },
      "ContactTagListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactTag"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "ContactTagCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "description": "Case-insensitively unique name. Surrounding whitespace is trimmed; control characters are rejected."
          },
          "color": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactTagColor"
              }
            ],
            "default": "slate"
          }
        },
        "required": [
          "name"
        ]
      },
      "ContactTagPatchRequest": {
        "type": "object",
        "minProperties": 1,
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "description": "Case-insensitively unique name. Surrounding whitespace is trimmed; control characters are rejected."
          },
          "color": {
            "$ref": "#/components/schemas/ContactTagColor"
          }
        }
      },
      "ContactListItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "e164": {
            "$ref": "#/components/schemas/ContactE164"
          },
          "display_name": {
            "type": "string",
            "maxLength": 120
          },
          "company": {
            "type": "string",
            "maxLength": 120
          },
          "timezone": {
            "type": "string",
            "description": "Canonical IANA timezone name used for contact-local outbound policy evaluation."
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactTagRef"
            }
          },
          "call_count": {
            "type": "integer",
            "minimum": 0
          },
          "last_contacted_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "e164",
          "tags",
          "call_count",
          "created_at",
          "updated_at"
        ]
      },
      "ContactDetail": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "e164": {
            "$ref": "#/components/schemas/ContactE164"
          },
          "display_name": {
            "type": "string",
            "maxLength": 120
          },
          "company": {
            "type": "string",
            "maxLength": 120
          },
          "timezone": {
            "type": "string",
            "description": "Canonical IANA timezone name used for contact-local outbound policy evaluation."
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactTagRef"
            }
          },
          "call_count": {
            "type": "integer",
            "minimum": 0
          },
          "last_contacted_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          }
        },
        "required": [
          "id",
          "e164",
          "tags",
          "call_count",
          "created_at",
          "updated_at"
        ]
      },
      "ContactCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "e164": {
            "$ref": "#/components/schemas/ContactE164"
          },
          "display_name": {
            "type": "string",
            "maxLength": 120,
            "description": "Optional display label. Surrounding whitespace is trimmed; control characters are rejected."
          },
          "company": {
            "type": "string",
            "maxLength": 120,
            "description": "Optional company label. Surrounding whitespace is trimmed; control characters are rejected."
          },
          "notes": {
            "type": "string",
            "maxLength": 10000,
            "description": "Optional multiline notes. Surrounding whitespace is trimmed; NUL and unsupported control characters are rejected."
          },
          "timezone": {
            "type": "string",
            "description": "Optional loadable IANA timezone name, such as Asia/Dubai. Local is rejected."
          },
          "tag_ids": {
            "type": "array",
            "maxItems": 50,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Existing contact-tag IDs in this workspace, assigned atomically with creation."
          }
        },
        "required": [
          "e164"
        ]
      },
      "ContactPatchRequest": {
        "type": "object",
        "minProperties": 1,
        "additionalProperties": false,
        "properties": {
          "display_name": {
            "type": "string",
            "maxLength": 120,
            "description": "New display label, or an empty string to clear it."
          },
          "company": {
            "type": "string",
            "maxLength": 120,
            "description": "New company label, or an empty string to clear it."
          },
          "notes": {
            "type": "string",
            "maxLength": 10000,
            "description": "New multiline notes, or an empty string to clear them."
          },
          "timezone": {
            "type": "string",
            "description": "New loadable IANA timezone name, or an empty string to clear it."
          }
        }
      },
      "ContactListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "ContactCallItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_name": {
            "type": "string"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": "string",
            "format": "date-time"
          },
          "duration_sec": {
            "type": "number",
            "minimum": 0
          },
          "lifecycle_status": {
            "$ref": "#/components/schemas/CallLifecycleStatus"
          },
          "outcome": {
            "type": "string"
          },
          "direction": {
            "type": "string",
            "description": "Direction recorded on the call. Legacy values are preserved rather than rewritten."
          }
        },
        "required": [
          "id",
          "started_at",
          "lifecycle_status"
        ]
      },
      "ContactCallListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactCallItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "ContactMemory": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "content": {
            "type": "string",
            "maxLength": 8000
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "content",
          "updated_at"
        ]
      },
      "ContactMemorySetRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "content": {
            "type": "string",
            "maxLength": 8000,
            "description": "Complete replacement document. Surrounding whitespace is trimmed; multiline text and tabs are allowed, while NUL and unsupported control characters are rejected. An empty string clears memory."
          }
        },
        "required": [
          "content"
        ]
      },
      "ContactMemoryWriteResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "content": {
            "type": "string",
            "maxLength": 8000
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "changed": {
            "type": "boolean"
          },
          "revision_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "required": [
          "content",
          "updated_at",
          "changed",
          "revision_id"
        ]
      },
      "ContactMemoryRevision": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "session_id": {
            "type": "string",
            "format": "uuid"
          },
          "previous_content": {
            "type": "string"
          },
          "new_content": {
            "type": "string",
            "maxLength": 8000
          },
          "changed": {
            "type": "boolean"
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "extraction"
            ]
          },
          "agent_name": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "previous_content",
          "new_content",
          "changed",
          "source",
          "created_at"
        ]
      },
      "ContactMemoryRevisionListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactMemoryRevision"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "CreateApiKeyRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Supply either expires_in_days or expires_at, not both. Omit both for a non-expiring credential.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "scopes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 256,
            "items": {
              "type": "string"
            }
          },
          "expires_in_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3650,
            "description": "Relative lifetime in whole days from creation; mutually exclusive with expires_at."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339 instant strictly after the request time and no more than 3650 days in the future; mutually exclusive with expires_in_days."
          }
        },
        "required": [
          "name",
          "scopes"
        ],
        "not": {
          "required": [
            "expires_in_days",
            "expires_at"
          ]
        }
      },
      "CreateApiKeyResponse": {
        "type": "object",
        "additionalProperties": false,
        "description": "Complete safe metadata plus the one-time credential secret.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "prefix": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "scopes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 256,
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "created_by_user_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "created_by_api_key_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "key": {
            "type": "string",
            "minLength": 1,
            "readOnly": true,
            "x-sonus-one-time-secret": true,
            "x-kejue-one-time-secret": true
          }
        },
        "required": [
          "id",
          "prefix",
          "name",
          "scopes",
          "status",
          "created_by_user_id",
          "created_by_api_key_id",
          "last_used_at",
          "expires_at",
          "revoked_at",
          "version",
          "created_at",
          "updated_at",
          "key"
        ]
      },
      "EvalGradeCallsRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "suite_id"
        ],
        "properties": {
          "suite_id": {
            "type": "string",
            "format": "uuid",
            "description": "The suite whose attached checks do the grading."
          },
          "call_ids": {
            "type": "array",
            "maxItems": 5000,
            "description": "Explicit calls to grade. Ids belonging to another org, or to calls that never finished, are dropped rather than failing the run.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "call_filter": {
            "description": "Used only when call_ids is empty. Matches finished calls, newest first, capped at 5000.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalCallFilter"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EvalCallFilter": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "agent_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "since": {
            "type": "string",
            "format": "date-time"
          },
          "until": {
            "type": "string",
            "format": "date-time"
          },
          "outcome": {
            "type": "string"
          }
        }
      },
      "EvalGradeCallsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "total"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "total": {
            "type": "integer",
            "description": "How many calls the selection resolved to."
          }
        }
      },
      "EvalCallerVoiceSettingsInput": {
        "type": "object",
        "additionalProperties": false,
        "description": "Writable provider-specific override layered over the selected voice's catalog settings. The selected connector permits only its advertised subset and can impose narrower ranges; inspect voice_settings_schema in GET /providers before authoring. Send {} to clear every per-agent override. Dialect is intentionally absent because it belongs to the selected voice catalog entry.",
        "properties": {
          "speed": {
            "type": "number",
            "minimum": 0.5,
            "maximum": 2
          },
          "volume": {
            "type": "number",
            "minimum": -20,
            "maximum": 20
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "top_p": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "stability": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "expressiveness": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Intonation variation (Bland). Higher is more varied; lower is flatter. Provider default 0.6."
          },
          "similarity_boost": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "style": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "use_speaker_boost": {
            "type": "boolean"
          },
          "normalize_text": {
            "type": "boolean",
            "description": "Ask the provider to normalize numbers, dates and dialect spellings before synthesis (OpenAI-compatible TTS such as Sawtak)."
          }
        }
      },
      "EvalCallModels": {
        "type": "object",
        "additionalProperties": false,
        "description": "Effective model selections expressed as public catalog references and display names. Missing or unavailable legacy identities are not guessed.",
        "properties": {
          "agent_ref": {
            "type": "string",
            "format": "uuid"
          },
          "agent_display_name": {
            "type": "string"
          },
          "agent_status": {
            "type": "string",
            "enum": [
              "unavailable"
            ]
          },
          "caller_ref": {
            "type": "string",
            "format": "uuid"
          },
          "caller_display_name": {
            "type": "string"
          },
          "caller_status": {
            "type": "string",
            "enum": [
              "unavailable"
            ]
          },
          "scorer_ref": {
            "type": "string",
            "format": "uuid"
          },
          "scorer_display_name": {
            "type": "string"
          },
          "scorer_status": {
            "type": "string",
            "enum": [
              "unavailable"
            ]
          },
          "tool_policy": {
            "type": "string"
          },
          "runtime_profile": {
            "$ref": "#/components/schemas/EvalRuntimeProfile"
          }
        }
      },
      "EvalRuntimeProfileInput": {
        "type": "object",
        "additionalProperties": true,
        "description": "Evaluation behavior and optional platform catalog references. Internal model, provider and upstream voice names are not accepted; select the corresponding catalog UUID.",
        "properties": {
          "agent_model_ref": {
            "type": "string",
            "format": "uuid",
            "description": "Platform catalog reference for this selection."
          },
          "caller_model_ref": {
            "type": "string",
            "format": "uuid",
            "description": "Platform catalog reference for this selection."
          },
          "scorer_model_ref": {
            "type": "string",
            "format": "uuid",
            "description": "Platform catalog reference for this selection."
          },
          "caller_tts_provider_ref": {
            "type": "string",
            "format": "uuid",
            "description": "Platform catalog reference for this selection."
          },
          "caller_voice_ref": {
            "type": "string",
            "format": "uuid",
            "description": "Platform catalog reference for this selection."
          },
          "pass_threshold": {
            "type": "number"
          },
          "run_pass_threshold": {
            "type": "number"
          },
          "caller_language": {
            "type": "string"
          },
          "caller_stt_language": {
            "type": "string"
          },
          "caller_stt_lang": {
            "type": "string"
          },
          "tool_mocks": {
            "type": "object",
            "additionalProperties": true
          },
          "max_turns": {
            "type": "integer"
          },
          "max_tokens": {
            "type": "integer"
          },
          "temperature": {
            "type": "number"
          },
          "timeout_seconds": {
            "type": "number"
          },
          "caller_voice_settings": {
            "$ref": "#/components/schemas/EvalCallerVoiceSettingsInput"
          }
        }
      },
      "EvalRuntimeProfile": {
        "type": "object",
        "additionalProperties": false,
        "description": "Customer-facing effective evaluation profile. Model and voice selections use platform UUIDs and catalog display names; unresolved legacy selections are marked unavailable. Internal execution identities are not returned.",
        "properties": {
          "agent_model_ref": {
            "type": "string",
            "format": "uuid",
            "description": "Platform catalog reference for this selection."
          },
          "caller_model_ref": {
            "type": "string",
            "format": "uuid",
            "description": "Platform catalog reference for this selection."
          },
          "scorer_model_ref": {
            "type": "string",
            "format": "uuid",
            "description": "Platform catalog reference for this selection."
          },
          "caller_tts_provider_ref": {
            "type": "string",
            "format": "uuid",
            "description": "Platform catalog reference for this selection."
          },
          "caller_voice_ref": {
            "type": "string",
            "format": "uuid",
            "description": "Platform catalog reference for this selection."
          },
          "agent_model_display_name": {
            "type": "string",
            "readOnly": true
          },
          "agent_model_status": {
            "type": "string",
            "enum": [
              "unavailable"
            ],
            "readOnly": true
          },
          "caller_model_display_name": {
            "type": "string",
            "readOnly": true
          },
          "caller_model_status": {
            "type": "string",
            "enum": [
              "unavailable"
            ],
            "readOnly": true
          },
          "scorer_model_display_name": {
            "type": "string",
            "readOnly": true
          },
          "scorer_model_status": {
            "type": "string",
            "enum": [
              "unavailable"
            ],
            "readOnly": true
          },
          "caller_tts_provider_display_name": {
            "type": "string",
            "readOnly": true
          },
          "caller_tts_provider_status": {
            "type": "string",
            "enum": [
              "unavailable"
            ],
            "readOnly": true
          },
          "caller_voice_display_name": {
            "type": "string",
            "readOnly": true
          },
          "caller_voice_status": {
            "type": "string",
            "enum": [
              "unavailable"
            ],
            "readOnly": true
          },
          "pass_threshold": {
            "type": "number"
          },
          "run_pass_threshold": {
            "type": "number"
          },
          "caller_language": {
            "type": "string"
          },
          "caller_stt_language": {
            "type": "string"
          },
          "caller_stt_lang": {
            "type": "string"
          },
          "tool_mocks": {
            "type": "object",
            "additionalProperties": true
          },
          "max_turns": {
            "type": "integer"
          },
          "max_tokens": {
            "type": "integer"
          },
          "temperature": {
            "type": "number"
          },
          "timeout_seconds": {
            "type": "number"
          },
          "caller_voice_settings": {
            "$ref": "#/components/schemas/AgentProviderVoiceSettings"
          }
        }
      },
      "EvalJSONObject": {
        "type": "object",
        "additionalProperties": true,
        "description": "Bounded product-defined JSON object. Its nested keys depend on the selected eval definition, worker, model, or rubric."
      },
      "EvalExecutionErrorCode": {
        "type": "string",
        "enum": [
          "eval_execution_failed",
          "eval_timed_out",
          "eval_agent_opening_failed",
          "eval_persona_crashed"
        ],
        "description": "Stable public classification. The worker's own message, scrubbed of credentials and personal data, is returned separately as error_detail."
      },
      "EvalGenerationErrorCode": {
        "type": "string",
        "enum": [
          "eval_generation_failed"
        ],
        "description": "Stable public generation failure classification."
      },
      "EvalSuiteListItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9][a-z0-9_-]{1,63}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "version",
          "archived_at",
          "created_at",
          "updated_at"
        ],
        "example": {
          "id": "11111111-1111-4111-8111-111111111111",
          "slug": "support_regression",
          "name": "Support regression",
          "description": "Core escalation and refund scenarios.",
          "version": 3,
          "archived_at": null,
          "created_at": "2026-07-21T08:00:00Z",
          "updated_at": "2026-07-21T09:00:00Z"
        }
      },
      "EvalSuite": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9][a-z0-9_-]{1,63}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "definition": {
            "$ref": "#/components/schemas/EvalJSONObject",
            "description": "Open JSON object; the encoded value must be at most 1048576 bytes."
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "version",
          "archived_at",
          "created_at",
          "updated_at",
          "definition"
        ],
        "example": {
          "id": "11111111-1111-4111-8111-111111111111",
          "slug": "support_regression",
          "name": "Support regression",
          "description": "Core escalation and refund scenarios.",
          "version": 3,
          "archived_at": null,
          "created_at": "2026-07-21T08:00:00Z",
          "updated_at": "2026-07-21T09:00:00Z",
          "definition": {
            "schema_version": 1
          }
        }
      },
      "EvalSuiteListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/EvalSuiteListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "EvalSuiteCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9][a-z0-9_-]{1,63}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Limited to 200 UTF-8 encoded bytes; maxLength is a generator hint."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Limited to 2000 UTF-8 encoded bytes; maxLength is a generator hint."
          },
          "definition": {
            "$ref": "#/components/schemas/EvalJSONObject",
            "description": "Optional; defaults to {}. Holds only the legacy (v1) suite fields; a v2 suite keeps its scenarios (/eval-suites/{id}/scenarios) and checks (/eval-suites/{id}/checks) as their own resources and needs nothing here. Recognised keys, all optional: start_node (string, at most 128 bytes) — the pathway node the simulated call starts on; rubric (array of at most 500 {name, description, ...} objects) — legacy LLM rubric criteria scored per conversation; assertions (object) — legacy structured assertions applied to every scenario (expected_path, expected_terminal_node, expected_tools_called, must_not_call_tools), overridden per scenario by the same key; personas (array of at most 5000 {id, label, persona, scenario, assertions} objects) — mirrored into first-class scenarios on write. Other keys are stored and ignored. The encoded value must be at most 1048576 bytes."
          }
        },
        "required": [
          "slug",
          "name"
        ],
        "example": {
          "slug": "support_regression",
          "name": "Support regression",
          "description": "Core escalation and refund scenarios."
        }
      },
      "EvalSuitePatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Limited to 200 UTF-8 encoded bytes; maxLength is a generator hint."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Limited to 2000 UTF-8 encoded bytes; maxLength is a generator hint."
          },
          "definition": {
            "$ref": "#/components/schemas/EvalJSONObject",
            "description": "Replaces the stored legacy definition; same keys as EvalSuiteCreateRequest.definition. Newly listed personas are mirrored into scenarios; existing scenarios are never removed by this field. The encoded value must be at most 1048576 bytes."
          }
        },
        "example": {
          "description": "Expanded regression coverage."
        }
      },
      "EvalScenario": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "minLength": 1,
            "description": "Stable stored handle. Historical compatibility rows predate the public create regex, so readers must not infer a character pattern."
          },
          "label": {
            "type": "string",
            "maxLength": 200,
            "description": "Limited to 200 UTF-8 encoded bytes; maxLength is a generator hint."
          },
          "persona_text": {
            "type": "string",
            "maxLength": 20000,
            "description": "Limited to 20000 UTF-8 encoded bytes; maxLength is a generator hint."
          },
          "scenario_text": {
            "type": "string",
            "maxLength": 20000,
            "description": "Limited to 20000 UTF-8 encoded bytes; maxLength is a generator hint."
          },
          "assertions": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalJSONObject"
              },
              {
                "type": "null"
              }
            ],
            "description": "Stored assertion object; scenario mutation inputs are limited to 262144 encoded bytes."
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "generated"
            ]
          },
          "generation_job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "position": {
            "type": "integer",
            "minimum": 0
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "label",
          "persona_text",
          "scenario_text",
          "assertions",
          "source",
          "generation_job_id",
          "position",
          "version",
          "archived_at",
          "created_at",
          "updated_at"
        ],
        "example": {
          "id": "22222222-2222-4222-8222-222222222222",
          "slug": "angry_refund",
          "label": "Angry refund request",
          "persona_text": "The caller is frustrated but cooperative.",
          "scenario_text": "Request a refund, then ask for a supervisor if denied.",
          "assertions": {
            "escalation_offered": true
          },
          "source": "manual",
          "generation_job_id": null,
          "position": 0,
          "version": 1,
          "archived_at": null,
          "created_at": "2026-07-21T08:05:00Z",
          "updated_at": "2026-07-21T08:05:00Z"
        }
      },
      "EvalScenarioListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/EvalScenario"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "offset": {
            "type": "integer",
            "const": 0,
            "description": "Public API cursor pagination always emits zero."
          }
        },
        "required": [
          "data",
          "next_cursor",
          "total",
          "limit",
          "offset"
        ]
      },
      "EvalScenarioCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9_]{2,64}$"
          },
          "label": {
            "type": "string",
            "maxLength": 200,
            "default": "",
            "description": "Limited to 200 UTF-8 encoded bytes; maxLength is a generator hint."
          },
          "persona_text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000,
            "description": "Limited to 20000 UTF-8 encoded bytes; maxLength is a generator hint."
          },
          "scenario_text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000,
            "description": "Limited to 20000 UTF-8 encoded bytes; maxLength is a generator hint."
          },
          "assertions": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalJSONObject"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional assertion object limited to 262144 encoded bytes."
          }
        },
        "required": [
          "slug",
          "persona_text",
          "scenario_text"
        ],
        "example": {
          "slug": "angry_refund",
          "label": "Angry refund request",
          "persona_text": "The caller is frustrated but cooperative.",
          "scenario_text": "Request a refund, then ask for a supervisor if denied.",
          "assertions": {
            "escalation_offered": true
          }
        }
      },
      "EvalScenarioPatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "label": {
            "type": "string",
            "maxLength": 200,
            "description": "Limited to 200 UTF-8 encoded bytes; maxLength is a generator hint."
          },
          "persona_text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000,
            "description": "Limited to 20000 UTF-8 encoded bytes; maxLength is a generator hint."
          },
          "scenario_text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000,
            "description": "Limited to 20000 UTF-8 encoded bytes; maxLength is a generator hint."
          },
          "assertions": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalJSONObject"
              },
              {
                "type": "null"
              }
            ],
            "description": "Nullable assertion object limited to 262144 encoded bytes when supplied."
          }
        },
        "example": {
          "label": "Escalating refund request"
        }
      },
      "EvalGenerationRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5000
          },
          "context_text": {
            "type": "string",
            "maxLength": 20000,
            "default": "",
            "description": "Limited to 20000 UTF-8 encoded bytes; maxLength is a generator hint."
          }
        },
        "required": [
          "agent_id",
          "count"
        ],
        "example": {
          "agent_id": "33333333-3333-4333-8333-333333333333",
          "count": 25,
          "context_text": "Focus on refund escalation and account verification."
        }
      },
      "EvalGenerationAccepted": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid"
          },
          "requested_count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5000
          }
        },
        "required": [
          "job_id",
          "requested_count"
        ],
        "example": {
          "job_id": "77777777-7777-4777-8777-777777777777",
          "requested_count": 25
        }
      },
      "EvalGenerationJob": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "suite_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "done",
              "failed",
              "cancelled"
            ]
          },
          "requested_count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5000
          },
          "completed_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5000
          },
          "context_text": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "generation failed",
              null
            ],
            "description": "Sanitized public message; provider or prompt details are never returned."
          },
          "error_code": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalGenerationErrorCode"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "suite_id",
          "agent_id",
          "status",
          "requested_count",
          "completed_count",
          "context_text",
          "error",
          "created_at",
          "started_at",
          "ended_at"
        ],
        "example": {
          "id": "77777777-7777-4777-8777-777777777777",
          "suite_id": "11111111-1111-4111-8111-111111111111",
          "agent_id": "33333333-3333-4333-8333-333333333333",
          "status": "running",
          "requested_count": 25,
          "completed_count": 8,
          "context_text": "Focus on refund escalation and account verification.",
          "error": null,
          "error_code": null,
          "created_at": "2026-07-21T09:10:00Z",
          "started_at": "2026-07-21T09:10:01Z",
          "ended_at": null
        }
      },
      "EvalRunMode": {
        "type": "string",
        "description": "Mode of an existing run. `audio` appears only on historical runs and cannot be requested; new runs are always `text`.",
        "enum": [
          "audio",
          "text"
        ]
      },
      "EvalRunCreateMode": {
        "type": "string",
        "description": "Mode to run. Only `text` is supported.",
        "enum": [
          "text"
        ]
      },
      "EvalToolPolicy": {
        "type": "string",
        "enum": [
          "dry_run",
          "mocked",
          "live"
        ]
      },
      "EvalRunStatus": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "done",
          "failed",
          "cancelled"
        ]
      },
      "EvalRunListItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "suite_id": {
            "type": "string",
            "format": "uuid"
          },
          "suite_slug": {
            "type": "string"
          },
          "suite_name": {
            "type": "string"
          },
          "pathway_name": {
            "type": "string"
          },
          "agent_version_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "mode": {
            "$ref": "#/components/schemas/EvalRunMode"
          },
          "tool_policy": {
            "$ref": "#/components/schemas/EvalToolPolicy"
          },
          "status": {
            "$ref": "#/components/schemas/EvalRunStatus"
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "completed": {
            "type": "integer",
            "minimum": 0
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duration_sec": {
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "cancel_requested_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "score_weighted": {
            "description": "The run's weighted score, 0-100, as the worker computed it. Null while the run is still going or when no check scored it.",
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "minimum": 0,
            "maximum": 100
          },
          "passed": {
            "description": "The run's verdict. Already accounts for blocking checks, so it is not derivable from score_weighted alone.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "unmocked_tool_calls": {
            "description": "Tool calls that reached a real upstream. Non-zero on a run whose tool_policy asked for mocks means the result is not trustworthy.",
            "type": "integer",
            "minimum": 0
          },
          "pass_rate": {
            "description": "Share of conversations that passed, 0-1. This is what `passed` is derived from — `score_weighted` is average partial credit and can be high on a run that failed.",
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "minimum": 0,
            "maximum": 1
          }
        },
        "required": [
          "id",
          "suite_id",
          "suite_slug",
          "suite_name",
          "pathway_name",
          "mode",
          "tool_policy",
          "status",
          "total",
          "completed",
          "created_at"
        ],
        "example": {
          "id": "55555555-5555-4555-8555-555555555555",
          "suite_id": "11111111-1111-4111-8111-111111111111",
          "suite_slug": "support_regression",
          "suite_name": "Support regression",
          "pathway_name": "support_agent",
          "agent_version_id": "44444444-4444-4444-8444-444444444444",
          "mode": "text",
          "tool_policy": "dry_run",
          "status": "running",
          "total": 25,
          "completed": 8,
          "started_at": "2026-07-21T09:15:00Z",
          "ended_at": null,
          "duration_sec": null,
          "created_at": "2026-07-21T09:14:59Z",
          "cancel_requested_at": null
        }
      },
      "EvalRunListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/EvalRunListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "EvalRunScenarioSummary": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          }
        },
        "required": [
          "id"
        ]
      },
      "EvalRunCallSummary": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "scenario_id": {
            "type": "string"
          },
          "scenario_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duration_sec": {
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "minimum": 0
          },
          "overall_score": {
            "type": [
              "number",
              "null"
            ],
            "format": "float"
          },
          "score_weighted": {
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "description": "The v2 weighted check score, 0-100. Null for a conversation no check scored."
          },
          "passed": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "timed_out": {
            "type": "boolean"
          },
          "end_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "eval execution failed",
              "eval execution timed out",
              "the agent failed to produce its opening turn",
              "the simulated caller crashed",
              null
            ]
          },
          "error_code": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalExecutionErrorCode"
              },
              {
                "type": "null"
              }
            ]
          },
          "error_detail": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2049,
            "description": "Internal worker diagnostics are withheld from customer responses. Use the classified error and support identifiers."
          },
          "checks_total": {
            "description": "Checks that produced a verdict for this conversation.",
            "type": "integer",
            "minimum": 0
          },
          "checks_passed": {
            "description": "How many of those verdicts passed.",
            "type": "integer",
            "minimum": 0
          },
          "failed_checks": {
            "description": "The checks this conversation failed, blocking ones first. Empty when it broke nothing. `passed` says how the conversation did; this says what did it.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvalRunCallCheckMark"
            }
          },
          "abstained_checks": {
            "description": "Slugs of checks that could not apply to this conversation. Excluded from the score — not failures.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "scenario_id",
          "started_at",
          "timed_out",
          "checks_total",
          "checks_passed",
          "failed_checks",
          "abstained_checks"
        ]
      },
      "EvalRunCallCheckMark": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "slug": {
            "type": "string"
          },
          "blocking": {
            "description": "A blocking failure fails the conversation whatever it scored.",
            "type": "boolean"
          }
        },
        "required": [
          "slug",
          "blocking"
        ]
      },
      "EvalCheck": {
        "type": "object",
        "additionalProperties": false,
        "description": "One library check: the list projection plus its kind-specific config.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9][a-z0-9_-]{1,63}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "kind": {
            "type": "string",
            "enum": [
              "judge",
              "tool",
              "flow"
            ]
          },
          "source_template_key": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 128
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "config": {
            "$ref": "#/components/schemas/EvalCheckStoredConfig"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "kind",
          "source_template_key",
          "archived_at",
          "created_at",
          "updated_at",
          "config"
        ],
        "example": {
          "id": "11111111-1111-4111-8111-111111111111",
          "slug": "never_cold_transfers",
          "name": "Never cold-transfers",
          "description": "The cold-transfer tool is never called.",
          "kind": "tool",
          "source_template_key": "never-cold-transfers",
          "archived_at": null,
          "created_at": "2026-08-01T08:00:00Z",
          "updated_at": "2026-08-01T09:00:00Z",
          "config": {
            "rule": "not_called",
            "tool": "transfer_to_human_cold"
          }
        }
      },
      "EvalCheckCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9][a-z0-9_-]{1,63}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "kind": {
            "type": "string",
            "enum": [
              "judge",
              "tool",
              "flow"
            ]
          },
          "config": {
            "$ref": "#/components/schemas/EvalCheckConfigInput"
          },
          "template_key": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 128,
            "description": "Records which template the check started from. It does not copy the template's config — send config too (list_eval_check_templates returns it)."
          }
        },
        "required": [
          "slug",
          "name",
          "kind",
          "config"
        ],
        "example": {
          "slug": "verifies_before_disclosing",
          "name": "Verifies before disclosing",
          "kind": "tool",
          "config": {
            "rule": "called_before",
            "tool": "verify_identity",
            "other_tool": "lookup_policy"
          }
        }
      },
      "EvalCheckAttachment": {
        "type": "object",
        "additionalProperties": false,
        "description": "One library check bound to a suite or a scenario. weight and blocking live on the binding rather than the check because the same assertion matters differently in different suites.",
        "required": [
          "check_id",
          "slug",
          "name",
          "kind",
          "weight",
          "blocking",
          "position"
        ],
        "properties": {
          "check_id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "judge",
              "tool",
              "flow"
            ]
          },
          "weight": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "blocking": {
            "type": "boolean",
            "description": "A failure fails the whole conversation regardless of the score."
          },
          "position": {
            "type": "integer",
            "description": "Display order. Always zero for scenario-level attachments."
          },
          "config": {
            "$ref": "#/components/schemas/EvalCheckStoredConfig"
          }
        }
      },
      "EvalCheckAttachmentListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvalCheckAttachment"
            }
          }
        }
      },
      "EvalCheckAttachmentInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "check_id"
        ],
        "properties": {
          "check_id": {
            "type": "string",
            "format": "uuid"
          },
          "weight": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "Defaults to 100 when omitted or null."
          },
          "blocking": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Defaults to false when omitted or null."
          }
        }
      },
      "EvalCheckAttachmentsRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "checks"
        ],
        "properties": {
          "checks": {
            "type": "array",
            "maxItems": 100,
            "description": "The complete attachment set. An empty array detaches everything.",
            "items": {
              "$ref": "#/components/schemas/EvalCheckAttachmentInput"
            }
          }
        }
      },
      "EvalCheckConfigInput": {
        "description": "A check's assertion. Exactly one shape applies: a judge check takes EvalCheckJudgeConfig (no rule); a tool or flow check takes the schema for its `rule`. Every key is closed — the server rejects an unknown key, a missing required key, or a wrong type with 422 validation_failed and the field path (for example config.expected), because the evaluator would otherwise ignore the key and silently grade against a default. Tool rules: called (tool, phase?, min?, max?), not_called (tool, phase?), called_with (tool, args, phase?, match?), called_before (tool, other_tool), succeeded (tool, phase?), failed (tool, phase?, error_kind?), result_matches (tool, expected, jsonpath?, phase?), no_unexpected_tools (allowlist), phase (tool, expected_phase). Flow rules: terminal_node (value), path_contains (value), slot_recorded (slot, expected?), max_turns (max), end_reason (value), transcript_matches (pattern, speaker?, expect?), pre_call_status (tool, status?), pre_call_var_set (value), pre_call_aborted (expect?). A few rules also accept a legacy spelling of their key (node, var, value) — send one spelling, not both.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/EvalCheckJudgeConfigInput"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolCalledConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolNotCalledConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolCalledWithConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolCalledBeforeConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolSucceededConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolFailedConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolResultMatchesConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolNoUnexpectedToolsConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolPhaseConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowTerminalNodeConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowPathContainsConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowSlotRecordedConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowMaxTurnsConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowEndReasonConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowTranscriptMatchesConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowPreCallStatusConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowPreCallVarSetConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowPreCallAbortedConfig"
          }
        ],
        "example": {
          "rule": "not_called",
          "tool": "transfer_to_human_cold"
        }
      },
      "EvalCheckJudgeConfigInput": {
        "type": "object",
        "additionalProperties": false,
        "title": "judge",
        "description": "An LLM grades the transcript and tool trace against an instruction.",
        "properties": {
          "model_ref": {
            "type": "string",
            "description": "Platform LLM catalog UUID for the judge. Omit to preserve an existing selection; an empty string clears it."
          },
          "instruction": {
            "type": "string",
            "minLength": 1,
            "description": "What to grade, in plain language. The judge grades only this dimension."
          },
          "levels": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "$ref": "#/components/schemas/EvalCheckJudgeLevel"
            },
            "description": "Graded ladder, worst first: 2–5 objects {key, label?, description?} with unique keys. Omit (or send []) for pass/fail."
          },
          "target_levels": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "Level keys that count as passing. Each must be a key in levels (or pass/fail when levels is omitted). Defaults to the last level."
          },
          "modality": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "text",
              "audio",
              "any"
            ],
            "description": "What the judge grades. audio abstains on runs with no recording. Defaults to any."
          },
          "model": {
            "type": "string",
            "deprecated": true,
            "description": "Legacy operator-only override. Customer requests use model_ref."
          }
        },
        "required": [
          "instruction"
        ],
        "example": {
          "instruction": "Pass only if the agent read the recording disclosure before collecting any information.",
          "modality": "text"
        }
      },
      "EvalCheckConfig": {
        "description": "A check's assertion. Exactly one shape applies: a judge check takes EvalCheckJudgeConfig (no rule); a tool or flow check takes the schema for its `rule`. Every key is closed — the server rejects an unknown key, a missing required key, or a wrong type with 422 validation_failed and the field path (for example config.expected), because the evaluator would otherwise ignore the key and silently grade against a default. Tool rules: called (tool, phase?, min?, max?), not_called (tool, phase?), called_with (tool, args, phase?, match?), called_before (tool, other_tool), succeeded (tool, phase?), failed (tool, phase?, error_kind?), result_matches (tool, expected, jsonpath?, phase?), no_unexpected_tools (allowlist), phase (tool, expected_phase). Flow rules: terminal_node (value), path_contains (value), slot_recorded (slot, expected?), max_turns (max), end_reason (value), transcript_matches (pattern, speaker?, expect?), pre_call_status (tool, status?), pre_call_var_set (value), pre_call_aborted (expect?). A few rules also accept a legacy spelling of their key (node, var, value) — send one spelling, not both.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/EvalCheckJudgeConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolCalledConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolNotCalledConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolCalledWithConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolCalledBeforeConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolSucceededConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolFailedConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolResultMatchesConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolNoUnexpectedToolsConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckToolPhaseConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowTerminalNodeConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowPathContainsConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowSlotRecordedConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowMaxTurnsConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowEndReasonConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowTranscriptMatchesConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowPreCallStatusConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowPreCallVarSetConfig"
          },
          {
            "$ref": "#/components/schemas/EvalCheckFlowPreCallAbortedConfig"
          }
        ],
        "example": {
          "rule": "not_called",
          "tool": "transfer_to_human_cold"
        }
      },
      "EvalCheckStoredConfig": {
        "type": "object",
        "additionalProperties": true,
        "description": "A check's config exactly as stored. Every check created or edited since config validation shipped conforms to EvalCheckConfig; a check last edited before that may still carry keys outside it until its config is next updated (the update is validated in full).",
        "example": {
          "rule": "not_called",
          "tool": "transfer_to_human_cold"
        }
      },
      "EvalCheckJudgeLevel": {
        "type": "object",
        "additionalProperties": false,
        "description": "One rung of a graded judge's ladder.",
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1,
            "description": "Unique within the ladder; what target_levels and verdicts refer to."
          },
          "label": {
            "type": "string",
            "description": "Display name. Defaults to key."
          },
          "description": {
            "type": "string",
            "description": "What earns this level; shown to the judge."
          }
        },
        "required": [
          "key"
        ]
      },
      "EvalCheckJudgeConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "judge",
        "description": "An LLM grades the transcript and tool trace against an instruction.",
        "properties": {
          "model_ref": {
            "type": "string",
            "description": "Platform LLM catalog UUID for the judge. Omit to preserve an existing selection; an empty string clears it."
          },
          "model_display_name": {
            "type": "string",
            "readOnly": true
          },
          "model_status": {
            "type": "string",
            "enum": [
              "unavailable"
            ],
            "readOnly": true
          },
          "instruction": {
            "type": "string",
            "minLength": 1,
            "description": "What to grade, in plain language. The judge grades only this dimension."
          },
          "levels": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "$ref": "#/components/schemas/EvalCheckJudgeLevel"
            },
            "description": "Graded ladder, worst first: 2–5 objects {key, label?, description?} with unique keys. Omit (or send []) for pass/fail."
          },
          "target_levels": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "Level keys that count as passing. Each must be a key in levels (or pass/fail when levels is omitted). Defaults to the last level."
          },
          "modality": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "text",
              "audio",
              "any"
            ],
            "description": "What the judge grades. audio abstains on runs with no recording. Defaults to any."
          },
          "model": {
            "type": "string",
            "deprecated": true,
            "description": "Legacy operator-only override. Customer requests use model_ref."
          }
        },
        "required": [
          "instruction"
        ],
        "example": {
          "instruction": "Pass only if the agent read the recording disclosure before collecting any information.",
          "modality": "text"
        }
      },
      "EvalCheckToolCalledConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "tool / called",
        "description": "The tool was called between min and max times.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "called"
            ]
          },
          "tool": {
            "type": "string",
            "minLength": 1,
            "description": "Tool name as it appears in the trace. Built-ins also match their per-destination variants."
          },
          "phase": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "pre_call",
              "in_call"
            ],
            "description": "Only count calls made in this phase. Omit to count every phase."
          },
          "min": {
            "type": "integer",
            "minimum": 0,
            "description": "Fewest calls that pass. Defaults to 1."
          },
          "max": {
            "type": "integer",
            "minimum": 0,
            "description": "Most calls that pass. Omit for no upper bound."
          }
        },
        "required": [
          "rule",
          "tool"
        ],
        "example": {
          "max": 2,
          "min": 1,
          "rule": "called",
          "tool": "lookup_policy"
        }
      },
      "EvalCheckToolNotCalledConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "tool / not_called",
        "description": "The tool was never called.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "not_called"
            ]
          },
          "tool": {
            "type": "string",
            "minLength": 1,
            "description": "Tool that must never run."
          },
          "phase": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "pre_call",
              "in_call"
            ],
            "description": "Only count calls made in this phase. Omit to count every phase."
          }
        },
        "required": [
          "rule",
          "tool"
        ],
        "example": {
          "rule": "not_called",
          "tool": "transfer_to_human_cold"
        }
      },
      "EvalCheckToolCalledWithConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "tool / called_with",
        "description": "The tool was called at least once with the expected arguments.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "called_with"
            ]
          },
          "tool": {
            "type": "string",
            "minLength": 1,
            "description": "Tool whose arguments are checked."
          },
          "phase": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "pre_call",
              "in_call"
            ],
            "description": "Only count calls made in this phase. Omit to count every phase."
          },
          "args": {
            "type": "object",
            "minProperties": 1,
            "additionalProperties": true,
            "description": "Expected arguments, compared as strings. At least one key."
          },
          "match": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "subset",
              "exact"
            ],
            "description": "subset (default): the listed arguments match; exact: the call's arguments equal args exactly."
          }
        },
        "required": [
          "rule",
          "tool",
          "args"
        ],
        "example": {
          "args": {
            "policy_number": "PN-1001"
          },
          "rule": "called_with",
          "tool": "lookup_policy"
        }
      },
      "EvalCheckToolCalledBeforeConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "tool / called_before",
        "description": "The first call to tool came before the first call to other_tool.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "called_before"
            ]
          },
          "tool": {
            "type": "string",
            "minLength": 1,
            "description": "Tool that must run first."
          },
          "other_tool": {
            "type": "string",
            "minLength": 1,
            "description": "Tool that must run after. If it never runs the check abstains."
          }
        },
        "required": [
          "rule",
          "tool",
          "other_tool"
        ],
        "example": {
          "other_tool": "lookup_policy",
          "rule": "called_before",
          "tool": "verify_identity"
        }
      },
      "EvalCheckToolSucceededConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "tool / succeeded",
        "description": "At least one call to the tool succeeded.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "succeeded"
            ]
          },
          "tool": {
            "type": "string",
            "minLength": 1,
            "description": "Tool that must succeed."
          },
          "phase": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "pre_call",
              "in_call"
            ],
            "description": "Only count calls made in this phase. Omit to count every phase."
          }
        },
        "required": [
          "rule",
          "tool"
        ],
        "example": {
          "rule": "succeeded",
          "tool": "lookup_policy"
        }
      },
      "EvalCheckToolFailedConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "tool / failed",
        "description": "At least one call to the tool failed (optionally with a specific error kind).",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "failed"
            ]
          },
          "tool": {
            "type": "string",
            "minLength": 1,
            "description": "Tool that must fail."
          },
          "phase": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "pre_call",
              "in_call"
            ],
            "description": "Only count calls made in this phase. Omit to count every phase."
          },
          "error_kind": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "network",
              "timeout",
              "http_4xx",
              "http_5xx",
              "parse",
              "auth",
              "config",
              "other"
            ],
            "description": "Require this failure category. Omit for any failure."
          }
        },
        "required": [
          "rule",
          "tool"
        ],
        "example": {
          "error_kind": "timeout",
          "rule": "failed",
          "tool": "lookup_policy"
        }
      },
      "EvalCheckToolResultMatchesConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "tool / result_matches",
        "description": "A call's result has expected at jsonpath.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "result_matches"
            ]
          },
          "tool": {
            "type": "string",
            "minLength": 1,
            "description": "Tool whose result is inspected."
          },
          "phase": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "pre_call",
              "in_call"
            ],
            "description": "Only count calls made in this phase. Omit to count every phase."
          },
          "jsonpath": {
            "type": "string",
            "minLength": 1,
            "description": "Path into the result body, $-rooted ($.a.b[0]). Defaults to $."
          },
          "expected": {
            "type": [
              "string",
              "number",
              "boolean"
            ],
            "description": "Value to find at jsonpath, compared as a string."
          }
        },
        "required": [
          "rule",
          "tool",
          "expected"
        ],
        "example": {
          "expected": "active",
          "jsonpath": "$.status",
          "rule": "result_matches",
          "tool": "lookup_policy"
        }
      },
      "EvalCheckToolNoUnexpectedToolsConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "tool / no_unexpected_tools",
        "description": "Every tool that ran is on the allowlist.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "no_unexpected_tools"
            ]
          },
          "allowlist": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "Tool names allowed to run. An empty list fails as soon as any tool runs."
          }
        },
        "required": [
          "rule",
          "allowlist"
        ],
        "example": {
          "allowlist": [
            "verify_identity",
            "lookup_policy"
          ],
          "rule": "no_unexpected_tools"
        }
      },
      "EvalCheckToolPhaseConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "tool / phase",
        "description": "Every call to the tool ran in the expected phase.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "phase"
            ]
          },
          "tool": {
            "type": "string",
            "minLength": 1,
            "description": "Tool whose phase is checked."
          },
          "expected_phase": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "pre_call",
              "in_call"
            ],
            "description": "Phase every call must run in."
          },
          "phase": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "pre_call",
              "in_call"
            ],
            "description": "Legacy spelling of expected_phase."
          }
        },
        "required": [
          "rule",
          "tool"
        ],
        "oneOf": [
          {
            "required": [
              "expected_phase"
            ]
          },
          {
            "required": [
              "phase"
            ]
          }
        ],
        "example": {
          "expected_phase": "pre_call",
          "rule": "phase",
          "tool": "lookup_account"
        }
      },
      "EvalCheckFlowTerminalNodeConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "flow / terminal_node",
        "description": "The pathway ended on this node. Abstains for prompt agents.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "terminal_node"
            ]
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "description": "Node id the conversation must end on."
          },
          "node": {
            "type": "string",
            "minLength": 1,
            "description": "Legacy spelling of value."
          }
        },
        "required": [
          "rule"
        ],
        "oneOf": [
          {
            "required": [
              "value"
            ]
          },
          {
            "required": [
              "node"
            ]
          }
        ],
        "example": {
          "rule": "terminal_node",
          "value": "resolved"
        }
      },
      "EvalCheckFlowPathContainsConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "flow / path_contains",
        "description": "The pathway visited this node. Abstains for prompt agents.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "path_contains"
            ]
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "description": "Node id that must be visited."
          },
          "node": {
            "type": "string",
            "minLength": 1,
            "description": "Legacy spelling of value."
          }
        },
        "required": [
          "rule"
        ],
        "oneOf": [
          {
            "required": [
              "value"
            ]
          },
          {
            "required": [
              "node"
            ]
          }
        ],
        "example": {
          "rule": "path_contains",
          "value": "verify_identity"
        }
      },
      "EvalCheckFlowSlotRecordedConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "flow / slot_recorded",
        "description": "A pathway slot was recorded (optionally with a specific value).",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "slot_recorded"
            ]
          },
          "slot": {
            "type": "string",
            "minLength": 1,
            "description": "Slot name that must be recorded."
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "description": "Legacy spelling of slot."
          },
          "expected": {
            "type": [
              "string",
              "number",
              "boolean"
            ],
            "description": "Require this recorded value, compared as a string."
          }
        },
        "required": [
          "rule"
        ],
        "oneOf": [
          {
            "required": [
              "slot"
            ]
          },
          {
            "required": [
              "value"
            ]
          }
        ],
        "example": {
          "rule": "slot_recorded",
          "slot": "policy_number"
        }
      },
      "EvalCheckFlowMaxTurnsConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "flow / max_turns",
        "description": "The conversation ran at most max turns.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "max_turns"
            ]
          },
          "max": {
            "type": "integer",
            "minimum": 1,
            "description": "Most transcript turns that pass."
          },
          "value": {
            "type": "integer",
            "minimum": 1,
            "description": "Legacy spelling of max."
          }
        },
        "required": [
          "rule"
        ],
        "oneOf": [
          {
            "required": [
              "max"
            ]
          },
          {
            "required": [
              "value"
            ]
          }
        ],
        "example": {
          "max": 20,
          "rule": "max_turns"
        }
      },
      "EvalCheckFlowEndReasonConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "flow / end_reason",
        "description": "The conversation ended for this reason.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "end_reason"
            ]
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "description": "How the conversation ended: agent_ended (the agent hung up or handed off), caller_ended (the simulated caller hung up), pathway_completed, timed_out, disconnected or pre_call_abort. Runs record the code with optional detail after a colon (caller_ended: goal achieved); the check matches the code. When grading real calls, the call's outcome."
          }
        },
        "required": [
          "rule",
          "value"
        ],
        "example": {
          "rule": "end_reason",
          "value": "agent_ended"
        }
      },
      "EvalCheckFlowTranscriptMatchesConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "flow / transcript_matches",
        "description": "A case-insensitive regular expression is (or is not) found in the transcript.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "transcript_matches"
            ]
          },
          "pattern": {
            "type": "string",
            "minLength": 1,
            "description": "Python regular expression, matched case-insensitively per turn."
          },
          "speaker": {
            "type": "string",
            "minLength": 1,
            "description": "Only search turns by this speaker as recorded in the transcript. Omit for every turn."
          },
          "expect": {
            "type": "boolean",
            "description": "true (default): the pattern must appear; false: it must not."
          }
        },
        "required": [
          "rule",
          "pattern"
        ],
        "example": {
          "expect": true,
          "pattern": "\\brecorded\\b",
          "rule": "transcript_matches"
        }
      },
      "EvalCheckFlowPreCallStatusConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "flow / pre_call_status",
        "description": "A pre-call tool finished with this status.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "pre_call_status"
            ]
          },
          "tool": {
            "type": "string",
            "minLength": 1,
            "description": "Pre-call tool slug."
          },
          "status": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "success",
              "failed",
              "timeout",
              "missing_vars",
              "config"
            ],
            "description": "Expected status. Defaults to success."
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "enum": [
              "success",
              "failed",
              "timeout",
              "missing_vars",
              "config"
            ],
            "description": "Legacy spelling of status."
          }
        },
        "required": [
          "rule",
          "tool"
        ],
        "not": {
          "required": [
            "status",
            "value"
          ]
        },
        "example": {
          "rule": "pre_call_status",
          "status": "success",
          "tool": "lookup_account"
        }
      },
      "EvalCheckFlowPreCallVarSetConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "flow / pre_call_var_set",
        "description": "A pre-call variable rendered non-empty.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "pre_call_var_set"
            ]
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "description": "Variable as <tool_slug>.<name>, the part after tools. in {{tools.X.Y}}."
          },
          "var": {
            "type": "string",
            "minLength": 1,
            "description": "Legacy spelling of value."
          }
        },
        "required": [
          "rule"
        ],
        "oneOf": [
          {
            "required": [
              "value"
            ]
          },
          {
            "required": [
              "var"
            ]
          }
        ],
        "example": {
          "rule": "pre_call_var_set",
          "value": "lookup_account.first_name"
        }
      },
      "EvalCheckFlowPreCallAbortedConfig": {
        "type": "object",
        "additionalProperties": false,
        "title": "flow / pre_call_aborted",
        "description": "The pre-call batch did (or did not) abort the call.",
        "properties": {
          "rule": {
            "type": "string",
            "enum": [
              "pre_call_aborted"
            ]
          },
          "expect": {
            "type": "boolean",
            "description": "true: the call must have been aborted; false (default): it must not."
          }
        },
        "required": [
          "rule"
        ],
        "example": {
          "expect": false,
          "rule": "pre_call_aborted"
        }
      },
      "EvalCheckListItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9][a-z0-9_-]{1,63}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "kind": {
            "type": "string",
            "enum": [
              "judge",
              "tool",
              "flow"
            ]
          },
          "source_template_key": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 128
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "kind",
          "source_template_key",
          "archived_at",
          "created_at",
          "updated_at"
        ],
        "example": {
          "id": "11111111-1111-4111-8111-111111111111",
          "slug": "never_cold_transfers",
          "name": "Never cold-transfers",
          "description": "The cold-transfer tool is never called.",
          "kind": "tool",
          "source_template_key": "never-cold-transfers",
          "archived_at": null,
          "created_at": "2026-08-01T08:00:00Z",
          "updated_at": "2026-08-01T09:00:00Z"
        }
      },
      "EvalCheckListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvalCheckListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "EvalCheckPatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Edits the check in place. The edit is live on the next run; verdicts already recorded keep their score and reasoning. kind, slug and template_key are fixed at creation: sending any of them returns 422 validation_failed with field code `immutable` — create a new check instead. A supplied config replaces the stored one and is validated in full against the check's kind and the config's rule.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "config": {
            "$ref": "#/components/schemas/EvalCheckConfigInput"
          }
        },
        "example": {
          "name": "Never cold-transfers"
        }
      },
      "EvalCheckTemplate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 128
          },
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "kind": {
            "type": "string",
            "enum": [
              "judge",
              "tool",
              "flow"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 2000
          },
          "config": {
            "$ref": "#/components/schemas/EvalCheckConfig"
          }
        },
        "required": [
          "key",
          "name",
          "kind",
          "description",
          "config"
        ]
      },
      "EvalCheckTemplateListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvalCheckTemplate"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "EvalRun": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "suite_id": {
            "type": "string",
            "format": "uuid"
          },
          "suite_slug": {
            "type": "string"
          },
          "suite_name": {
            "type": "string"
          },
          "pathway_name": {
            "type": "string"
          },
          "agent_version_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "mode": {
            "$ref": "#/components/schemas/EvalRunMode"
          },
          "tool_policy": {
            "$ref": "#/components/schemas/EvalToolPolicy"
          },
          "status": {
            "$ref": "#/components/schemas/EvalRunStatus"
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "completed": {
            "type": "integer",
            "minimum": 0
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duration_sec": {
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "cancel_requested_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "score_weighted": {
            "description": "The run's weighted score, 0-100, as the worker computed it. Null while the run is still going or when no check scored it.",
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "minimum": 0,
            "maximum": 100
          },
          "passed": {
            "description": "The run's verdict. Already accounts for blocking checks, so it is not derivable from score_weighted alone.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "unmocked_tool_calls": {
            "description": "Tool calls that reached a real upstream. Non-zero on a run whose tool_policy asked for mocks means the result is not trustworthy.",
            "type": "integer",
            "minimum": 0
          },
          "pass_rate": {
            "description": "Share of conversations that passed, 0-1. This is what `passed` is derived from — `score_weighted` is average partial credit and can be high on a run that failed.",
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "minimum": 0,
            "maximum": 1
          },
          "requested_concurrency": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "effective_concurrency": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "Requested value after mode defaults and current workspace headroom clamping; the deployment cap is configurable."
          },
          "summary": {
            "$ref": "#/components/schemas/EvalJSONObject"
          },
          "runtime_profile": {
            "$ref": "#/components/schemas/EvalRuntimeProfile"
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "eval execution failed",
              "the agent failed to produce its opening turn",
              "the simulated caller crashed",
              null
            ]
          },
          "error_code": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalExecutionErrorCode"
              },
              {
                "type": "null"
              }
            ]
          },
          "error_detail": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2049,
            "description": "Internal worker diagnostics are withheld from customer responses. Use the classified error and support identifiers."
          },
          "agent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "agent_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "agent_version_number": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "scenarios": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvalRunScenarioSummary"
            }
          },
          "calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvalRunCallSummary"
            }
          }
        },
        "required": [
          "id",
          "suite_id",
          "suite_slug",
          "suite_name",
          "pathway_name",
          "mode",
          "tool_policy",
          "status",
          "total",
          "completed",
          "created_at",
          "requested_concurrency",
          "effective_concurrency",
          "scenarios",
          "calls"
        ]
      },
      "EvalRunCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "suite_id": {
            "type": "string",
            "format": "uuid"
          },
          "mode": {
            "$ref": "#/components/schemas/EvalRunCreateMode"
          },
          "concurrency": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000,
            "default": 0,
            "description": "Zero selects the mode default; the server clamps against current workspace headroom."
          },
          "tool_policy": {
            "type": "string",
            "enum": [
              "dry_run",
              "mocked"
            ],
            "default": "dry_run",
            "description": "API keys must use create_live_eval_run for live tool execution."
          },
          "runtime_profile": {
            "$ref": "#/components/schemas/EvalRuntimeProfileInput"
          }
        },
        "required": [
          "agent_id",
          "suite_id",
          "mode"
        ],
        "example": {
          "agent_id": "33333333-3333-4333-8333-333333333333",
          "agent_version_id": "44444444-4444-4444-8444-444444444444",
          "suite_id": "11111111-1111-4111-8111-111111111111",
          "mode": "text",
          "concurrency": 4,
          "tool_policy": "dry_run",
          "runtime_profile": {}
        }
      },
      "LiveEvalRunCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "suite_id": {
            "type": "string",
            "format": "uuid"
          },
          "mode": {
            "$ref": "#/components/schemas/EvalRunCreateMode"
          },
          "concurrency": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000,
            "default": 0
          },
          "tool_policy": {
            "type": "string",
            "enum": [
              "live"
            ],
            "default": "live"
          },
          "runtime_profile": {
            "$ref": "#/components/schemas/EvalRuntimeProfileInput"
          }
        },
        "required": [
          "agent_id",
          "suite_id",
          "mode"
        ],
        "example": {
          "agent_id": "33333333-3333-4333-8333-333333333333",
          "suite_id": "11111111-1111-4111-8111-111111111111",
          "mode": "text",
          "concurrency": 1,
          "tool_policy": "live",
          "runtime_profile": {}
        }
      },
      "EvalRunCreateResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "effective_concurrency": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "Requested value after mode defaults and current workspace headroom clamping; the deployment cap is configurable."
          },
          "total": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "id",
          "effective_concurrency",
          "total"
        ],
        "example": {
          "id": "55555555-5555-4555-8555-555555555555",
          "effective_concurrency": 4,
          "total": 25
        }
      },
      "EvalRunCancelResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "$ref": "#/components/schemas/EvalRunStatus"
          },
          "completed": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "cancel_requested_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "status",
          "completed",
          "total"
        ],
        "example": {
          "id": "55555555-5555-4555-8555-555555555555",
          "status": "running",
          "completed": 8,
          "total": 25,
          "cancel_requested_at": "2026-07-21T09:16:00Z",
          "ended_at": null
        }
      },
      "EvalVerdict": {
        "type": "object",
        "additionalProperties": false,
        "description": "One check's answer about one conversation.",
        "properties": {
          "check_id": {
            "type": "string",
            "format": "uuid"
          },
          "check_slug": {
            "type": "string"
          },
          "check_kind": {
            "type": "string",
            "enum": [
              "judge",
              "tool",
              "flow"
            ]
          },
          "selected_level_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "For a graded judge, the level the judge selected."
          },
          "score_0_100": {
            "type": [
              "number",
              "null"
            ],
            "format": "float"
          },
          "is_target_match": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "passed": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "confidence": {
            "type": [
              "number",
              "null"
            ],
            "format": "float"
          },
          "insufficient_evidence": {
            "type": "boolean",
            "description": "The check could not be answered from this conversation. Excluded from the weighted mean rather than scored zero."
          },
          "reasoning": {
            "type": [
              "string",
              "null"
            ]
          },
          "evidence": {
            "description": "Quoted spans supporting the verdict."
          },
          "weight": {
            "type": "integer"
          },
          "blocking": {
            "type": "boolean"
          }
        },
        "required": [
          "check_id",
          "check_slug",
          "check_kind",
          "insufficient_evidence",
          "weight",
          "blocking"
        ]
      },
      "EvalCallListItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "suite_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "suite_name": {
            "type": "string"
          },
          "scenario_id": {
            "type": "string"
          },
          "scenario_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "pathway_name": {
            "type": "string"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duration_sec": {
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "minimum": 0
          },
          "end_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "timed_out": {
            "type": "boolean"
          },
          "overall_score": {
            "type": [
              "number",
              "null"
            ],
            "format": "float"
          },
          "score_weighted": {
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "description": "The v2 weighted check score, 0-100. Null for a conversation no check scored."
          },
          "passed": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the conversation cleared the suite threshold and every blocking check."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "eval execution failed",
              "eval execution timed out",
              "the agent failed to produce its opening turn",
              "the simulated caller crashed",
              null
            ]
          },
          "error_code": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalExecutionErrorCode"
              },
              {
                "type": "null"
              }
            ]
          },
          "error_detail": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2049,
            "description": "Internal worker diagnostics are withheld from customer responses. Use the classified error and support identifiers."
          },
          "agent_version_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "session_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "tool_policy": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalToolPolicy"
              },
              {
                "type": "null"
              }
            ]
          },
          "models": {
            "$ref": "#/components/schemas/EvalCallModels"
          }
        },
        "required": [
          "id",
          "suite_name",
          "scenario_id",
          "pathway_name",
          "started_at",
          "timed_out"
        ],
        "example": {
          "id": "66666666-6666-4666-8666-666666666666",
          "run_id": "55555555-5555-4555-8555-555555555555",
          "suite_id": "11111111-1111-4111-8111-111111111111",
          "suite_name": "Support regression",
          "scenario_id": "angry_refund",
          "scenario_label": "Angry refund request",
          "pathway_name": "support_agent",
          "started_at": "2026-07-21T09:15:02Z",
          "ended_at": "2026-07-21T09:15:20Z",
          "duration_sec": 18,
          "end_reason": "completed",
          "timed_out": false,
          "overall_score": 0.92,
          "score_weighted": 92.45,
          "passed": true,
          "error": null,
          "error_code": null,
          "agent_version_id": "44444444-4444-4444-8444-444444444444",
          "session_id": null,
          "tool_policy": "dry_run",
          "models": {}
        }
      },
      "EvalCall": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "suite_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "suite_name": {
            "type": "string"
          },
          "scenario_id": {
            "type": "string"
          },
          "scenario_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "pathway_name": {
            "type": "string"
          },
          "agent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "agent_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "agent_version_number": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duration_sec": {
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "minimum": 0
          },
          "end_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "timed_out": {
            "type": "boolean"
          },
          "overall_score": {
            "type": [
              "number",
              "null"
            ],
            "format": "float"
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "eval execution failed",
              "eval execution timed out",
              "the agent failed to produce its opening turn",
              "the simulated caller crashed",
              null
            ]
          },
          "error_code": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalExecutionErrorCode"
              },
              {
                "type": "null"
              }
            ]
          },
          "error_detail": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2049,
            "description": "Internal worker diagnostics are withheld from customer responses. Use the classified error and support identifiers."
          },
          "agent_version_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "session_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "tool_policy": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalToolPolicy"
              },
              {
                "type": "null"
              }
            ]
          },
          "transcript": {
            "description": "Stored structured transcript. It is authorized eval content, may contain model- or tool-generated values, and its shape depends on the worker version."
          },
          "pathway_events": {
            "description": "Structured pathway event sequence."
          },
          "agent_metrics_summary": {
            "description": "Agent-side metrics summary. JSON null when the worker recorded none.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalJSONObject"
              },
              {
                "type": "null"
              }
            ]
          },
          "caller_metrics_summary": {
            "description": "Simulated-caller metrics summary. JSON null when the worker recorded none.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalJSONObject"
              },
              {
                "type": "null"
              }
            ]
          },
          "structured_results": {
            "type": [
              "array",
              "null"
            ],
            "description": "Per-assertion scorer results in evaluation order. An empty array when the conversation crashed before scoring; JSON null when the scorer produced no structured section.",
            "items": {
              "$ref": "#/components/schemas/EvalJSONObject"
            }
          },
          "rubric_results": {
            "description": "The scorer's rubric output (every scorer key except the structured section). JSON null when the conversation was not rubric-scored, including crashed conversations.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EvalJSONObject"
              },
              {
                "type": "null"
              }
            ]
          },
          "models": {
            "$ref": "#/components/schemas/EvalCallModels"
          },
          "score_weighted": {
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "description": "Weighted mean of the attached checks' verdicts, excluding those that abstained. Null when the suite has no checks attached — distinct from a score of zero."
          },
          "passed": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this conversation cleared the pass threshold with no blocking failure. Always false when the conversation errored or timed out: a conversation that never happened satisfies every negative check trivially and must not pass on that basis."
          },
          "eval_tool_calls": {
            "description": "Ordered tool trace the checks were evaluated against, including which calls were mocked. Authorized eval content whose shape depends on the worker version."
          },
          "verdicts": {
            "type": "array",
            "description": "One entry per attached check. Empty when none are attached.",
            "items": {
              "$ref": "#/components/schemas/EvalVerdict"
            }
          }
        },
        "required": [
          "id",
          "suite_name",
          "scenario_id",
          "pathway_name",
          "started_at",
          "timed_out",
          "verdicts"
        ]
      },
      "EvalCallListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/EvalCallListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "ExtractionFieldType": {
        "type": "string",
        "enum": [
          "string",
          "integer",
          "number",
          "boolean",
          "enum",
          "array"
        ],
        "description": "JSON value type produced for this field. `enum` produces a string restricted to enum_values; `array` uses item_type."
      },
      "ExtractionArrayItemType": {
        "type": "string",
        "enum": [
          "string",
          "integer",
          "number"
        ]
      },
      "ExtractionField": {
        "type": "object",
        "additionalProperties": false,
        "description": "Normalized output field. Optional configuration is emitted explicitly so clients never need to distinguish omission from defaults.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
          },
          "type": {
            "$ref": "#/components/schemas/ExtractionFieldType"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "required": {
            "type": "boolean"
          },
          "enum_values": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Non-empty only when type is enum; otherwise an empty array."
          },
          "item_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "string",
              "integer",
              "number",
              null
            ],
            "description": "Element type when type is array; otherwise null. Omitted array item_type normalizes to string."
          }
        },
        "required": [
          "name",
          "type",
          "description",
          "required",
          "enum_values",
          "item_type"
        ]
      },
      "ExtractionFieldInput": {
        "description": "A field definition. Field names are ASCII identifiers and are unique within an object under case-insensitive comparison. Type-specific properties are rejected on other field types.",
        "oneOf": [
          {
            "title": "String extraction field",
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
              },
              "type": {
                "type": "string",
                "const": "string"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 1000
              },
              "required": {
                "type": "boolean",
                "default": false
              }
            },
            "required": [
              "name",
              "type"
            ]
          },
          {
            "title": "Integer extraction field",
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
              },
              "type": {
                "type": "string",
                "const": "integer"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 1000
              },
              "required": {
                "type": "boolean",
                "default": false
              }
            },
            "required": [
              "name",
              "type"
            ]
          },
          {
            "title": "Number extraction field",
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
              },
              "type": {
                "type": "string",
                "const": "number"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 1000
              },
              "required": {
                "type": "boolean",
                "default": false
              }
            },
            "required": [
              "name",
              "type"
            ]
          },
          {
            "title": "Boolean extraction field",
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
              },
              "type": {
                "type": "string",
                "const": "boolean"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 1000
              },
              "required": {
                "type": "boolean",
                "default": false
              }
            },
            "required": [
              "name",
              "type"
            ]
          },
          {
            "title": "Enum extraction field",
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
              },
              "type": {
                "type": "string",
                "const": "enum"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 1000
              },
              "required": {
                "type": "boolean",
                "default": false
              },
              "enum_values": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                }
              }
            },
            "required": [
              "name",
              "type",
              "enum_values"
            ]
          },
          {
            "title": "Array extraction field",
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
              },
              "type": {
                "type": "string",
                "const": "array"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 1000
              },
              "required": {
                "type": "boolean",
                "default": false
              },
              "item_type": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ExtractionArrayItemType"
                  }
                ],
                "default": "string"
              }
            },
            "required": [
              "name",
              "type"
            ]
          }
        ]
      },
      "ExtractionObjectDetail": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "fields": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ExtractionField"
            }
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "fields",
          "archived_at",
          "created_at",
          "updated_at"
        ]
      },
      "ExtractionObjectListItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "field_count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "fields": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ExtractionField"
            },
            "description": "Present only when the request uses expand=fields."
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "field_count",
          "archived_at",
          "created_at",
          "updated_at"
        ]
      },
      "ExtractionObjectCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Null or a blank string normalizes to null."
          },
          "fields": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ExtractionFieldInput"
            }
          }
        },
        "required": [
          "name",
          "fields"
        ]
      },
      "ExtractionObjectListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExtractionObjectListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "ExtractionObjectPatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Null or a blank string clears the description."
          },
          "fields": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ExtractionFieldInput"
            }
          }
        }
      },
      "FlowNode": {
        "type": "object",
        "additionalProperties": false,
        "description": "One agent on the flow canvas. `id` is the node's own identity and stays stable across agent renames and re-pointing; `x` and `y` are canvas coordinates the API stores verbatim and never interprets. Each agent may appear at most once in a flow, because every handoff out of a node derives a tool named after the target agent's slug.",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "agent_id": {
            "type": "string",
            "format": "uuid",
            "description": "An un-archived agent in this workspace whose production version carries a prompt or a workflow. Anything else is rejected with 422, because the runtime could not dispatch to it."
          },
          "x": {
            "type": "number",
            "default": 0,
            "description": "Canvas coordinate. Always present in responses; defaults to 0 when omitted on write."
          },
          "y": {
            "type": "number",
            "default": 0,
            "description": "Canvas coordinate. Always present in responses; defaults to 0 when omitted on write."
          },
          "agent_slug": {
            "type": "string",
            "readOnly": true,
            "description": "Read-only label so the canvas can render nodes without one request per agent. Accepted but ignored on write, so a body just read can be sent straight back. Absent when the referenced agent no longer resolves, which is how a broken node stays visible instead of disappearing."
          },
          "agent_name": {
            "type": "string",
            "readOnly": true,
            "description": "Read-only label; see agent_slug."
          }
        },
        "required": [
          "id",
          "agent_id"
        ]
      },
      "FlowEdge": {
        "type": "object",
        "additionalProperties": false,
        "description": "One directed handoff. The runtime compiles each edge into a `transfer_to_agent__<target-slug>` tool on the source agent, so a flow may not contain self-edges or two edges with the same (source, target) pair.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Client-assigned edge identity. Always present in responses; may be omitted on write, but ids that are supplied must be unique."
          },
          "source": {
            "type": "string",
            "description": "The `id` of a node in this flow's graph."
          },
          "target": {
            "type": "string",
            "description": "The `id` of a different node in this flow's graph. An agent cannot hand off to itself."
          },
          "label": {
            "type": "string",
            "maxLength": 120,
            "description": "Optional short caption for the canvas. Always present in responses, empty when unset."
          },
          "condition": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "Required. The operator's \"hand off when…\" text; it becomes the transfer tool's trigger and is the only thing telling the model which of several handoffs applies."
          }
        },
        "required": [
          "source",
          "target",
          "condition"
        ]
      },
      "FlowGraph": {
        "type": "object",
        "additionalProperties": false,
        "description": "The flow canvas — the agents on it and the handoffs between them.",
        "properties": {
          "nodes": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/FlowNode"
            }
          },
          "edges": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/FlowEdge"
            }
          }
        },
        "required": [
          "nodes",
          "edges"
        ]
      },
      "FlowNodeInput": {
        "type": "object",
        "additionalProperties": false,
        "description": "One agent on the canvas, as supplied on write. Identical to FlowNode except that the two derived labels are plain optional fields here: they are accepted and ignored, so a graph you just read can be sent straight back without stripping them.",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "agent_id": {
            "type": "string",
            "format": "uuid",
            "description": "An un-archived agent in this workspace whose production version carries a prompt or a workflow. Anything else is rejected with 422, because the runtime could not dispatch to it."
          },
          "x": {
            "type": "number",
            "default": 0,
            "description": "Canvas coordinate, stored verbatim and never interpreted."
          },
          "y": {
            "type": "number",
            "default": 0,
            "description": "Canvas coordinate, stored verbatim and never interpreted."
          },
          "agent_slug": {
            "type": "string",
            "description": "Accepted and ignored; the server derives it on read."
          },
          "agent_name": {
            "type": "string",
            "description": "Accepted and ignored; the server derives it on read."
          }
        },
        "required": [
          "id",
          "agent_id"
        ]
      },
      "FlowGraphInput": {
        "type": "object",
        "additionalProperties": false,
        "description": "The flow canvas as supplied on write. Sending it REPLACES the stored graph whole; it is never merged edge by edge.",
        "properties": {
          "nodes": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/FlowNodeInput"
            }
          },
          "edges": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/FlowEdge"
            }
          }
        },
        "required": [
          "nodes",
          "edges"
        ]
      },
      "Flow": {
        "type": "object",
        "additionalProperties": false,
        "description": "A named graph of existing agents joined by agent-to-agent handoffs. The same representation is returned for a single flow and for each element of a list page. A flow owns the graph, the start agent and an after-call override; prompt, model and voice configuration stays on each member agent's own version. Flows are not versioned — `resource_version` feeds the strong ETag that PATCH's If-Match is checked against.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "org_id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 2000,
            "description": "Absent when no description is set."
          },
          "start_agent_id": {
            "type": "string",
            "format": "uuid",
            "description": "The agent that ANSWERS a call routed at this flow; the graph's edges take over from there. Must be one of the agents on the canvas. Absent when the flow has no start agent yet, in which case the flow cannot be targeted by a number, a job or a call."
          },
          "graph": {
            "$ref": "#/components/schemas/FlowGraph"
          },
          "agent_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Derived count of graph.nodes, so a list page can show each flow's shape."
          },
          "handoff_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Derived count of graph.edges."
          },
          "summary_enabled": {
            "type": "boolean",
            "description": "After-call override. These four fields REPLACE every member agent's own after-call configuration for calls that run inside the flow."
          },
          "summary_prompt": {
            "type": "string",
            "maxLength": 50000,
            "description": "Absent when no override prompt is set."
          },
          "extraction_object_ids": {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "webhook_config_ids": {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "resource_version": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "Monotonic row version maintained by the database, never by the handler. It is the value behind the strong ETag."
          },
          "archived_at": {
            "type": "string",
            "format": "date-time",
            "description": "Absent unless the flow has been archived."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "org_id",
          "slug",
          "name",
          "graph",
          "agent_count",
          "handoff_count",
          "summary_enabled",
          "extraction_object_ids",
          "webhook_config_ids",
          "resource_version",
          "created_at",
          "updated_at"
        ]
      },
      "FlowListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Flow"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "FlowCloneRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Display name for the copy."
          },
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
            "description": "Unique routing identifier for the copy. Derived from the name when omitted."
          }
        }
      },
      "FlowCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Creates a flow. Only `name` is required: a flow may be created empty and wired up afterwards, and an omitted `slug` is derived from the name. Maximum encoded body size is 1048576 bytes.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
            "description": "Unique per workspace. Lower-cased and trimmed before validation. Derived from `name` when omitted."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "start_agent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Must be one of the agents in `graph.nodes`. Null leaves it unset."
          },
          "graph": {
            "$ref": "#/components/schemas/FlowGraphInput"
          },
          "summary_enabled": {
            "type": "boolean",
            "default": true
          },
          "summary_prompt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50000
          },
          "extraction_object_ids": {
            "type": [
              "array",
              "null"
            ],
            "maxItems": 100,
            "uniqueItems": true,
            "description": "Null is accepted and stores an empty list.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "webhook_config_ids": {
            "type": [
              "array",
              "null"
            ],
            "maxItems": 100,
            "uniqueItems": true,
            "description": "Null is accepted and stores an empty list.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "name"
        ]
      },
      "FlowPatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "Omitted fields are unchanged; at least one field must be supplied. Explicit null clears description, start_agent_id and summary_prompt, and empties the two after-call id lists. `graph` and `summary_enabled` reject null. Supplying `graph` REPLACES the whole canvas. Cross-field rules are evaluated against the merged result, so a patch that only moves the start agent must still name an agent the stored graph contains. Maximum encoded body size is 1048576 bytes.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "start_agent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "graph": {
            "$ref": "#/components/schemas/FlowGraphInput"
          },
          "summary_enabled": {
            "type": "boolean"
          },
          "summary_prompt": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50000
          },
          "extraction_object_ids": {
            "type": [
              "array",
              "null"
            ],
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "webhook_config_ids": {
            "type": [
              "array",
              "null"
            ],
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "GroupMember": {
        "type": "object",
        "additionalProperties": false,
        "description": "One live agent in a group. Removed members are not listed here (their past calls keep the member id and label; see GroupResults.members).",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Stable member id, stamped on every call the member takes as group_member_id."
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_name": {
            "type": "string"
          },
          "agent_slug": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "pattern": "^[A-Z]+$",
            "description": "Stable display label (A, B, … Z, AA …), assigned in order of joining and never reused within the group."
          },
          "weight": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "position": {
            "type": "integer",
            "minimum": 0,
            "description": "Display and pick order, set by the order of the members array."
          },
          "share": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "This member's weight as a percentage of the live total, one decimal."
          },
          "dispatchable": {
            "type": "boolean",
            "description": "False when the agent is archived or has no production version; such a member is skipped when calls are assigned."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "agent_id",
          "agent_name",
          "agent_slug",
          "label",
          "weight",
          "position",
          "share",
          "dispatchable",
          "created_at"
        ]
      },
      "GroupMetric": {
        "type": "object",
        "additionalProperties": false,
        "description": "One custom field measured on every call routed through the group, extracted after hangup by the group-owned extraction object and charted on the results page.",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,63}$",
            "description": "Unique within the group. overall_score and outcome are reserved."
          },
          "type": {
            "type": "string",
            "enum": [
              "number",
              "integer",
              "boolean",
              "enum"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 1000,
            "description": "What the extractor should measure. Absent when not set."
          },
          "enum_values": {
            "type": "array",
            "minItems": 2,
            "maxItems": 20,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "The allowed values of an enum metric. Absent for other types."
          }
        },
        "required": [
          "name",
          "type"
        ]
      },
      "GroupMetricInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,63}$",
            "description": "Lowercase letters, digits and underscores, starting with a letter; unique within the group. overall_score and outcome are reserved for Overall performance."
          },
          "type": {
            "type": "string",
            "enum": [
              "number",
              "integer",
              "boolean",
              "enum"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "enum_values": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Required for an enum metric: 2–20 unique, non-empty values (compared case-insensitively). Rejected for every other type."
          }
        },
        "required": [
          "name",
          "type"
        ]
      },
      "GroupMemberInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "agent_id": {
            "type": "string",
            "format": "uuid",
            "description": "An un-archived agent in this workspace with a production version. Each agent may appear at most once."
          },
          "weight": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "default": 0,
            "description": "Relative traffic weight. Shares are weight / sum of weights; a member with weight 0 stays in the group but receives no new calls."
          }
        },
        "required": [
          "agent_id"
        ]
      },
      "GroupUsedByCounts": {
        "type": "object",
        "additionalProperties": false,
        "description": "How many non-archived phone numbers and campaigns point at the group.",
        "properties": {
          "phone_numbers": {
            "type": "integer",
            "minimum": 0
          },
          "campaigns": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "phone_numbers",
          "campaigns"
        ]
      },
      "GroupUsedByDetail": {
        "type": "object",
        "additionalProperties": false,
        "description": "Every non-archived phone number and campaign that points at the group — what has to be re-pointed before the group can be archived.",
        "properties": {
          "phone_numbers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "e164": {
                  "type": "string"
                },
                "label": {
                  "type": "string",
                  "description": "Absent when the number has no label."
                }
              },
              "required": [
                "id",
                "e164"
              ]
            }
          },
          "campaigns": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "status"
              ]
            }
          }
        },
        "required": [
          "phone_numbers",
          "campaigns"
        ]
      },
      "GroupRoutingStrategy": {
        "type": "string",
        "enum": [
          "sticky",
          "random",
          "prefer_new"
        ],
        "description": "Chooses among eligible members in proportion to their weights. sticky assigns a number consistently while the eligible members and weights are unchanged. random draws independently for each new assignment. prefer_new draws from agents with no retained answered call for the number in this group, or from all eligible members once every eligible agent has answered it. When the number is unavailable, sticky and prefer_new use weighted random."
      },
      "Group": {
        "type": "object",
        "additionalProperties": false,
        "description": "A set of existing agents with traffic weights. A phone number, outbound job or campaign can target a group instead of a single agent or a flow; each call is assigned to one member using routing_strategy and measured on the same metrics, so agents can be compared on real traffic. A group owns no prompt, model or voice configuration — those stay on each member agent's production version. Groups are not versioned: a save is live on the next call, and `resource_version` feeds the strong ETag that PATCH's If-Match is checked against.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "org_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 2000,
            "description": "Absent when no description is set."
          },
          "routing_strategy": {
            "$ref": "#/components/schemas/GroupRoutingStrategy"
          },
          "overall_enabled": {
            "type": "boolean",
            "description": "Whether every call is measured on the platform's Overall performance fields: overall_score (integer 1–10) and outcome (achieved, partial, not_achieved or escalated)."
          },
          "members": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/GroupMember"
            },
            "description": "The live members in position order."
          },
          "metrics": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/GroupMetric"
            }
          },
          "extraction_object_id": {
            "type": "string",
            "format": "uuid",
            "description": "The group-owned extraction object that measures overall_enabled and metrics. It runs after every call routed through the group, is hidden from GET /v1/extraction-objects, and PATCH/DELETE on it return 409 extraction_object_managed_by_group — change the group instead."
          },
          "used_by": {
            "$ref": "#/components/schemas/GroupUsedByCounts"
          },
          "used_by_detail": {
            "$ref": "#/components/schemas/GroupUsedByDetail",
            "description": "Returned by the single-group endpoints (GET, POST, PATCH) only."
          },
          "resource_version": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "Monotonic row version maintained by the database, never by the handler. It is the value behind the strong ETag."
          },
          "archived_at": {
            "type": "string",
            "format": "date-time",
            "description": "Absent unless the group has been archived."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "org_id",
          "name",
          "overall_enabled",
          "routing_strategy",
          "members",
          "metrics",
          "used_by",
          "resource_version",
          "created_at",
          "updated_at"
        ]
      },
      "GroupListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Group"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "GroupCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Creates a group. name and members are required. overall_enabled defaults to true, routing_strategy to sticky, and metrics to an empty list. Maximum encoded body size is 262144 bytes.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Unique among the workspace's non-archived groups. Trimmed."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "overall_enabled": {
            "type": "boolean",
            "default": true
          },
          "routing_strategy": {
            "$ref": "#/components/schemas/GroupRoutingStrategy",
            "default": "sticky"
          },
          "members": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "description": "1–10 distinct agents; at least one weight must be above 0. Array order sets position and the labels (A, B, …).",
            "items": {
              "$ref": "#/components/schemas/GroupMemberInput"
            }
          },
          "metrics": {
            "type": [
              "array",
              "null"
            ],
            "maxItems": 20,
            "description": "Custom metrics. Null is accepted and stores an empty list.",
            "items": {
              "$ref": "#/components/schemas/GroupMetricInput"
            }
          }
        },
        "required": [
          "name",
          "members"
        ]
      },
      "GroupPatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "Omitted fields are unchanged; at least one field must be supplied. Explicit null clears description and empties metrics. name, overall_enabled, routing_strategy and members reject null. members REPLACES the live member set, matched by agent_id (existing agents keep their member id and label; agents left out are removed). metrics REPLACES the custom metric list. Maximum encoded body size is 262144 bytes.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "overall_enabled": {
            "type": "boolean"
          },
          "routing_strategy": {
            "$ref": "#/components/schemas/GroupRoutingStrategy"
          },
          "members": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/GroupMemberInput"
            }
          },
          "metrics": {
            "type": [
              "array",
              "null"
            ],
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/GroupMetricInput"
            }
          }
        }
      },
      "GroupChangeMember": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "member_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string"
          },
          "weight": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          }
        },
        "required": [
          "member_id",
          "agent_id",
          "label",
          "weight"
        ]
      },
      "GroupChange": {
        "type": "object",
        "additionalProperties": false,
        "description": "The live member set right after one member or weight change.",
        "properties": {
          "changed_at": {
            "type": "string",
            "format": "date-time"
          },
          "changed_by": {
            "type": "string",
            "format": "uuid",
            "description": "The user who saved the change. Absent for API-key and system writes."
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupChangeMember"
            }
          }
        },
        "required": [
          "changed_at",
          "members"
        ]
      },
      "GroupChangeListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/GroupChange"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "GroupResultsMember": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "member_id": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string"
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_name": {
            "type": "string"
          },
          "weight": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "The current weight; 0 for a removed member."
          },
          "removed": {
            "type": "boolean",
            "description": "True for a member removed from the group that still took calls in the window."
          }
        },
        "required": [
          "member_id",
          "label",
          "agent_id",
          "agent_name",
          "weight",
          "removed"
        ]
      },
      "GroupResultValue": {
        "type": "object",
        "additionalProperties": false,
        "description": "One member's value for one metric.",
        "properties": {
          "member_id": {
            "type": "string",
            "format": "uuid"
          },
          "n": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "Sample size the value is computed over."
          },
          "value": {
            "type": [
              "number",
              "null"
            ],
            "description": "Count, rate (0–1), mean or median depending on the metric kind. Null when the member has no sample, and always null for enum metrics."
          },
          "ci_low": {
            "type": [
              "number",
              "null"
            ],
            "description": "Lower bound of the 95% interval (Wilson for rates, normal for means)."
          },
          "ci_high": {
            "type": [
              "number",
              "null"
            ]
          },
          "distribution": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "description": "Enum metrics only — the count of calls per value."
          }
        },
        "required": [
          "member_id",
          "n",
          "value",
          "ci_low",
          "ci_high"
        ]
      },
      "GroupVerdict": {
        "type": "object",
        "additionalProperties": false,
        "description": "insufficient_data while fewer than two members have traffic or any member with traffic has fewer than 30 calls; otherwise the best two members are compared (two-proportion z-test for rates, Welch z-test for means) and the status is leader when p < 0.05, else no_difference.",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "leader",
              "no_difference",
              "insufficient_data"
            ]
          },
          "member_id": {
            "type": "string",
            "format": "uuid",
            "description": "The leading member. Present only when status is leader."
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "1 − p of the comparison, rounded to three decimals and capped at 0.999; absent when no comparison was made."
          }
        },
        "required": [
          "status"
        ]
      },
      "GroupBuiltinMetric": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "calls",
              "answer_rate",
              "avg_duration_sec",
              "transfer_rate",
              "failure_rate",
              "tool_failure_rate",
              "early_hangup_rate",
              "p50_latency_ms"
            ],
            "description": "answer_rate is present only when the window contains outbound calls."
          },
          "label": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "count",
              "rate",
              "mean",
              "median"
            ]
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "description": "seconds or ms for durations and latencies; null otherwise."
          },
          "higher_is_better": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupResultValue"
            }
          },
          "verdict": {
            "$ref": "#/components/schemas/GroupVerdict"
          }
        },
        "required": [
          "key",
          "label",
          "kind",
          "unit",
          "higher_is_better",
          "values",
          "verdict"
        ]
      },
      "GroupMetricResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "number",
              "integer",
              "boolean",
              "enum"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "overall",
              "custom"
            ],
            "description": "overall for overall_score / outcome, custom for the group's own metrics."
          },
          "description": {
            "type": "string"
          },
          "enum_values": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "higher_is_better": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupResultValue"
            }
          },
          "verdict": {
            "$ref": "#/components/schemas/GroupVerdict"
          }
        },
        "required": [
          "name",
          "label",
          "type",
          "source",
          "higher_is_better",
          "values",
          "verdict"
        ]
      },
      "GroupTrendPoint": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "member_id": {
            "type": "string",
            "format": "uuid"
          },
          "calls": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "overall_score": {
            "type": [
              "number",
              "null"
            ],
            "description": "Mean overall_score that day; null without scored calls."
          }
        },
        "required": [
          "date",
          "member_id",
          "calls",
          "overall_score"
        ]
      },
      "GroupTrend": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "bucket": {
            "type": "string",
            "const": "day"
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupTrendPoint"
            }
          }
        },
        "required": [
          "bucket",
          "points"
        ]
      },
      "GroupResults": {
        "type": "object",
        "additionalProperties": false,
        "description": "Per-member comparison of the calls routed through a group in one window.",
        "properties": {
          "group_id": {
            "type": "string",
            "format": "uuid"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupResultsMember"
            }
          },
          "builtin": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupBuiltinMetric"
            }
          },
          "metrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupMetricResult"
            }
          },
          "trend": {
            "$ref": "#/components/schemas/GroupTrend"
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupChange"
            },
            "description": "Member/weight snapshots saved inside the window."
          }
        },
        "required": [
          "group_id",
          "from",
          "to",
          "members",
          "builtin",
          "metrics",
          "trend",
          "changes"
        ]
      },
      "GuardrailSetCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Creates one immutable-slug catalog resource. slug, name, description, rule identifiers, rule names, and severity are trimmed. Control characters are rejected in single-line fields. Omitted description becomes null and omitted definition becomes the canonical empty definition. A JSON request body over 4,194,304 encoded bytes returns 413; a definition over its narrower 1,048,576 byte limit returns 422 with a definition field error.",
        "properties": {
          "slug": {
            "$ref": "#/components/schemas/GuardrailSetSlugInput"
          },
          "name": {
            "$ref": "#/components/schemas/GuardrailSetName"
          },
          "description": {
            "$ref": "#/components/schemas/GuardrailSetDescription"
          },
          "definition": {
            "$ref": "#/components/schemas/GuardrailDefinitionInput"
          }
        },
        "required": [
          "slug",
          "name"
        ]
      },
      "GuardrailSetSlugInput": {
        "type": "string",
        "minLength": 2,
        "maxLength": 64,
        "pattern": "^\\p{Z}*[a-z0-9_-]{2,64}\\p{Z}*$",
        "description": "Immutable workspace-unique slug on create. The complete raw value contains at most 64 Unicode characters. Surrounding Unicode separator characters are accepted and removed; the normalized value contains 2–64 lowercase ASCII letters, digits, hyphens, or underscores. Controls, internal whitespace, uppercase letters, and unpaired Unicode surrogate escapes are rejected."
      },
      "GuardrailSetSlug": {
        "type": "string",
        "minLength": 2,
        "maxLength": 64,
        "pattern": "^[a-z0-9_-]+$",
        "description": "Canonical immutable workspace-unique slug emitted after input normalization. It contains only lowercase ASCII letters, digits, hyphens, and underscores and never includes surrounding whitespace."
      },
      "GuardrailSetName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200,
        "description": "Human label after trimming. The raw and normalized value must each contain 1–200 Unicode characters and no control characters."
      },
      "GuardrailSetDescription": {
        "type": [
          "string",
          "null"
        ],
        "maxLength": 2000,
        "description": "Optional authored description. Leading/trailing whitespace is removed; null or a blank string normalizes to null. The raw and normalized value must contain at most 2000 Unicode characters. Newline, carriage return, and tab are accepted; other control characters and unpaired Unicode surrogate escapes are rejected."
      },
      "GuardrailRuleInput": {
        "description": "One ordered rule. kind=llm and kind=static have disjoint closed shapes; fields belonging to the other variant are rejected rather than ignored.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/LLMGuardrailInput"
          },
          {
            "$ref": "#/components/schemas/StaticGuardrailInput"
          }
        ]
      },
      "LLMGuardrailInput": {
        "type": "object",
        "additionalProperties": false,
        "description": "A model-judged constraint. Omitted kind is accepted as llm. The server trims instruction and emits kind=llm explicitly in the canonical response.",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/GuardrailLocalIdInput"
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Optional trimmed label. Blank input normalizes to omission; control characters and unpaired Unicode surrogate escapes are rejected."
          },
          "severity": {
            "$ref": "#/components/schemas/GuardrailSeverityInput"
          },
          "kind": {
            "$ref": "#/components/schemas/LLMGuardrailKindInput"
          },
          "instruction": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000,
            "description": "Natural-language constraint judged against each drafted response. Leading and trailing whitespace is removed. The raw and normalized value must each contain 1–20000 Unicode characters. Newline, carriage return, and tab are accepted; other control characters and unpaired surrogate escapes are rejected. This is literal policy text; prompt-variable syntax is never expanded."
          }
        },
        "required": [
          "id",
          "instruction"
        ]
      },
      "StaticGuardrailInput": {
        "type": "object",
        "additionalProperties": false,
        "description": "A deterministic case-insensitive phrase gate. kind=static is required.",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/GuardrailLocalIdInput"
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Optional trimmed label. Blank input normalizes to omission; control characters and unpaired Unicode surrogate escapes are rejected."
          },
          "severity": {
            "$ref": "#/components/schemas/GuardrailSeverityInput"
          },
          "kind": {
            "$ref": "#/components/schemas/StaticGuardrailKindInput"
          },
          "phrases": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "description": "Ordered phrases. Every run of Unicode whitespace normalizes to one ASCII space and leading/trailing whitespace is removed. Duplicate phrases within this rule are rejected after that whitespace normalization, Unicode NFKC compatibility normalization, and Unicode case folding. Phrases are literal; prompt-variable syntax is never expanded.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500,
              "description": "The raw and normalized phrase must each contain 1–500 Unicode characters. Newline, carriage return, and tab normalize as whitespace; other controls and unpaired surrogate escapes are rejected."
            }
          }
        },
        "required": [
          "id",
          "kind",
          "phrases"
        ]
      },
      "GuardrailDefinitionInput": {
        "type": "object",
        "additionalProperties": false,
        "description": "Complete ordered set replacement. Omission of this object on create, or omission of guardrails within it, normalizes to guardrails:[]. The encoded definition and its normalized form must each be at most 1,048,576 bytes. One definition may contain at most 100 rules; a larger array reports too_many_items at definition.guardrails. Once shape-valid, a single set is admitted only when it contains at most 40,000 LLM-instruction characters, 1,000 static phrases, and 100,000 static-phrase characters, reported respectively as guardrail_instruction_budget_exceeded, guardrail_phrase_budget_exceeded, and guardrail_phrase_character_budget_exceeded. An agent's ordered aggregate of assigned sets has those same limits plus the 100-rule limit; the first set ID that crosses a limit reports guardrail_rule_budget_exceeded or the corresponding character/phrase code at behavior.guardrails.guardrail_set_ids[i]. A live definition PATCH uses the analogous assigned_agent_guardrail_* code at definition and names the affected agent and deployment stage.",
        "properties": {
          "guardrails": {
            "type": "array",
            "maxItems": 100,
            "default": [],
            "description": "Ordered rules. Rule ids must be unique after trimming within this array; duplicate comparison is case-sensitive. Empty sets are valid and useful while building a policy incrementally.",
            "items": {
              "$ref": "#/components/schemas/GuardrailRuleInput"
            }
          }
        }
      },
      "GuardrailDefinition": {
        "type": "object",
        "additionalProperties": false,
        "description": "Canonical response definition. guardrails is always present and preserves authored rule order.",
        "properties": {
          "guardrails": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/GuardrailRule"
            }
          }
        },
        "required": [
          "guardrails"
        ]
      },
      "GuardrailRule": {
        "description": "Canonical rule with an explicit kind discriminator.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/LLMGuardrail"
          },
          {
            "$ref": "#/components/schemas/StaticGuardrail"
          }
        ]
      },
      "LLMGuardrail": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/CatalogLocalId"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "severity": {
            "$ref": "#/components/schemas/GuardrailSeverity"
          },
          "kind": {
            "type": "string",
            "const": "llm"
          },
          "instruction": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          }
        },
        "required": [
          "id",
          "kind",
          "instruction"
        ]
      },
      "StaticGuardrail": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/CatalogLocalId"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "severity": {
            "$ref": "#/components/schemas/GuardrailSeverity"
          },
          "kind": {
            "type": "string",
            "const": "static"
          },
          "phrases": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          }
        },
        "required": [
          "id",
          "kind",
          "phrases"
        ]
      },
      "GuardrailSeverityInput": {
        "type": "string",
        "minLength": 1,
        "maxLength": 32,
        "pattern": "^\\p{Z}*[A-Za-z0-9_-]+\\p{Z}*$",
        "description": "Optional machine-readable policy label on input. The complete raw value contains at most 32 Unicode characters. Surrounding Unicode separator characters are removed and ASCII letters are normalized to lowercase; the normalized value contains 1–32 ASCII letters, digits, hyphens, or underscores. Controls, internal whitespace, blank input, and unpaired Unicode surrogate escapes are rejected."
      },
      "LLMGuardrailKindInput": {
        "type": "string",
        "pattern": "^\\p{Z}*[Ll][Ll][Mm]\\p{Z}*$",
        "default": "llm",
        "description": "Optional llm discriminator on input. ASCII case is ignored and surrounding Unicode separator characters are removed; the canonical response always emits llm."
      },
      "StaticGuardrailKindInput": {
        "type": "string",
        "pattern": "^\\p{Z}*[Ss][Tt][Aa][Tt][Ii][Cc]\\p{Z}*$",
        "description": "Required static discriminator on input. ASCII case is ignored and surrounding Unicode separator characters are removed; the canonical response always emits static."
      },
      "GuardrailSeverity": {
        "type": "string",
        "minLength": 1,
        "maxLength": 32,
        "pattern": "^[a-z0-9_-]+$",
        "description": "Canonical machine-readable policy label such as warn, block, low, medium, or high. Responses contain only lowercase ASCII letters, digits, hyphens, and underscores and never include surrounding whitespace."
      },
      "GuardrailLocalIdInput": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "pattern": "^\\p{Z}*[A-Za-z0-9][A-Za-z0-9._:-]*\\p{Z}*$",
        "description": "Stable identifier on input, unique within the containing definition after normalization. The complete raw value contains at most 128 Unicode characters. Surrounding Unicode separator characters are removed; the normalized value starts with an ASCII letter or digit and then uses only ASCII letters, digits, dots, colons, hyphens, or underscores. Controls, internal whitespace, and unpaired Unicode surrogate escapes are rejected."
      },
      "CatalogLocalId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
        "description": "Canonical stable identifier emitted after input normalization. It starts with an ASCII letter or digit, continues with only ASCII letters, digits, dots, colons, hyphens, or underscores, and never includes surrounding whitespace."
      },
      "GuardrailSetDetail": {
        "type": "object",
        "additionalProperties": false,
        "description": "Complete normalized resource. configuration_errors is omitted for canonical rows. When present, it identifies legacy stored fields/rules that were unsafe to emit or an aggregate runtime budget exceeded by the stored definition. When the root and guardrails array are representable, invalid rules are omitted independently. A malformed or missing root/array, a stored definition above the 1,048,576-byte encoded limit, or an oversized normalized safe view returns the canonical empty definition instead. A legacy array above 100 rules is truncated to its first 100 entries and reports too_many_items; those entries are then normalized independently. Aggregate-only diagnostics retain every individually valid rule among those first 100, so this object always remains schema-valid and can be repaired with one complete-definition PATCH.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "$ref": "#/components/schemas/GuardrailSetSlug"
          },
          "name": {
            "$ref": "#/components/schemas/GuardrailSetName"
          },
          "description": {
            "$ref": "#/components/schemas/GuardrailSetDescription"
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "definition": {
            "$ref": "#/components/schemas/GuardrailDefinition"
          },
          "configuration_errors": {
            "type": "array",
            "minItems": 1,
            "readOnly": true,
            "description": "Exact legacy-repair diagnostics. Replace the complete definition using the current ETag; do not assume an omitted invalid rule or a rule beyond the 100-entry response boundary still executes. When the returned definition is empty because its root/array could not be represented safely or the stored definition exceeded the encoded-size limit, do not infer that any stored rule executes. An oversized legacy array uses too_many_items. Container/rule diagnostics use stored_value_invalid, too_large, invalid_type, unknown, required, too_many_items, too_few_items, too_long, invalid, invalid_unicode, invalid_format, invalid_enum, duplicate, or not_allowed as applicable. Aggregate diagnostics can use guardrail_instruction_budget_exceeded, guardrail_phrase_budget_exceeded, or guardrail_phrase_character_budget_exceeded without omitting individually valid rules from the returned definition.",
            "items": {
              "$ref": "#/components/schemas/FieldError"
            }
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "archived_at",
          "created_at",
          "updated_at",
          "definition"
        ]
      },
      "GuardrailSetListItem": {
        "type": "object",
        "additionalProperties": false,
        "description": "Guardrail-set metadata only; definition is never included in a list.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "$ref": "#/components/schemas/GuardrailSetSlug"
          },
          "name": {
            "$ref": "#/components/schemas/GuardrailSetName"
          },
          "description": {
            "$ref": "#/components/schemas/GuardrailSetDescription"
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "archived_at",
          "created_at",
          "updated_at"
        ]
      },
      "GuardrailSetListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/GuardrailSetListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "description": "Opaque cursor for the same endpoint and filter set, or null when this is the final page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "GuardrailSetPatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "Partial metadata update with complete replacement semantics for definition. slug is not patchable. At least one supported field must be present. A JSON request body over 4,194,304 encoded bytes returns 413; a definition over its narrower 1,048,576 byte limit returns 422 with a definition field error.",
        "properties": {
          "name": {
            "$ref": "#/components/schemas/GuardrailSetName"
          },
          "description": {
            "$ref": "#/components/schemas/GuardrailSetDescription"
          },
          "definition": {
            "$ref": "#/components/schemas/GuardrailDefinitionInput"
          }
        }
      },
      "GuardrailSetActiveDependency": {
        "type": "object",
        "additionalProperties": false,
        "description": "One active agent pointer that must stop referencing the set before archive can succeed.",
        "properties": {
          "kind": {
            "type": "string",
            "const": "agent_version"
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 48,
            "pattern": "^[a-z0-9_]+$"
          },
          "agent_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "agent_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_version": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Immutable snapshot number, or null for the mutable draft."
          },
          "deployment_stage": {
            "type": "string",
            "enum": [
              "draft",
              "staging",
              "production"
            ]
          },
          "reference": {
            "type": "string",
            "const": "behavior.guardrails.guardrail_set_ids"
          }
        },
        "required": [
          "kind",
          "agent_id",
          "agent_slug",
          "agent_name",
          "agent_version_id",
          "agent_version",
          "deployment_stage",
          "reference"
        ]
      },
      "GuardrailSetInUseDetails": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "dependencies": {
            "type": "array",
            "minItems": 1,
            "description": "Complete deterministic dependency list for the transaction snapshot.",
            "items": {
              "$ref": "#/components/schemas/GuardrailSetActiveDependency"
            }
          },
          "dependency_count": {
            "type": "integer",
            "minimum": 1,
            "description": "Exact number of entries in dependencies."
          }
        },
        "required": [
          "dependencies",
          "dependency_count"
        ]
      },
      "GuardrailSetInUseErrorVariant": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "const": "guardrail_set_in_use"
          },
          "message": {
            "type": "string",
            "minLength": 1
          },
          "request_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "details": {
            "$ref": "#/components/schemas/GuardrailSetInUseDetails"
          }
        },
        "required": [
          "code",
          "message",
          "request_id",
          "details"
        ]
      },
      "Insight": {
        "type": "object",
        "additionalProperties": false,
        "description": "A normalized saved analysis insight.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "board_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "chart_type": {
            "$ref": "#/components/schemas/AnalysisChartType"
          },
          "time_range": {
            "$ref": "#/components/schemas/AnalysisTimeRange"
          },
          "bucket": {
            "$ref": "#/components/schemas/AnalysisBucket"
          },
          "group_by": {
            "$ref": "#/components/schemas/AnalysisGroupBy"
          },
          "config": {
            "$ref": "#/components/schemas/InsightConfig"
          },
          "position": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "layout": {
            "$ref": "#/components/schemas/AnalysisInsightLayout"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "board_id",
          "name",
          "chart_type",
          "time_range",
          "bucket",
          "group_by",
          "config",
          "position",
          "layout",
          "created_at",
          "updated_at"
        ]
      },
      "InsightCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Creates a saved insight. Presentation fields use the documented defaults when omitted. Omit position to append after the board's current highest position. The request body is limited to 65536 bytes.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "chart_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AnalysisChartType"
              }
            ],
            "default": "bar"
          },
          "time_range": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AnalysisTimeRange"
              }
            ],
            "default": "7d"
          },
          "bucket": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AnalysisBucket"
              }
            ],
            "default": "day"
          },
          "group_by": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AnalysisGroupBy"
              }
            ],
            "default": "time"
          },
          "config": {
            "$ref": "#/components/schemas/InsightConfigInput"
          },
          "position": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "layout": {
            "$ref": "#/components/schemas/AnalysisInsightLayout"
          }
        },
        "required": [
          "name",
          "config"
        ]
      },
      "InsightPatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "A true partial update. The server merges supplied fields into the saved definition, validates the complete result, and returns the normalized insight.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "chart_type": {
            "$ref": "#/components/schemas/AnalysisChartType"
          },
          "time_range": {
            "$ref": "#/components/schemas/AnalysisTimeRange"
          },
          "bucket": {
            "$ref": "#/components/schemas/AnalysisBucket"
          },
          "group_by": {
            "$ref": "#/components/schemas/AnalysisGroupBy"
          },
          "config": {
            "$ref": "#/components/schemas/InsightConfigInput"
          },
          "position": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "layout": {
            "$ref": "#/components/schemas/AnalysisInsightLayout"
          }
        }
      },
      "InsightPreviewRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Computes an unsaved strict JSON definition. name and position are not part of this shape and are rejected. The request body is limited to 65536 bytes.",
        "properties": {
          "chart_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AnalysisChartType"
              }
            ],
            "default": "bar"
          },
          "time_range": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AnalysisTimeRange"
              }
            ],
            "default": "7d"
          },
          "bucket": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AnalysisBucket"
              }
            ],
            "default": "day"
          },
          "group_by": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AnalysisGroupBy"
              }
            ],
            "default": "time"
          },
          "config": {
            "$ref": "#/components/schemas/InsightConfigInput"
          }
        },
        "required": [
          "config"
        ]
      },
      "InsightConfigInput": {
        "type": "object",
        "additionalProperties": false,
        "description": "Query configuration. formula is a closed arithmetic expression over query names using numbers, +, -, *, /, and parentheses. group_by_2 requires one query, a primary grouping dimension other than none, and a different secondary dimension. formula and group_by_2 cannot be combined.",
        "properties": {
          "queries": {
            "type": "array",
            "minItems": 1,
            "maxItems": 6,
            "items": {
              "$ref": "#/components/schemas/AnalysisQueryInput"
            }
          },
          "formula": {
            "type": "string",
            "maxLength": 256,
            "description": "Blank input is normalized away; otherwise every referenced identifier must be a query name."
          },
          "group_by_2": {
            "$ref": "#/components/schemas/AnalysisSecondaryGroupBy"
          },
          "range_from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the window when time_range is custom. Required with range_to, must be before it, and the span may not exceed 400 days. Inclusive RFC3339 instant with an explicit timezone offset or Z. Fractional seconds are preserved. Rejected for any other time_range."
          },
          "range_to": {
            "type": "string",
            "format": "date-time",
            "description": "Exclusive RFC3339 end of the custom window, with an explicit timezone offset or Z. Fractional seconds are preserved; saved bounds are normalized to UTC. For complete calendar days, pass midnight after the last selected day in the desired timezone."
          },
          "display": {
            "$ref": "#/components/schemas/AnalysisInsightDisplay"
          }
        },
        "required": [
          "queries"
        ],
        "not": {
          "required": [
            "formula",
            "group_by_2"
          ]
        }
      },
      "InsightConfig": {
        "type": "object",
        "additionalProperties": false,
        "description": "Normalized query configuration returned for a saved insight.",
        "properties": {
          "queries": {
            "type": "array",
            "minItems": 1,
            "maxItems": 6,
            "items": {
              "$ref": "#/components/schemas/AnalysisQuery"
            }
          },
          "formula": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "group_by_2": {
            "$ref": "#/components/schemas/AnalysisSecondaryGroupBy"
          },
          "range_from": {
            "type": "string",
            "format": "date-time",
            "description": "Inclusive custom window start, normalized to UTC with fractional seconds preserved."
          },
          "range_to": {
            "type": "string",
            "format": "date-time",
            "description": "Exclusive custom window end, normalized to UTC with fractional seconds preserved."
          },
          "display": {
            "$ref": "#/components/schemas/AnalysisInsightDisplay"
          }
        },
        "required": [
          "queries"
        ],
        "not": {
          "required": [
            "formula",
            "group_by_2"
          ]
        }
      },
      "HumanCallIngestStatus": {
        "type": "string",
        "description": "queued accepted, waiting for a worker; transcribing fetching the audio and running the platform's batch speech-to-text with speaker diarization; analyzing transcript stored and analysis jobs dispatched; done analysis is under way on the resulting call; error gave up, see error. Transcription polls to completion and may take minutes on a long recording.",
        "enum": [
          "queued",
          "transcribing",
          "analyzing",
          "done",
          "error"
        ]
      },
      "HumanCallTranscriptSegment": {
        "type": "object",
        "additionalProperties": false,
        "description": "One attributed line of an already-produced transcript. role is accepted as a synonym for speaker, since that is what most transcription vendors emit.",
        "properties": {
          "speaker": {
            "type": "string",
            "maxLength": 200,
            "description": "Who spoke. Free text, used verbatim. unknown is used when the segment is unattributed. When Kejue Voice transcribes a recording itself, diarized speakers are labelled speaker_N using the provider's own numbering, and an undiarized recording yields a single unknown speaker rather than invented turns."
          },
          "role": {
            "type": "string",
            "maxLength": 200,
            "description": "Synonym for speaker. Ignored when speaker is supplied."
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          }
        },
        "required": [
          "text"
        ]
      },
      "HumanCallIngestRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Supply exactly one of recording_url or transcript. The recording is fetched server-side through an SSRF-guarded client that refuses private address ranges, and is subject to a size limit.",
        "properties": {
          "recording_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "description": "http or https URL the platform fetches the recording from. Must resolve to a public address; private ranges are refused. The audio is transcribed with speaker diarization and is not retained by the transcription provider — the uploaded file and the finished job are both deleted once the transcript is read."
          },
          "transcript": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5000,
            "description": "An already-produced transcript, for telephony that transcribes on its own. Skips speech-to-text and goes straight to analysis.",
            "items": {
              "$ref": "#/components/schemas/HumanCallTranscriptSegment"
            }
          },
          "human_agent": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Identifier for the human who handled the call. Free text owned by the caller's own systems. Boards can group by it."
          },
          "direction": {
            "type": "string",
            "enum": [
              "inbound",
              "outbound"
            ],
            "default": "inbound"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the call started. Must not be in the future."
          },
          "ended_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the call ended. Used to derive duration when the recording does not report one."
          },
          "caller_number": {
            "type": "string",
            "maxLength": 32,
            "description": "The external party's number in E.164 form."
          },
          "external_ref": {
            "type": "string",
            "maxLength": 200,
            "description": "The caller's own identifier for this call. Unique per workspace: re-posting the same value returns the original ingest with 200 rather than creating a second call."
          },
          "extraction_object_ids": {
            "type": "array",
            "maxItems": 20,
            "uniqueItems": true,
            "description": "Extraction objects to run against the transcript. Each must exist and be unarchived in this workspace.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "metadata": {
            "type": "object",
            "description": "Free-form JSON stored on the resulting call. The keys human_agent, ingest_source, and transcript_segments are written by the platform and are rejected here."
          },
          "key_terms": {
            "type": "array",
            "maxItems": 100,
            "description": "Words and phrases the transcriber should favor for this recording — product names, brands, people, jargon. Terms are trimmed, blanks are dropped, and case-insensitive duplicates are removed (the first spelling wins); at most 100 distinct terms of at most 100 characters each, with no control characters. They are merged with the platform's default key terms (this request's terms first) and capped to the transcription model's own limit; terms over that limit are not sent and the ingest gets a key_terms_truncated warning. Only used when Kejue Voice transcribes a recording_url. If the platform's transcription model does not support key terms, or a transcript is supplied, the request still succeeds, the terms are ignored, and the response's warnings say so (key_terms_unsupported / key_terms_not_applicable).",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          }
        },
        "required": [
          "human_agent",
          "started_at"
        ]
      },
      "HumanCallIngest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "session_id": {
            "type": "string",
            "format": "uuid",
            "description": "The call this ingest created. Readable through the calls API as soon as the ingest is accepted."
          },
          "status": {
            "$ref": "#/components/schemas/HumanCallIngestStatus"
          },
          "source_kind": {
            "type": "string",
            "enum": [
              "url",
              "upload",
              "transcript"
            ]
          },
          "external_ref": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "human_agent": {
            "type": "string",
            "maxLength": 200
          },
          "key_terms": {
            "type": "array",
            "maxItems": 100,
            "description": "The key terms this request supplied, after normalization (trimmed, de-duplicated). Empty when none were sent. Platform default terms are not listed here.",
            "items": {
              "type": "string",
              "maxLength": 100
            }
          },
          "warnings": {
            "type": "array",
            "maxItems": 20,
            "description": "Non-fatal conditions on this ingest, each with a stable code. Empty when there are none. A warning never changes status: the call is still transcribed and analyzed. Present on the 202 for conditions known at accept time, and added while the worker transcribes for the rest, so read the ingest again to see the full list.",
            "items": {
              "$ref": "#/components/schemas/HumanCallIngestWarning"
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "A stable, bounded reason when status is error. Never a raw provider message, so it is safe to surface to an end user. The reasons are the recording URL was rejected, the recording could not be transcribed, the recording is larger than the limit, the recording produced no transcribable speech, the transcription provider timed out, the transcript could not be stored for analysis, speech-to-text is not configured for this deployment, and transcription did not succeed after repeated attempts."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "session_id",
          "status",
          "source_kind",
          "external_ref",
          "human_agent",
          "key_terms",
          "warnings",
          "error",
          "created_at",
          "updated_at",
          "completed_at"
        ]
      },
      "HumanCallIngestWarning": {
        "type": "object",
        "additionalProperties": false,
        "description": "One non-fatal condition on a human-call ingest. Branch on code; message is human-readable and may change.",
        "properties": {
          "code": {
            "type": "string",
            "description": "key_terms_unsupported — key_terms were sent but the platform's human-call transcription model does not support key terms, so they were ignored. key_terms_not_applicable — key_terms were sent with a transcript, so no speech-to-text ran and they were ignored. key_terms_truncated — the request's terms plus the platform's default terms exceeded the transcription model's key-term limit, so the excess (platform defaults first, then the last request terms) was not sent. New codes may be added; treat an unknown code as informational.",
            "examples": [
              "key_terms_unsupported"
            ]
          },
          "message": {
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "HumanCallIngestListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/HumanCallIngest"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "InviteMemberRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 320
          },
          "role_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "email"
        ]
      },
      "InviteMemberResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "invitation_id": {
            "type": "string",
            "format": "uuid"
          },
          "user_id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "role_id": {
            "type": "string",
            "format": "uuid"
          },
          "role": {
            "type": "string",
            "minLength": 1
          },
          "invited_by_user_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "invited_by_email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "expired",
              "accepted",
              "revoked"
            ]
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "accepted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "invite_url": {
            "type": "string",
            "minLength": 1
          },
          "email_sent": {
            "type": "boolean"
          },
          "email_error": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "invitation_id",
          "user_id",
          "email",
          "role_id",
          "role",
          "invited_by_user_id",
          "invited_by_email",
          "status",
          "version",
          "created_at",
          "updated_at",
          "expires_at",
          "accepted_at",
          "revoked_at",
          "invite_url",
          "email_sent",
          "email_error"
        ]
      },
      "SecretName": {
        "type": "string",
        "minLength": 2,
        "maxLength": 64,
        "pattern": "^[A-Za-z_][A-Za-z0-9_]{1,63}$",
        "description": "Stable name of an active workspace secret. The referenced plaintext is never returned through the API."
      },
      "MCPAuthMode": {
        "type": "string",
        "enum": [
          "none",
          "bearer",
          "oauth2"
        ]
      },
      "MCPToolName": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256,
        "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:/-]{0,255}$"
      },
      "MCPToolHashes": {
        "type": "object",
        "additionalProperties": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "description": "Map of remote MCP tool name to SHA-256 of the sanitized description and input schema."
      },
      "MCPStoredTool": {
        "type": "object",
        "additionalProperties": false,
        "description": "Bounded sanitized tool snapshot. Approved snapshots define agent admission; observed snapshots remain untrusted until drift approval.",
        "properties": {
          "name": {
            "$ref": "#/components/schemas/MCPToolName"
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "input_schema": {
            "type": "object",
            "additionalProperties": true,
            "description": "Model-facing object schema with untrusted annotations removed and schema prose sanitized."
          },
          "hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "name",
          "description",
          "input_schema",
          "hash"
        ]
      },
      "MCPAttachmentStatus": {
        "type": "string",
        "description": "Machine-readable readiness of this registration for agent attachment.",
        "enum": [
          "not_introspected",
          "hash_enforcement_disabled",
          "approved_catalog_invalid",
          "ready_with_drift",
          "ready",
          "archived"
        ]
      },
      "MCPApproveDriftResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "no_drift",
              "drift_approved"
            ]
          },
          "pinned_tool_hashes": {
            "$ref": "#/components/schemas/MCPToolHashes"
          }
        },
        "required": [
          "id",
          "status",
          "pinned_tool_hashes"
        ]
      },
      "MCPIntrospectResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "tools": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/MCPIntrospectedTool"
            }
          },
          "removed_tools": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/MCPToolName"
            }
          },
          "has_drift": {
            "type": "boolean"
          },
          "pinned_tool_hashes": {
            "$ref": "#/components/schemas/MCPToolHashes"
          },
          "observed_tool_hashes": {
            "$ref": "#/components/schemas/MCPToolHashes"
          },
          "last_introspected_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_introspection_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Always null after a successful introspection."
          }
        },
        "required": [
          "id",
          "slug",
          "tools",
          "removed_tools",
          "has_drift",
          "pinned_tool_hashes",
          "observed_tool_hashes",
          "last_introspected_at",
          "last_introspection_error"
        ]
      },
      "MCPIntrospectedTool": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "$ref": "#/components/schemas/MCPToolName"
          },
          "description": {
            "type": "string",
            "maxLength": 4000,
            "description": "Sanitized LLM-facing description prefixed with the MCP server slug."
          },
          "input_schema": {
            "type": "object",
            "additionalProperties": true,
            "description": "Remote JSON Schema after structural validation; root type is object when specified."
          },
          "hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "allowed": {
            "type": "boolean",
            "description": "False when tool_allowlist is non-empty and does not include this name."
          },
          "pinned_hash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[a-f0-9]{64}$"
          },
          "drift_status": {
            "type": "string",
            "enum": [
              "new",
              "unchanged",
              "changed"
            ]
          },
          "blocked_by_hash": {
            "type": "boolean",
            "description": "True when hash enforcement prevents this new or changed tool from being exposed to agents."
          }
        },
        "required": [
          "name",
          "description",
          "input_schema",
          "hash",
          "allowed",
          "pinned_hash",
          "drift_status",
          "blocked_by_hash"
        ]
      },
      "MCPServerCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "auth_mode=none forbids every credential field; bearer requires auth_secret_ref; oauth2 uses a pre-registered client-credentials grant, requires both OAuth credential refs, and forbids auth_secret_ref. Every OAuth token request includes an RFC 8707 resource indicator. Empty optional strings normalize to null.",
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 48,
            "pattern": "^[a-z0-9](?:[a-z0-9-]{0,46}[a-z0-9])?$",
            "description": "Immutable public identifier."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 4096,
            "pattern": "^https://",
            "description": "Public HTTPS Streamable HTTP MCP endpoint. Userinfo, fragments, private DNS/IP targets, and redirects to unsafe targets are rejected."
          },
          "auth_mode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MCPAuthMode"
              }
            ],
            "default": "none"
          },
          "auth_secret_ref": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{1,63}$"
          },
          "tool_allowlist": {
            "type": "array",
            "maxItems": 500,
            "uniqueItems": true,
            "default": [],
            "description": "Empty means all successfully discovered tools are allowed, subject to hash enforcement.",
            "items": {
              "$ref": "#/components/schemas/MCPToolName"
            }
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 500,
            "maximum": 60000,
            "default": 10000
          },
          "enforce_hashes": {
            "type": "boolean",
            "default": true
          },
          "oauth_token_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "maxLength": 4096,
            "pattern": "^https://",
            "description": "Public HTTPS token endpoint. Null enables MCP 2025-11-25 endpoint-specific/root protected-resource discovery followed by RFC 8414 or OpenID Connect discovery."
          },
          "oauth_client_id_ref": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{1,63}$"
          },
          "oauth_client_secret_ref": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{1,63}$"
          },
          "oauth_scope": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Space-separated OAuth scope tokens; at most 100 unique printable ASCII tokens."
          },
          "oauth_audience": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "maxLength": 4096,
            "pattern": "^https://",
            "description": "RFC 8707 resource indicator sent in every token request. When null, the discovered canonical resource or configured MCP URL is used automatically."
          }
        },
        "required": [
          "slug",
          "name",
          "url"
        ]
      },
      "MCPServerListItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "auth_mode": {
            "$ref": "#/components/schemas/MCPAuthMode"
          },
          "timeout_ms": {
            "type": "integer"
          },
          "enforce_hashes": {
            "type": "boolean"
          },
          "last_introspected_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "url",
          "auth_mode",
          "timeout_ms",
          "enforce_hashes",
          "last_introspected_at",
          "archived_at",
          "created_at",
          "updated_at"
        ]
      },
      "MCPServerDetail": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "auth_mode": {
            "$ref": "#/components/schemas/MCPAuthMode"
          },
          "auth_secret_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "tool_allowlist": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/MCPToolName"
            }
          },
          "timeout_ms": {
            "type": "integer"
          },
          "enforce_hashes": {
            "type": "boolean"
          },
          "pinned_tool_hashes": {
            "$ref": "#/components/schemas/MCPToolHashes"
          },
          "observed_tool_hashes": {
            "$ref": "#/components/schemas/MCPToolHashes"
          },
          "approved_tools": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/MCPStoredTool"
            }
          },
          "observed_tools": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/MCPStoredTool"
            }
          },
          "attachment_status": {
            "$ref": "#/components/schemas/MCPAttachmentStatus"
          },
          "oauth_token_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "oauth_client_id_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "oauth_client_secret_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "oauth_scope": {
            "type": [
              "string",
              "null"
            ]
          },
          "oauth_audience": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Explicit resource override, or null when the runtime derives it from discovery/the MCP URL."
          },
          "last_introspected_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_introspection_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Sanitized machine reason for the last failed introspection; never contains an upstream body or secret."
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "url",
          "auth_mode",
          "auth_secret_ref",
          "tool_allowlist",
          "timeout_ms",
          "enforce_hashes",
          "pinned_tool_hashes",
          "observed_tool_hashes",
          "approved_tools",
          "observed_tools",
          "attachment_status",
          "oauth_token_url",
          "oauth_client_id_ref",
          "oauth_client_secret_ref",
          "oauth_scope",
          "oauth_audience",
          "last_introspected_at",
          "last_introspection_error",
          "archived_at",
          "created_at",
          "updated_at"
        ]
      },
      "MCPServerListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MCPServerListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "MCPServerPatchRequest": {
        "type": "object",
        "minProperties": 1,
        "additionalProperties": false,
        "description": "Partial replacement fields. The complete resulting configuration must satisfy the same auth and safety invariants as creation. Slug is not patchable.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 4096,
            "pattern": "^https://"
          },
          "auth_mode": {
            "$ref": "#/components/schemas/MCPAuthMode"
          },
          "auth_secret_ref": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{1,63}$"
          },
          "tool_allowlist": {
            "type": "array",
            "maxItems": 500,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/MCPToolName"
            }
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 500,
            "maximum": 60000
          },
          "enforce_hashes": {
            "type": "boolean"
          },
          "oauth_token_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "maxLength": 4096,
            "pattern": "^https://"
          },
          "oauth_client_id_ref": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{1,63}$"
          },
          "oauth_client_secret_ref": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{1,63}$"
          },
          "oauth_scope": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "oauth_audience": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "maxLength": 4096,
            "pattern": "^https://",
            "description": "Null restores automatic RFC 8707 resource derivation."
          }
        }
      },
      "Member": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "membership_id": {
            "type": "string",
            "format": "uuid"
          },
          "user_id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "display_name": {
            "type": "string"
          },
          "role_id": {
            "type": "string",
            "format": "uuid"
          },
          "role": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "is_protected": {
            "type": "boolean",
            "description": "True for the platform's protected owner account. It can never be removed, demoted, disabled or have its credentials reset by another member."
          }
        },
        "required": [
          "membership_id",
          "user_id",
          "email",
          "display_name",
          "role_id",
          "role",
          "version",
          "created_at",
          "updated_at",
          "is_protected"
        ]
      },
      "MemberInvitation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "invitation_id": {
            "type": "string",
            "format": "uuid"
          },
          "user_id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "role_id": {
            "type": "string",
            "format": "uuid"
          },
          "role": {
            "type": "string",
            "minLength": 1
          },
          "invited_by_user_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "invited_by_email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "expired",
              "accepted",
              "revoked"
            ]
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "accepted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "invitation_id",
          "user_id",
          "email",
          "role_id",
          "role",
          "invited_by_user_id",
          "invited_by_email",
          "status",
          "version",
          "created_at",
          "updated_at",
          "expires_at",
          "accepted_at",
          "revoked_at"
        ]
      },
      "MemberListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Member"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cursor for the next membership page, or null after the final page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "MemberInvitationListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MemberInvitation"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cursor for the next unresolved-invitation page, or null after the final page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "MemberRemovalResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "membership_id": {
            "type": "string",
            "format": "uuid"
          },
          "removed_user_id": {
            "type": "string",
            "format": "uuid"
          },
          "revoked_api_keys": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "revoked_sessions": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        },
        "required": [
          "membership_id",
          "removed_user_id",
          "revoked_api_keys",
          "revoked_sessions"
        ]
      },
      "ObserveTokenResponse": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "room_name": {
            "type": "string"
          }
        },
        "required": [
          "token",
          "url",
          "room_name"
        ]
      },
      "OutboundE164": {
        "type": "string",
        "pattern": "^(\\+[1-9][0-9]{7,14}|[0-9*#]{1,20}|sips?:[^@\\s]+@[A-Za-z0-9._-]+(:[0-9]{1,5})?(;\\S*)?)$",
        "description": "A dial target: an E.164 number, a bare internal number/extension of 1 to 20 [0-9*#] characters (e.g. 103, 2770124), or a sip:/sips: URI (e.g. sip:103@pbx.example.com)."
      },
      "OutboundTransport": {
        "type": "string",
        "enum": [
          "livekit_sip",
          "twilio_media_streams"
        ]
      },
      "OutboundCallingWindow": {
        "type": "object",
        "additionalProperties": false,
        "description": "Recurring lead-local interval. Weekdays use ISO numbering (Monday=1 through Sunday=7); start is inclusive and end is exclusive. Windows may be adjacent but may not overlap on the same day.",
        "properties": {
          "weekdays": {
            "type": "array",
            "minItems": 1,
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 7
            }
          },
          "start": {
            "type": "string",
            "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$",
            "examples": [
              "09:00"
            ]
          },
          "end": {
            "type": "string",
            "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$",
            "examples": [
              "17:00"
            ]
          }
        },
        "required": [
          "weekdays",
          "start",
          "end"
        ]
      },
      "OutboundPolicySource": {
        "type": "string",
        "enum": [
          "organization",
          "call_override",
          "legacy_default"
        ]
      },
      "OutboundTimingPolicySnapshot": {
        "type": "object",
        "additionalProperties": false,
        "description": "Immutable contact-hours decision stored on a job at creation time.",
        "properties": {
          "schema_version": {
            "type": "integer",
            "const": 1
          },
          "source": {
            "$ref": "#/components/schemas/OutboundPolicySource"
          },
          "org_policy_version": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "timezone": {
            "type": "string",
            "description": "Canonical IANA timezone used to interpret windows."
          },
          "windows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/OutboundCallingWindow"
            }
          }
        },
        "required": [
          "schema_version",
          "source",
          "org_policy_version",
          "timezone",
          "windows"
        ]
      },
      "OutboundCapacityRetry": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "minimum_seconds": {
            "type": "integer",
            "minimum": 1
          },
          "maximum_seconds": {
            "type": "integer",
            "minimum": 1
          },
          "jitter": {
            "type": "boolean"
          }
        },
        "required": [
          "minimum_seconds",
          "maximum_seconds",
          "jitter"
        ]
      },
      "OutboundRetryPolicySnapshot": {
        "type": "object",
        "additionalProperties": false,
        "description": "Immutable retry decision stored on a job at creation time. Capacity waits never consume a call attempt. A carrier or route failure (a SIP 5xx, or a call that could not be placed on the route) first gets a few retries that do not consume an attempt, with growing waits; we redial at once only when another trunk that has not yet failed this job is available. After that, each route failure consumes an attempt, so the job ends at max_attempts. A carrier's Retry-After is honored as the minimum wait, up to one hour.",
        "properties": {
          "version": {
            "type": "integer",
            "const": 1
          },
          "source": {
            "$ref": "#/components/schemas/OutboundPolicySource"
          },
          "org_policy_version": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "destination_busy_backoff_seconds": {
            "$ref": "#/components/schemas/OutboundRetryDelays"
          },
          "destination_unavailable_backoff_seconds": {
            "$ref": "#/components/schemas/OutboundRetryDelays"
          },
          "destination_declined_backoff_seconds": {
            "$ref": "#/components/schemas/OutboundRetryDelays"
          },
          "retry_declined": {
            "type": "boolean"
          },
          "capacity_retry": {
            "$ref": "#/components/schemas/OutboundCapacityRetry"
          },
          "ambiguous_provider_result": {
            "type": "string",
            "const": "reconcile_before_retry"
          }
        },
        "required": [
          "version",
          "source",
          "org_policy_version",
          "destination_busy_backoff_seconds",
          "destination_unavailable_backoff_seconds",
          "destination_declined_backoff_seconds",
          "retry_declined",
          "capacity_retry",
          "ambiguous_provider_result"
        ]
      },
      "OutboundRetryDelays": {
        "type": "array",
        "minItems": 1,
        "maxItems": 9,
        "items": {
          "type": "integer",
          "minimum": 1,
          "maximum": 604800
        }
      },
      "OutboundPolicyOverrides": {
        "type": "object",
        "additionalProperties": false,
        "description": "Per-job overrides. The organization policy may disable all overrides, and overridden windows must fit inside organization guardrails. `timezone` is accepted only with `timezone_mode=custom`; custom mode requires it.",
        "allOf": [
          {
            "if": {
              "required": [
                "timezone"
              ]
            },
            "then": {
              "required": [
                "timezone_mode"
              ],
              "properties": {
                "timezone_mode": {
                  "const": "custom"
                }
              }
            }
          },
          {
            "if": {
              "required": [
                "timezone_mode"
              ],
              "properties": {
                "timezone_mode": {
                  "const": "custom"
                }
              }
            },
            "then": {
              "required": [
                "timezone"
              ]
            }
          }
        ],
        "properties": {
          "timezone_mode": {
            "type": "string",
            "enum": [
              "contact",
              "organization",
              "custom"
            ]
          },
          "timezone": {
            "type": "string",
            "description": "Canonical IANA timezone. Required for custom mode and rejected for contact or organization mode."
          },
          "windows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/OutboundCallingWindow"
            }
          },
          "max_attempts": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "destination_busy_backoff_seconds": {
            "$ref": "#/components/schemas/OutboundRetryDelays"
          },
          "destination_unavailable_backoff_seconds": {
            "$ref": "#/components/schemas/OutboundRetryDelays"
          },
          "destination_declined_backoff_seconds": {
            "$ref": "#/components/schemas/OutboundRetryDelays"
          },
          "retry_declined": {
            "type": "boolean"
          }
        }
      },
      "OutboundJobStatus": {
        "type": "string",
        "enum": [
          "scheduled",
          "queued",
          "claimed",
          "reserving",
          "dialing",
          "ringing",
          "active",
          "retry_wait",
          "completed",
          "failed",
          "canceled",
          "expired",
          "provider_unknown"
        ]
      },
      "OutboundJobCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Maximum encoded body size is 262144 bytes. `max_attempts` is a compatibility shorthand for `policy_overrides.max_attempts`; supplying both with different values is rejected.",
        "properties": {
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_version": {
            "type": "string",
            "enum": [
              "production",
              "staging"
            ],
            "default": "production",
            "description": "Which of the agent's versions the call runs. `production` (the default) dials the deployed version; `staging` dials the version last promoted to staging so a change can be heard on a real call before it is deployed, and fails 409 `no_staging_version` when the agent has none. The resolved version id is stored on the job, so a later promote or deploy does not change what it dials. `staging` is only accepted with agent_id."
          },
          "flow_id": {
            "type": "string",
            "format": "uuid",
            "description": "Schedule the job against a flow instead of a single agent. The flow's start agent is resolved at create time and stored as the job's agent_id, with flow_id kept alongside as the annotation the dialer forwards at placement. Exactly one of agent_id and flow_id is required. Requires the `flows` entitlement, and the flow must be dispatchable now or the create fails 422 on `flow_id`."
          },
          "group_id": {
            "type": "string",
            "format": "uuid",
            "description": "Schedule the job against a group of agents. One member is picked at create time for the destination number (the contact's stored number when contact_id is given) using the group's routing strategy. It is stored as the job's agent_id, with group_id and group_member_id alongside; placement and every retry dial that member, always on its production version (agent_version `staging` is rejected with 422 `unsupported_with_group`). Exactly one of agent_id, flow_id and group_id is required (422 `exactly_one_required` on `group_id`). Requires the `groups` entitlement, and the group must have a member that can take calls now or the create fails 422 on `group_id` (not_found, archived, no_members)."
          },
          "contact_id": {
            "type": "string",
            "format": "uuid"
          },
          "to_number": {
            "$ref": "#/components/schemas/OutboundE164"
          },
          "number_pool_id": {
            "type": "string",
            "format": "uuid"
          },
          "phone_number_id": {
            "type": "string",
            "format": "uuid"
          },
          "trunk_id": {
            "type": "string",
            "format": "uuid",
            "description": "Optional route constraint. A forced phone number must belong to this trunk; a pool must have an eligible member on it."
          },
          "transport": {
            "$ref": "#/components/schemas/OutboundTransport"
          },
          "scheduled_at": {
            "type": "string",
            "format": "date-time",
            "description": "Requested schedule instant. Past values are accepted and evaluated from the current instant for contact hours."
          },
          "contact_timezone": {
            "type": "string",
            "description": "Legacy per-call IANA timezone override. Prefer policy_overrides for new clients."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Explicit expiry must be after scheduled_at and the next permitted contact-hours instant, and no more than 90 days after scheduled_at. When omitted, the policy TTL is added to the current evaluation instant for a past schedule, or to scheduled_at for a future schedule."
          },
          "max_attempts": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "policy_overrides": {
            "$ref": "#/components/schemas/OutboundPolicyOverrides"
          },
          "priority": {
            "type": "integer",
            "minimum": -100,
            "maximum": 100,
            "default": 0,
            "description": "Higher values are claimed first among otherwise-due jobs."
          },
          "variables": {
            "type": "object",
            "maxProperties": 50,
            "propertyNames": {
              "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
            },
            "additionalProperties": {
              "type": "string",
              "description": "Maximum 2000 UTF-8 bytes per value."
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "dncr": {
            "$ref": "#/components/schemas/DNCROptions"
          }
        },
        "allOf": [
          {
            "oneOf": [
              {
                "required": [
                  "agent_id"
                ],
                "not": {
                  "anyOf": [
                    {
                      "required": [
                        "flow_id"
                      ]
                    },
                    {
                      "required": [
                        "group_id"
                      ]
                    }
                  ]
                }
              },
              {
                "required": [
                  "flow_id"
                ],
                "not": {
                  "anyOf": [
                    {
                      "required": [
                        "agent_id"
                      ]
                    },
                    {
                      "required": [
                        "group_id"
                      ]
                    }
                  ]
                }
              },
              {
                "required": [
                  "group_id"
                ],
                "not": {
                  "anyOf": [
                    {
                      "required": [
                        "agent_id"
                      ]
                    },
                    {
                      "required": [
                        "flow_id"
                      ]
                    }
                  ]
                }
              }
            ]
          },
          {
            "oneOf": [
              {
                "required": [
                  "number_pool_id"
                ],
                "not": {
                  "required": [
                    "phone_number_id"
                  ]
                }
              },
              {
                "required": [
                  "phone_number_id"
                ],
                "not": {
                  "required": [
                    "number_pool_id"
                  ]
                }
              }
            ]
          },
          {
            "anyOf": [
              {
                "required": [
                  "contact_id"
                ]
              },
              {
                "required": [
                  "to_number"
                ]
              }
            ]
          }
        ]
      },
      "OutboundJobAccepted": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "$ref": "#/components/schemas/OutboundJobStatus"
          },
          "scheduled_at": {
            "type": "string",
            "format": "date-time"
          },
          "not_before": {
            "type": "string",
            "format": "date-time",
            "description": "Earliest instant after applying contact hours. Capacity may delay execution further."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "contact_timezone": {
            "type": "string"
          },
          "policy_context": {
            "$ref": "#/components/schemas/OutboundTimingPolicySnapshot"
          },
          "retry_policy": {
            "$ref": "#/components/schemas/OutboundRetryPolicySnapshot"
          },
          "max_attempts": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "dncr": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DNCRSnapshot"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            ]
          }
        },
        "required": [
          "id",
          "status",
          "scheduled_at",
          "not_before",
          "expires_at",
          "contact_timezone",
          "policy_context",
          "retry_policy",
          "max_attempts"
        ]
      },
      "OutboundJob": {
        "type": "object",
        "additionalProperties": false,
        "description": "Stable job-owned state and resource identifiers. Mutable agent, pool, phone-number, and trunk display enrichment is intentionally resolved through each canonical resource so it cannot change beneath this representation.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "org_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "flow_id": {
            "type": "string",
            "format": "uuid",
            "description": "The flow this job targets, absent for a job that targets a single agent. agent_id is then the flow's start agent as resolved when the job was created."
          },
          "group_id": {
            "type": "string",
            "format": "uuid",
            "description": "The group this job targets, absent otherwise. agent_id is then the agent of the member picked when the job was created."
          },
          "group_member_id": {
            "type": "string",
            "format": "uuid",
            "description": "The group member picked for this job, absent unless group_id is set."
          },
          "agent_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "contact_id": {
            "type": "string",
            "format": "uuid"
          },
          "destination_e164": {
            "$ref": "#/components/schemas/OutboundE164"
          },
          "number_pool_id": {
            "type": "string",
            "format": "uuid"
          },
          "phone_number_id": {
            "type": "string",
            "format": "uuid"
          },
          "trunk_id": {
            "type": "string",
            "format": "uuid"
          },
          "transport": {
            "$ref": "#/components/schemas/OutboundTransport"
          },
          "status": {
            "$ref": "#/components/schemas/OutboundJobStatus"
          },
          "priority": {
            "type": "integer",
            "minimum": -100,
            "maximum": 100
          },
          "scheduled_at": {
            "type": "string",
            "format": "date-time"
          },
          "not_before": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "contact_timezone": {
            "type": "string"
          },
          "attempt_count": {
            "type": "integer",
            "minimum": 0
          },
          "consumed_attempt_count": {
            "type": "integer",
            "minimum": 0
          },
          "max_attempts": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "variables": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "policy_context": {
            "$ref": "#/components/schemas/OutboundTimingPolicySnapshot"
          },
          "retry_policy": {
            "$ref": "#/components/schemas/OutboundRetryPolicySnapshot"
          },
          "last_failure_class": {
            "type": "string"
          },
          "last_provider_code": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "dncr": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DNCRSnapshot"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            ]
          },
          "dncr_result": {
            "$ref": "#/components/schemas/DNCRResult"
          }
        },
        "required": [
          "id",
          "org_id",
          "agent_id",
          "destination_e164",
          "status",
          "priority",
          "scheduled_at",
          "not_before",
          "contact_timezone",
          "attempt_count",
          "consumed_attempt_count",
          "max_attempts",
          "variables",
          "metadata",
          "policy_context",
          "retry_policy",
          "created_at",
          "updated_at"
        ]
      },
      "OutboundAttemptStatus": {
        "type": "string",
        "enum": [
          "reserved",
          "dial_requesting",
          "dialing",
          "ringing",
          "active",
          "completed",
          "failed",
          "canceled",
          "provider_unknown"
        ]
      },
      "OutboundAttempt": {
        "type": "object",
        "additionalProperties": false,
        "description": "Sanitized attempt state. Raw provider status text is never public; branch on the normalized failure_class, provider_status_code, and status.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "attempt_number": {
            "type": "integer",
            "minimum": 1
          },
          "session_id": {
            "type": "string",
            "format": "uuid"
          },
          "phone_number_id": {
            "type": "string",
            "format": "uuid"
          },
          "trunk_id": {
            "type": "string",
            "format": "uuid"
          },
          "transport": {
            "$ref": "#/components/schemas/OutboundTransport"
          },
          "status": {
            "$ref": "#/components/schemas/OutboundAttemptStatus"
          },
          "provider_call_id": {
            "type": "string"
          },
          "sip_call_id": {
            "type": "string"
          },
          "failure_class": {
            "type": "string"
          },
          "provider_status_code": {
            "type": "string"
          },
          "requested_at": {
            "type": "string",
            "format": "date-time"
          },
          "ringing_at": {
            "type": "string",
            "format": "date-time"
          },
          "answered_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "attempt_number",
          "transport",
          "status",
          "created_at",
          "updated_at"
        ]
      },
      "OutboundJobDetailResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "job": {
            "$ref": "#/components/schemas/OutboundJob"
          },
          "attempts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutboundAttempt"
            }
          }
        },
        "required": [
          "job",
          "attempts"
        ]
      },
      "OutboundJobListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutboundJob"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "OutboundJobCancelRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 8,
            "maxLength": 500,
            "description": "Optional audit reason. Leading/trailing whitespace is removed and control characters are rejected."
          }
        }
      },
      "OutboundJobCancelResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "const": "canceled"
          },
          "changed": {
            "type": "boolean"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "status",
          "changed",
          "updated_at"
        ]
      },
      "OutboundNumberPoolSelectionPolicy": {
        "type": "string",
        "enum": [
          "sticky_least_loaded",
          "least_loaded",
          "weighted_round_robin"
        ]
      },
      "OutboundNumberPoolStatus": {
        "type": "string",
        "enum": [
          "active",
          "archived"
        ]
      },
      "OutboundNumberPoolMemberInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "phone_number_id": {
            "type": "string",
            "format": "uuid"
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "default": 100,
            "description": "Lower priorities are considered first. Explicit zero is meaningful and is not treated as omitted."
          },
          "weight": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000,
            "default": 100
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        },
        "required": [
          "phone_number_id"
        ]
      },
      "OutboundNumberPoolMember": {
        "type": "object",
        "additionalProperties": false,
        "description": "Stable membership and selection settings. Read the phone-number resource for current routing metadata and the capacity endpoint for draining state.",
        "properties": {
          "phone_number_id": {
            "type": "string",
            "format": "uuid"
          },
          "priority": {
            "type": "integer",
            "minimum": 0
          },
          "weight": {
            "type": "integer",
            "minimum": 1
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "phone_number_id",
          "priority",
          "weight",
          "enabled"
        ]
      },
      "OutboundNumberPool": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "selection_policy": {
            "$ref": "#/components/schemas/OutboundNumberPoolSelectionPolicy"
          },
          "status": {
            "$ref": "#/components/schemas/OutboundNumberPoolStatus"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutboundNumberPoolMember"
            }
          },
          "archived_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "selection_policy",
          "status",
          "members",
          "created_at",
          "updated_at"
        ]
      },
      "OutboundNumberPoolCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "selection_policy": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OutboundNumberPoolSelectionPolicy"
              }
            ],
            "default": "sticky_least_loaded"
          },
          "members": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/OutboundNumberPoolMemberInput"
            }
          }
        },
        "required": [
          "name",
          "members"
        ]
      },
      "OutboundNumberPoolPatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "selection_policy": {
            "$ref": "#/components/schemas/OutboundNumberPoolSelectionPolicy"
          },
          "status": {
            "$ref": "#/components/schemas/OutboundNumberPoolStatus"
          },
          "members": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/OutboundNumberPoolMemberInput"
            }
          }
        }
      },
      "OutboundNumberPoolListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutboundNumberPool"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "OutboundCapacityScopeType": {
        "type": "string",
        "enum": [
          "provider_account",
          "provider_profile",
          "campaign"
        ]
      },
      "OutboundCapacitySharingMode": {
        "type": "string",
        "enum": [
          "org",
          "physical"
        ]
      },
      "OutboundCapacityMode": {
        "type": "string",
        "enum": [
          "unknown",
          "fixed",
          "unlimited"
        ]
      },
      "OutboundCapacityProfileSource": {
        "type": "string",
        "enum": [
          "manual",
          "provider_discovered"
        ]
      },
      "OutboundCapacityProfileRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Maximum encoded body size is 65536 bytes. Campaign profiles must use org sharing. Limit fields are allowed only in fixed mode; fixed mode requires max_concurrent or max_cps, and cps_burst requires max_cps.",
        "properties": {
          "scope_type": {
            "$ref": "#/components/schemas/OutboundCapacityScopeType"
          },
          "scope_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Stable provider-native or logical identifier. Never place credentials here."
          },
          "sharing_mode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OutboundCapacitySharingMode"
              }
            ],
            "default": "org"
          },
          "capacity_mode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OutboundCapacityMode"
              }
            ],
            "default": "unknown"
          },
          "max_concurrent": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "max_cps": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 100000
          },
          "cps_burst": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          }
        },
        "required": [
          "scope_type",
          "scope_key"
        ],
        "oneOf": [
          {
            "properties": {
              "capacity_mode": {
                "const": "fixed"
              }
            },
            "required": [
              "capacity_mode"
            ],
            "anyOf": [
              {
                "required": [
                  "max_concurrent"
                ]
              },
              {
                "required": [
                  "max_cps"
                ]
              }
            ]
          },
          {
            "properties": {
              "capacity_mode": {
                "enum": [
                  "unknown",
                  "unlimited"
                ]
              }
            },
            "not": {
              "anyOf": [
                {
                  "required": [
                    "max_concurrent"
                  ]
                },
                {
                  "required": [
                    "max_cps"
                  ]
                },
                {
                  "required": [
                    "cps_burst"
                  ]
                }
              ]
            }
          }
        ]
      },
      "OutboundCapacityProfileCore": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "scope_type": {
            "$ref": "#/components/schemas/OutboundCapacityScopeType"
          },
          "scope_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "sharing_mode": {
            "$ref": "#/components/schemas/OutboundCapacitySharingMode"
          },
          "capacity_mode": {
            "$ref": "#/components/schemas/OutboundCapacityMode"
          },
          "max_concurrent": {
            "type": "integer",
            "minimum": 1
          },
          "max_cps": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "cps_burst": {
            "type": "integer",
            "minimum": 1
          },
          "source": {
            "$ref": "#/components/schemas/OutboundCapacityProfileSource"
          },
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "scope_type",
          "scope_key",
          "sharing_mode",
          "capacity_mode",
          "source",
          "created_at",
          "updated_at"
        ]
      },
      "OutboundCapacityProfile": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OutboundCapacityProfileCore"
          }
        ],
        "unevaluatedProperties": false
      },
      "OutboundCapacityProfileListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutboundCapacityProfile"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "OutboundCapacityState": {
        "type": "string",
        "enum": [
          "available",
          "available_unverified",
          "busy",
          "draining"
        ]
      },
      "OutboundCapacityStatusCore": {
        "type": "object",
        "properties": {
          "scope_type": {
            "type": "string"
          },
          "scope_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "capacity_mode": {
            "type": "string",
            "enum": [
              "unknown",
              "inherit",
              "fixed",
              "unlimited"
            ]
          },
          "max_concurrent": {
            "type": "integer",
            "minimum": 1
          },
          "max_cps": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "cps_burst": {
            "type": "integer",
            "minimum": 1
          },
          "active": {
            "type": "integer",
            "minimum": 0
          },
          "available": {
            "type": "integer",
            "minimum": 0
          },
          "state": {
            "$ref": "#/components/schemas/OutboundCapacityState"
          },
          "draining": {
            "type": "boolean"
          },
          "sharing_mode": {
            "$ref": "#/components/schemas/OutboundCapacitySharingMode"
          },
          "source": {
            "$ref": "#/components/schemas/OutboundCapacityProfileSource"
          },
          "capacity_profile_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "scope_type",
          "scope_id",
          "capacity_mode",
          "active",
          "state"
        ]
      },
      "OutboundCapacityStatus": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OutboundCapacityStatusCore"
          }
        ],
        "unevaluatedProperties": false
      },
      "OutboundNumberCapacityStatus": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OutboundCapacityStatusCore"
          },
          {
            "type": "object",
            "properties": {
              "e164": {
                "$ref": "#/components/schemas/OutboundE164"
              },
              "trunk_id": {
                "type": "string",
                "format": "uuid"
              },
              "active_calls": {
                "type": "integer",
                "minimum": 0
              },
              "effective_available": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "e164",
              "trunk_id",
              "active_calls"
            ]
          }
        ],
        "unevaluatedProperties": false
      },
      "OutboundCapacityProfileStatus": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OutboundCapacityProfileCore"
          },
          {
            "type": "object",
            "properties": {
              "active": {
                "type": "integer",
                "minimum": 0
              },
              "available": {
                "type": "integer",
                "minimum": 0
              },
              "state": {
                "$ref": "#/components/schemas/OutboundCapacityState"
              }
            },
            "required": [
              "active",
              "state"
            ]
          }
        ],
        "unevaluatedProperties": false
      },
      "OutboundCapacityOverview": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "org": {
            "$ref": "#/components/schemas/OutboundCapacityStatus"
          },
          "account": {
            "$ref": "#/components/schemas/OutboundCapacityStatus"
          },
          "trunks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutboundCapacityStatus"
            }
          },
          "phone_numbers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutboundNumberCapacityStatus"
            }
          },
          "profiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OutboundCapacityProfileStatus"
            }
          },
          "observed_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "org",
          "trunks",
          "phone_numbers",
          "profiles",
          "observed_at"
        ]
      },
      "OutboundPolicyCore": {
        "type": "object",
        "properties": {
          "schema_version": {
            "type": "integer",
            "const": 1
          },
          "default_timezone_mode": {
            "type": "string",
            "enum": [
              "contact",
              "organization"
            ]
          },
          "default_windows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/OutboundCallingWindow"
            }
          },
          "guardrail_windows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/OutboundCallingWindow"
            }
          },
          "default_max_attempts": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "destination_busy_backoff_seconds": {
            "$ref": "#/components/schemas/OutboundRetryDelays"
          },
          "destination_unavailable_backoff_seconds": {
            "$ref": "#/components/schemas/OutboundRetryDelays"
          },
          "destination_declined_backoff_seconds": {
            "$ref": "#/components/schemas/OutboundRetryDelays"
          },
          "retry_declined": {
            "type": "boolean"
          },
          "default_job_ttl_seconds": {
            "type": "integer",
            "minimum": 300,
            "maximum": 7776000
          },
          "allow_call_overrides": {
            "type": "boolean"
          },
          "dncr": {
            "$ref": "#/components/schemas/DNCROrganizationPolicy"
          }
        },
        "required": [
          "schema_version",
          "default_timezone_mode",
          "default_windows",
          "guardrail_windows",
          "default_max_attempts",
          "destination_busy_backoff_seconds",
          "destination_unavailable_backoff_seconds",
          "destination_declined_backoff_seconds",
          "retry_declined",
          "default_job_ttl_seconds",
          "allow_call_overrides"
        ]
      },
      "OutboundPolicyDocument": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OutboundPolicyCore"
          },
          {
            "type": "object",
            "properties": {
              "policy_version": {
                "type": "integer",
                "format": "int64",
                "minimum": 0
              },
              "organization_version": {
                "type": "integer",
                "format": "int64",
                "minimum": 1
              },
              "organization_timezone": {
                "type": "string",
                "description": "Canonical IANA timezone."
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "policy_version",
              "organization_version",
              "organization_timezone",
              "updated_at"
            ]
          }
        ],
        "unevaluatedProperties": false
      },
      "OutboundPolicyUpdateRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OutboundPolicyCore"
          },
          {
            "type": "object",
            "properties": {
              "organization_timezone": {
                "type": "string",
                "description": "IANA timezone such as Asia/Dubai."
              }
            },
            "required": [
              "organization_timezone"
            ]
          }
        ],
        "unevaluatedProperties": false
      },
      "OutboundCallRequest": {
        "type": "object",
        "properties": {
          "agent_id": {
            "type": "string",
            "description": "Required unless flow_id or group_id is given; exactly one of the three is allowed."
          },
          "flow_id": {
            "type": "string",
            "description": "Place the call with a flow instead of a single agent. The flow's start agent places it and the graph's handoffs take over. Mutually exclusive with agent_id — exactly one of the two is required, and naming neither or both is a 400. Requires the `flows` entitlement."
          },
          "group_id": {
            "type": "string",
            "format": "uuid",
            "description": "Place the call with a group of agents. The group's routing strategy picks a member for to_number, and that agent's production version places the call. The call records group_id and group_member_id. Exactly one of agent_id, flow_id and group_id. Requires the `groups` entitlement."
          },
          "trunk_id": {
            "type": "string"
          },
          "to_number": {
            "type": "string"
          },
          "caller_id": {
            "type": "string"
          },
          "metadata": {
            "type": "string"
          },
          "variables": {
            "type": "object",
            "additionalProperties": true
          },
          "dncr": {
            "$ref": "#/components/schemas/DNCROptions"
          }
        },
        "required": [
          "trunk_id",
          "to_number",
          "caller_id",
          "variables"
        ]
      },
      "OutboundCallResponse": {
        "type": "object",
        "properties": {
          "call_id": {
            "type": "string"
          },
          "room_name": {
            "type": "string"
          },
          "sip_call_id": {
            "type": "string"
          },
          "participant_id": {
            "type": "string"
          },
          "agent_dispatch_id": {
            "type": "string"
          }
        },
        "required": [
          "call_id",
          "room_name",
          "sip_call_id",
          "participant_id",
          "agent_dispatch_id"
        ]
      },
      "CurrentOrganization": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "retention_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3650
          },
          "default_timezone": {
            "type": "string",
            "minLength": 1,
            "description": "Canonical IANA timezone."
          },
          "mfa_policy": {
            "type": "string",
            "enum": [
              "off",
              "optional",
              "required"
            ],
            "description": "Second-factor requirement for PASSWORD sign-in to this organization. `off` asks for no second factor, `optional` lets members enrol and challenges those who have, `required` obliges every member to enrol before using the dashboard. Federated (OIDC) identities are governed by the upstream identity provider instead. Changing this requires the `mfa` entitlement; reading it never does."
          },
          "pii_access_mode": {
            "type": "string",
            "enum": [
              "open",
              "reason",
              "approval"
            ],
            "description": "How much friction stands in front of an un-redacted read of call data. `open` asks for nothing, `reason` requires a written justification per read, `approval` requires a request another member approves before any read is allowed. It never changes WHICH permission is required — `pii-access:unmask` still gates raw transcripts and raw tool I/O, `calls:download-recording` still gates audio. Changing this requires the `pii_redaction_config` entitlement; reading it never does."
          },
          "pii_access_grant_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365,
            "description": "How many days an approved break-glass request stays usable. `0` means it never expires. Stamped onto a request when it is approved, so shortening this later never cuts short an approval already granted. Only meaningful when `pii_access_mode` is `approval`."
          },
          "pii_masking": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ],
            "description": "Whether calls are PII-masked when they are stored. `enabled` masks the built-in identifier set plus the organization's custom terms. `disabled` (the default for new organizations) stores transcripts, tool input/output, guardrail reasons and context messages as spoken; credentials in tool I/O (authorization headers, tokens, passwords, API keys, PINs, card security codes) stay masked. Applies to calls recorded after the change — stored calls are never rewritten. Changing this requires the `pii_redaction_config` entitlement; reading it never does."
          },
          "ai_connectors": {
            "$ref": "#/components/schemas/AIConnectorsMode"
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "retention_days",
          "default_timezone",
          "mfa_policy",
          "pii_access_mode",
          "pii_access_grant_days",
          "pii_masking",
          "ai_connectors",
          "version",
          "created_at",
          "updated_at"
        ]
      },
      "PatchMemberInvitationRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "role_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "role_id"
        ]
      },
      "PatchMemberRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "role_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "role_id"
        ]
      },
      "PatchOrgRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "retention_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3650
          },
          "default_timezone": {
            "type": "string",
            "minLength": 1,
            "description": "Canonical IANA timezone, for example Asia/Dubai."
          },
          "mfa_policy": {
            "type": "string",
            "enum": [
              "off",
              "optional",
              "required"
            ],
            "description": "Second-factor requirement for password sign-in. Requires the `mfa` entitlement to CHANGE; a write of the current value is always permitted so automation can converge without the add-on."
          },
          "pii_access_mode": {
            "type": "string",
            "enum": [
              "open",
              "reason",
              "approval"
            ],
            "description": "Friction in front of un-redacted reads of call data — `open`, `reason`, or `approval`. Requires the `pii_redaction_config` entitlement to CHANGE; a write of the current value is always permitted so automation can converge without the add-on."
          },
          "pii_access_grant_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365,
            "description": "Lifetime in days of an approved break-glass request; `0` never expires. Same entitlement rule as `pii_access_mode`."
          },
          "pii_masking": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ],
            "description": "`enabled` masks PII when calls are stored; `disabled` stores calls as spoken (credentials in tool I/O stay masked). Applies to calls recorded after the change. Same entitlement rule as `pii_access_mode`."
          },
          "ai_connectors": {
            "$ref": "#/components/schemas/AIConnectorsMode"
          }
        }
      },
      "PIIAccessRequestStatus": {
        "type": "string",
        "description": "Effective status. `expired` is computed, not stored: an approval whose lifetime has elapsed remains `approved` in the database, because the decision did happen and rewriting it on a clock tick would be dishonest.",
        "enum": [
          "pending",
          "approved",
          "rejected",
          "revoked",
          "expired"
        ]
      },
      "PIIAccessRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "call_id": {
            "oneOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "The call covered by this request, or null for an Inference transcription job. Exactly one subject is non-null."
          },
          "requested_by": {
            "type": "string",
            "format": "uuid"
          },
          "requester_email": {
            "description": "Null for a member whose home workspace is elsewhere; the id is always present.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "requester_name": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "type": "string",
            "description": "The requester's written justification."
          },
          "status": {
            "$ref": "#/components/schemas/PIIAccessRequestStatus"
          },
          "decided_by": {
            "oneOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "decided_by_email": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "decided_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "decision_note": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "description": "When the granted access lapses, or null when the organization set `pii_access_grant_days` to 0 (never expires).",
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "inference_job_id": {
            "type": "string",
            "format": "uuid",
            "description": "The Inference transcription job covered by a browser queue request. Omitted for call requests; Voice API keys return call requests only."
          }
        },
        "required": [
          "id",
          "call_id",
          "requested_by",
          "requester_email",
          "requester_name",
          "reason",
          "status",
          "decided_by",
          "decided_by_email",
          "decided_at",
          "decision_note",
          "expires_at",
          "created_at",
          "updated_at"
        ],
        "oneOf": [
          {
            "properties": {
              "call_id": {
                "type": "string",
                "format": "uuid"
              }
            },
            "not": {
              "required": [
                "inference_job_id"
              ]
            }
          },
          {
            "required": [
              "inference_job_id"
            ],
            "properties": {
              "call_id": {
                "type": "null"
              },
              "inference_job_id": {
                "type": "string",
                "format": "uuid"
              }
            }
          }
        ]
      },
      "PIIAccessRequestList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PIIAccessRequest"
            }
          },
          "next_cursor": {
            "description": "Opaque cursor for the next page, or null at the end.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "pending_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Requests awaiting a decision across the whole organization, independent of this page's filters. Always 0 for a caller without `pii-access:approve`, who only ever sees their own requests."
          },
          "self_decision_allowed": {
            "type": "boolean",
            "description": "This caller is the organization's only approver, so the API will let them decide their own request rather than leave it undecidable. False everywhere else."
          }
        },
        "required": [
          "data",
          "next_cursor",
          "pending_count",
          "self_decision_allowed"
        ]
      },
      "PIIAccessDecisionRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "decision": {
            "type": "string",
            "enum": [
              "approve",
              "reject"
            ]
          },
          "note": {
            "type": "string",
            "maxLength": 500,
            "description": "Optional context shown to the requester in the decision notification."
          }
        },
        "required": [
          "decision"
        ]
      },
      "PIIAccessRevokeRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "note": {
            "type": "string",
            "maxLength": 500,
            "description": "Optional context shown to the requester."
          }
        }
      },
      "PathwayState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "slots": {
            "type": "object",
            "additionalProperties": true
          },
          "current_node": {
            "type": [
              "string",
              "null"
            ]
          },
          "terminal": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ]
          },
          "node_history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PathwayNodeVisit"
            }
          }
        },
        "required": [
          "slots",
          "current_node",
          "terminal",
          "outcome",
          "node_history"
        ]
      },
      "PathwayNodeVisit": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "node": {
            "type": "string"
          },
          "at": {
            "type": [
              "string",
              "null"
            ]
          },
          "offset_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          }
        },
        "required": [
          "node",
          "at",
          "offset_ms"
        ]
      },
      "PhoneNumberDirection": {
        "type": "string",
        "enum": [
          "inbound",
          "outbound",
          "both"
        ]
      },
      "PhoneNumberTransport": {
        "type": "string",
        "enum": [
          "livekit_sip",
          "twilio_media_streams"
        ]
      },
      "PhoneNumberStatus": {
        "type": "string",
        "enum": [
          "provisioning",
          "active",
          "error",
          "archived"
        ]
      },
      "PhoneNumberOutboundCapacityMode": {
        "type": "string",
        "enum": [
          "inherit",
          "fixed",
          "unlimited"
        ]
      },
      "E164PhoneNumber": {
        "type": "string",
        "pattern": "^(\\+[1-9][0-9]{7,14}|[0-9*#]{1,20})$",
        "description": "An E.164 number with a non-zero country code and 7 to 15 digits, or a bare internal number/extension of 1 to 20 [0-9*#] characters (e.g. 103, 2770124)."
      },
      "InboundRoutingRules": {
        "type": "array",
        "maxItems": 32,
        "description": "Ordered SIP-header routes. First matching route wins; agent_id on the phone number is the required default. A route may use one legacy condition or a conditions group matched with all (AND) or any (OR). At most 8 conditions are allowed per route and 64 across the number. Requires livekit_sip transport and inbound or both direction. Omit on PATCH to preserve; [] removes all routes; null is invalid. Changes provision header mappings automatically and return provisioning until reconciled. Values ignore case unless case_sensitive is true. Missing headers match only not_exists, never negative comparisons. An archived matching agent falls back to the default agent. Only new calls use changes; existing calls continue with their selected agent.",
        "items": {
          "$ref": "#/components/schemas/InboundRoutingRule"
        }
      },
      "InboundRoutingRule": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/InboundRoutingLegacyRule"
          },
          {
            "$ref": "#/components/schemas/InboundRoutingGroupedRule"
          }
        ]
      },
      "InboundRoutingCondition": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "header",
          "operator"
        ],
        "properties": {
          "header": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Case-insensitive SIP header name, such as X-Language or Accept-Language. Authentication headers are not supported."
          },
          "operator": {
            "type": "string",
            "enum": [
              "equals",
              "not_equals",
              "contains",
              "not_contains",
              "starts_with",
              "ends_with",
              "exists",
              "not_exists"
            ]
          },
          "value": {
            "type": "string",
            "maxLength": 1024,
            "description": "Non-empty comparison value (at most 1024 UTF-8 bytes). Omit or send an empty string for exists and not_exists. CR, LF, and NUL are forbidden."
          },
          "case_sensitive": {
            "type": "boolean",
            "default": false,
            "description": "Compare header values with case sensitivity. Header names always ignore case."
          }
        }
      },
      "InboundRoutingLegacyRule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "header",
          "operator",
          "agent_id"
        ],
        "properties": {
          "header": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "operator": {
            "type": "string",
            "enum": [
              "equals",
              "not_equals",
              "contains",
              "not_contains",
              "starts_with",
              "ends_with",
              "exists",
              "not_exists"
            ]
          },
          "value": {
            "type": "string",
            "maxLength": 1024
          },
          "case_sensitive": {
            "type": "boolean",
            "default": false
          },
          "agent_id": {
            "type": "string",
            "format": "uuid",
            "description": "Active agent in the same organization."
          }
        }
      },
      "InboundRoutingGroupedRule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "conditions",
          "agent_id"
        ],
        "properties": {
          "match": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ],
            "default": "all",
            "description": "all requires every condition (AND); any requires at least one condition (OR)."
          },
          "conditions": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/InboundRoutingCondition"
            }
          },
          "agent_id": {
            "type": "string",
            "format": "uuid",
            "description": "Active agent in the same organization selected when this route matches."
          }
        }
      },
      "PhoneNumberCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Connects a purchased or BYO number to an active SIP trunk. livekit_sip is the default transport. twilio_media_streams is available only on an active twilio_automated trunk and configures Twilio Programmable Voice instead of LiveKit SIP.\n\ndirection defaults to inbound. outbound_capacity_mode defaults to inherit; fixed requires max_concurrent_outbound, while that limit is forbidden for inherit and unlimited. agent_id may be omitted to create an unassigned route. At most one of agent_id, flow_id and group_id may be set.",
        "properties": {
          "inbound_routing_rules": {
            "$ref": "#/components/schemas/InboundRoutingRules"
          },
          "trunk_id": {
            "type": "string",
            "format": "uuid"
          },
          "e164": {
            "$ref": "#/components/schemas/E164PhoneNumber"
          },
          "label": {
            "type": "string",
            "maxLength": 160
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "flow_id": {
            "type": "string",
            "format": "uuid",
            "description": "Answer inbound calls with a flow instead of a single agent. The flow's start agent takes the call and the graph's handoffs take over. Mutually exclusive with agent_id, and rejected with 422 unless the flow is dispatchable now (un-archived, at least one agent on the canvas, and a start agent with a published version). Requires the `flows` entitlement."
          },
          "group_id": {
            "type": "string",
            "format": "uuid",
            "description": "Answer inbound calls with a group of agents. The group's routing strategy picks a member for the caller's number. Mutually exclusive with agent_id, flow_id and inbound_routing_rules (422 `conflict`). Rejected on twilio_media_streams numbers (422 `unsupported_transport`) and unless the group exists (`not_found`), is not archived (`archived`) and has a member that can take calls now (`no_members`). Requires the `groups` entitlement (403 entitlement_required)."
          },
          "direction": {
            "$ref": "#/components/schemas/PhoneNumberDirection"
          },
          "transport": {
            "$ref": "#/components/schemas/PhoneNumberTransport"
          },
          "outbound_capacity_mode": {
            "$ref": "#/components/schemas/PhoneNumberOutboundCapacityMode"
          },
          "max_concurrent_outbound": {
            "type": "integer",
            "minimum": 1
          },
          "outbound_weight": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000,
            "default": 1
          },
          "outbound_draining": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "trunk_id",
          "e164"
        ]
      },
      "PhoneNumber": {
        "type": "object",
        "additionalProperties": false,
        "description": "Complete safe phone-number configuration and provider state. Raw provider errors are never present in the public representation.",
        "properties": {
          "inbound_routing_rules": {
            "$ref": "#/components/schemas/InboundRoutingRules"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "trunk_id": {
            "type": "string",
            "format": "uuid"
          },
          "trunk_name": {
            "type": "string"
          },
          "e164": {
            "$ref": "#/components/schemas/E164PhoneNumber"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "agent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "agent_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "flow_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The flow this number answers with, or null when it answers with a single agent. Exactly one of the agent_id/agent_slug pair and the flow_id/flow_slug pair is ever non-null. The agent that actually answers a flow-targeted number is the flow's start agent; it is deliberately not mirrored into agent_slug, so this read model keeps reporting what the operator configured."
          },
          "flow_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "group_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The group this number answers with, or null. When set, agent_id and agent_slug read null: the agent that answers is picked per call from the group's members, and the session records it (group_member_id on the call). At most one of agent_id, flow_id and group_id is non-null."
          },
          "group_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "direction": {
            "$ref": "#/components/schemas/PhoneNumberDirection"
          },
          "transport": {
            "$ref": "#/components/schemas/PhoneNumberTransport"
          },
          "livekit_inbound_trunk_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "livekit_dispatch_rule_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/PhoneNumberStatus"
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Sanitized recovery-oriented message."
          },
          "last_error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable machine-readable provider/provisioning error code."
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "outbound_capacity_mode": {
            "$ref": "#/components/schemas/PhoneNumberOutboundCapacityMode"
          },
          "max_concurrent_outbound": {
            "type": [
              "integer",
              "null"
            ]
          },
          "outbound_weight": {
            "type": "integer",
            "minimum": 1
          },
          "outbound_draining": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "trunk_id",
          "trunk_name",
          "e164",
          "label",
          "agent_id",
          "agent_slug",
          "flow_id",
          "flow_slug",
          "group_id",
          "group_name",
          "direction",
          "transport",
          "livekit_inbound_trunk_id",
          "livekit_dispatch_rule_id",
          "status",
          "last_error",
          "last_error_code",
          "archived_at",
          "created_at",
          "updated_at",
          "outbound_capacity_mode",
          "max_concurrent_outbound",
          "outbound_weight",
          "outbound_draining"
        ]
      },
      "PhoneNumberListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PhoneNumber"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "PhoneNumberProvisioningResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "const": "provisioning"
          },
          "resource_url": {
            "type": "string",
            "pattern": "^/v1/phone-numbers/[0-9a-f-]+$"
          },
          "poll_after_seconds": {
            "type": "integer",
            "minimum": 1
          },
          "provisioning_async": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "id",
          "status",
          "resource_url",
          "poll_after_seconds",
          "provisioning_async"
        ]
      },
      "PhoneNumberPatchRequest": {
        "type": "object",
        "minProperties": 1,
        "additionalProperties": false,
        "description": "Omitted fields are unchanged. Explicit null clears label, agent, flow or group assignment, or max_concurrent_outbound. Setting capacity mode to inherit or unlimited also clears the fixed limit. A number answers with one target, so assigning any of agent_id, flow_id or group_id implicitly clears the other two; naming more than one in the same request is rejected with 422.",
        "properties": {
          "inbound_routing_rules": {
            "$ref": "#/components/schemas/InboundRoutingRules"
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 160
          },
          "agent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "flow_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Re-point the number at a flow. Setting it clears agent_id; null clears the flow assignment. Setting a flow requires the `flows` entitlement and a dispatchable flow; clearing it never does, so a workspace that lost the entitlement can always un-stick a number."
          },
          "group_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Re-point the number at a group of agents. Setting it clears agent_id and flow_id; it cannot be combined with inbound_routing_rules and is refused on twilio_media_streams numbers. Setting a group requires the `groups` entitlement and a group with a member that can take calls now (422 on `group_id`: not_found, archived, no_members, conflict, unsupported_transport); null clears it and is never gated."
          },
          "direction": {
            "$ref": "#/components/schemas/PhoneNumberDirection"
          },
          "outbound_capacity_mode": {
            "$ref": "#/components/schemas/PhoneNumberOutboundCapacityMode"
          },
          "max_concurrent_outbound": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "outbound_weight": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "outbound_draining": {
            "type": "boolean"
          }
        }
      },
      "PiiConfigPutRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "custom_entities": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/PiiCustomEntity"
            }
          }
        },
        "required": [
          "custom_entities"
        ]
      },
      "PiiConfigResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "custom_entities": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/PiiCustomEntity"
            }
          },
          "builtin_entities": {
            "type": "array",
            "minItems": 8,
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "SSN",
                "CREDIT_CARD",
                "EMAIL",
                "PHONE",
                "DOB",
                "POLICY_NUMBER",
                "MRN",
                "ACCOUNT_NUMBER"
              ]
            }
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "custom_entities",
          "builtin_entities",
          "version",
          "updated_at"
        ]
      },
      "PiiCustomEntity": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string",
            "minLength": 2,
            "maxLength": 32,
            "pattern": "^[A-Z][A-Z0-9_]{1,31}$"
          },
          "terms": {
            "type": "array",
            "minItems": 1,
            "maxItems": 200,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        },
        "required": [
          "label",
          "terms"
        ]
      },
      "PronunciationTableCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9_-]+$",
            "description": "Immutable workspace-unique slug."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Blank strings normalize to null."
          },
          "definition": {
            "$ref": "#/components/schemas/PronunciationDefinitionInput"
          }
        },
        "required": [
          "slug",
          "name"
        ]
      },
      "PronunciationEntryInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/PronunciationLocalIdInput"
          },
          "from": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Literal source text. The complete raw value and normalized value are each at most 500 Unicode characters. Surrounding Unicode whitespace is removed; controls and an empty normalized value are rejected. In word mode, a match is rejected only when immediately adjacent to a Unicode letter, number, or underscore, so punctuation-bearing terms such as C++ and .NET work."
          },
          "to": {
            "type": "string",
            "maxLength": 1000,
            "description": "Literal replacement sent to TTS. Controls are rejected. An empty string intentionally removes matched text from spoken output; prompt variables, SSML, and phoneme syntax are not interpreted."
          },
          "match": {
            "type": "string",
            "pattern": "^\\p{Z}*(?:[Ww][Oo][Rr][Dd]|[Aa][Nn][Yy][Ww][Hh][Ee][Rr][Ee])\\p{Z}*$",
            "default": "word",
            "description": "word or anywhere. ASCII case is ignored and surrounding Unicode separator characters are removed; responses always emit the lowercase canonical value."
          },
          "case_sensitive": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "id",
          "from",
          "to"
        ]
      },
      "PronunciationEntry": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/CatalogLocalId"
          },
          "from": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "to": {
            "type": "string",
            "maxLength": 1000
          },
          "match": {
            "type": "string",
            "enum": [
              "word",
              "anywhere"
            ]
          },
          "case_sensitive": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "from",
          "to",
          "match",
          "case_sensitive"
        ]
      },
      "PronunciationDefinitionInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "entries": {
            "type": "array",
            "maxItems": 250,
            "default": [],
            "description": "Ordered substitutions. Entry ids must be unique. Duplicate effective matches with the same match mode and case-sensitivity are rejected using Unicode case folding when case_sensitive is false. At one input position, the earlier entry wins an overlap; replacement output is never rescanned, so rules do not cascade. Omitting entries produces an explicit empty array in responses.",
            "items": {
              "$ref": "#/components/schemas/PronunciationEntryInput"
            }
          }
        }
      },
      "PronunciationDefinition": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "entries": {
            "type": "array",
            "maxItems": 250,
            "items": {
              "$ref": "#/components/schemas/PronunciationEntry"
            }
          }
        },
        "required": [
          "entries"
        ]
      },
      "PronunciationLocalIdInput": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "pattern": "^\\p{Z}*[A-Za-z0-9][A-Za-z0-9._:-]*\\p{Z}*$",
        "description": "Stable entry identifier on input, unique within the table after normalization. The complete raw value contains at most 128 Unicode characters. Surrounding Unicode separator characters are removed; the canonical response starts with an ASCII letter or digit and then uses only ASCII letters, digits, dots, colons, hyphens, or underscores. Controls and unpaired surrogate escapes are rejected."
      },
      "PronunciationTableDetail": {
        "type": "object",
        "additionalProperties": false,
        "description": "Complete normalized table. configuration_errors is omitted for canonical rows. When present, it identifies invalid legacy or out-of-band stored fields and entries omitted from the safe definition. A malformed root/container or an encoded definition above 1,048,576 bytes returns the canonical empty definition; a legacy array above 250 entries is truncated before entries are normalized. Repair by replacing the complete definition with the current ETag.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "definition": {
            "$ref": "#/components/schemas/PronunciationDefinition"
          },
          "configuration_errors": {
            "type": "array",
            "minItems": 1,
            "readOnly": true,
            "description": "Exact repair diagnostics for legacy stored content. Invalid entries are not assumed to execute at call time. Correct every field and PATCH one complete definition using the current ETag.",
            "items": {
              "$ref": "#/components/schemas/FieldError"
            }
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "archived_at",
          "created_at",
          "updated_at",
          "definition"
        ]
      },
      "PronunciationTableListItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "archived_at",
          "created_at",
          "updated_at"
        ]
      },
      "PronunciationTableListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PronunciationTableListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "PronunciationTablePatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Null or a blank string clears the description."
          },
          "definition": {
            "$ref": "#/components/schemas/PronunciationDefinitionInput"
          }
        }
      },
      "ProviderCatalogEntry": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "display_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300,
            "description": "The provider's product name — the only name this catalog carries. Select models and voices by their id; the upstream engine behind a product, its wire protocol and its connector are platform implementation detail and are not part of this API."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "stt",
              "llm",
              "tts",
              "slm",
              "sts",
              "embedding",
              "endpointing",
              null
            ]
          },
          "beta": {
            "type": "boolean"
          },
          "key_terms_enabled": {
            "type": "boolean",
            "description": "True when this speech-to-text provider accepts the agent's key terms as a recognition prompt."
          },
          "agent_text_input_enabled": {
            "type": "boolean",
            "description": "True when this speech-to-text provider relays the agent's own spoken words to the transcriber next to the caller audio (agent text input), so the transcriber can separate the caller's reply from the agent's echo. Only providers whose integration lists an agent-text model can have it on."
          },
          "sort_order": {
            "type": "integer",
            "description": "Picker ordering (lower first). Providers arrive sorted by this."
          },
          "available": {
            "type": "boolean",
            "description": "True when this model service can currently run requests. Choose an available model or contact support when false."
          },
          "availability_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "temporarily_unavailable",
              null
            ],
            "description": "Why available is false; null when the provider is available."
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderModel"
            }
          },
          "voices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderVoice"
            }
          },
          "voice_settings_schema": {
            "type": "array",
            "description": "Valid per-agent tts_voice_settings keys for this provider's connector. Empty means non-empty overrides are not supported.",
            "items": {
              "$ref": "#/components/schemas/ProviderSettingField"
            }
          },
          "stt_capabilities": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ProviderSTTCapabilities"
              },
              {
                "type": "null"
              }
            ],
            "description": "Which agent speech settings this transcriber honors. null for a provider that is not a transcriber, and for a transcriber whose capabilities the platform does not publish."
          }
        },
        "required": [
          "id",
          "display_name",
          "type",
          "beta",
          "available",
          "availability_reason",
          "models",
          "voices",
          "voice_settings_schema",
          "stt_capabilities"
        ]
      },
      "ProviderSTTCapabilities": {
        "type": "object",
        "additionalProperties": false,
        "description": "One transcriber's agent-visible capabilities: which agent settings it honors and within what limits. Capability fields can be added over time; ignore unknown ones.",
        "properties": {
          "two_stage_only": {
            "type": "boolean",
            "description": "The transcriber only runs under a speech-model pipeline, so it cannot be selected for a cascaded one."
          },
          "async": {
            "type": "boolean",
            "description": "The transcriber returns one result per turn rather than a live stream."
          },
          "vocabulary": {
            "type": "boolean",
            "description": "Accepts stt_vocabulary (custom terms and context)."
          },
          "vocabulary_limits": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/STTVocabularyLimits"
              },
              {
                "type": "null"
              }
            ],
            "description": "Tighter caps on stt_vocabulary.terms for this transcriber, or null when the generic limits apply."
          },
          "language_hints": {
            "type": "boolean",
            "description": "Accepts stt_language_hints, a list of expected languages."
          },
          "languages": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/STTLanguageCatalog"
              },
              {
                "type": "null"
              }
            ],
            "description": "Accepted stt_language / stt_language_hints codes, or null when the transcriber has no language setting."
          },
          "endpointing": {
            "$ref": "#/components/schemas/STTEndpointingCapability"
          }
        },
        "required": [
          "two_stage_only",
          "async",
          "vocabulary",
          "vocabulary_limits",
          "language_hints",
          "languages",
          "endpointing"
        ]
      },
      "STTVocabularyLimits": {
        "type": "object",
        "additionalProperties": false,
        "description": "Caps on a recognition vocabulary, tighter than the stored shape.",
        "properties": {
          "max_terms": {
            "type": "integer",
            "description": "Most terms accepted."
          },
          "max_term_length": {
            "type": "integer",
            "description": "Longest accepted term, in characters."
          }
        },
        "required": [
          "max_terms",
          "max_term_length"
        ]
      },
      "ProviderListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderCatalogEntry"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "ProviderPublicProjection": {
        "type": "object",
        "additionalProperties": false,
        "description": "Describes the fail-closed projection applied to legacy operator-managed JSON before it is returned by the public catalog.",
        "properties": {
          "public_schema_version": {
            "type": "integer",
            "const": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "complete",
              "filtered",
              "defaulted"
            ]
          },
          "dropped_fields_count": {
            "type": "integer",
            "minimum": 1,
            "description": "Present when unknown fields were omitted from a filtered object."
          },
          "reason_code": {
            "type": "string",
            "enum": [
              "legacy_null"
            ],
            "description": "Present when a legacy null object was replaced by an empty object."
          }
        },
        "required": [
          "public_schema_version",
          "status"
        ]
      },
      "ProviderModelCapabilities": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "streaming": {
            "type": "boolean"
          },
          "tool_calls": {
            "type": "boolean"
          },
          "barge_in": {
            "type": "boolean"
          },
          "multilingual": {
            "type": "boolean"
          },
          "context_window": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000000
          },
          "sample_rate": {
            "type": "integer",
            "minimum": 1,
            "maximum": 384000
          },
          "dimensions": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "languages": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 35,
              "pattern": "^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8}){0,7}$"
            }
          },
          "format": {
            "type": "string",
            "enum": [
              "pcm_s16le",
              "pcm_f32le",
              "mulaw",
              "alaw",
              "mp3",
              "opus",
              "wav"
            ]
          },
          "gender": {
            "type": "string",
            "enum": [
              "female",
              "male",
              "neutral"
            ]
          }
        }
      },
      "ProviderVoiceSettings": {
        "type": "object",
        "additionalProperties": false,
        "description": "Safe union of connector-declared voice setting keys. The companion voice_settings_schema on the provider gives the exact per-connector subset, ranges, defaults, and options.",
        "properties": {
          "volume": {
            "type": "number",
            "minimum": -20,
            "maximum": 20
          },
          "speed": {
            "type": "number",
            "minimum": 0.5,
            "maximum": 2
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "top_p": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "stability": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "similarity_boost": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "style": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "expressiveness": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "use_speaker_boost": {
            "type": "boolean"
          },
          "normalize_text": {
            "type": "boolean"
          }
        }
      },
      "ProviderModel": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "llm",
              "stt",
              "tts",
              "speechlm",
              "s2s",
              "embedding"
            ]
          },
          "display_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "capabilities": {
            "$ref": "#/components/schemas/ProviderModelCapabilities"
          },
          "projection": {
            "$ref": "#/components/schemas/ProviderPublicProjection"
          }
        },
        "required": [
          "id",
          "kind",
          "display_name",
          "capabilities",
          "projection"
        ]
      },
      "ProviderVoice": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "display_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 1000
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 1000
          },
          "gender": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 1000,
            "description": "Stable value from GET /voice-attributes, or null for a legacy/unclassified voice."
          },
          "dialect": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 1000,
            "description": "Stable parent dialect/accent value from GET /voice-attributes, or null when not applicable."
          },
          "sub_dialect": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 1000,
            "description": "Optional refinement whose parent is identified by the voice-attribute catalog."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          "settings": {
            "$ref": "#/components/schemas/ProviderVoiceSettings"
          },
          "projection": {
            "$ref": "#/components/schemas/ProviderPublicProjection"
          },
          "supported_dialects": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          }
        },
        "required": [
          "id",
          "display_name",
          "description",
          "language",
          "gender",
          "dialect",
          "sub_dialect",
          "tags",
          "settings",
          "projection",
          "supported_dialects"
        ]
      },
      "ProviderSettingField": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "type": "string",
            "enum": [
              "number",
              "select",
              "boolean",
              "text"
            ]
          },
          "default": {
            "description": "Provider default scalar value."
          },
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          },
          "step": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderSettingOption"
            }
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "label",
          "type"
        ]
      },
      "ProviderSettingOption": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "label",
          "value"
        ]
      },
      "VoiceLanguageOption": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 35
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "code",
          "label"
        ]
      },
      "VoiceGenderOption": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "value",
          "label"
        ]
      },
      "VoiceDialectOption": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "language": {
            "type": "string",
            "minLength": 1,
            "maxLength": 35
          },
          "country_code": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "ISO 3166-1 alpha-2 origin mark, or the AR/EN language fallback used for cross-country dialects."
          }
        },
        "required": [
          "value",
          "label",
          "language",
          "country_code"
        ]
      },
      "VoiceSubDialectOption": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "dialect": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Parent VoiceDialectOption.value."
          }
        },
        "required": [
          "value",
          "label",
          "dialect"
        ]
      },
      "BackgroundNoiseListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BackgroundNoiseOption"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "BackgroundNoiseOption": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$",
            "maxLength": 64,
            "description": "Value for behavior.background_noise.sound."
          },
          "name": {
            "type": "string",
            "description": "Display name."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "builtin": {
            "type": "boolean",
            "description": "True for a clip bundled with the platform; false for an operator-uploaded library sound."
          },
          "preview_available": {
            "type": "boolean",
            "description": "Whether an audio preview of the sound can be streamed. Always false for bundled clips."
          }
        },
        "required": [
          "key",
          "name",
          "description",
          "builtin",
          "preview_available"
        ]
      },
      "STTLanguageCatalog": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "select": {
            "type": "string",
            "enum": [
              "single",
              "multi"
            ],
            "description": "single pins one language (or auto-detect); multi allows several, where one pick sets stt_language and two or more set stt_language_hints with stt_language auto."
          },
          "auto": {
            "type": "string",
            "description": "Display label of the auto-detect choice."
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/STTLanguageOption"
            }
          }
        },
        "required": [
          "select",
          "auto",
          "options"
        ]
      },
      "STTLanguageOption": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "description": "Lower-case language code sent as stt_language or a stt_language_hints entry, such as ar or ar-eg."
          },
          "label": {
            "type": "string"
          },
          "group": {
            "type": "string",
            "description": "Optional section label for grouping options."
          }
        },
        "required": [
          "code",
          "label"
        ]
      },
      "STTEndpointingCapability": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "capable": {
            "type": "boolean",
            "description": "The recognizer emits a native end-of-turn signal."
          },
          "reliable": {
            "type": "boolean",
            "description": "Its end-of-turn signal is usable mid-stream, so endpointing_mode stt can drive turns."
          },
          "window_min_ms": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Smallest accepted silence window, or null when there is no window setting."
          },
          "window_max_ms": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Largest accepted silence window, or null when there is no window setting."
          },
          "window_default_ms": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Default silence window, or null when not applicable."
          },
          "stt_driven_default_ms": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Silence window used for STT-driven turns when the agent sets none, or null when not applicable."
          },
          "sensitivity": {
            "type": "boolean",
            "description": "The recognizer exposes an end-of-turn sensitivity setting."
          },
          "auto": {
            "type": "boolean",
            "description": "With endpointing_mode auto on a cascaded pipeline, the recognizer's own turn detection decides when the caller has finished; otherwise auto uses the agent's own endpointer."
          }
        },
        "required": [
          "capable",
          "reliable",
          "window_min_ms",
          "window_max_ms",
          "window_default_ms",
          "stt_driven_default_ms",
          "sensitivity",
          "auto"
        ]
      },
      "VoiceAttributeCatalog": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "languages": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/VoiceLanguageOption"
            }
          },
          "genders": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/VoiceGenderOption"
            }
          },
          "dialects": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/VoiceDialectOption"
            }
          },
          "sub_dialects": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/VoiceSubDialectOption"
            }
          }
        },
        "required": [
          "languages",
          "genders",
          "dialects",
          "sub_dialects"
        ]
      },
      "RBACAction": {
        "type": "string",
        "enum": [
          "create",
          "read",
          "update",
          "delete",
          "deploy",
          "promote",
          "execute-live-tools",
          "listen-live",
          "download-recording",
          "inject-context",
          "hangup",
          "legal-hold",
          "place-outbound",
          "start-web",
          "read-sip-pcap",
          "unmask",
          "approve",
          "read-internal",
          "cancel",
          "manage-memory",
          "test",
          "reset-password"
        ]
      },
      "RBACCatalogResource": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "actions": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/RBACAction"
            }
          },
          "api_key_scope_available": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "label",
          "actions",
          "api_key_scope_available"
        ]
      },
      "RBACCatalogResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "resources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RBACCatalogResource"
            }
          },
          "action_descriptions": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "required": [
          "resources",
          "action_descriptions"
        ]
      },
      "Role": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "is_system": {
            "type": "boolean"
          },
          "is_locked": {
            "type": "boolean"
          },
          "permissions": {
            "type": "array",
            "maxItems": 256,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "member_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "is_system",
          "is_locked",
          "permissions",
          "member_count",
          "version",
          "created_at",
          "updated_at"
        ]
      },
      "RoleListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Role"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cursor for the next role page, or null after the final page."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "RoleCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "permissions": {
            "type": "array",
            "maxItems": 256,
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "required": [
          "name",
          "permissions"
        ]
      },
      "RolePatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "permissions": {
            "type": "array",
            "maxItems": 256,
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      },
      "QueryResult": {
        "type": "object",
        "additionalProperties": false,
        "description": "Complete computed result. The server returns 422 instead of truncating when rows, series, or cells exceed the limits object.",
        "properties": {
          "group_by": {
            "$ref": "#/components/schemas/AnalysisGroupBy"
          },
          "series": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "rows": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/QueryResultRow"
            }
          },
          "stacked": {
            "type": "boolean"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "limits": {
            "$ref": "#/components/schemas/AnalysisResultLimits"
          },
          "previous": {
            "type": [
              "number",
              "null"
            ],
            "description": "The first query's value over the window immediately preceding the selected one, measured with the identical joins, filters, and aggregate. Present only for number_delta insights, and null when the range has no comparable predecessor."
          }
        },
        "required": [
          "group_by",
          "series",
          "rows",
          "stacked",
          "generated_at",
          "limits"
        ]
      },
      "QueryResultRow": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "x": {
            "type": "string",
            "maxLength": 500,
            "description": "Primary dimension label. Empty string is used by an ungrouped empty result."
          },
          "values": {
            "type": "object",
            "maxProperties": 50,
            "additionalProperties": {
              "type": "number"
            },
            "description": "Finite numeric values keyed by the names in series."
          }
        },
        "required": [
          "x",
          "values"
        ]
      },
      "AnalysisResultLimits": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "rows": {
            "type": "integer",
            "const": 500
          },
          "series": {
            "type": "integer",
            "const": 50
          },
          "cells": {
            "type": "integer",
            "const": 10000
          }
        },
        "required": [
          "rows",
          "series",
          "cells"
        ]
      },
      "RawTranscriptResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "session_id": {
            "type": "string",
            "format": "uuid"
          },
          "transcript_id": {
            "type": "string",
            "format": "uuid"
          },
          "leg": {
            "type": "string",
            "enum": [
              "caller",
              "brief"
            ]
          },
          "segments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TranscriptSegment"
            }
          }
        },
        "required": [
          "session_id",
          "transcript_id",
          "leg",
          "segments"
        ]
      },
      "RawToolIOResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "session_id": {
            "type": "string",
            "format": "uuid"
          },
          "tool_id": {
            "type": "string",
            "format": "uuid"
          },
          "request": {
            "description": "Original unredacted JSON request value."
          },
          "response": {
            "description": "Original unredacted JSON response value."
          }
        },
        "required": [
          "session_id",
          "tool_id",
          "request",
          "response"
        ]
      },
      "RecordingSummary": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "role": {
            "type": "string",
            "enum": [
              "agent",
              "caller",
              "mixed"
            ]
          },
          "leg": {
            "type": "string",
            "enum": [
              "caller",
              "brief"
            ]
          },
          "segment_index": {
            "type": "integer",
            "minimum": 0
          },
          "status": {
            "type": "string",
            "enum": [
              "recording",
              "encrypting",
              "ready",
              "failed"
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "ogg_opus"
            ]
          },
          "duration_sec": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "size_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "error_kind": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable failure class for a failed recording (start_signal_missing, pipeline_early_stop, egress_failed, mix_failed, upload_failed, encrypt_failed, other)."
          },
          "channels": {
            "type": [
              "integer",
              "null"
            ],
            "enum": [
              1,
              2,
              null
            ],
            "description": "2 for a stereo mix (caller left, agent right), 1 for mono."
          },
          "has_peaks": {
            "type": "boolean",
            "description": "True when precomputed waveform peaks are available."
          },
          "egress_started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Wall-clock start of the recording, for aligning audio with the call timeline."
          }
        },
        "required": [
          "id",
          "role",
          "leg",
          "segment_index",
          "status",
          "format",
          "duration_sec",
          "size_bytes",
          "error",
          "created_at",
          "completed_at",
          "error_kind",
          "channels",
          "has_peaks",
          "egress_started_at"
        ]
      },
      "SecretCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "$ref": "#/components/schemas/SecretName"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Optional operator note. Whitespace-only values normalize to null."
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "writeOnly": true,
            "description": "Write-only UTF-8 value, at most 16384 encoded bytes. It is encrypted before storage and never echoed."
          }
        },
        "required": [
          "name",
          "value"
        ]
      },
      "SecretDetail": {
        "type": "object",
        "additionalProperties": false,
        "description": "Safe write-only secret metadata. No plaintext, ciphertext, data-key ID, or wrapped key is ever included.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "$ref": "#/components/schemas/SecretName"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "fingerprint_suffix": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4,
            "description": "Up to the final four characters of the submitted value, for operator identification only."
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "fingerprint_suffix",
          "last_used_at",
          "archived_at",
          "created_at",
          "updated_at"
        ]
      },
      "SecretListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecretDetail"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "SecretPatchRequest": {
        "type": "object",
        "minProperties": 1,
        "additionalProperties": false,
        "description": "Secret names are immutable and therefore absent. Send description:null to clear the note; send value to rotate the encrypted value.",
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "writeOnly": true,
            "description": "Write-only replacement value, at most 16384 encoded UTF-8 bytes."
          }
        }
      },
      "SipTrunkProvider": {
        "type": "string",
        "enum": [
          "sip",
          "twilio_automated"
        ],
        "description": "sip uses customer-managed carrier/PBX configuration; twilio_automated provisions Twilio resources from stored account credentials."
      },
      "SipSignalingMode": {
        "type": "string",
        "enum": [
          "static_peer",
          "registered_peer",
          "remote_registered_peer"
        ]
      },
      "SipAuthMode": {
        "type": "string",
        "enum": [
          "ip_allowlist",
          "credentials"
        ]
      },
      "SipTransport": {
        "type": "string",
        "enum": [
          "udp",
          "tcp",
          "tls"
        ]
      },
      "SipTrunkStatus": {
        "type": "string",
        "enum": [
          "provisioning",
          "active",
          "error",
          "archived"
        ]
      },
      "SipRegistrationStatus": {
        "type": "string",
        "description": "Registration state, interpreted for the trunk's signaling mode. `not_applicable` is every `static_peer` trunk. `unregistered` and `expired` describe the `registered_peer` direction (the PBX registers to Kejue Voice), where a Contact expiry really exists. `registering`, `failed`, `disabled` and `unknown` describe the `remote_registered_peer` direction (Kejue Voice registers to the PBX) and come from the SIP registrar's periodic report — `unknown` means no recent report, not a failure.",
        "enum": [
          "not_applicable",
          "unregistered",
          "registered",
          "expired",
          "registering",
          "failed",
          "disabled",
          "unknown"
        ]
      },
      "SipMediaEncryption": {
        "type": "string",
        "enum": [
          "disable",
          "allow",
          "require"
        ]
      },
      "SipIncludeHeaders": {
        "type": "string",
        "enum": [
          "none",
          "x",
          "all"
        ]
      },
      "SipOutboundCapacityMode": {
        "type": "string",
        "enum": [
          "unknown",
          "fixed",
          "unlimited"
        ]
      },
      "SipInboundAdvancedCreate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Optional LiveKit inbound-leg settings. Omitted fields use provider defaults.",
        "properties": {
          "allowed_numbers": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "^\\S+$"
            }
          },
          "media_encryption": {
            "$ref": "#/components/schemas/SipMediaEncryption"
          },
          "ringing_timeout_ms": {
            "type": "integer",
            "minimum": 0,
            "description": "Zero or omission uses the provider default."
          },
          "max_call_duration_ms": {
            "type": "integer",
            "minimum": 0,
            "description": "Zero or omission uses the provider default."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Replacement SIP header map, capped at 4096 encoded bytes."
          },
          "headers_to_attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Replacement SIP-header to participant-attribute map, capped at 4096 encoded bytes."
          },
          "attributes_to_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Replacement participant-attribute to SIP-header map, capped at 4096 encoded bytes."
          },
          "include_headers": {
            "$ref": "#/components/schemas/SipIncludeHeaders"
          }
        }
      },
      "SipInboundAdvancedPatch": {
        "type": "object",
        "minProperties": 1,
        "additionalProperties": false,
        "description": "Presence-aware inbound settings. Empty arrays/maps clear collections; explicit null clears nullable durations.",
        "properties": {
          "allowed_numbers": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "^\\S+$"
            }
          },
          "media_encryption": {
            "$ref": "#/components/schemas/SipMediaEncryption"
          },
          "ringing_timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "max_call_duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "headers_to_attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "attributes_to_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "include_headers": {
            "$ref": "#/components/schemas/SipIncludeHeaders"
          }
        }
      },
      "SipOutboundAdvancedCreate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Optional LiveKit outbound-leg settings plus Kejue Voice toll-fraud destination allowlists.",
        "properties": {
          "metadata": {
            "type": "string",
            "description": "Provider metadata, capped at 16384 encoded bytes."
          },
          "destination_country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "ISO 3166-1 alpha-2 country code; normalized to uppercase."
          },
          "media_encryption": {
            "$ref": "#/components/schemas/SipMediaEncryption"
          },
          "from_host": {
            "type": "string",
            "maxLength": 512
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "headers_to_attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "attributes_to_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "include_headers": {
            "$ref": "#/components/schemas/SipIncludeHeaders"
          },
          "allowed_prefixes": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "pattern": "^\\+?[0-9*#]{1,20}$"
            },
            "description": "Allowed outbound dial prefixes, external (+44) or internal (277). When non-empty, unmatched PSTN destinations are denied."
          },
          "allowed_sip_hosts": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "Allowed SIP hosts or host:port values, without a URI scheme."
          },
          "via_proxy": {
            "type": "boolean",
            "default": false,
            "description": "Send outbound INVITEs through the Kejue Voice SIP edge so the carrier sees them from port 5060 instead of 5062. Only for static_peer trunks with an outbound_transport of udp or tcp. twilio_automated trunks set it themselves, so do not send it for them."
          }
        }
      },
      "SipOutboundAdvancedPatch": {
        "type": "object",
        "minProperties": 1,
        "additionalProperties": false,
        "description": "Presence-aware outbound settings. Empty arrays/maps clear collections; explicit null clears nullable country/from-host values.",
        "properties": {
          "metadata": {
            "type": "string",
            "description": "Provider metadata, capped at 16384 encoded bytes. Send an empty string to clear."
          },
          "destination_country": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 2,
            "maxLength": 2
          },
          "media_encryption": {
            "$ref": "#/components/schemas/SipMediaEncryption"
          },
          "from_host": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 512
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "headers_to_attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "attributes_to_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "include_headers": {
            "$ref": "#/components/schemas/SipIncludeHeaders"
          },
          "allowed_prefixes": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "pattern": "^\\+?[0-9*#]{1,20}$"
            }
          },
          "allowed_sip_hosts": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "via_proxy": {
            "type": "boolean",
            "description": "Send outbound INVITEs through the Kejue Voice SIP edge so the carrier sees them from port 5060 instead of 5062. Only for static_peer trunks with an outbound_transport of udp or tcp. twilio_automated trunks set it themselves, so do not send it for them."
          }
        }
      },
      "SipPcapSummaryResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "call_id": {
            "type": "string",
            "format": "uuid"
          },
          "packet_count": {
            "type": "integer",
            "minimum": 0
          },
          "byte_size": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "captured_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "encrypting",
              "ready",
              "failed"
            ]
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "call_id",
          "packet_count",
          "byte_size",
          "captured_at",
          "status"
        ]
      },
      "SipRuntimeInfo": {
        "type": "object",
        "additionalProperties": false,
        "description": "Deployment-specific SIP endpoints needed to configure a carrier or PBX. Unconfigured scalar values are explicit nulls.",
        "properties": {
          "sip_egress_cidrs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Source IP addresses or CIDRs a carrier must allow for Kejue Voice-originated SIP traffic."
          },
          "public_sip_uri": {
            "type": [
              "string",
              "null"
            ],
            "description": "Canonical public SIP URI carriers use to originate traffic toward Kejue Voice. This is the first entry of public_sip_uris; prefer that list when configuring a carrier."
          },
          "public_sip_uris": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every public SIP edge carriers should originate toward. The SIP tier runs one independent stack per edge, so a carrier pointed at only one of them loses inbound while that edge restarts. Point the carrier at all of them, with equal priority and weight."
          },
          "registration_domain": {
            "type": [
              "string",
              "null"
            ],
            "description": "Domain registered_peer clients use in SIP digest registration."
          },
          "registrar_sip_address": {
            "type": [
              "string",
              "null"
            ],
            "description": "Internal SIP-edge address used for registered-peer outbound routing."
          }
        },
        "required": [
          "sip_egress_cidrs",
          "public_sip_uri",
          "public_sip_uris",
          "registration_domain",
          "registrar_sip_address"
        ]
      },
      "SipTrunkCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Creates either a customer-managed SIP trunk or an automated Twilio trunk. Credentials are write-only and never appear in responses.\n\nWorkflow rules:\n* provider=twilio_automated requires account_sid and auth_token and forbids all BYO signaling, address, and auth fields; Kejue Voice derives those values.\n* provider=sip defaults sip_signaling_mode to static_peer. static_peer requires inbound_auth_mode. ip_allowlist requires inbound_allowed_addresses; credentials requires auth_username and auth_password.\n* registered_peer requires auth_username and auth_password and derives inbound auth/address configuration. If outbound_auth_mode is supplied it must be ip_allowlist.\n* remote_registered_peer requires auth_username, auth_password, and remote_registrar_address; it derives inbound and outbound routing. Other remote registration values have documented defaults.\n* A static outbound_address defaults outbound_transport to tls and outbound_auth_mode to credentials. Credential auth requires auth_username and auth_password; ip_allowlist forbids them unless registered_peer also needs them for registration.\n* outbound_capacity_mode defaults to unknown. fixed requires max_concurrent_outbound or max_outbound_cps; burst requires max_outbound_cps. Limits are forbidden for unknown and unlimited modes.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 80,
            "description": "Unique display name within the organization. Leading and trailing whitespace is removed."
          },
          "provider": {
            "$ref": "#/components/schemas/SipTrunkProvider"
          },
          "sip_signaling_mode": {
            "$ref": "#/components/schemas/SipSignalingMode"
          },
          "inbound_auth_mode": {
            "$ref": "#/components/schemas/SipAuthMode"
          },
          "inbound_allowed_addresses": {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "IPv4/IPv6 addresses or CIDRs. Values are canonicalized and duplicates removed."
          },
          "outbound_address": {
            "type": "string",
            "maxLength": 512,
            "description": "SIP host or host:port without a username or URI scheme."
          },
          "outbound_transport": {
            "$ref": "#/components/schemas/SipTransport"
          },
          "outbound_auth_mode": {
            "$ref": "#/components/schemas/SipAuthMode"
          },
          "auth_username": {
            "type": "string",
            "maxLength": 256,
            "description": "Write-only SIP digest username. Limited to 256 encoded UTF-8 bytes."
          },
          "auth_password": {
            "type": "string",
            "maxLength": 1024,
            "description": "Write-only SIP digest password. Limited to 1024 encoded UTF-8 bytes."
          },
          "remote_registrar_address": {
            "type": "string",
            "maxLength": 512,
            "description": "Remote PBX/carrier SIP host or host:port. Required for remote_registered_peer."
          },
          "remote_registrar_transport": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SipTransport"
              }
            ],
            "description": "Defaults to udp."
          },
          "remote_registrar_domain": {
            "type": "string",
            "minLength": 1,
            "description": "Digest domain; derived from remote_registrar_address when omitted."
          },
          "remote_register_realm": {
            "type": "string",
            "minLength": 1,
            "description": "Digest realm; defaults to remote_registrar_domain."
          },
          "remote_register_expires_seconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 3600,
            "default": 300
          },
          "account_sid": {
            "type": "string",
            "maxLength": 128,
            "description": "Write-only Twilio account SID for provider=twilio_automated."
          },
          "auth_token": {
            "type": "string",
            "maxLength": 1024,
            "description": "Write-only Twilio auth token for provider=twilio_automated."
          },
          "inbound_advanced_settings": {
            "$ref": "#/components/schemas/SipInboundAdvancedCreate"
          },
          "outbound_advanced_settings": {
            "$ref": "#/components/schemas/SipOutboundAdvancedCreate"
          },
          "outbound_capacity_mode": {
            "$ref": "#/components/schemas/SipOutboundCapacityMode"
          },
          "max_concurrent_outbound": {
            "type": "integer",
            "minimum": 1
          },
          "max_outbound_cps": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "outbound_cps_burst": {
            "type": "integer",
            "minimum": 1
          },
          "outbound_capacity_profile_id": {
            "type": "string",
            "format": "uuid",
            "description": "Capacity profile in the same organization."
          }
        },
        "required": [
          "name",
          "provider"
        ]
      },
      "SipTrunk": {
        "type": "object",
        "additionalProperties": false,
        "description": "Complete public SIP trunk state. Secrets and raw upstream errors are never returned. Every safe field is present; unset scalars are null and empty collections are arrays or objects.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "$ref": "#/components/schemas/SipTrunkProvider"
          },
          "sip_signaling_mode": {
            "$ref": "#/components/schemas/SipSignalingMode"
          },
          "inbound_auth_mode": {
            "$ref": "#/components/schemas/SipAuthMode"
          },
          "inbound_allowed_addresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "outbound_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "outbound_transport": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SipTransport"
              },
              {
                "type": "null"
              }
            ]
          },
          "outbound_auth_mode": {
            "$ref": "#/components/schemas/SipAuthMode"
          },
          "has_credentials": {
            "type": "boolean",
            "description": "Whether encrypted SIP credentials exist. Credential values are never returned."
          },
          "registrar_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "registrar_domain": {
            "type": [
              "string",
              "null"
            ]
          },
          "registration_status": {
            "$ref": "#/components/schemas/SipRegistrationStatus"
          },
          "registration_contact": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_register_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "registration_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "registration_checked_at": {
            "description": "When the SIP registrar last reported on this trunk. A liveness heartbeat for the report itself, not call activity. Only populated for `remote_registered_peer`; `null` means the registrar has never reported and `registration_status` reads `unknown`.",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "remote_registrar_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "remote_registrar_domain": {
            "type": [
              "string",
              "null"
            ]
          },
          "remote_register_realm": {
            "type": [
              "string",
              "null"
            ]
          },
          "remote_register_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "remote_registrar_transport": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SipTransport"
              },
              {
                "type": "null"
              }
            ]
          },
          "remote_register_expires_seconds": {
            "type": [
              "integer",
              "null"
            ]
          },
          "livekit_inbound_trunk_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "livekit_outbound_trunk_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/SipTrunkStatus"
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Sanitized recovery-oriented message suitable for customers and agents."
          },
          "last_error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable machine-readable provider/provisioning error code."
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "inbound_allowed_numbers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "inbound_media_encryption": {
            "$ref": "#/components/schemas/SipMediaEncryption"
          },
          "inbound_ringing_timeout_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "inbound_max_call_duration_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "inbound_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "inbound_headers_to_attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "inbound_attributes_to_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "inbound_include_headers": {
            "$ref": "#/components/schemas/SipIncludeHeaders"
          },
          "outbound_metadata": {
            "type": "string"
          },
          "outbound_destination_country": {
            "type": [
              "string",
              "null"
            ]
          },
          "outbound_media_encryption": {
            "$ref": "#/components/schemas/SipMediaEncryption"
          },
          "outbound_from_host": {
            "type": [
              "string",
              "null"
            ]
          },
          "outbound_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "outbound_headers_to_attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "outbound_attributes_to_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "outbound_include_headers": {
            "$ref": "#/components/schemas/SipIncludeHeaders"
          },
          "outbound_allowed_prefixes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "outbound_allowed_sip_hosts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pcap_enabled": {
            "type": "boolean"
          },
          "outbound_capacity_mode": {
            "$ref": "#/components/schemas/SipOutboundCapacityMode"
          },
          "max_concurrent_outbound": {
            "type": [
              "integer",
              "null"
            ]
          },
          "max_outbound_cps": {
            "type": [
              "number",
              "null"
            ]
          },
          "outbound_cps_burst": {
            "type": [
              "integer",
              "null"
            ]
          },
          "outbound_capacity_profile_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "outbound_via_proxy": {
            "type": "boolean",
            "description": "Outbound INVITEs are relayed through the Kejue Voice SIP edge (port 5060). Always true for twilio_automated trunks on a deployment with a SIP edge."
          }
        },
        "required": [
          "id",
          "name",
          "provider",
          "sip_signaling_mode",
          "inbound_auth_mode",
          "inbound_allowed_addresses",
          "outbound_address",
          "outbound_transport",
          "outbound_auth_mode",
          "has_credentials",
          "registrar_username",
          "registrar_domain",
          "registration_status",
          "registration_contact",
          "last_register_at",
          "registration_expires_at",
          "registration_checked_at",
          "remote_registrar_address",
          "remote_registrar_domain",
          "remote_register_realm",
          "remote_register_username",
          "remote_registrar_transport",
          "remote_register_expires_seconds",
          "livekit_inbound_trunk_id",
          "livekit_outbound_trunk_id",
          "status",
          "last_error",
          "last_error_code",
          "archived_at",
          "created_at",
          "updated_at",
          "inbound_allowed_numbers",
          "inbound_media_encryption",
          "inbound_ringing_timeout_ms",
          "inbound_max_call_duration_ms",
          "inbound_headers",
          "inbound_headers_to_attributes",
          "inbound_attributes_to_headers",
          "inbound_include_headers",
          "outbound_metadata",
          "outbound_destination_country",
          "outbound_media_encryption",
          "outbound_from_host",
          "outbound_headers",
          "outbound_headers_to_attributes",
          "outbound_attributes_to_headers",
          "outbound_include_headers",
          "outbound_allowed_prefixes",
          "outbound_allowed_sip_hosts",
          "pcap_enabled",
          "outbound_capacity_mode",
          "max_concurrent_outbound",
          "max_outbound_cps",
          "outbound_cps_burst",
          "outbound_capacity_profile_id",
          "outbound_via_proxy"
        ]
      },
      "SipTrunkListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SipTrunk"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "SipTrunkProvisioningResponse": {
        "type": "object",
        "additionalProperties": false,
        "description": "Stable polling contract returned after asynchronous create or reconcile acceptance.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "const": "provisioning"
          },
          "resource_url": {
            "type": "string",
            "pattern": "^/v1/sip-trunks/[0-9a-f-]+$"
          },
          "poll_after_seconds": {
            "type": "integer",
            "minimum": 1
          },
          "provisioning_async": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "id",
          "status",
          "resource_url",
          "poll_after_seconds",
          "provisioning_async"
        ]
      },
      "SipTrunkPatchRequest": {
        "type": "object",
        "minProperties": 1,
        "additionalProperties": false,
        "dependentRequired": {
          "auth_username": [
            "auth_password"
          ],
          "auth_password": [
            "auth_username"
          ],
          "remote_register_realm": [
            "auth_username",
            "auth_password"
          ]
        },
        "description": "Presence-aware partial update. Omitted fields are unchanged. Empty arrays/maps replace and clear collections. Explicit null clears nullable advanced/capacity values. auth_username and auth_password must be sent together to rotate credentials.\n\nProvider-facing edits return the trunk with status=provisioning and reconcile asynchronously. They return 409 if another provisioning operation is still active. Automated Twilio trunks reject inbound allowlist and SIP credential rotation; archive and recreate those trunks instead.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 80
          },
          "inbound_allowed_addresses": {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "auth_username": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Write-only replacement SIP digest username."
          },
          "auth_password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "description": "Write-only replacement SIP digest password."
          },
          "remote_register_realm": {
            "type": "string",
            "maxLength": 256,
            "description": "remote_registered_peer only. Digest realm Kejue Voice answers the PBX's REGISTER challenge with (Yeastar PBXs use YSAsterisk). Sent together with auth_username and auth_password, because the stored digest includes the realm. Empty falls back to the remote registrar domain."
          },
          "inbound_advanced_settings": {
            "$ref": "#/components/schemas/SipInboundAdvancedPatch"
          },
          "outbound_advanced_settings": {
            "$ref": "#/components/schemas/SipOutboundAdvancedPatch"
          },
          "pcap_enabled": {
            "type": "boolean"
          },
          "outbound_capacity_mode": {
            "$ref": "#/components/schemas/SipOutboundCapacityMode"
          },
          "max_concurrent_outbound": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "max_outbound_cps": {
            "type": [
              "number",
              "null"
            ],
            "exclusiveMinimum": 0
          },
          "outbound_cps_burst": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "outbound_capacity_profile_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "ToolMode": {
        "type": "string",
        "enum": [
          "sync",
          "async"
        ]
      },
      "ToolPhase": {
        "type": "string",
        "description": "When the tool runs. `in_call` (the default, and every tool authored before this field existed) is invoked by the model during the conversation. `pre_call` fires once, before the agent speaks, with no model involvement: its parameters must be static, system, or secret cards, its templates may reference only {{system.NAME}}, {{vars.NAME}}, and {{secrets.NAME}}, and its `response_map` names the values it publishes as {{tools.SLUG.NAME}}. `pre_call` additionally requires `mode: sync`, `default_reaction: speaks`, and `precomputable: false`, because all three describe behaviour during a conversation that has not started yet.",
        "enum": [
          "in_call",
          "pre_call"
        ]
      },
      "ToolPreCallAttachment": {
        "type": "object",
        "additionalProperties": false,
        "description": "One pre-call tool attached to an agent. The referenced tool must have `phase: pre_call`; attaching an `in_call` tool here is rejected.",
        "properties": {
          "tool_id": {
            "type": "string",
            "format": "uuid",
            "description": "Catalog tool to run before the agent speaks."
          },
          "on_failure": {
            "type": "string",
            "default": "proceed",
            "description": "`proceed` continues the call with the tool's variables rendering empty. `abort` ends the call before the agent speaks — an outbound placement fails as retryable, an inbound call is terminated.",
            "enum": [
              "proceed",
              "abort"
            ]
          },
          "inject_as_context": {
            "type": "boolean",
            "default": false,
            "description": "Append the response to the system prompt as a fenced data block, in addition to publishing it as {{tools.SLUG.NAME}}."
          },
          "required_vars": {
            "type": "array",
            "maxItems": 20,
            "description": "Names from `response_map` that must be present and non-empty for the call to count as successful. A 2xx response missing one of these is routed through `on_failure`.",
            "items": {
              "type": "string",
              "pattern": "^[a-zA-Z_][a-zA-Z0-9_]{0,63}$"
            }
          }
        },
        "required": [
          "tool_id"
        ]
      },
      "ToolMethod": {
        "type": "string",
        "enum": [
          "GET",
          "POST",
          "PUT",
          "PATCH",
          "DELETE"
        ]
      },
      "ToolReaction": {
        "type": "string",
        "enum": [
          "speaks",
          "listens"
        ]
      },
      "ToolParameterLocation": {
        "type": "string",
        "enum": [
          "path",
          "query",
          "header",
          "body"
        ]
      },
      "ToolObjectProperty": {
        "type": "object",
        "additionalProperties": false,
        "description": "One field inside a dynamic object parameter. Object parameters are intentionally one level deep; a property cannot itself be an object.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "boolean",
              "enum"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "required": {
            "type": "boolean",
            "default": false
          },
          "enum_values": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Required exactly when type is enum; forbidden for other property types."
          }
        },
        "required": [
          "name",
          "type"
        ]
      },
      "ToolArrayItems": {
        "type": "object",
        "additionalProperties": false,
        "description": "Element contract of a dynamic array parameter. Items are scalar (string, number, boolean), enum, or object; an object item uses the same one-level ToolObjectProperty shape as an object parameter, so items cannot nest further arrays or objects.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "boolean",
              "enum",
              "object"
            ]
          },
          "enum_values": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Required exactly when the item type is enum; forbidden for other item types."
          },
          "properties": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ToolObjectProperty"
            },
            "description": "Required exactly when the item type is object; forbidden for other item types. Property names must be unique."
          }
        },
        "required": [
          "type"
        ]
      },
      "ToolDynamicParameter": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
          },
          "kind": {
            "type": "string",
            "const": "dynamic"
          },
          "location": {
            "$ref": "#/components/schemas/ToolParameterLocation"
          },
          "type": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "boolean",
              "enum",
              "object",
              "array"
            ],
            "default": "string"
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "required": {
            "type": "boolean",
            "default": false,
            "description": "Whether a dynamic argument must be supplied. Path parameters are always required at execution and are normalized to true when omitted."
          },
          "enum_values": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Required exactly when type is enum; forbidden for other dynamic types."
          },
          "properties": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ToolObjectProperty"
            },
            "description": "Required exactly when type is object. Object parameters are allowed only in the request body, and property names must be unique."
          },
          "items": {
            "$ref": "#/components/schemas/ToolArrayItems",
            "description": "Required exactly when type is array; forbidden for other dynamic types. Array parameters are allowed only in the request body."
          }
        },
        "required": [
          "name",
          "kind",
          "location"
        ]
      },
      "ToolStaticParameter": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
          },
          "kind": {
            "type": "string",
            "const": "static"
          },
          "location": {
            "$ref": "#/components/schemas/ToolParameterLocation"
          },
          "value": {
            "type": "string",
            "maxLength": 8192,
            "description": "Literal value inserted at runtime. Template expressions are permitted and validated. A path/query static value cannot reference the secrets scope."
          }
        },
        "required": [
          "name",
          "kind",
          "location",
          "value"
        ]
      },
      "ToolSystemParameter": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
          },
          "kind": {
            "type": "string",
            "const": "system"
          },
          "location": {
            "$ref": "#/components/schemas/ToolParameterLocation"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z_][A-Za-z0-9_.-]{0,127}$",
            "description": "Name from the system scope, for example call_id, agent_id, or caller_phone."
          }
        },
        "required": [
          "name",
          "kind",
          "location",
          "value"
        ]
      },
      "ToolSecretParameter": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
          },
          "kind": {
            "type": "string",
            "const": "secret"
          },
          "location": {
            "type": "string",
            "enum": [
              "header",
              "body"
            ],
            "description": "Secret material is intentionally forbidden in URL paths and query strings because URLs are commonly logged by clients, proxies, providers, and observability systems."
          },
          "value": {
            "$ref": "#/components/schemas/SecretName"
          },
          "prefix": {
            "type": "string",
            "maxLength": 1000,
            "description": "Optional literal prefix such as \"Bearer \". Templates and control characters are rejected."
          }
        },
        "required": [
          "name",
          "kind",
          "location",
          "value"
        ]
      },
      "ToolSlotParameter": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z_][A-Za-z0-9_-]{0,63}$"
          },
          "kind": {
            "type": "string",
            "const": "slot"
          },
          "location": {
            "$ref": "#/components/schemas/ToolParameterLocation"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z_][A-Za-z0-9_.-]{0,127}$",
            "description": "Existing pathway slot name."
          }
        },
        "required": [
          "name",
          "kind",
          "location",
          "value"
        ]
      },
      "ToolParameter": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ToolDynamicParameter"
          },
          {
            "$ref": "#/components/schemas/ToolStaticParameter"
          },
          {
            "$ref": "#/components/schemas/ToolSystemParameter"
          },
          {
            "$ref": "#/components/schemas/ToolSecretParameter"
          },
          {
            "$ref": "#/components/schemas/ToolSlotParameter"
          }
        ],
        "discriminator": {
          "propertyName": "kind"
        }
      },
      "ToolLegacyParameters": {
        "type": "object",
        "additionalProperties": true,
        "description": "Compatibility JSON Schema. Root type, when present, must be object; properties must be an object with at most 100 valid parameter names; required must contain unique declared property names."
      },
      "ToolParameters": {
        "oneOf": [
          {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": false,
            "description": "Rich parameter cards. Names must be unique; header-location names must also be unique case-insensitively. A path card may target a raw `{name}` placeholder or a matching precomposed template. Query, header, and body cards are inserted when absent; an existing destination must contain the card's exact canonical template/value or validation fails instead of choosing one source implicitly.",
            "items": {
              "$ref": "#/components/schemas/ToolParameter"
            }
          },
          {
            "$ref": "#/components/schemas/ToolLegacyParameters"
          }
        ]
      },
      "ToolHeaders": {
        "type": "object",
        "maxProperties": 100,
        "propertyNames": {
          "maxLength": 128,
          "pattern": "^[!#$%&'*+.^_`|~0-9A-Za-z-]+$"
        },
        "additionalProperties": {
          "type": "string",
          "maxLength": 8192
        },
        "description": "Header templates. Host, Content-Length, Transfer-Encoding, Connection, Proxy-Authorization, Proxy-Authenticate, Proxy-Connection, Keep-Alive, TE, Trailer, and Upgrade are transport-controlled and forbidden. Values cannot contain CR/LF."
      },
      "ToolBody": {
        "description": "Templated string, templated JSON object, or null for no request body. Arrays and scalar JSON values other than strings are rejected.",
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "object",
            "additionalProperties": true
          },
          {
            "type": "null"
          }
        ]
      },
      "ToolResponseMap": {
        "type": "object",
        "maxProperties": 100,
        "propertyNames": {
          "maxLength": 128,
          "pattern": "^[A-Za-z_][A-Za-z0-9_.-]{0,127}$"
        },
        "additionalProperties": {
          "type": "string",
          "maxLength": 512,
          "pattern": "^\\$(?:\\.(?:[A-Za-z_][A-Za-z0-9_-]*|0|[1-9][0-9]*))*$"
        },
        "description": "Map of destination slot name to the supported tiny JSONPath syntax, such as $.customer.name or $.items.0.id."
      },
      "ToolAckResponse": {
        "description": "Async-only agent-visible templated JSON object injected immediately while the real request continues; null disables it. It may use {{params.NAME}}, {{slots.NAME}}, {{system.NAME}}, and {{vars.NAME}}. It must never reference {{secrets.NAME}} at any nesting depth; public validation rejects the request rather than exposing a credential to the agent.",
        "oneOf": [
          {
            "type": "object",
            "maxProperties": 100,
            "additionalProperties": true
          },
          {
            "type": "null"
          }
        ]
      },
      "ToolInternalSlots": {
        "type": "array",
        "maxItems": 100,
        "uniqueItems": true,
        "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z_][A-Za-z0-9_.-]{0,127}$"
        },
        "description": "Subset of response_map slot names whose captured value is withheld from the model. The slot is still filled and still usable in templated tool fields such as a later request body or URL, but its value is never placed in the conversation the model sees, so a tool may return an account number or a policy document without that text entering the transcript or a prompt. Every entry must be a key of response_map; an unknown name is a 422. Stored canonically (sorted and deduplicated); omitted or null means an empty list."
      },
      "ToolCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Template expressions use {{slots.NAME}}, {{params.NAME}}, {{system.NAME}}, {{vars.NAME}}, or {{secrets.NAME}}. Rich parameter cards are the canonical automation workflow and preserve JSON scalar types in object bodies. Parameter references must be declared, secret names must exist and be active, braces must balance, and templates are forbidden in object keys. Secrets may appear only in headers or bodies and make HTTPS mandatory. The complete stored request is checked for duplicate or conflicting destinations before commit.",
        "properties": {
          "slug": {
            "type": "string",
            "minLength": 2,
            "maxLength": 48,
            "pattern": "^[a-z0-9_]{2,48}$",
            "description": "Immutable public identifier."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "mode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ToolMode"
              }
            ],
            "default": "sync"
          },
          "phase": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ToolPhase"
              }
            ],
            "default": "in_call"
          },
          "method": {
            "$ref": "#/components/schemas/ToolMethod"
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096,
            "description": "Absolute public HTTP(S) URL. Scheme, authority, credentials, and fragment are static. A raw `{name}` token is allowed only in the path when a rich path card with that exact name exists. Legacy `{{scope.name}}` templates remain accepted in path/query for stored compatibility, but new clients should use rich cards for component-safe percent encoding. Direct `{{secrets.NAME}}` URL references are always rejected."
          },
          "default_reaction": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ToolReaction"
              }
            ],
            "default": "speaks"
          },
          "precomputable": {
            "type": "boolean",
            "default": false,
            "description": "Allows execution to begin while generated speech is still playing. Use only for calls that are safe to start speculatively; the HTTP method does not determine whether an operation is semantically read-only."
          },
          "carry_across_calls": {
            "type": "boolean",
            "default": false,
            "description": "Declares that successful results remain valid on the timescale of a dropped-call redial. When an agent with resume enabled continues a recent call, the runtime replays this tool's latest successful result from the previous call into context. Leave false for tools returning live or per-moment data. Agents may override the value per attachment."
          },
          "headers": {
            "$ref": "#/components/schemas/ToolHeaders"
          },
          "body": {
            "$ref": "#/components/schemas/ToolBody"
          },
          "parameters": {
            "$ref": "#/components/schemas/ToolParameters"
          },
          "response_map": {
            "$ref": "#/components/schemas/ToolResponseMap"
          },
          "internal_slots": {
            "$ref": "#/components/schemas/ToolInternalSlots"
          },
          "ack_response": {
            "$ref": "#/components/schemas/ToolAckResponse"
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 100,
            "maximum": 60000,
            "default": 5000
          },
          "retries": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5,
            "default": 0
          }
        },
        "required": [
          "slug",
          "name",
          "method",
          "url"
        ]
      },
      "ToolListItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "mode": {
            "$ref": "#/components/schemas/ToolMode"
          },
          "phase": {
            "$ref": "#/components/schemas/ToolPhase"
          },
          "method": {
            "$ref": "#/components/schemas/ToolMethod"
          },
          "url": {
            "type": "string"
          },
          "default_reaction": {
            "$ref": "#/components/schemas/ToolReaction"
          },
          "precomputable": {
            "type": "boolean"
          },
          "carry_across_calls": {
            "type": "boolean"
          },
          "timeout_ms": {
            "type": "integer"
          },
          "retries": {
            "type": "integer"
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "mode",
          "phase",
          "method",
          "url",
          "default_reaction",
          "precomputable",
          "carry_across_calls",
          "timeout_ms",
          "retries",
          "archived_at",
          "created_at",
          "updated_at"
        ]
      },
      "ToolDetail": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "mode": {
            "$ref": "#/components/schemas/ToolMode"
          },
          "phase": {
            "$ref": "#/components/schemas/ToolPhase"
          },
          "method": {
            "$ref": "#/components/schemas/ToolMethod"
          },
          "url": {
            "type": "string"
          },
          "default_reaction": {
            "$ref": "#/components/schemas/ToolReaction"
          },
          "precomputable": {
            "type": "boolean"
          },
          "carry_across_calls": {
            "type": "boolean"
          },
          "timeout_ms": {
            "type": "integer"
          },
          "retries": {
            "type": "integer"
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "headers": {
            "$ref": "#/components/schemas/ToolHeaders"
          },
          "body": {
            "$ref": "#/components/schemas/ToolBody"
          },
          "parameters": {
            "$ref": "#/components/schemas/ToolParameters"
          },
          "response_map": {
            "$ref": "#/components/schemas/ToolResponseMap"
          },
          "internal_slots": {
            "$ref": "#/components/schemas/ToolInternalSlots"
          },
          "ack_response": {
            "$ref": "#/components/schemas/ToolAckResponse"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "mode",
          "phase",
          "method",
          "url",
          "default_reaction",
          "precomputable",
          "carry_across_calls",
          "timeout_ms",
          "retries",
          "archived_at",
          "created_at",
          "updated_at",
          "headers",
          "body",
          "parameters",
          "response_map",
          "internal_slots",
          "ack_response"
        ]
      },
      "ToolListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "ToolPatchRequest": {
        "type": "object",
        "minProperties": 1,
        "additionalProperties": false,
        "description": "Slug is immutable. Every supplied field is combined with current state, then the whole executable request is validated before any change is persisted.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "mode": {
            "$ref": "#/components/schemas/ToolMode"
          },
          "phase": {
            "$ref": "#/components/schemas/ToolPhase"
          },
          "method": {
            "$ref": "#/components/schemas/ToolMethod"
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "default_reaction": {
            "$ref": "#/components/schemas/ToolReaction"
          },
          "precomputable": {
            "type": "boolean"
          },
          "carry_across_calls": {
            "type": "boolean"
          },
          "headers": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ToolHeaders"
              },
              {
                "type": "null"
              }
            ]
          },
          "body": {
            "$ref": "#/components/schemas/ToolBody"
          },
          "parameters": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ToolParameters"
              },
              {
                "type": "null"
              }
            ]
          },
          "response_map": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ToolResponseMap"
              },
              {
                "type": "null"
              }
            ]
          },
          "internal_slots": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ToolInternalSlots"
              },
              {
                "type": "null"
              }
            ]
          },
          "ack_response": {
            "$ref": "#/components/schemas/ToolAckResponse"
          },
          "timeout_ms": {
            "type": "integer",
            "minimum": 100,
            "maximum": 60000
          },
          "retries": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5
          }
        }
      },
      "ToolTestObjectValue": {
        "type": "object",
        "maxProperties": 100,
        "additionalProperties": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            }
          ]
        },
        "description": "One-level object value for a dynamic parameter whose declared type is object. The stored property schema determines allowed keys, types, required fields, and enum values."
      },
      "ToolTestParamValue": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "$ref": "#/components/schemas/ToolTestObjectValue"
          }
        ]
      },
      "ToolTestRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "params": {
            "type": "object",
            "maxProperties": 100,
            "additionalProperties": {
              "$ref": "#/components/schemas/ToolTestParamValue"
            },
            "description": "Dynamic tool arguments keyed by declared parameter name. Required arguments must be present; unknown names and type mismatches return 422 before any outbound request is made."
          },
          "system": {
            "$ref": "#/components/schemas/ToolTestScopeOverrides"
          },
          "slots": {
            "$ref": "#/components/schemas/ToolTestScopeOverrides"
          },
          "vars": {
            "$ref": "#/components/schemas/ToolTestScopeOverrides"
          }
        },
        "required": [
          "params"
        ]
      },
      "ToolTestScopeOverrides": {
        "type": "object",
        "maxProperties": 100,
        "propertyNames": {
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z_][A-Za-z0-9_.-]{0,127}$"
        },
        "additionalProperties": {
          "type": "string",
          "maxLength": 65536
        },
        "description": "Optional test-only values for a scope normally populated by a live call. These overrides are never persisted."
      },
      "ToolTestRequestCapture": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "method": {
            "$ref": "#/components/schemas/ToolMethod"
          },
          "url": {
            "type": "string"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "body": {
            "type": "string"
          }
        },
        "required": [
          "method",
          "url"
        ],
        "description": "Secret-masked representation of the outbound request. The URL can contain supplied test parameter values but never plaintext secret values."
      },
      "ToolTestUpstreamResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "status": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "First values of safe response headers. Set-Cookie and authorization headers are omitted; resolved secret values are redacted."
          },
          "body": {
            "type": "string",
            "maxLength": 1048576,
            "description": "At most the first 1 MiB, with resolved secret values redacted."
          },
          "body_truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "status",
          "body",
          "body_truncated"
        ]
      },
      "ToolTestResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "request": {
            "$ref": "#/components/schemas/ToolTestRequestCapture"
          },
          "response": {
            "$ref": "#/components/schemas/ToolTestUpstreamResponse"
          },
          "error": {
            "type": "string",
            "description": "Sanitized human-readable transport failure. Absent when an HTTP response was received."
          },
          "error_code": {
            "type": "string",
            "enum": [
              "invalid_rendered_request",
              "upstream_timeout",
              "upstream_unreachable",
              "upstream_response_read_failed"
            ]
          },
          "retryable": {
            "type": "boolean"
          },
          "latency_ms": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "request",
          "retryable",
          "latency_ms"
        ],
        "description": "Exactly one of response or error/error_code is present."
      },
      "TranscriptSegmentSpeaker": {
        "type": "string",
        "enum": [
          "agent",
          "caller",
          "tool_call",
          "tool_result",
          "system",
          "wait",
          "noise"
        ],
        "description": "Who or what produced the row. agent and caller are spoken turns. tool_call and tool_result are the agent's tool activity inline in conversation order (full diagnostics live in tool_invocations). system marks an out-of-band event such as an agent handoff, wait marks a deliberate silent hold, and noise marks caller audio the speech model judged unintelligible (a marker row with empty text)."
      },
      "TranscriptSegmentKind": {
        "type": "string",
        "enum": [
          "",
          "dtmf_received",
          "dtmf_sent",
          "dtmf",
          "transcription_failed",
          "agent_handoff",
          "tool_interrupted"
        ],
        "description": "Out-of-band row classifier. An empty string is an ordinary spoken or tool row and is by far the common case. dtmf_received is a keypad entry from the caller; dtmf_sent is reserved for a digit the agent sends and is not currently emitted; dtmf is a caller turn the current speech engine sealed from keypad input. transcription_failed marks a caller turn whose audio could not be transcribed, agent_handoff a same-room agent-to-agent handover, and tool_interrupted a tool call the caller barged in on before it ran (a system row naming the tool; the tool never executed)."
      },
      "TranscriptSegment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "segment_index": {
            "type": "integer",
            "minimum": 0,
            "description": "Zero-based consultation segment; for brief rows this is transfer.attempt minus one. Missing on older transcript rows means zero."
          },
          "speaker": {
            "$ref": "#/components/schemas/TranscriptSegmentSpeaker"
          },
          "text": {
            "type": "string"
          },
          "timestamp": {
            "type": "number",
            "description": "Unix epoch seconds when the row occurred."
          },
          "kind": {
            "$ref": "#/components/schemas/TranscriptSegmentKind"
          },
          "interrupted": {
            "type": "boolean",
            "description": "Agent rows only. True when the caller barged in mid-playout, so only a prefix of text was actually heard. Absent otherwise."
          },
          "name": {
            "type": "string",
            "description": "Tool name. Present on tool_call and tool_result rows."
          },
          "is_error": {
            "type": "boolean",
            "description": "tool_result rows only. True when the invocation failed; the call's tool_invocations array carries the full diagnostics."
          },
          "dtmf_masked": {
            "type": "boolean",
            "description": "True when the row stands in for keypad digits that are deliberately withheld. The digits never enter the transcript, the model's context, or a webhook — only the count does."
          },
          "digit_count": {
            "type": "integer",
            "minimum": 0,
            "description": "How many keys were pressed, when dtmf_masked is true."
          },
          "reason": {
            "type": "string",
            "description": "Closed-vocabulary explanation for a non-empty kind or a masked DTMF value. Never free text and never caller-supplied."
          },
          "speech_id": {
            "type": "string",
            "description": "Framework speech-handle id of the agent generation that produced this reply. It is the same key the turn's latency metrics carry, so agent turns can be joined to per-turn timings deterministically. Present only on agent rows produced by the current speech engine; omitted on caller and tool rows and on older transcripts."
          },
          "from_agent": {
            "type": "string",
            "description": "On an agent_handoff row, the slug of the agent that handed the call over. The row's text names it in prose as well; this field lets you rebuild the path a flow call took between agents without parsing a sentence. Omitted on every other row kind, and on handoffs recorded before agents began stamping it."
          },
          "to_agent": {
            "type": "string",
            "description": "On an agent_handoff row, the slug of the agent that took the call over. See from_agent."
          },
          "leg": {
            "type": "string",
            "enum": [
              "caller",
              "brief"
            ]
          }
        },
        "required": [
          "speaker",
          "text",
          "timestamp",
          "kind",
          "leg"
        ]
      },
      "TransferState": {
        "type": "string",
        "enum": [
          "requested",
          "dialing",
          "ringing",
          "briefing",
          "bridging",
          "bridged",
          "failed",
          "recovering",
          "resolved"
        ]
      },
      "TransferFailureCode": {
        "type": "string",
        "enum": [
          "capability_denied",
          "toll_fraud_blocked",
          "provider_no_refer",
          "target_no_answer",
          "target_busy",
          "target_unavailable",
          "target_voicemail",
          "target_rejected",
          "target_dropped_briefing",
          "caller_hungup",
          "caller_hungup_during_bridge",
          "post_bridge_target_drop",
          "livekit_error",
          "internal_timeout",
          "pod_lost",
          "admin_canceled",
          "brief_capacity_exhausted",
          "dncr_blocked",
          "dncr_unavailable",
          "dncr_configuration_invalid"
        ]
      },
      "Transfer": {
        "type": "object",
        "additionalProperties": false,
        "description": "Complete customer-safe transfer state. Every nullable field is explicit. Raw provider errors and infrastructure pod identity are excluded.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "org_id": {
            "type": "string",
            "format": "uuid"
          },
          "session_id": {
            "type": "string",
            "format": "uuid"
          },
          "attempt": {
            "type": "integer",
            "minimum": 1,
            "description": "One-based transfer attempt within this call, including unsuccessful attempts. Older records may reuse one."
          },
          "kind": {
            "type": "string",
            "enum": [
              "cold",
              "warm",
              "agent"
            ],
            "description": "cold or warm for a transfer to a human by phone; agent for a same-call handoff to another Kejue Voice agent (always method handoff, recorded in its final state - bridged when the other agent took over, failed when it could not be started)."
          },
          "method": {
            "type": "string",
            "enum": [
              "refer",
              "bridge",
              "handoff"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/TransferState"
          },
          "destination": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048,
            "description": "The number or SIP URI dialled, or for an agent handoff the slug of the agent that took over."
          },
          "trunk_id": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "LiveKit/provider trunk identifier; it is not necessarily a UUID."
          },
          "label": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "announcement": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 50000
              },
              {
                "type": "null"
              }
            ]
          },
          "caller_identity": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "caller_number": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "consult_room": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "target_identity": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "sip_status_code": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 100,
                "maximum": 699
              },
              {
                "type": "null"
              }
            ]
          },
          "sip_status_text": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "failure_code": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/TransferFailureCode"
              },
              {
                "type": "null"
              }
            ]
          },
          "failure_message": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "failure_advice": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "state_entered_at": {
            "type": "string",
            "format": "date-time"
          },
          "state_deadline_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "absolute_deadline_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_heartbeat_at": {
            "type": "string",
            "format": "date-time"
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "org_id",
          "session_id",
          "attempt",
          "kind",
          "method",
          "state",
          "destination",
          "trunk_id",
          "label",
          "announcement",
          "caller_identity",
          "caller_number",
          "consult_room",
          "target_identity",
          "sip_status_code",
          "sip_status_text",
          "failure_code",
          "failure_message",
          "failure_advice",
          "state_entered_at",
          "state_deadline_at",
          "absolute_deadline_at",
          "last_heartbeat_at",
          "version",
          "created_at",
          "updated_at"
        ]
      },
      "TransferCancelRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "reason": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 8,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional operator reason. Null is equivalent to omission."
          }
        }
      },
      "TransferCapabilitiesResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "providers": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "sip": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TransferCapability"
                }
              },
              "twilio_automated": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TransferCapability"
                }
              }
            },
            "required": [
              "sip",
              "twilio_automated"
            ]
          }
        },
        "required": [
          "providers"
        ]
      },
      "TransferCapability": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "cold",
              "warm"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "refer",
              "bridge"
            ]
          }
        },
        "required": [
          "kind",
          "method"
        ]
      },
      "TransferEvent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "org_id": {
            "type": "string",
            "format": "uuid"
          },
          "transfer_id": {
            "type": "string",
            "format": "uuid"
          },
          "event_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "from_state": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/TransferState"
              },
              {
                "type": "null"
              }
            ]
          },
          "to_state": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/TransferState"
              },
              {
                "type": "null"
              }
            ]
          },
          "payload": {
            "$ref": "#/components/schemas/TransferEventPayload"
          },
          "payload_redacted": {
            "type": "boolean",
            "description": "True when internal, nested, unsupported, or overlong payload fields were removed or truncated."
          },
          "source": {
            "type": "string",
            "enum": [
              "agent",
              "janitor",
              "admin"
            ]
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "org_id",
          "transfer_id",
          "event_type",
          "from_state",
          "to_state",
          "payload",
          "payload_redacted",
          "source",
          "occurred_at"
        ]
      },
      "TransferEventPayload": {
        "type": "object",
        "additionalProperties": false,
        "description": "Fail-closed public subset of an internal event payload. All fields are event-dependent and therefore optional.",
        "properties": {
          "advice": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "destination": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "failure_code": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "kind": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "method": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "operator_api_key_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "operator_user_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "provider": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "sip_status_code": {
            "type": [
              "number",
              "null"
            ]
          },
          "sip_status_text": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "stale_reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "twilio_call_sid": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          }
        }
      },
      "TransferListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransferWithEvents"
            }
          },
          "count": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "items",
          "count"
        ]
      },
      "TransferWithEvents": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "transfer": {
            "$ref": "#/components/schemas/Transfer"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransferEvent"
            }
          }
        },
        "required": [
          "transfer",
          "events"
        ]
      },
      "TwilioNumber": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sid": {
            "type": "string"
          },
          "phone_number": {
            "type": "string",
            "pattern": "^\\+[1-9][0-9]{1,14}$",
            "description": "Purchased number in E.164 form."
          },
          "friendly_name": {
            "type": "string"
          }
        },
        "required": [
          "sid",
          "phone_number",
          "friendly_name"
        ]
      },
      "TwilioNumberListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TwilioNumber"
            }
          },
          "count": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "data",
          "count"
        ]
      },
      "UsageEventKind": {
        "type": "string",
        "enum": [
          "llm",
          "stt",
          "tts",
          "speechlm",
          "embedding",
          "endpointing"
        ]
      },
      "UsageEventActorKind": {
        "type": "string",
        "enum": [
          "agent",
          "caller",
          "scorer",
          "system",
          "guardrail",
          "analysis",
          "pathway_brain"
        ]
      },
      "UsageEventStatus": {
        "type": "string",
        "enum": [
          "ok",
          "error",
          "timeout"
        ]
      },
      "UsageEventFailure": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "upstream_error",
              "upstream_invalid_request",
              "upstream_authentication_failed",
              "upstream_permission_denied",
              "upstream_not_found",
              "upstream_timeout",
              "upstream_conflict",
              "upstream_validation_failed",
              "upstream_rate_limited",
              "upstream_unavailable",
              "upstream_http_error",
              "capacity_exhausted"
            ]
          },
          "message": {
            "type": "string",
            "minLength": 1
          },
          "retryable": {
            "type": "boolean"
          },
          "detail": {
            "type": "null",
            "deprecated": true,
            "description": "Reserved compatibility field. Internal provider diagnostics are available only to platform administrators."
          }
        },
        "required": [
          "code",
          "message",
          "retryable"
        ]
      },
      "UsageEventMetadata": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "generation_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "conversational_turn_index": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "turn_index": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "turn_outcome": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "completed",
              "cancelled",
              "aborted",
              "superseded",
              "error",
              "unfinalized",
              null
            ]
          },
          "speech_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_-]+$"
          }
        },
        "required": [
          "turn_index",
          "turn_outcome",
          "speech_id"
        ]
      },
      "UsageEventListItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "provider_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "provider_instance_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Identifies the inference instance that served the request, so requests can be told apart by the instance behind them and one can be named in a support request. Opaque and stable; null when no instance owns the request (a legacy or environment-configured target)."
          },
          "pipeline_mode": {
            "type": [
              "string",
              "null"
            ]
          },
          "pipeline_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "ts": {
            "type": "string",
            "format": "date-time"
          },
          "kind": {
            "$ref": "#/components/schemas/UsageEventKind"
          },
          "actor_kind": {
            "$ref": "#/components/schemas/UsageEventActorKind"
          },
          "status": {
            "$ref": "#/components/schemas/UsageEventStatus"
          },
          "http_status": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 100,
            "maximum": 599
          },
          "failure": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UsageEventFailure"
              },
              {
                "type": "null"
              }
            ]
          },
          "latency_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "ttft_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "prompt_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "completion_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "total_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "prompt_cached_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "audio_duration_sec": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "characters_count": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "streamed": {
            "type": "boolean"
          },
          "service_display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "failover_attempts": {
            "type": "integer",
            "minimum": 0
          },
          "session_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 256
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UsageEventMetadata"
              },
              {
                "type": "null"
              }
            ]
          },
          "model_display_name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "ts",
          "kind",
          "actor_kind",
          "status",
          "http_status",
          "failure",
          "latency_ms",
          "ttft_ms",
          "prompt_tokens",
          "completion_tokens",
          "total_tokens",
          "prompt_cached_tokens",
          "audio_duration_sec",
          "characters_count",
          "streamed",
          "service_display_name",
          "failover_attempts",
          "session_id",
          "request_id",
          "metadata",
          "model_display_name"
        ]
      },
      "UsageEventListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageEventListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "OrgUsageAnalyticsScope": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "const": "org"
          },
          "org_id": {
            "type": "string",
            "format": "uuid"
          },
          "org_name": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "kind",
          "org_id",
          "org_name"
        ]
      },
      "OrgUsageAnalyticsTotals": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "calls": {
            "type": "integer",
            "minimum": 0
          },
          "failed_calls": {
            "type": "integer",
            "minimum": 0
          },
          "answered_calls": {
            "type": "integer",
            "minimum": 0
          },
          "call_failure_rate": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "call_minutes": {
            "type": "number",
            "minimum": 0
          },
          "avg_minutes_per_call": {
            "type": "number",
            "minimum": 0
          },
          "active_live_calls": {
            "type": "integer",
            "minimum": 0
          },
          "peak_concurrent_calls": {
            "type": "integer",
            "minimum": 0
          },
          "tool_calls": {
            "type": "integer",
            "minimum": 0
          },
          "tool_failures": {
            "type": "integer",
            "minimum": 0
          },
          "tool_failure_rate": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "webhook_deliveries": {
            "type": "integer",
            "minimum": 0
          },
          "webhook_failures": {
            "type": "integer",
            "minimum": 0
          },
          "webhook_failure_rate": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "usage_events": {
            "type": "integer",
            "minimum": 0
          },
          "usage_failures": {
            "type": "integer",
            "minimum": 0
          },
          "usage_failure_rate": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "total_tokens": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "audio_minutes": {
            "type": "number",
            "minimum": 0
          },
          "tts_characters": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "failover_events": {
            "type": "integer",
            "minimum": 0
          },
          "p95_usage_latency_ms": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "p95_voice_response_latency_ms": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "p95_voice_slm_ttft_ms": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "avg_slm_duty_cycle": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "avg_duty_cycle": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          }
        },
        "required": [
          "calls",
          "failed_calls",
          "answered_calls",
          "call_failure_rate",
          "call_minutes",
          "avg_minutes_per_call",
          "active_live_calls",
          "peak_concurrent_calls",
          "tool_calls",
          "tool_failures",
          "tool_failure_rate",
          "webhook_deliveries",
          "webhook_failures",
          "webhook_failure_rate",
          "usage_events",
          "usage_failures",
          "usage_failure_rate",
          "total_tokens",
          "audio_minutes",
          "tts_characters",
          "failover_events",
          "p95_usage_latency_ms",
          "p95_voice_response_latency_ms",
          "p95_voice_slm_ttft_ms",
          "avg_slm_duty_cycle",
          "avg_duty_cycle"
        ]
      },
      "OrgUsageAnalyticsPoint": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "bucket_start": {
            "type": "string",
            "format": "date-time"
          },
          "calls": {
            "type": "integer",
            "minimum": 0
          },
          "failed_calls": {
            "type": "integer",
            "minimum": 0
          },
          "call_minutes": {
            "type": "number",
            "minimum": 0
          },
          "concurrent_calls": {
            "type": "integer",
            "minimum": 0
          },
          "slm_duty_cycle": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "tool_calls": {
            "type": "integer",
            "minimum": 0
          },
          "tool_failures": {
            "type": "integer",
            "minimum": 0
          },
          "webhook_deliveries": {
            "type": "integer",
            "minimum": 0
          },
          "webhook_failures": {
            "type": "integer",
            "minimum": 0
          },
          "usage_events": {
            "type": "integer",
            "minimum": 0
          },
          "usage_failures": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "bucket_start",
          "calls",
          "failed_calls",
          "call_minutes",
          "concurrent_calls",
          "slm_duty_cycle",
          "tool_calls",
          "tool_failures",
          "webhook_deliveries",
          "webhook_failures",
          "usage_events",
          "usage_failures"
        ]
      },
      "OrgUsageAnalyticsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "grain": {
            "type": "string",
            "enum": [
              "hour",
              "day",
              "week",
              "month"
            ]
          },
          "scope": {
            "$ref": "#/components/schemas/OrgUsageAnalyticsScope"
          },
          "totals": {
            "$ref": "#/components/schemas/OrgUsageAnalyticsTotals"
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrgUsageAnalyticsPoint"
            }
          }
        },
        "required": [
          "from",
          "to",
          "grain",
          "scope",
          "totals",
          "series"
        ]
      },
      "WebCallCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "agent_id"
        ],
        "properties": {
          "agent_id": {
            "type": "string",
            "format": "uuid",
            "description": "The agent to talk to. Its production version is used unless version_id is given."
          },
          "version_id": {
            "type": "string",
            "format": "uuid",
            "description": "Run a specific agent version instead of the production one. The version must belong to agent_id."
          },
          "variables": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "maxLength": 2000
            },
            "maxProperties": 50,
            "description": "Per-call prompt variables, referenced as {{name}} or {{vars.name}}. Names must match [A-Za-z_][A-Za-z0-9_]{0,63}. Supply your own end-user's identity or context here — these values are trusted because they arrive over an authenticated server-side request, never from the browser."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Opaque object stored on the call for your own bookkeeping and returned by GET /v1/calls/{id}. Max 8 KiB encoded. Never shown to the agent or the caller."
          },
          "modality": {
            "type": "string",
            "enum": [
              "audio",
              "text"
            ],
            "default": "audio",
            "description": "The conversation surface. audio (the default) streams speech both ways over WebRTC. text runs the same agent — same prompt, same tools, same pathway — as a typed conversation over the room's data channel, with no microphone, no speech recognition and no synthesis. Text calls are billed as minutes for their full duration and share the same concurrency limit as audio web calls."
          }
        }
      },
      "WebCallCreateResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "call_id",
          "token",
          "ws_url",
          "room_name",
          "agent_name",
          "expires_at_ms",
          "modality"
        ],
        "properties": {
          "call_id": {
            "type": "string",
            "format": "uuid",
            "description": "The call's id, usable immediately against GET /v1/calls/{id}."
          },
          "token": {
            "type": "string",
            "description": "Short-lived join credential for the browser. Treat it as a secret in transit; it authorizes exactly one room."
          },
          "ws_url": {
            "type": "string",
            "format": "uri",
            "description": "The WebRTC signalling endpoint the browser connects to."
          },
          "room_name": {
            "type": "string",
            "description": "The room the browser joins. Diagnostic — the SDK takes it from the token."
          },
          "agent_name": {
            "type": "string",
            "description": "The dispatched worker identity. Diagnostic only."
          },
          "agent_version_id": {
            "type": "string",
            "format": "uuid",
            "description": "The agent version actually resolved for this call."
          },
          "expires_at_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Unix ms after which the token can no longer be used to JOIN. It does not bound an already-connected call."
          },
          "modality": {
            "type": "string",
            "enum": [
              "audio",
              "text"
            ],
            "description": "The surface this call was opened on, echoed back so a client that omitted the field still knows which transport to run."
          }
        }
      },
      "WebhookConfig": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 4096,
            "pattern": "^https://",
            "description": "Public HTTPS URL. Credentials, fragments, local/private hosts, and dynamic authorities are rejected."
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/WebhookEvent"
            }
          },
          "active": {
            "type": "boolean"
          },
          "has_secret": {
            "type": "boolean",
            "description": "Whether encrypted signing material is available. The secret value is never returned here."
          },
          "last_delivery_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_delivery_status": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/WebhookDeliveryStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "url",
          "events",
          "active",
          "has_secret",
          "last_delivery_at",
          "last_delivery_status",
          "archived_at",
          "created_at",
          "updated_at"
        ]
      },
      "WebhookCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 4096,
            "pattern": "^https://"
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 7,
            "uniqueItems": true,
            "default": [
              "call.completed"
            ],
            "items": {
              "$ref": "#/components/schemas/WebhookEvent"
            }
          },
          "active": {
            "type": "boolean",
            "default": true
          }
        },
        "required": [
          "name",
          "url"
        ]
      },
      "WebhookCreateResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://"
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/WebhookEvent"
            }
          },
          "active": {
            "type": "boolean"
          },
          "has_secret": {
            "type": "boolean",
            "const": true
          },
          "last_delivery_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_delivery_status": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/WebhookDeliveryStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "secret": {
            "type": "string",
            "minLength": 49,
            "maxLength": 49,
            "pattern": "^whsec_[A-Za-z0-9_-]{43}$",
            "description": "One-time HMAC-SHA256 signing secret. Store it securely; later GET/list responses omit it.",
            "readOnly": true,
            "x-sonus-one-time-secret": true,
            "x-kejue-one-time-secret": true
          }
        },
        "required": [
          "id",
          "name",
          "url",
          "events",
          "active",
          "has_secret",
          "last_delivery_at",
          "last_delivery_status",
          "archived_at",
          "created_at",
          "updated_at",
          "secret"
        ]
      },
      "WebhookDeliveryStatus": {
        "type": "string",
        "enum": [
          "pending",
          "running",
          "success",
          "failed_permanent",
          "exhausted"
        ],
        "description": "pending is due now or scheduled for retry; running has an active worker lease; success is terminal; failed_permanent is non-retryable; exhausted means every configured attempt was used."
      },
      "WebhookDelivery": {
        "type": "object",
        "description": "Compact delivery representation embedded in a call detail response.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "webhook_config_id": {
            "type": "string",
            "format": "uuid"
          },
          "webhook_name": {
            "type": "string"
          },
          "webhook_url": {
            "type": "string",
            "format": "uri"
          },
          "event": {
            "$ref": "#/components/schemas/WebhookEvent"
          },
          "attempt": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10
          },
          "max_attempts": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "status": {
            "$ref": "#/components/schemas/WebhookDeliveryStatus"
          },
          "scheduled_at": {
            "type": "string",
            "format": "date-time"
          },
          "next_retry_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": "string",
            "format": "date-time"
          },
          "response_status": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "event",
          "attempt",
          "max_attempts",
          "status",
          "scheduled_at"
        ]
      },
      "WebhookEvent": {
        "type": "string",
        "description": "call.dncr_blocked is workspace-wide and fires only for a confirmed registry match before dialing; DNCR lookup failures do not emit it.",
        "enum": [
          "call.completed",
          "call.dncr_blocked",
          "campaign.started",
          "campaign.paused",
          "campaign.resumed",
          "campaign.completed",
          "campaign.stopped",
          "inference.transcription.completed",
          "inference.transcription.failed",
          "inference.transcription.cancelled"
        ]
      },
      "WebhookReplayMode": {
        "type": "string",
        "enum": [
          "snapshot",
          "rebuild"
        ]
      },
      "WebhookDeliveryListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "webhook_config_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "webhook_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "call_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "event": {
            "$ref": "#/components/schemas/WebhookEvent"
          },
          "is_test": {
            "type": "boolean",
            "description": "True for explicit test deliveries, which have call_id=null and payload call=null."
          },
          "replayed_from_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "replay_mode": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/WebhookReplayMode"
              },
              {
                "type": "null"
              }
            ]
          },
          "attempt": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10
          },
          "max_attempts": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "status": {
            "$ref": "#/components/schemas/WebhookDeliveryStatus"
          },
          "scheduled_at": {
            "type": "string",
            "format": "date-time"
          },
          "next_retry_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "response_status": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 100,
            "maximum": 599
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable machine token such as http_503, timeout, network_error, or unsafe_webhook_url."
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Safe human-readable explanation corresponding to error_code."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "webhook_config_id",
          "webhook_name",
          "call_id",
          "event",
          "is_test",
          "replayed_from_id",
          "replay_mode",
          "attempt",
          "max_attempts",
          "status",
          "scheduled_at",
          "next_retry_at",
          "started_at",
          "completed_at",
          "response_status",
          "error_code",
          "error_message",
          "created_at",
          "updated_at"
        ]
      },
      "WebhookDeliveryDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WebhookDeliveryListItem"
          },
          {
            "type": "object",
            "properties": {
              "request_url": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri",
                "description": "Immutable destination snapshotted on the first attempt. Null before the first attempt."
              },
              "request_body_sha256": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[0-9a-f]{64}$",
                "description": "SHA-256 of the exact canonical UTF-8 request body. The body itself is never exposed."
              },
              "response_body_preview": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 2048,
                "description": "Sanitized preview capped at 2048 UTF-8 bytes; null when no HTTP response was received."
              }
            },
            "required": [
              "request_url",
              "request_body_sha256",
              "response_body_preview"
            ]
          }
        ]
      },
      "WebhookDeliveryListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryListItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "WebhookListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookConfig"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "WebhookPatchRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 4096,
            "pattern": "^https://"
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/WebhookEvent"
            }
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "WebhookTestResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "delivery_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "const": "pending"
          }
        },
        "required": [
          "delivery_id",
          "status"
        ]
      },
      "WebhookReplayRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WebhookReplayMode"
              }
            ],
            "default": "snapshot"
          }
        }
      },
      "WebhookReplayResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "delivery_id": {
            "type": "string",
            "format": "uuid"
          },
          "replayed_from_id": {
            "type": "string",
            "format": "uuid"
          },
          "mode": {
            "$ref": "#/components/schemas/WebhookReplayMode"
          },
          "status": {
            "type": "string",
            "const": "pending"
          }
        },
        "required": [
          "delivery_id",
          "replayed_from_id",
          "mode",
          "status"
        ]
      },
      "WebhookOutboundEvent": {
        "type": "object",
        "additionalProperties": false,
        "description": "Canonical JSON body POSTed to the webhook destination. Maximum encoded size is 2 MiB.",
        "properties": {
          "api_version": {
            "type": "string",
            "const": "2026-07-01"
          },
          "event": {
            "$ref": "#/components/schemas/WebhookEvent"
          },
          "delivery_id": {
            "type": "string",
            "format": "uuid"
          },
          "delivered_at": {
            "type": "string",
            "format": "date-time"
          },
          "test": {
            "type": "boolean"
          },
          "replayed_from_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "call": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/WebhookCallPayload"
              },
              {
                "type": "null"
              }
            ]
          },
          "campaign": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/WebhookCampaignPayload"
              },
              {
                "type": "null"
              }
            ]
          },
          "transcription_job": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/WebhookTranscriptionJobPayload"
              },
              {
                "type": "null"
              }
            ],
            "description": "Present and non-null for inference.transcription events; omitted or null on legacy call and campaign envelopes."
          }
        },
        "required": [
          "api_version",
          "event",
          "delivery_id",
          "delivered_at",
          "test",
          "replayed_from_id",
          "call",
          "campaign"
        ],
        "oneOf": [
          {
            "properties": {
              "event": {
                "enum": [
                  "call.completed",
                  "call.dncr_blocked",
                  "campaign.started",
                  "campaign.paused",
                  "campaign.resumed",
                  "campaign.completed",
                  "campaign.stopped"
                ]
              },
              "transcription_job": {
                "type": "null"
              }
            }
          },
          {
            "required": [
              "transcription_job"
            ],
            "properties": {
              "event": {
                "enum": [
                  "inference.transcription.completed",
                  "inference.transcription.failed",
                  "inference.transcription.cancelled"
                ]
              },
              "transcription_job": {
                "$ref": "#/components/schemas/WebhookTranscriptionJobPayload"
              },
              "call": {
                "type": "null"
              },
              "campaign": {
                "type": "null"
              }
            }
          }
        ]
      },
      "WebhookCampaignPayload": {
        "type": "object",
        "additionalProperties": false,
        "description": "Campaign snapshot carried by `campaign.*` events, read after the transition committed. Null on call events, just as `call` is null here.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/CampaignStatus"
          },
          "paused_reason": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CampaignPausedReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "counters": {
            "$ref": "#/components/schemas/CampaignCounters"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          },
          "dncr": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DNCROptions"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "paused_reason",
          "counters",
          "occurred_at"
        ]
      },
      "WebhookTranscriptionJobPayload": {
        "type": "object",
        "additionalProperties": false,
        "description": "Metadata-only transcription notification. Retrieve retained transcript content through the authorized result API.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "model": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "request_id": {
            "oneOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "model",
          "status",
          "request_id"
        ]
      },
      "WebhookCallPayload": {
        "description": "Call snapshot. DNCR-blocked attempts additionally include dialed, failure_code, dncr, outbound_job_id and campaign_id; no conversation or analysis ran.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "room_name": {
            "type": "string"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duration_sec": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ]
          },
          "direction": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "inbound",
              "outbound",
              null
            ]
          },
          "caller_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "platform_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "from_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "to_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "agent": {
            "$ref": "#/components/schemas/WebhookAgentSnapshot"
          },
          "flow": {
            "description": "The flow the call ran inside, or null for an ordinary single-agent call. On a flow call `agent` is whichever member agent held the call at hangup; the flow is what the delivery was configured against.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/WebhookFlowSnapshot"
              },
              {
                "type": "null"
              }
            ]
          },
          "transcript": {
            "type": "array",
            "description": "Caller-leg, PII-redacted transcript only. Warm-transfer brief-leg conversation is excluded.",
            "items": {
              "$ref": "#/components/schemas/WebhookTranscriptSegment"
            }
          },
          "pathway_state": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "summary": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/WebhookSummaryResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "extractions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookExtractionResult"
            }
          },
          "dialed": {
            "type": "boolean",
            "const": false,
            "description": "Present on call.dncr_blocked; no carrier leg was placed."
          },
          "failure_code": {
            "type": "string",
            "const": "dncr_blocked",
            "description": "Present on call.dncr_blocked. Lookup errors do not emit this event."
          },
          "dncr": {
            "type": "object",
            "additionalProperties": false,
            "description": "Confirmed DNCR registration that prevented dialing.",
            "properties": {
              "decision": {
                "type": "string",
                "const": "blocked"
              },
              "reason": {
                "type": "string",
                "const": "dncr_registered"
              }
            },
            "required": [
              "decision",
              "reason"
            ]
          },
          "outbound_job_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Present on call.dncr_blocked; null for direct placements."
          },
          "campaign_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Present on call.dncr_blocked; null outside a campaign."
          },
          "analysis_timed_out": {
            "type": "boolean",
            "description": "Present and true when the delivery deadline elapsed before all configured summary and extraction jobs reached a final state."
          }
        },
        "required": [
          "id",
          "room_name",
          "started_at",
          "ended_at",
          "duration_sec",
          "outcome",
          "direction",
          "caller_number",
          "platform_number",
          "from_number",
          "to_number",
          "agent",
          "flow",
          "transcript",
          "pathway_state",
          "summary",
          "extractions"
        ]
      },
      "WebhookFlowSnapshot": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug",
          "name"
        ]
      },
      "WebhookAgentSnapshot": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "version"
        ]
      },
      "WebhookTranscriptSegment": {
        "type": "object",
        "additionalProperties": false,
        "description": "A webhook transcript row. This is the stored redacted row exactly as recorded, so it carries slightly less than the same row read back from GET /v1/calls/{id}: there is no leg (a webhook only ever carries the caller leg) and kind is present only on the out-of-band rows that have one, rather than always.",
        "properties": {
          "speaker": {
            "$ref": "#/components/schemas/TranscriptSegmentSpeaker"
          },
          "text": {
            "type": "string"
          },
          "timestamp": {
            "type": "number",
            "description": "Unix epoch seconds when the row occurred."
          },
          "kind": {
            "type": "string",
            "enum": [
              "dtmf_received",
              "dtmf_sent",
              "dtmf",
              "transcription_failed",
              "agent_handoff",
              "tool_interrupted"
            ],
            "description": "Present only on out-of-band rows. Absent on ordinary spoken and tool rows. See TranscriptSegmentKind for the meaning of each value."
          },
          "speech_id": {
            "type": "string",
            "description": "Agent rows. Framework speech-handle id of the generation that produced the reply."
          },
          "interrupted": {
            "type": "boolean",
            "description": "Agent rows. The reply was cut mid-playout by a barge-in."
          },
          "name": {
            "type": "string",
            "description": "Tool name. Present on tool_call and tool_result rows."
          },
          "is_error": {
            "type": "boolean",
            "description": "tool_result rows. True when the invocation failed."
          },
          "dtmf_masked": {
            "type": "boolean",
            "description": "The row stands in for withheld keypad digits."
          },
          "digit_count": {
            "type": "integer",
            "minimum": 0,
            "description": "How many keys were pressed, when dtmf_masked is true."
          },
          "reason": {
            "type": "string",
            "description": "Closed-vocabulary explanation for kind or a masked DTMF value."
          },
          "from_agent": {
            "type": "string",
            "description": "agent_handoff rows. Slug of the agent that handed the call over."
          },
          "to_agent": {
            "type": "string",
            "description": "agent_handoff rows. Slug of the agent that took the call over."
          },
          "diar_speaker": {
            "type": "string",
            "description": "Caller rows on agents with speaker diarization enabled. The turn's diarized speaker label (for example `SPEAKER_00`), distinct from `speaker`, which stays the caller/agent role. Absent when diarization is off."
          },
          "diar_segments": {
            "type": "array",
            "description": "Caller rows on agents with speaker diarization enabled. Per-speaker slices of the turn; each slice's text is PII-redacted like the row text. Absent when diarization is off.",
            "items": {
              "$ref": "#/components/schemas/WebhookDiarizationSegment"
            }
          }
        },
        "required": [
          "speaker",
          "text",
          "timestamp"
        ]
      },
      "WebhookDiarizationSegment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "speaker": {
            "type": "string",
            "description": "Diarized speaker label."
          },
          "start": {
            "type": "number",
            "description": "Slice start, in seconds, as reported by the speech recognizer."
          },
          "end": {
            "type": "number",
            "description": "Slice end, in seconds, as reported by the speech recognizer."
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "speaker",
          "start",
          "end",
          "text"
        ]
      },
      "WebhookSummaryResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "done",
              "error"
            ]
          },
          "text": {
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable machine-safe failure token; provider exception text is never emitted."
          }
        },
        "required": [
          "id",
          "status",
          "text",
          "model",
          "error"
        ]
      },
      "WebhookExtractionResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "extraction_object_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "done",
              "error"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "result": {
            "description": "Validated structured extraction result; null unless status=done."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable machine-safe failure token."
          }
        },
        "required": [
          "id",
          "extraction_object_id",
          "name",
          "status",
          "model",
          "result",
          "error"
        ]
      },
      "WebhookSignatureHeaders": {
        "type": "object",
        "additionalProperties": false,
        "description": "Headers sent with each webhook. Verify sha256=HMAC_SHA256(secret, X-Sonus-Timestamp + '.' + exact_body), compare in constant time, reject stale timestamps, and deduplicate by X-Sonus-Delivery-Id.",
        "properties": {
          "X-Sonus-API-Version": {
            "type": "string",
            "const": "2026-07-01"
          },
          "X-Sonus-Event": {
            "$ref": "#/components/schemas/WebhookEvent"
          },
          "X-Sonus-Delivery-Id": {
            "type": "string",
            "format": "uuid"
          },
          "X-Sonus-Attempt": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "X-Sonus-Timestamp": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "X-Sonus-Signature": {
            "type": "string",
            "pattern": "^sha256=[0-9a-f]{64}$"
          },
          "X-Sonus-Replayed-From": {
            "type": "string",
            "format": "uuid",
            "description": "Present only for replay deliveries."
          }
        },
        "required": [
          "X-Sonus-API-Version",
          "X-Sonus-Event",
          "X-Sonus-Delivery-Id",
          "X-Sonus-Attempt",
          "X-Sonus-Timestamp",
          "X-Sonus-Signature"
        ]
      },
      "CampaignStatus": {
        "type": "string",
        "description": "Campaign lifecycle. `draft` holds configuration and places no calls; `scheduled` is launched but waiting for `start_at`; `running` is feeding calls; `paused` stopped feeding (by an operator or by the platform, see `paused_reason`); `completed` finished every recipient or passed `end_at`; `stopped` was ended for good and cannot be resumed.",
        "enum": [
          "draft",
          "scheduled",
          "running",
          "paused",
          "completed",
          "stopped"
        ]
      },
      "CampaignPausedReason": {
        "type": "string",
        "description": "Why a paused campaign stopped. `manual` is an operator action; the rest are platform decisions the feeder makes and re-evaluates — `minutes_exhausted` when the monthly call-minutes wallet is empty, `calls_disabled` when calling is switched off for the tenant, `entitlement_revoked` when the campaigns entitlement was withdrawn mid-run, `configuration_invalid` when every job would be rejected for the same configuration reason (its phone number, trunk or agent is gone or unavailable; the exact rejection is in `paused_detail`), `dncr_configuration_invalid` when the campaign's DNCR connection or its credentials are unusable (calls stay stopped until it is repaired).",
        "enum": [
          "manual",
          "minutes_exhausted",
          "calls_disabled",
          "entitlement_revoked",
          "dncr_configuration_invalid",
          "configuration_invalid"
        ]
      },
      "CampaignVoicemailAction": {
        "type": "string",
        "description": "What the agent should do when a call reaches voicemail. `hangup` ends the call; `message` leaves `voicemail_message` and then ends it. Delivered as an instruction to the agent for that call, so it is best-effort rather than a detector guarantee.",
        "enum": [
          "hangup",
          "message"
        ]
      },
      "CampaignRecipientStatus": {
        "type": "string",
        "description": "Dial state of one recipient. `pending` is not yet fed; `queued` has an outbound job waiting; `calling` is dialing or connected; `completed`, `failed`, and `canceled` are terminal. `excluded` rows were either rejected at import (never eligible to dial) or refused by the do-not-call register when the feeder dialed them; `exclusion_reason` says which.",
        "enum": [
          "pending",
          "queued",
          "calling",
          "completed",
          "failed",
          "canceled",
          "excluded"
        ]
      },
      "CampaignCounters": {
        "type": "object",
        "additionalProperties": false,
        "description": "Per-status recipient tally, always derived from the recipient rows rather than stored, so it cannot drift from reality.",
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "pending": {
            "type": "integer",
            "minimum": 0
          },
          "queued": {
            "type": "integer",
            "minimum": 0
          },
          "calling": {
            "type": "integer",
            "minimum": 0
          },
          "completed": {
            "type": "integer",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "minimum": 0
          },
          "canceled": {
            "type": "integer",
            "minimum": 0
          },
          "excluded": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "total",
          "pending",
          "queued",
          "calling",
          "completed",
          "failed",
          "canceled",
          "excluded"
        ]
      },
      "Campaign": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "org_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "agent_id": {
            "type": "string",
            "format": "uuid"
          },
          "agent_name": {
            "type": "string"
          },
          "agent_version_id": {
            "type": "string",
            "format": "uuid",
            "description": "Pinned agent version. When absent the agent's production version is resolved at dial time."
          },
          "group_id": {
            "type": "string",
            "format": "uuid",
            "description": "The group the campaign dials through, absent otherwise. Each recipient is assigned to one member using the group's routing strategy and dialed by that member's production version. agent_id and agent_name identify the first dispatchable member when the group was attached, a display placeholder rather than the agent every call uses."
          },
          "group_name": {
            "type": "string"
          },
          "number_pool_id": {
            "type": "string",
            "format": "uuid"
          },
          "number_pool_name": {
            "type": "string",
            "description": "Display name of the attached number pool, denormalized so the caller-ID route can be named without a second request."
          },
          "phone_number_id": {
            "type": "string",
            "format": "uuid"
          },
          "phone_number_e164": {
            "type": "string",
            "description": "E.164 of the pinned caller ID, denormalized so the caller-ID route can be named without a second request."
          },
          "trunk_id": {
            "type": "string",
            "format": "uuid"
          },
          "transport": {
            "$ref": "#/components/schemas/PhoneNumberTransport"
          },
          "status": {
            "$ref": "#/components/schemas/CampaignStatus"
          },
          "paused_reason": {
            "$ref": "#/components/schemas/CampaignPausedReason"
          },
          "paused_detail": {
            "type": "string",
            "maxLength": 1024,
            "description": "The exact rejection behind paused_reason configuration_invalid."
          },
          "start_at": {
            "type": "string",
            "format": "date-time"
          },
          "end_at": {
            "type": "string",
            "format": "date-time",
            "description": "Hard stop. When it passes, queued calls are canceled and the campaign completes."
          },
          "policy_overrides": {
            "$ref": "#/components/schemas/OutboundPolicyOverrides"
          },
          "max_concurrent": {
            "type": "integer",
            "minimum": 1,
            "description": "Ceiling on this campaign's simultaneous calls. Absent means the organization limit applies."
          },
          "reserved_for_other": {
            "type": "integer",
            "minimum": 0,
            "description": "Concurrency slots held back from this campaign for other traffic, such as inbound."
          },
          "board_id": {
            "type": "string",
            "format": "uuid",
            "description": "Analysis board rendered for this campaign, scoped to its calls."
          },
          "auto_resume_on_renewal": {
            "type": "boolean",
            "description": "Resume automatically once minutes come back after a `minutes_exhausted` pause."
          },
          "voicemail_action": {
            "$ref": "#/components/schemas/CampaignVoicemailAction"
          },
          "voicemail_message": {
            "type": "string"
          },
          "counters": {
            "$ref": "#/components/schemas/CampaignCounters"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "dncr": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DNCROptions"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "org_id",
          "name",
          "agent_id",
          "agent_name",
          "status",
          "reserved_for_other",
          "auto_resume_on_renewal",
          "voicemail_action",
          "counters",
          "created_at",
          "updated_at"
        ]
      },
      "CampaignListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Campaign"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "CampaignCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "A campaign is created as a draft, so only a name and a target — an agent (`agent_id`) or a group (`group_id`) — are required. A caller-ID source (`number_pool_id` or `phone_number_id`) is required to launch, not to create.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "description": {
            "type": "string",
            "maxLength": 2000
          },
          "agent_id": {
            "type": "string",
            "format": "uuid",
            "description": "Required unless group_id is given; setting both is rejected with 422 `conflict` on `group_id`."
          },
          "group_id": {
            "type": "string",
            "format": "uuid",
            "description": "Dial through a group of agents instead of one agent: the feeder picks one member per recipient. The group must have a member that can take calls now (422 on `group_id`: not_found, archived, no_members), and agent_version_id cannot be pinned. Requires the `groups` entitlement in addition to `campaigns`."
          },
          "agent_version_id": {
            "type": "string",
            "format": "uuid"
          },
          "number_pool_id": {
            "type": "string",
            "format": "uuid"
          },
          "phone_number_id": {
            "type": "string",
            "format": "uuid"
          },
          "trunk_id": {
            "type": "string",
            "format": "uuid"
          },
          "transport": {
            "$ref": "#/components/schemas/PhoneNumberTransport"
          },
          "start_at": {
            "type": "string",
            "format": "date-time"
          },
          "end_at": {
            "type": "string",
            "format": "date-time"
          },
          "policy_overrides": {
            "$ref": "#/components/schemas/OutboundPolicyOverrides"
          },
          "max_concurrent": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          },
          "reserved_for_other": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "board_id": {
            "type": "string",
            "format": "uuid"
          },
          "auto_resume_on_renewal": {
            "type": "boolean"
          },
          "voicemail_action": {
            "$ref": "#/components/schemas/CampaignVoicemailAction"
          },
          "voicemail_message": {
            "type": "string",
            "maxLength": 1000,
            "description": "Required when `voicemail_action` is `message`, and rejected otherwise."
          },
          "dncr": {
            "$ref": "#/components/schemas/DNCROptions"
          }
        },
        "required": [
          "name"
        ],
        "anyOf": [
          {
            "required": [
              "agent_id"
            ]
          },
          {
            "required": [
              "group_id"
            ]
          }
        ]
      },
      "CampaignUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Partial update, accepted only while the campaign is `draft` or `paused`. An explicit `null` clears a nullable field; an omitted field is left alone.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "agent_id": {
            "type": "string",
            "format": "uuid",
            "description": "Setting an agent moves a group campaign back to that single agent (clears group_id)."
          },
          "group_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Move the campaign onto a group (stores its first dispatchable member as the placeholder agent_id and drops a pinned agent_version_id), or null to stop dialing through the group — null must come with agent_id in the same request (422 `agent_required`). Pinning agent_version_id on a group campaign is rejected with 422 `unsupported_with_group`. Setting a group requires the `groups` entitlement."
          },
          "agent_version_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "number_pool_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "phone_number_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "trunk_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "transport": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PhoneNumberTransport"
              },
              {
                "type": "null"
              }
            ]
          },
          "start_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "end_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "policy_overrides": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/OutboundPolicyOverrides"
              },
              {
                "type": "null"
              }
            ]
          },
          "max_concurrent": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 1000
          },
          "reserved_for_other": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "board_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "auto_resume_on_renewal": {
            "type": "boolean"
          },
          "voicemail_action": {
            "$ref": "#/components/schemas/CampaignVoicemailAction"
          },
          "voicemail_message": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "dncr": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DNCROptions"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CampaignCloneRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Name for the clone. Omit to get \"<source name> (copy)\", uniquified."
          },
          "include_recipients": {
            "type": "boolean",
            "default": false,
            "description": "Copy the recipient list into the clone as fresh pending rows."
          }
        }
      },
      "CampaignRecipient": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "campaign_id": {
            "type": "string",
            "format": "uuid"
          },
          "row_number": {
            "type": "integer",
            "minimum": 1,
            "description": "Position in the uploaded file, so a row can be traced back to its source line."
          },
          "phone_e164": {
            "type": "string"
          },
          "contact_id": {
            "type": "string",
            "format": "uuid"
          },
          "variables": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Per-recipient prompt variables taken from the upload's non-phone columns."
          },
          "status": {
            "$ref": "#/components/schemas/CampaignRecipientStatus"
          },
          "exclusion_reason": {
            "type": "string",
            "description": "Why the row is excluded. Set at import to `duplicate`, `invalid_number`, or `invalid_variables`; set to `dncr_blocked` when the number was refused by the do-not-call register at dial time. Treat unknown values as opaque."
          },
          "job_id": {
            "type": "string",
            "format": "uuid",
            "description": "Outbound job created for this recipient, once fed."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "campaign_id",
          "row_number",
          "phone_e164",
          "variables",
          "status",
          "created_at",
          "updated_at"
        ]
      },
      "CampaignRecipientListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CampaignRecipient"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "CampaignRecipientImportMapping": {
        "type": "object",
        "additionalProperties": false,
        "description": "Steers how the uploaded columns become recipients. Sent as the `mapping` multipart part.",
        "properties": {
          "phone_column": {
            "type": "string",
            "description": "Header of the dial-target column. Optional when a conventional header can be inferred."
          },
          "variable_columns": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Renames source headers to prompt-variable names, keyed by header. Unlisted non-phone columns keep their header as the variable name."
          },
          "skip_invalid": {
            "type": "boolean",
            "default": false,
            "description": "Import past unusable rows, storing them as `excluded`, instead of rejecting the whole file."
          }
        }
      },
      "CampaignRecipientUpload": {
        "type": "object",
        "additionalProperties": false,
        "description": "Multipart upload body. At most 10 MiB in total.",
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "CSV or XLSX recipient list. The parser is chosen from the file content, not its name."
          },
          "mapping": {
            "$ref": "#/components/schemas/CampaignRecipientImportMapping"
          }
        },
        "required": [
          "file"
        ]
      },
      "CampaignRecipientRowIssue": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "row_number": {
            "type": "integer",
            "minimum": 1
          },
          "code": {
            "type": "string",
            "enum": [
              "duplicate",
              "invalid_number",
              "invalid_variables"
            ]
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "row_number",
          "code",
          "message"
        ]
      },
      "CampaignRecipientPreviewRow": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "row_number": {
            "type": "integer",
            "minimum": 1
          },
          "phone": {
            "type": "string"
          },
          "variables": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "issue": {
            "type": "string",
            "description": "Present when this sampled row would be excluded."
          }
        },
        "required": [
          "row_number",
          "phone",
          "variables"
        ]
      },
      "CampaignRecipientPreviewResponse": {
        "type": "object",
        "additionalProperties": false,
        "description": "What an import of the uploaded file would do. Nothing is stored.",
        "properties": {
          "headers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "phone_column": {
            "type": [
              "string",
              "null"
            ],
            "description": "The resolved dial-target column, or null when none could be inferred — supply `mapping.phone_column` and preview again."
          },
          "total_rows": {
            "type": "integer",
            "minimum": 0
          },
          "valid_rows": {
            "type": "integer",
            "minimum": 0
          },
          "invalid_rows": {
            "type": "integer",
            "minimum": 0
          },
          "duplicate_rows": {
            "type": "integer",
            "minimum": 0
          },
          "sample": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CampaignRecipientPreviewRow"
            },
            "description": "First rows of the file, for confirming the column mapping."
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CampaignRecipientRowIssue"
            },
            "description": "Problem rows, capped at 200 entries."
          },
          "issues_total": {
            "type": "integer",
            "minimum": 0,
            "description": "Total problem rows, which may exceed the reported `issues`."
          }
        },
        "required": [
          "headers",
          "phone_column",
          "total_rows",
          "valid_rows",
          "invalid_rows",
          "duplicate_rows",
          "sample",
          "issues",
          "issues_total"
        ]
      },
      "CampaignRecipientImportResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "campaign_id": {
            "type": "string",
            "format": "uuid"
          },
          "total_rows": {
            "type": "integer",
            "minimum": 0
          },
          "imported": {
            "type": "integer",
            "minimum": 0
          },
          "excluded": {
            "type": "integer",
            "minimum": 0
          },
          "counters": {
            "$ref": "#/components/schemas/CampaignCounters"
          }
        },
        "required": [
          "campaign_id",
          "total_rows",
          "imported",
          "excluded",
          "counters"
        ]
      },
      "ErrorCode": {
        "type": "string",
        "description": "Stable machine-readable error token. The top-level x-sonus-error-catalog extension defines allowed statuses, retry policy, details shape, and recovery guidance for every value.",
        "enum": [
          "agent_archived",
          "agent_baseline_too_large",
          "agent_capacity_exhausted",
          "agent_not_found",
          "agent_state_changed",
          "agent_version_not_found",
          "ai_connectors_disabled",
          "alert_limit_reached",
          "alert_not_found",
          "analysis_board_archived",
          "analysis_board_capacity_reached",
          "analysis_board_name_taken",
          "analysis_board_not_found",
          "analysis_export_failed",
          "analysis_insight_not_found",
          "analysis_result_too_large",
          "api_key_not_found",
          "api_key_product_mismatch",
          "audit_required",
          "authentication_rate_limited",
          "authentication_unavailable",
          "bad_request",
          "body_read_failed",
          "call_already_purged",
          "call_hangup_in_progress",
          "call_hangup_outcome_unknown",
          "call_hangup_provider_failed",
          "call_hangup_unavailable",
          "call_not_ended",
          "call_not_found",
          "call_not_live",
          "call_on_legal_hold",
          "call_processing_in_progress",
          "call_summary_not_found",
          "calls_disabled",
          "campaign_no_recipients",
          "campaign_not_found",
          "campaign_recipient_not_found",
          "campaign_recipients_invalid",
          "campaign_state_invalid",
          "capacity_unavailable",
          "conflict",
          "connected_app_not_found",
          "contact_e164_conflict",
          "contact_not_found",
          "contact_number_mismatch",
          "contact_tag_name_conflict",
          "contact_tag_not_found",
          "context_delivery_unconfigured",
          "context_encryption_failed",
          "credential_decryption_failed",
          "credential_encryption_failed",
          "credential_service_unavailable",
          "db_error",
          "delegation_not_allowed",
          "dncr_blocked",
          "dncr_configuration_invalid",
          "dncr_enforced",
          "dncr_unavailable",
          "draft_not_promotable",
          "draft_state_changed",
          "duplicate_field",
          "duplicate_query_parameter",
          "empty_body",
          "encode_error",
          "encoding_failed",
          "entitlement_required",
          "entitlements_unavailable",
          "eval_call_not_found",
          "eval_check_archived",
          "eval_check_not_found",
          "eval_check_slug_taken",
          "eval_generation_job_not_found",
          "eval_run_not_cancelable",
          "eval_run_not_found",
          "eval_scenario_archived",
          "eval_scenario_not_found",
          "eval_scenario_slug_taken",
          "eval_suite_archived",
          "eval_suite_empty",
          "eval_suite_not_found",
          "eval_suite_slug_taken",
          "extraction_object_archived",
          "extraction_object_in_use",
          "extraction_object_managed_by_group",
          "extraction_object_name_taken",
          "extraction_object_not_found",
          "flow_archived",
          "flow_in_use",
          "flow_not_found",
          "flow_slug_taken",
          "forbidden",
          "group_archived",
          "group_in_use",
          "group_name_taken",
          "group_not_found",
          "guardrail_set_archived",
          "guardrail_set_in_use",
          "guardrail_set_not_found",
          "idempotency_capacity_exceeded",
          "idempotency_conflict",
          "idempotency_identity_unavailable",
          "idempotency_in_progress",
          "idempotency_key_required",
          "idempotency_misconfigured",
          "idempotency_persistence_failed",
          "idempotency_result_lost",
          "idempotency_result_unavailable",
          "idempotency_security_context_changed",
          "idempotency_unavailable",
          "inference_async_disabled",
          "inference_capacity_unavailable",
          "inference_concurrency_exhausted",
          "inference_content_expired",
          "inference_job_limit",
          "inference_model_not_found",
          "inference_model_unavailable",
          "inference_quota_exhausted",
          "inference_request_exists",
          "inference_result_not_ready",
          "inference_storage_unavailable",
          "inference_unsupported_timestamps",
          "inference_upload_expired",
          "inference_upstream_failed",
          "inference_voice_not_found",
          "internal",
          "internal_context_missing",
          "internal_error",
          "invalid_call_policy",
          "invalid_header",
          "invalid_idempotency_key",
          "invalid_json",
          "invalid_multipart",
          "invalid_outbound_policy",
          "invalid_path_parameter",
          "invalid_query_parameter",
          "invalid_range",
          "invalid_recipient_file",
          "invalid_request_id",
          "invalid_uuid",
          "kms_error",
          "knowledge_base_archived",
          "knowledge_base_in_use",
          "knowledge_base_not_found",
          "knowledge_base_slug_taken",
          "knowledge_document_not_found",
          "mcp_introspection_failed",
          "mcp_server_archived",
          "mcp_server_in_use",
          "mcp_server_not_found",
          "mcp_server_slug_taken",
          "member_already_exists",
          "member_invitation_accepted",
          "member_invitation_conflict",
          "member_invitation_not_found",
          "member_invitation_revoked",
          "member_last_owner",
          "member_not_found",
          "method_not_allowed",
          "minutes_quota_exhausted",
          "model_release_changed",
          "multiple_json_values",
          "name_taken",
          "no_agent_version",
          "no_draft",
          "no_mutable_draft",
          "no_observed_tool_state",
          "no_org",
          "no_production_version",
          "no_staging_version",
          "no_tx",
          "not_found",
          "number_in_use",
          "number_pool_not_found",
          "number_pool_unavailable",
          "number_taken",
          "operation_not_available",
          "organization_not_found",
          "outbound_capacity_profile_conflict",
          "outbound_capacity_profile_in_use",
          "outbound_capacity_profile_not_found",
          "outbound_destination_denied",
          "outbound_job_already_started",
          "outbound_job_not_found",
          "outbound_job_terminal",
          "outbound_number_pool_in_use",
          "outbound_number_pool_name_conflict",
          "outbound_number_pool_not_found",
          "payload_encoding_failed",
          "pcap_not_configured",
          "pcap_unavailable",
          "permission_escalation",
          "phone_number_archived",
          "phone_number_not_found",
          "phone_number_operation_in_progress",
          "phone_number_provisioning",
          "phone_number_unavailable",
          "pii_access_already_granted",
          "pii_access_approval_required",
          "pii_access_mode_unavailable",
          "pii_access_request_exists",
          "pii_access_request_not_actionable",
          "pii_access_request_not_found",
          "pii_access_request_requires_user",
          "pii_access_self_decision_forbidden",
          "precondition_failed",
          "preview_failed",
          "preview_unsupported",
          "pronunciation_table_archived",
          "pronunciation_table_in_use",
          "pronunciation_table_not_found",
          "protected_member",
          "provider_request_failed",
          "rate_limit_exceeded",
          "rate_limited",
          "reconciliation_service_unavailable",
          "recording_blob_missing",
          "recording_decryption_failed",
          "recording_failed",
          "recording_not_found",
          "recording_not_ready",
          "recording_storage_unavailable",
          "recording_unavailable",
          "referenced_resource_missing",
          "request_body_read_failed",
          "request_timeout",
          "request_too_large",
          "resource_changed",
          "response_buffer_failed",
          "role_in_use",
          "role_name_conflict",
          "role_name_reserved",
          "role_not_found",
          "route_mismatch",
          "scheduling_unconfigured",
          "secret_archived",
          "secret_encryption_failed",
          "secret_in_use",
          "secret_name_taken",
          "secret_not_found",
          "secret_resolution_failed",
          "sip_pcap_blob_missing",
          "sip_pcap_decryption_failed",
          "sip_pcap_failed",
          "sip_pcap_not_found",
          "sip_pcap_not_ready",
          "sip_pcap_storage_unavailable",
          "sip_trunk_archived",
          "sip_trunk_credentials_unavailable",
          "sip_trunk_in_use",
          "sip_trunk_not_found",
          "sip_trunk_operation_in_progress",
          "sip_trunk_provisioning",
          "slug_taken",
          "stored_data_invalid",
          "stored_policy_invalid",
          "system_role_immutable",
          "team_not_connected",
          "tool_archived",
          "tool_in_use",
          "tool_invocation_not_found",
          "tool_io_decryption_failed",
          "tool_io_decryption_unavailable",
          "tool_io_raw_not_found",
          "tool_not_found",
          "tool_slug_taken",
          "transcript_decryption_failed",
          "transcript_decryption_unavailable",
          "transcript_not_found",
          "transcript_raw_not_found",
          "transcription_output_invalid",
          "transfer_already_terminal",
          "transfer_cancel_outcome_unknown",
          "transfer_cancel_provider_failed",
          "transfer_cancel_unavailable",
          "transfer_not_found",
          "transport_mismatch",
          "trunk_busy",
          "trunk_not_active",
          "trunk_provider_not_ready",
          "turn_audio_expired",
          "turn_audio_not_found",
          "turn_audio_storage_unavailable",
          "turn_audio_unavailable",
          "twilio_inventory_unavailable",
          "twilio_native_unconfigured",
          "unauthorized",
          "unexpected_body",
          "unknown_query_parameter",
          "unsupported_media_type",
          "unsupported_transport",
          "validation_failed",
          "value_too_long",
          "version_locked",
          "webhook_archived",
          "webhook_delivery_in_progress",
          "webhook_delivery_not_found",
          "webhook_delivery_payload_invalid",
          "webhook_delivery_payload_missing",
          "webhook_in_use",
          "webhook_inactive",
          "webhook_missing",
          "webhook_name_taken",
          "webhook_not_found",
          "webhook_secret_encryption_failed",
          "webhook_secret_missing",
          "workspace_contract_unavailable",
          "workspace_not_found"
        ]
      },
      "DNCROptions": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "inherit",
              "enabled",
              "disabled"
            ]
          },
          "connection_id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DNCROrganizationPolicy": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "default_off",
              "default_on",
              "enforced"
            ]
          },
          "connection_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "mode"
        ]
      },
      "DNCRSnapshot": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "schema_version": {
            "type": "integer",
            "enum": [
              1
            ]
          },
          "requested": {
            "$ref": "#/components/schemas/DNCROptions"
          },
          "enabled": {
            "type": "boolean"
          },
          "enforced": {
            "type": "boolean"
          },
          "connection_id": {
            "type": "string",
            "format": "uuid"
          },
          "policy_version": {
            "type": "integer",
            "minimum": 0
          },
          "source": {
            "type": "string",
            "enum": [
              "organization",
              "override"
            ]
          }
        },
        "required": [
          "schema_version",
          "requested",
          "enabled",
          "enforced",
          "policy_version",
          "source"
        ],
        "description": "Server-owned scheduling snapshot. Current organization enforcement always takes precedence at dispatch. Legacy jobs with an empty snapshot inherit current policy."
      },
      "DNCRResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "decision": {
            "type": "string",
            "enum": [
              "allowed",
              "blocked",
              "disabled",
              "unavailable",
              "not_applicable"
            ]
          },
          "reason": {
            "type": "string"
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          },
          "connection_id": {
            "type": "string",
            "format": "uuid"
          },
          "credential_revision": {
            "type": "integer",
            "minimum": 1
          },
          "transaction_id": {
            "type": "string"
          },
          "policy": {
            "$ref": "#/components/schemas/DNCRSnapshot"
          },
          "detail": {
            "type": "string",
            "maxLength": 1025,
            "description": "Why a check was unavailable, in operator terms (the Kejue Voice limiter and its configured rate, or the provider request and HTTP status). Subscriber numbers are masked. Absent when the check completed."
          }
        },
        "required": [
          "decision",
          "reason",
          "checked_at",
          "policy"
        ]
      },
      "DNCRConnectionCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "endpoint": {
            "type": "string",
            "format": "uri",
            "default": "https://apihub.etisalat.ae:9443/etisalat/serviceapis/dncr/v0/check"
          },
          "token_endpoint": {
            "type": "string",
            "format": "uri",
            "default": "https://apihub.etisalat.ae:9443/etisalat/serviceapis/confidential/oauth2/token"
          },
          "requests_per_minute": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000,
            "default": 5,
            "description": "Kejue Voice admission ceiling shared by all checks on this connection. Both minute and second limits apply."
          },
          "requests_per_second": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "default": 0,
            "description": "Additional sliding one-second ceiling shared across replicas. Zero disables this ceiling. Configure from the verified provider subscription; this does not track its monthly allowance."
          },
          "client_id": {
            "type": "string",
            "maxLength": 4096,
            "writeOnly": true,
            "description": "Omit on PATCH to retain the stored value. Optional user credentials are stored for provisioning; DNCR v0 authenticates with client credentials."
          },
          "client_secret": {
            "type": "string",
            "maxLength": 4096,
            "writeOnly": true,
            "description": "Omit on PATCH to retain the stored value. Optional user credentials are stored for provisioning; DNCR v0 authenticates with client credentials."
          },
          "user_id": {
            "type": "string",
            "maxLength": 4096,
            "writeOnly": true,
            "description": "Omit on PATCH to retain the stored value. Optional user credentials are stored for provisioning; DNCR v0 authenticates with client credentials."
          },
          "password": {
            "type": "string",
            "maxLength": 4096,
            "writeOnly": true,
            "description": "Omit on PATCH to retain the stored value. Optional user credentials are stored for provisioning; DNCR v0 authenticates with client credentials."
          }
        },
        "required": [
          "name",
          "client_id",
          "client_secret"
        ]
      },
      "DNCRConnectionUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "endpoint": {
            "type": "string",
            "format": "uri",
            "default": "https://apihub.etisalat.ae:9443/etisalat/serviceapis/dncr/v0/check"
          },
          "token_endpoint": {
            "type": "string",
            "format": "uri",
            "default": "https://apihub.etisalat.ae:9443/etisalat/serviceapis/confidential/oauth2/token"
          },
          "requests_per_minute": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000,
            "default": 5,
            "description": "Kejue Voice admission ceiling shared by all checks on this connection. Both minute and second limits apply."
          },
          "requests_per_second": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "default": 0,
            "description": "Additional sliding one-second ceiling shared across replicas. Zero disables this ceiling. Configure from the verified provider subscription; this does not track its monthly allowance."
          },
          "client_id": {
            "type": "string",
            "maxLength": 4096,
            "writeOnly": true,
            "description": "Omit on PATCH to retain the stored value. Optional user credentials are stored for provisioning; DNCR v0 authenticates with client credentials."
          },
          "client_secret": {
            "type": "string",
            "maxLength": 4096,
            "writeOnly": true,
            "description": "Omit on PATCH to retain the stored value. Optional user credentials are stored for provisioning; DNCR v0 authenticates with client credentials."
          },
          "user_id": {
            "type": "string",
            "maxLength": 4096,
            "writeOnly": true,
            "description": "Omit on PATCH to retain the stored value. Optional user credentials are stored for provisioning; DNCR v0 authenticates with client credentials."
          },
          "password": {
            "type": "string",
            "maxLength": 4096,
            "writeOnly": true,
            "description": "Omit on PATCH to retain the stored value. Optional user credentials are stored for provisioning; DNCR v0 authenticates with client credentials."
          }
        },
        "minProperties": 1
      },
      "DNCRConnection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "endpoint": {
            "type": "string",
            "format": "uri",
            "default": "https://apihub.etisalat.ae:9443/etisalat/serviceapis/dncr/v0/check"
          },
          "token_endpoint": {
            "type": "string",
            "format": "uri",
            "default": "https://apihub.etisalat.ae:9443/etisalat/serviceapis/confidential/oauth2/token"
          },
          "requests_per_minute": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000,
            "default": 5,
            "description": "Kejue Voice admission ceiling shared by all checks on this connection. Both minute and second limits apply."
          },
          "requests_per_second": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "default": 0,
            "description": "Additional sliding one-second ceiling shared across replicas. Zero disables this ceiling. Configure from the verified provider subscription; this does not track its monthly allowance."
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "configured_fields": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "client_id",
                "client_secret",
                "user_id",
                "password"
              ]
            }
          },
          "credential_revision": {
            "type": "integer",
            "minimum": 1
          },
          "resource_version": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "name",
          "endpoint",
          "token_endpoint",
          "requests_per_minute",
          "id",
          "configured_fields",
          "credential_revision",
          "resource_version",
          "created_at",
          "updated_at",
          "archived_at"
        ]
      },
      "DNCRConnectionListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DNCRConnection"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "DNCRConnectionTestRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "to_number": {
            "type": "string",
            "description": "UAE phone number, in +971 or local 0 format."
          }
        },
        "required": [
          "to_number"
        ]
      },
      "ResolveDateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "timezone"
        ],
        "properties": {
          "timezone": {
            "type": "string",
            "minLength": 1,
            "description": "IANA timezone, e.g. Asia/Dubai or America/New_York. Required; no phone-number or server-local inference."
          },
          "reference_date": {
            "type": "string",
            "format": "date",
            "description": "Optional arithmetic anchor, Gregorian YYYY-MM-DD. Defaults to local today."
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Explicit valid Gregorian date. Mutually exclusive with date components."
          },
          "day_of_month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 31
          },
          "month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "description": "Requires day_of_month."
          },
          "year": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9999,
            "description": "Requires month and day_of_month."
          },
          "weekday": {
            "type": "string",
            "enum": [
              "monday",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday",
              "sunday"
            ],
            "description": "Anchor weekday, or a weekday claim to validate against an explicit date."
          },
          "occurrence": {
            "type": "string",
            "enum": [
              "next",
              "on_or_after",
              "previous",
              "on_or_before",
              "this_week",
              "next_week",
              "last_week"
            ],
            "description": "Only for a weekday anchor. Defaults to next, or previous when direction is past."
          },
          "direction": {
            "type": "string",
            "enum": [
              "future",
              "past"
            ],
            "default": "future",
            "description": "Direction for incomplete calendar dates and bare weekdays. Does not override an explicit year/date or occurrence."
          },
          "days": {
            "type": "integer",
            "minimum": -36600,
            "maximum": 36600,
            "default": 0
          },
          "weeks": {
            "type": "integer",
            "minimum": -5200,
            "maximum": 5200,
            "default": 0
          },
          "months": {
            "type": "integer",
            "minimum": -1200,
            "maximum": 1200,
            "default": 0
          },
          "week_starts_on": {
            "type": "string",
            "enum": [
              "monday",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday",
              "sunday"
            ],
            "default": "monday"
          },
          "locale": {
            "type": "string",
            "enum": [
              "en-US",
              "ar-SA"
            ],
            "default": "en-US",
            "description": "Spoken-date formatting only. The calendar remains Gregorian."
          }
        }
      },
      "ResolveDateResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "resolved_date",
          "weekday",
          "today",
          "reference_date",
          "timezone",
          "timezone_source",
          "days_from_today",
          "is_past",
          "date_spoken",
          "adjustments"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "resolved",
              "weekday_mismatch"
            ]
          },
          "resolved_date": {
            "type": "string",
            "format": "date"
          },
          "weekday": {
            "type": "string",
            "enum": [
              "monday",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday",
              "sunday"
            ]
          },
          "today": {
            "type": "string",
            "format": "date"
          },
          "reference_date": {
            "type": "string",
            "format": "date"
          },
          "timezone": {
            "type": "string"
          },
          "timezone_source": {
            "type": "string",
            "enum": [
              "request",
              "organization",
              "configuration",
              "caller",
              "agent"
            ]
          },
          "days_from_today": {
            "type": "integer"
          },
          "is_past": {
            "type": "boolean"
          },
          "date_spoken": {
            "type": "string"
          },
          "adjustments": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "month_end_clamped"
              ]
            }
          },
          "expected_weekday": {
            "type": "string",
            "enum": [
              "monday",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday",
              "sunday"
            ]
          },
          "question": {
            "type": "string"
          }
        }
      },
      "AgentBehaviorResolveDate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Opt-in date calculator; no catalog tool ID or external credentials. An attached catalog tool named resolve_date conflicts and must be detached before enabling. A calculation clears last-result slots, then a successful result writes resolve_date_date, resolve_date_timezone and resolve_date_spoken for exact chaining.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "default": false
          },
          "timezone_mode": {
            "type": "string",
            "enum": [
              "organization",
              "custom",
              "caller",
              "agent"
            ],
            "default": "organization",
            "description": "organization uses the workspace default. custom requires timezone. caller uses vars.lead_timezone, otherwise the workspace default; an invalid provided zone fails. agent exposes a REQUIRED timezone argument to the model: ask the caller for an unambiguous location/IANA zone, never guess or infer from their phone number."
          },
          "timezone": {
            "type": "string",
            "minLength": 1,
            "description": "IANA timezone required for custom mode."
          },
          "week_starts_on": {
            "type": "string",
            "enum": [
              "monday",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday",
              "sunday"
            ],
            "default": "monday"
          },
          "locale": {
            "type": "string",
            "enum": [
              "en-US",
              "ar-SA"
            ],
            "default": "en-US",
            "description": "Spoken-date formatting only. The calendar remains Gregorian."
          }
        }
      }
    }
  },
  "x-sonus-error-registry-version": 1,
  "x-kejue-error-registry-version": 1,
  "x-sonus-error-catalog": [
    {
      "code": "agent_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of agent archived."
    },
    {
      "code": "agent_baseline_too_large",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "polymorphic_object",
      "description": "The request is syntactically valid but cannot be applied because of agent baseline too large."
    },
    {
      "code": "agent_capacity_exhausted",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "No agent worker has a free dispatch slot for a new call right now; retry after the Retry-After interval while autoscaling adds capacity."
    },
    {
      "code": "agent_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested agent does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "agent_state_changed",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of agent state changed."
    },
    {
      "code": "agent_version_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested agent version does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "ai_connectors_disabled",
      "statuses": [
        403
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "AI assistant access (connected apps) is turned off for this team. A team admin can enable it with PATCH /v1/orgs/current {\"ai_connectors\": \"enabled\"}."
    },
    {
      "code": "alert_limit_reached",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The operation conflicts with current resource state because of alert limit reached."
    },
    {
      "code": "alert_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested alert does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "analysis_board_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of analysis board archived."
    },
    {
      "code": "analysis_board_capacity_reached",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of analysis board capacity reached."
    },
    {
      "code": "analysis_board_name_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of analysis board name taken."
    },
    {
      "code": "analysis_board_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested analysis board does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "analysis_export_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of analysis export failed; retain request_id for support correlation."
    },
    {
      "code": "analysis_insight_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested analysis insight does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "analysis_result_too_large",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "polymorphic_object",
      "description": "The request is syntactically valid but cannot be applied because of analysis result too large."
    },
    {
      "code": "api_key_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested API key does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "api_key_product_mismatch",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "none",
      "description": "This key belongs to a different product. Use an Inference key for Inference endpoints and a Voice key for Voice endpoints."
    },
    {
      "code": "audit_required",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of audit required; retain request_id for support correlation."
    },
    {
      "code": "authentication_rate_limited",
      "statuses": [
        429
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "The caller exceeded an enforced limit; wait for Retry-After before retrying."
    },
    {
      "code": "authentication_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of authentication unavailable; follow the registry retry policy."
    },
    {
      "code": "bad_request",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of bad request; correct the request before retrying."
    },
    {
      "code": "body_read_failed",
      "statuses": [
        400
      ],
      "retry": "safe",
      "details": "none",
      "description": "The request was rejected because of body read failed; correct the request before retrying."
    },
    {
      "code": "call_already_purged",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of call already purged."
    },
    {
      "code": "call_hangup_in_progress",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of call hangup in progress."
    },
    {
      "code": "call_hangup_outcome_unknown",
      "statuses": [
        504
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "An upstream operation timed out; use details.retryable to decide whether to retry."
    },
    {
      "code": "call_hangup_provider_failed",
      "statuses": [
        502
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "An upstream provider request failed; use details.retryable to decide whether to retry."
    },
    {
      "code": "call_hangup_unavailable",
      "statuses": [
        503
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "A required service is unavailable because of call hangup unavailable; follow the registry retry policy."
    },
    {
      "code": "call_not_ended",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of call not ended."
    },
    {
      "code": "call_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested call does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "call_not_live",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of call not live."
    },
    {
      "code": "call_on_legal_hold",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of call on legal hold."
    },
    {
      "code": "call_processing_in_progress",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of call processing in progress."
    },
    {
      "code": "call_summary_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested call summary does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "calls_disabled",
      "statuses": [
        403,
        503
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "Call activity is switched off for this tenant by a Kejue Voice operator; details.scope names the tier (platform, account or org) and details.reason carries the operator's note. Calls already in progress are unaffected. Retrying will not succeed until the switch is lifted."
    },
    {
      "code": "campaign_no_recipients",
      "statuses": [
        422
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The campaign has no pending recipients to dial; import a recipient list before launching."
    },
    {
      "code": "campaign_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested campaign does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "campaign_recipient_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested campaign recipient does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "campaign_recipients_invalid",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The uploaded recipient file contains rows that cannot be imported (invalid numbers, duplicates, or bad variables). Fix the listed rows, or set mapping.skip_invalid to import past them as excluded rows. details carries the per-row report."
    },
    {
      "code": "campaign_state_invalid",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The campaign is not in a lifecycle state this operation applies to; details carries the current and required status."
    },
    {
      "code": "capacity_unavailable",
      "statuses": [
        503
      ],
      "retry": "safe",
      "details": "none",
      "description": "A required service is unavailable because of capacity unavailable; follow the registry retry policy."
    },
    {
      "code": "conflict",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of conflict."
    },
    {
      "code": "connected_app_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested connected app does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "contact_e164_conflict",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of contact e164 conflict."
    },
    {
      "code": "contact_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested contact does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "contact_number_mismatch",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The request is syntactically valid but cannot be applied because of contact number mismatch."
    },
    {
      "code": "contact_tag_name_conflict",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of contact tag name conflict."
    },
    {
      "code": "contact_tag_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested contact tag does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "context_delivery_unconfigured",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "A required service is unavailable because of context delivery unconfigured; follow the registry retry policy."
    },
    {
      "code": "context_encryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of context encryption failed; retain request_id for support correlation."
    },
    {
      "code": "credential_decryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of credential decryption failed; retain request_id for support correlation."
    },
    {
      "code": "credential_encryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of credential encryption failed; retain request_id for support correlation."
    },
    {
      "code": "credential_service_unavailable",
      "statuses": [
        503
      ],
      "retry": "safe",
      "details": "none",
      "description": "A required service is unavailable because of credential service unavailable; follow the registry retry policy."
    },
    {
      "code": "db_error",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of db error; retain request_id for support correlation."
    },
    {
      "code": "delegation_not_allowed",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "none",
      "description": "The authenticated caller is not allowed to complete the operation because of delegation not allowed."
    },
    {
      "code": "dncr_blocked",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "none",
      "description": "The authenticated caller is not allowed to complete the operation because of dncr blocked."
    },
    {
      "code": "dncr_configuration_invalid",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of dncr configuration invalid; follow the registry retry policy."
    },
    {
      "code": "dncr_enforced",
      "statuses": [
        403
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The authenticated caller is not allowed to complete the operation because of dncr enforced."
    },
    {
      "code": "dncr_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of dncr unavailable; follow the registry retry policy."
    },
    {
      "code": "draft_not_promotable",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of draft not promotable."
    },
    {
      "code": "draft_state_changed",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of draft state changed."
    },
    {
      "code": "duplicate_field",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The request was rejected because of duplicate field; correct the request before retrying."
    },
    {
      "code": "duplicate_query_parameter",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "parameter",
      "description": "The request was rejected because of duplicate query parameter; correct the request before retrying."
    },
    {
      "code": "empty_body",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of empty body; correct the request before retrying."
    },
    {
      "code": "encode_error",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of encode error; retain request_id for support correlation."
    },
    {
      "code": "encoding_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of encoding failed; retain request_id for support correlation."
    },
    {
      "code": "entitlement_required",
      "statuses": [
        403
      ],
      "retry": "after_state_change",
      "details": "entitlement_feature",
      "description": "The authenticated caller is not allowed to complete the operation because of entitlement required."
    },
    {
      "code": "entitlements_unavailable",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of entitlements unavailable; retain request_id for support correlation."
    },
    {
      "code": "eval_call_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested eval call does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "eval_check_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of eval check archived."
    },
    {
      "code": "eval_check_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested eval check does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "eval_check_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of eval check slug taken."
    },
    {
      "code": "eval_generation_job_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested eval generation job does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "eval_run_not_cancelable",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of eval run not cancelable."
    },
    {
      "code": "eval_run_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested eval run does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "eval_scenario_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of eval scenario archived."
    },
    {
      "code": "eval_scenario_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested eval scenario does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "eval_scenario_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of eval scenario slug taken."
    },
    {
      "code": "eval_suite_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of eval suite archived."
    },
    {
      "code": "eval_suite_empty",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of eval suite empty."
    },
    {
      "code": "eval_suite_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested eval suite does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "eval_suite_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of eval suite slug taken."
    },
    {
      "code": "extraction_object_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of extraction object archived."
    },
    {
      "code": "extraction_object_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of extraction object in use."
    },
    {
      "code": "extraction_object_managed_by_group",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The extraction object is owned by a group and can only be changed through /v1/groups."
    },
    {
      "code": "extraction_object_name_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of extraction object name taken."
    },
    {
      "code": "extraction_object_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested extraction object does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "flow_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of flow archived."
    },
    {
      "code": "flow_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The flow is still assigned to at least one live phone number and cannot be archived; details.phone_numbers lists the E.164 numbers to re-point first."
    },
    {
      "code": "flow_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested flow does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "flow_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of flow slug taken."
    },
    {
      "code": "forbidden",
      "statuses": [
        403
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The authenticated caller is not allowed to complete the operation because of forbidden."
    },
    {
      "code": "group_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of group archived."
    },
    {
      "code": "group_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The group is still used by at least one live phone number or campaign and cannot be archived; details.phone_numbers and details.campaigns list what to re-point first."
    },
    {
      "code": "group_name_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of group name taken."
    },
    {
      "code": "group_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested group does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "guardrail_set_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of guardrail set archived."
    },
    {
      "code": "guardrail_set_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of guardrail set in use."
    },
    {
      "code": "guardrail_set_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested guardrail set does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "idempotency_capacity_exceeded",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of idempotency capacity exceeded; follow the registry retry policy."
    },
    {
      "code": "idempotency_conflict",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "idempotency",
      "description": "The idempotency key was already used for a request with a different canonical method, path, body, precondition, or security context."
    },
    {
      "code": "idempotency_identity_unavailable",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of idempotency identity unavailable; retain request_id for support correlation."
    },
    {
      "code": "idempotency_in_progress",
      "statuses": [
        409
      ],
      "retry": "after_retry_after",
      "details": "idempotency",
      "description": "An equivalent request with this idempotency key is still running; wait for Retry-After before replaying it."
    },
    {
      "code": "idempotency_key_required",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "idempotency",
      "description": "The request was rejected because of idempotency key required; correct the request before retrying."
    },
    {
      "code": "idempotency_misconfigured",
      "statuses": [
        500
      ],
      "retry": "never",
      "details": "none",
      "description": "The server detected idempotency misconfigured; retrying the same request cannot correct the stored or deployment state."
    },
    {
      "code": "idempotency_persistence_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of idempotency persistence failed; retain request_id for support correlation."
    },
    {
      "code": "idempotency_result_lost",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "idempotency",
      "description": "The operation reached a terminal state but its replay payload is unavailable; inspect the target resource instead of repeating the mutation."
    },
    {
      "code": "idempotency_result_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of idempotency result unavailable; follow the registry retry policy."
    },
    {
      "code": "idempotency_security_context_changed",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "idempotency",
      "description": "The idempotency key belongs to a different actor, permission set, or tenant security context."
    },
    {
      "code": "idempotency_unavailable",
      "statuses": [
        500,
        503
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of idempotency unavailable; retain request_id for support correlation."
    },
    {
      "code": "inference_async_disabled",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "New asynchronous transcription work is temporarily disabled. Existing job status, retained results, cancellation and deletion remain available. Retry when admission is enabled."
    },
    {
      "code": "inference_capacity_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The model could not accept this request. Inspect request status and retry with a new request identity when capacity recovers."
    },
    {
      "code": "inference_concurrency_exhausted",
      "statuses": [
        429
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "The workspace has reached its Inference concurrency limit. Retry after Retry-After."
    },
    {
      "code": "inference_content_expired",
      "statuses": [
        410
      ],
      "retry": "never",
      "details": "none",
      "description": "Transcription content expired or was deleted. Billing and job metadata remain, but the audio and transcript cannot be retrieved."
    },
    {
      "code": "inference_job_limit",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The workspace reached its outstanding asynchronous job, upload, or byte budget. Complete or delete existing work before submitting more."
    },
    {
      "code": "inference_model_not_found",
      "statuses": [
        404
      ],
      "retry": "never",
      "details": "none",
      "description": "No model with this name and modality is published to the workspace. List names with GET /inference/models."
    },
    {
      "code": "inference_model_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The model is published but has no available capacity right now. Retry later or ask an administrator."
    },
    {
      "code": "inference_quota_exhausted",
      "statuses": [
        402
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The workspace has insufficient credit for this modality: input characters for text to speech, audio minutes for speech to text. Add credit or wait for its next monthly grant."
    },
    {
      "code": "inference_request_exists",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "none",
      "description": "This Idempotency-Key already identifies a request. No new computation was started. Inspect request history; audio is never replayed."
    },
    {
      "code": "inference_result_not_ready",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "No committed transcription output is available yet. Poll job status with backoff before requesting its result."
    },
    {
      "code": "inference_storage_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "Transcription storage is temporarily unavailable. Retry the same logical operation with its original idempotency key."
    },
    {
      "code": "inference_unsupported_timestamps",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "This model does not support the requested timestamp granularity and language. Choose a combination advertised by GET /inference/models."
    },
    {
      "code": "inference_upload_expired",
      "statuses": [
        410
      ],
      "retry": "never",
      "details": "none",
      "description": "This upload expired. Start a new upload with a new idempotency key; expired source objects and multipart parts are cleaned up."
    },
    {
      "code": "inference_upstream_failed",
      "statuses": [
        502
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The model did not complete a valid response. Inspect request status before deciding to start another request."
    },
    {
      "code": "inference_voice_not_found",
      "statuses": [
        404
      ],
      "retry": "never",
      "details": "none",
      "description": "The voice is not approved for this model. List approved voices with GET /inference/voices."
    },
    {
      "code": "internal",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of internal; retain request_id for support correlation."
    },
    {
      "code": "internal_context_missing",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of internal context missing; retain request_id for support correlation."
    },
    {
      "code": "internal_error",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation; retain the request_id and retry only with the same idempotency key when applicable."
    },
    {
      "code": "invalid_call_policy",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request is syntactically valid but cannot be applied because of invalid call policy."
    },
    {
      "code": "invalid_header",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "header",
      "description": "The request was rejected because of invalid header; correct the request before retrying."
    },
    {
      "code": "invalid_idempotency_key",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of invalid idempotency key; correct the request before retrying."
    },
    {
      "code": "invalid_json",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The request was rejected because of invalid json; correct the request before retrying."
    },
    {
      "code": "invalid_multipart",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of invalid multipart; correct the request before retrying."
    },
    {
      "code": "invalid_outbound_policy",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "validation_fields",
      "description": "The request is syntactically valid but cannot be applied because of invalid outbound policy."
    },
    {
      "code": "invalid_path_parameter",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "parameter",
      "description": "The request was rejected because of invalid path parameter; correct the request before retrying."
    },
    {
      "code": "invalid_query_parameter",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "parameter",
      "description": "The request was rejected because of invalid query parameter; correct the request before retrying."
    },
    {
      "code": "invalid_range",
      "statuses": [
        416
      ],
      "retry": "after_correction",
      "details": "polymorphic_object",
      "description": "The requested byte range is invalid for the selected artifact."
    },
    {
      "code": "invalid_recipient_file",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The uploaded recipient file could not be parsed (not UTF-8, not valid CSV, or missing a header/data rows); the message names the first problem found."
    },
    {
      "code": "invalid_request_id",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "header",
      "description": "The request was rejected because of invalid request id; correct the request before retrying."
    },
    {
      "code": "invalid_uuid",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of invalid uuid; correct the request before retrying."
    },
    {
      "code": "kms_error",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of kms error; retain request_id for support correlation."
    },
    {
      "code": "knowledge_base_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of knowledge base archived."
    },
    {
      "code": "knowledge_base_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of knowledge base in use."
    },
    {
      "code": "knowledge_base_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested knowledge base does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "knowledge_base_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of knowledge base slug taken."
    },
    {
      "code": "knowledge_document_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested knowledge document does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "mcp_introspection_failed",
      "statuses": [
        409,
        500,
        502,
        504
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "The operation conflicts with current resource state because of mcp introspection failed."
    },
    {
      "code": "mcp_server_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of mcp server archived."
    },
    {
      "code": "mcp_server_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of mcp server in use."
    },
    {
      "code": "mcp_server_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested MCP server does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "mcp_server_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of mcp server slug taken."
    },
    {
      "code": "member_already_exists",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of member already exists."
    },
    {
      "code": "member_invitation_accepted",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of member invitation accepted."
    },
    {
      "code": "member_invitation_conflict",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of member invitation conflict."
    },
    {
      "code": "member_invitation_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested member invitation does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "member_invitation_revoked",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of member invitation revoked."
    },
    {
      "code": "member_last_owner",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of member last owner."
    },
    {
      "code": "member_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested member does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "method_not_allowed",
      "statuses": [
        405
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The route exists, but it does not support the requested HTTP method."
    },
    {
      "code": "minutes_quota_exhausted",
      "statuses": [
        429
      ],
      "retry": "after_retry_after",
      "details": "optional_object",
      "description": "The tenant has used its included call minutes for the current billing cycle. Calls already in progress are unaffected; new calls resume when the cycle rolls over or an operator grants more minutes. details.cycle_end is when the allowance resets."
    },
    {
      "code": "model_release_changed",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The transcription model release changed. Internal batch processing waits for the job's pinned release to become available."
    },
    {
      "code": "multiple_json_values",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of multiple json values; correct the request before retrying."
    },
    {
      "code": "name_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of name taken."
    },
    {
      "code": "no_agent_version",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of no agent version."
    },
    {
      "code": "no_draft",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of no draft."
    },
    {
      "code": "no_mutable_draft",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of no mutable draft."
    },
    {
      "code": "no_observed_tool_state",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of no observed tool state."
    },
    {
      "code": "no_org",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of no org; retain request_id for support correlation."
    },
    {
      "code": "no_production_version",
      "statuses": [
        422
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The request is syntactically valid but cannot be applied because of no production version."
    },
    {
      "code": "no_staging_version",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of no staging version."
    },
    {
      "code": "no_tx",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of no tx; retain request_id for support correlation."
    },
    {
      "code": "not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested route or resource does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "number_in_use",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of number in use."
    },
    {
      "code": "number_pool_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested outbound number pool does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "number_pool_unavailable",
      "statuses": [
        422
      ],
      "retry": "after_state_change",
      "details": "parameter",
      "description": "The request is syntactically valid but cannot be applied because of number pool unavailable."
    },
    {
      "code": "number_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of number taken."
    },
    {
      "code": "operation_not_available",
      "statuses": [
        404
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "The route exists for an internal or browser workflow but is not part of the reviewed public API."
    },
    {
      "code": "organization_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested organization does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "outbound_capacity_profile_conflict",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of outbound capacity profile conflict."
    },
    {
      "code": "outbound_capacity_profile_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of outbound capacity profile in use."
    },
    {
      "code": "outbound_capacity_profile_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested outbound capacity profile does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "outbound_destination_denied",
      "statuses": [
        403
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The SIP trunk's outbound allowlist does not permit this destination; add its prefix or SIP host to the trunk's allowed destinations."
    },
    {
      "code": "outbound_job_already_started",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of outbound job already started."
    },
    {
      "code": "outbound_job_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested outbound job does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "outbound_job_terminal",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of outbound job terminal."
    },
    {
      "code": "outbound_number_pool_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of outbound number pool in use."
    },
    {
      "code": "outbound_number_pool_name_conflict",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of outbound number pool name conflict."
    },
    {
      "code": "outbound_number_pool_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested outbound number pool does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "payload_encoding_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of payload encoding failed; retain request_id for support correlation."
    },
    {
      "code": "pcap_not_configured",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "A required service is unavailable because of pcap not configured; follow the registry retry policy."
    },
    {
      "code": "pcap_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of pcap unavailable; follow the registry retry policy."
    },
    {
      "code": "permission_escalation",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "polymorphic_object",
      "description": "The authenticated caller is not allowed to complete the operation because of permission escalation."
    },
    {
      "code": "phone_number_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of phone number archived."
    },
    {
      "code": "phone_number_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested phone number does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "phone_number_operation_in_progress",
      "statuses": [
        409
      ],
      "retry": "after_retry_after",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of phone number operation in progress."
    },
    {
      "code": "phone_number_provisioning",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of phone number provisioning."
    },
    {
      "code": "phone_number_unavailable",
      "statuses": [
        422
      ],
      "retry": "after_state_change",
      "details": "parameter",
      "description": "The request is syntactically valid but cannot be applied because of phone number unavailable."
    },
    {
      "code": "pii_access_already_granted",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "You already hold approved access to this call, so there is nothing to request. details carries the granting request_id."
    },
    {
      "code": "pii_access_approval_required",
      "statuses": [
        403
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "This workspace requires an approved break-glass request before sensitive call or transcription data can be read. Raise one in the dashboard (Settings → Access requests) and retry once it is approved."
    },
    {
      "code": "pii_access_mode_unavailable",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of pii access mode unavailable; retain request_id for support correlation."
    },
    {
      "code": "pii_access_request_exists",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "A request for this call from this user is already awaiting a decision. details carries its request_id."
    },
    {
      "code": "pii_access_request_not_actionable",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "The request is no longer in a state this decision applies to — only a pending request can be approved or rejected, and only a live approval can be revoked. details carries the current and required status."
    },
    {
      "code": "pii_access_request_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested break-glass access request does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "pii_access_request_requires_user",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "none",
      "description": "Break-glass requests must be raised by a signed-in user. An API key cannot be notified or approved, so keys holding pii-access:unmask supply a reason instead."
    },
    {
      "code": "pii_access_self_decision_forbidden",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "Approving your own request for sensitive data is not review. Another holder of pii-access:approve must decide it. Permitted only when the requester is the workspace's sole approver, where the request would otherwise be undecidable."
    },
    {
      "code": "precondition_failed",
      "statuses": [
        412
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The supplied conditional request no longer matches current resource state; fetch the latest ETag before retrying."
    },
    {
      "code": "preview_failed",
      "statuses": [
        502
      ],
      "retry": "safe",
      "details": "none",
      "description": "The TTS provider could not synthesize the preview clip. The table itself is unaffected and can still be saved; retry the preview or pick another voice."
    },
    {
      "code": "preview_unsupported",
      "statuses": [
        501
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "The selected voice does not support pronunciation preview audio yet. Pick another voice to hear the table; the table can still be saved."
    },
    {
      "code": "pronunciation_table_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of pronunciation table archived."
    },
    {
      "code": "pronunciation_table_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of pronunciation table in use."
    },
    {
      "code": "pronunciation_table_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested pronunciation table does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "protected_member",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "The membership belongs to the platform's protected owner account, which can never be removed or moved off the owner role through the API."
    },
    {
      "code": "provider_request_failed",
      "statuses": [
        502
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "An upstream provider request failed; use details.retryable to decide whether to retry."
    },
    {
      "code": "rate_limit_exceeded",
      "statuses": [
        429
      ],
      "retry": "after_retry_after",
      "details": "rate_limit",
      "description": "The caller exceeded an enforced limit; wait for Retry-After before retrying."
    },
    {
      "code": "rate_limited",
      "statuses": [
        429
      ],
      "retry": "after_retry_after",
      "details": "rate_limit",
      "description": "The caller exceeded an enforced limit; wait for Retry-After before retrying."
    },
    {
      "code": "reconciliation_service_unavailable",
      "statuses": [
        503
      ],
      "retry": "safe",
      "details": "none",
      "description": "A required service is unavailable because of reconciliation service unavailable; follow the registry retry policy."
    },
    {
      "code": "recording_blob_missing",
      "statuses": [
        410
      ],
      "retry": "never",
      "details": "none",
      "description": "The requested artifact is no longer retained because of recording blob missing."
    },
    {
      "code": "recording_decryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of recording decryption failed; retain request_id for support correlation."
    },
    {
      "code": "recording_failed",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of recording failed."
    },
    {
      "code": "recording_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested recording does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "recording_not_ready",
      "statuses": [
        409
      ],
      "retry": "after_retry_after",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of recording not ready."
    },
    {
      "code": "recording_storage_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of recording storage unavailable; follow the registry retry policy."
    },
    {
      "code": "recording_unavailable",
      "statuses": [
        503
      ],
      "retry": "safe",
      "details": "none",
      "description": "A required service is unavailable because of recording unavailable; follow the registry retry policy."
    },
    {
      "code": "referenced_resource_missing",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request is syntactically valid but cannot be applied because of referenced resource missing."
    },
    {
      "code": "request_body_read_failed",
      "statuses": [
        400
      ],
      "retry": "safe",
      "details": "none",
      "description": "The request was rejected because of request body read failed; correct the request before retrying."
    },
    {
      "code": "request_timeout",
      "statuses": [
        408
      ],
      "retry": "safe",
      "details": "none",
      "description": "The request body did not arrive before the server deadline; send a complete bounded body and retry."
    },
    {
      "code": "request_too_large",
      "statuses": [
        413
      ],
      "retry": "after_correction",
      "details": "polymorphic_object",
      "description": "The encoded request exceeds the endpoint limit; reduce it before retrying."
    },
    {
      "code": "resource_changed",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of resource changed."
    },
    {
      "code": "response_buffer_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of response buffer failed; retain request_id for support correlation."
    },
    {
      "code": "role_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of role in use."
    },
    {
      "code": "role_name_conflict",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of role name conflict."
    },
    {
      "code": "role_name_reserved",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of role name reserved."
    },
    {
      "code": "role_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested role does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "route_mismatch",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "parameter",
      "description": "The request is syntactically valid but cannot be applied because of route mismatch."
    },
    {
      "code": "scheduling_unconfigured",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "A required service is unavailable because of scheduling unconfigured; follow the registry retry policy."
    },
    {
      "code": "secret_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of secret archived."
    },
    {
      "code": "secret_encryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of secret encryption failed; retain request_id for support correlation."
    },
    {
      "code": "secret_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of secret in use."
    },
    {
      "code": "secret_name_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of secret name taken."
    },
    {
      "code": "secret_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested secret does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "secret_resolution_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of secret resolution failed; retain request_id for support correlation."
    },
    {
      "code": "sip_pcap_blob_missing",
      "statuses": [
        410
      ],
      "retry": "never",
      "details": "none",
      "description": "The requested artifact is no longer retained because of sip pcap blob missing."
    },
    {
      "code": "sip_pcap_decryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of sip pcap decryption failed; retain request_id for support correlation."
    },
    {
      "code": "sip_pcap_failed",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of sip pcap failed."
    },
    {
      "code": "sip_pcap_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested SIP PCAP does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "sip_pcap_not_ready",
      "statuses": [
        409
      ],
      "retry": "after_retry_after",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of sip pcap not ready."
    },
    {
      "code": "sip_pcap_storage_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of sip pcap storage unavailable; follow the registry retry policy."
    },
    {
      "code": "sip_trunk_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of sip trunk archived."
    },
    {
      "code": "sip_trunk_credentials_unavailable",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of sip trunk credentials unavailable."
    },
    {
      "code": "sip_trunk_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of sip trunk in use."
    },
    {
      "code": "sip_trunk_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested SIP trunk does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "sip_trunk_operation_in_progress",
      "statuses": [
        409
      ],
      "retry": "after_retry_after",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of sip trunk operation in progress."
    },
    {
      "code": "sip_trunk_provisioning",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of sip trunk provisioning."
    },
    {
      "code": "slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of slug taken."
    },
    {
      "code": "stored_data_invalid",
      "statuses": [
        500
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "The server detected stored data invalid; retrying the same request cannot correct the stored or deployment state."
    },
    {
      "code": "stored_policy_invalid",
      "statuses": [
        500
      ],
      "retry": "never",
      "details": "none",
      "description": "The server detected stored policy invalid; retrying the same request cannot correct the stored or deployment state."
    },
    {
      "code": "system_role_immutable",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "none",
      "description": "The authenticated caller is not allowed to complete the operation because of system role immutable."
    },
    {
      "code": "team_not_connected",
      "statuses": [
        403
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The connected app's grant does not include the team named by the Kejue-Org-Id header (or the user is no longer a member). List the teams the token reaches with GET /v1/auth/me, or reconnect and approve the team."
    },
    {
      "code": "tool_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of tool archived."
    },
    {
      "code": "tool_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of tool in use."
    },
    {
      "code": "tool_invocation_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested tool invocation does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "tool_io_decryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of tool io decryption failed; retain request_id for support correlation."
    },
    {
      "code": "tool_io_decryption_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "A required service is unavailable because of tool io decryption unavailable; follow the registry retry policy."
    },
    {
      "code": "tool_io_raw_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested raw tool I/O does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "tool_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested tool does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "tool_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of tool slug taken."
    },
    {
      "code": "transcript_decryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of transcript decryption failed; retain request_id for support correlation."
    },
    {
      "code": "transcript_decryption_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "A required service is unavailable because of transcript decryption unavailable; follow the registry retry policy."
    },
    {
      "code": "transcript_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested transcript does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "transcript_raw_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested raw transcript does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "transcription_output_invalid",
      "statuses": [
        502
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The transcription model returned an invalid result. Internal batch processing retries without committing or charging this output."
    },
    {
      "code": "transfer_already_terminal",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of transfer already terminal."
    },
    {
      "code": "transfer_cancel_outcome_unknown",
      "statuses": [
        504
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "An upstream operation timed out; use details.retryable to decide whether to retry."
    },
    {
      "code": "transfer_cancel_provider_failed",
      "statuses": [
        502
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "An upstream provider request failed; use details.retryable to decide whether to retry."
    },
    {
      "code": "transfer_cancel_unavailable",
      "statuses": [
        503
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "A required service is unavailable because of transfer cancel unavailable; follow the registry retry policy."
    },
    {
      "code": "transfer_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested transfer does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "transport_mismatch",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "parameter",
      "description": "The request is syntactically valid but cannot be applied because of transport mismatch."
    },
    {
      "code": "trunk_busy",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of trunk busy."
    },
    {
      "code": "trunk_not_active",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of trunk not active."
    },
    {
      "code": "trunk_provider_not_ready",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of trunk provider not ready."
    },
    {
      "code": "turn_audio_expired",
      "statuses": [
        410
      ],
      "retry": "never",
      "details": "none",
      "description": "The requested artifact is no longer retained because of turn audio expired."
    },
    {
      "code": "turn_audio_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested turn audio does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "turn_audio_storage_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of turn audio storage unavailable; follow the registry retry policy."
    },
    {
      "code": "turn_audio_unavailable",
      "statuses": [
        503
      ],
      "retry": "safe",
      "details": "none",
      "description": "A required service is unavailable because of turn audio unavailable; follow the registry retry policy."
    },
    {
      "code": "twilio_inventory_unavailable",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "upstream_failure",
      "description": "The operation conflicts with current resource state because of twilio inventory unavailable."
    },
    {
      "code": "twilio_native_unconfigured",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "A required service is unavailable because of twilio native unconfigured; follow the registry retry policy."
    },
    {
      "code": "unauthorized",
      "statuses": [
        401
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "Authentication failed; provide exactly one valid, active credential before retrying."
    },
    {
      "code": "unexpected_body",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "request_body",
      "description": "The request was rejected because of unexpected body; correct the request before retrying."
    },
    {
      "code": "unknown_query_parameter",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "parameter",
      "description": "The request was rejected because of unknown query parameter; correct the request before retrying."
    },
    {
      "code": "unsupported_media_type",
      "statuses": [
        415
      ],
      "retry": "after_correction",
      "details": "media_type",
      "description": "The request Content-Type is unsupported; use the media type declared by the operation."
    },
    {
      "code": "unsupported_transport",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request is syntactically valid but cannot be applied because of unsupported transport."
    },
    {
      "code": "validation_failed",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "validation_fields",
      "description": "One or more request fields failed validation; correct every entry in details.fields before retrying."
    },
    {
      "code": "value_too_long",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of value too long; correct the request before retrying."
    },
    {
      "code": "version_locked",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of version locked."
    },
    {
      "code": "webhook_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of webhook archived."
    },
    {
      "code": "webhook_delivery_in_progress",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of webhook delivery in progress."
    },
    {
      "code": "webhook_delivery_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested webhook delivery does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "webhook_delivery_payload_invalid",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of webhook delivery payload invalid."
    },
    {
      "code": "webhook_delivery_payload_missing",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of webhook delivery payload missing."
    },
    {
      "code": "webhook_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of webhook in use."
    },
    {
      "code": "webhook_inactive",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of webhook inactive."
    },
    {
      "code": "webhook_missing",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of webhook missing."
    },
    {
      "code": "webhook_name_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of webhook name taken."
    },
    {
      "code": "webhook_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested webhook does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "webhook_secret_encryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of webhook secret encryption failed; retain request_id for support correlation."
    },
    {
      "code": "webhook_secret_missing",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of webhook secret missing."
    },
    {
      "code": "workspace_contract_unavailable",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of workspace contract unavailable; retain request_id for support correlation."
    },
    {
      "code": "workspace_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested workspace does not exist in the current workspace or is not visible to the caller."
    }
  ],
  "x-kejue-error-catalog": [
    {
      "code": "agent_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of agent archived."
    },
    {
      "code": "agent_baseline_too_large",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "polymorphic_object",
      "description": "The request is syntactically valid but cannot be applied because of agent baseline too large."
    },
    {
      "code": "agent_capacity_exhausted",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "No agent worker has a free dispatch slot for a new call right now; retry after the Retry-After interval while autoscaling adds capacity."
    },
    {
      "code": "agent_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested agent does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "agent_state_changed",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of agent state changed."
    },
    {
      "code": "agent_version_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested agent version does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "ai_connectors_disabled",
      "statuses": [
        403
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "AI assistant access (connected apps) is turned off for this team. A team admin can enable it with PATCH /v1/orgs/current {\"ai_connectors\": \"enabled\"}."
    },
    {
      "code": "alert_limit_reached",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The operation conflicts with current resource state because of alert limit reached."
    },
    {
      "code": "alert_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested alert does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "analysis_board_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of analysis board archived."
    },
    {
      "code": "analysis_board_capacity_reached",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of analysis board capacity reached."
    },
    {
      "code": "analysis_board_name_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of analysis board name taken."
    },
    {
      "code": "analysis_board_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested analysis board does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "analysis_export_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of analysis export failed; retain request_id for support correlation."
    },
    {
      "code": "analysis_insight_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested analysis insight does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "analysis_result_too_large",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "polymorphic_object",
      "description": "The request is syntactically valid but cannot be applied because of analysis result too large."
    },
    {
      "code": "api_key_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested API key does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "api_key_product_mismatch",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "none",
      "description": "This key belongs to a different product. Use an Inference key for Inference endpoints and a Voice key for Voice endpoints."
    },
    {
      "code": "audit_required",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of audit required; retain request_id for support correlation."
    },
    {
      "code": "authentication_rate_limited",
      "statuses": [
        429
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "The caller exceeded an enforced limit; wait for Retry-After before retrying."
    },
    {
      "code": "authentication_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of authentication unavailable; follow the registry retry policy."
    },
    {
      "code": "bad_request",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of bad request; correct the request before retrying."
    },
    {
      "code": "body_read_failed",
      "statuses": [
        400
      ],
      "retry": "safe",
      "details": "none",
      "description": "The request was rejected because of body read failed; correct the request before retrying."
    },
    {
      "code": "call_already_purged",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of call already purged."
    },
    {
      "code": "call_hangup_in_progress",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of call hangup in progress."
    },
    {
      "code": "call_hangup_outcome_unknown",
      "statuses": [
        504
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "An upstream operation timed out; use details.retryable to decide whether to retry."
    },
    {
      "code": "call_hangup_provider_failed",
      "statuses": [
        502
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "An upstream provider request failed; use details.retryable to decide whether to retry."
    },
    {
      "code": "call_hangup_unavailable",
      "statuses": [
        503
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "A required service is unavailable because of call hangup unavailable; follow the registry retry policy."
    },
    {
      "code": "call_not_ended",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of call not ended."
    },
    {
      "code": "call_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested call does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "call_not_live",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of call not live."
    },
    {
      "code": "call_on_legal_hold",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of call on legal hold."
    },
    {
      "code": "call_processing_in_progress",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of call processing in progress."
    },
    {
      "code": "call_summary_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested call summary does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "calls_disabled",
      "statuses": [
        403,
        503
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "Call activity is switched off for this tenant by a Kejue Voice operator; details.scope names the tier (platform, account or org) and details.reason carries the operator's note. Calls already in progress are unaffected. Retrying will not succeed until the switch is lifted."
    },
    {
      "code": "campaign_no_recipients",
      "statuses": [
        422
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The campaign has no pending recipients to dial; import a recipient list before launching."
    },
    {
      "code": "campaign_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested campaign does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "campaign_recipient_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested campaign recipient does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "campaign_recipients_invalid",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The uploaded recipient file contains rows that cannot be imported (invalid numbers, duplicates, or bad variables). Fix the listed rows, or set mapping.skip_invalid to import past them as excluded rows. details carries the per-row report."
    },
    {
      "code": "campaign_state_invalid",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The campaign is not in a lifecycle state this operation applies to; details carries the current and required status."
    },
    {
      "code": "capacity_unavailable",
      "statuses": [
        503
      ],
      "retry": "safe",
      "details": "none",
      "description": "A required service is unavailable because of capacity unavailable; follow the registry retry policy."
    },
    {
      "code": "conflict",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of conflict."
    },
    {
      "code": "connected_app_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested connected app does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "contact_e164_conflict",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of contact e164 conflict."
    },
    {
      "code": "contact_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested contact does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "contact_number_mismatch",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The request is syntactically valid but cannot be applied because of contact number mismatch."
    },
    {
      "code": "contact_tag_name_conflict",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of contact tag name conflict."
    },
    {
      "code": "contact_tag_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested contact tag does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "context_delivery_unconfigured",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "A required service is unavailable because of context delivery unconfigured; follow the registry retry policy."
    },
    {
      "code": "context_encryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of context encryption failed; retain request_id for support correlation."
    },
    {
      "code": "credential_decryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of credential decryption failed; retain request_id for support correlation."
    },
    {
      "code": "credential_encryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of credential encryption failed; retain request_id for support correlation."
    },
    {
      "code": "credential_service_unavailable",
      "statuses": [
        503
      ],
      "retry": "safe",
      "details": "none",
      "description": "A required service is unavailable because of credential service unavailable; follow the registry retry policy."
    },
    {
      "code": "db_error",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of db error; retain request_id for support correlation."
    },
    {
      "code": "delegation_not_allowed",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "none",
      "description": "The authenticated caller is not allowed to complete the operation because of delegation not allowed."
    },
    {
      "code": "dncr_blocked",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "none",
      "description": "The authenticated caller is not allowed to complete the operation because of dncr blocked."
    },
    {
      "code": "dncr_configuration_invalid",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of dncr configuration invalid; follow the registry retry policy."
    },
    {
      "code": "dncr_enforced",
      "statuses": [
        403
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The authenticated caller is not allowed to complete the operation because of dncr enforced."
    },
    {
      "code": "dncr_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of dncr unavailable; follow the registry retry policy."
    },
    {
      "code": "draft_not_promotable",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of draft not promotable."
    },
    {
      "code": "draft_state_changed",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of draft state changed."
    },
    {
      "code": "duplicate_field",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The request was rejected because of duplicate field; correct the request before retrying."
    },
    {
      "code": "duplicate_query_parameter",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "parameter",
      "description": "The request was rejected because of duplicate query parameter; correct the request before retrying."
    },
    {
      "code": "empty_body",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of empty body; correct the request before retrying."
    },
    {
      "code": "encode_error",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of encode error; retain request_id for support correlation."
    },
    {
      "code": "encoding_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of encoding failed; retain request_id for support correlation."
    },
    {
      "code": "entitlement_required",
      "statuses": [
        403
      ],
      "retry": "after_state_change",
      "details": "entitlement_feature",
      "description": "The authenticated caller is not allowed to complete the operation because of entitlement required."
    },
    {
      "code": "entitlements_unavailable",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of entitlements unavailable; retain request_id for support correlation."
    },
    {
      "code": "eval_call_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested eval call does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "eval_check_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of eval check archived."
    },
    {
      "code": "eval_check_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested eval check does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "eval_check_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of eval check slug taken."
    },
    {
      "code": "eval_generation_job_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested eval generation job does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "eval_run_not_cancelable",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of eval run not cancelable."
    },
    {
      "code": "eval_run_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested eval run does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "eval_scenario_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of eval scenario archived."
    },
    {
      "code": "eval_scenario_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested eval scenario does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "eval_scenario_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of eval scenario slug taken."
    },
    {
      "code": "eval_suite_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of eval suite archived."
    },
    {
      "code": "eval_suite_empty",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of eval suite empty."
    },
    {
      "code": "eval_suite_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested eval suite does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "eval_suite_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of eval suite slug taken."
    },
    {
      "code": "extraction_object_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of extraction object archived."
    },
    {
      "code": "extraction_object_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of extraction object in use."
    },
    {
      "code": "extraction_object_managed_by_group",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The extraction object is owned by a group and can only be changed through /v1/groups."
    },
    {
      "code": "extraction_object_name_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of extraction object name taken."
    },
    {
      "code": "extraction_object_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested extraction object does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "flow_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of flow archived."
    },
    {
      "code": "flow_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The flow is still assigned to at least one live phone number and cannot be archived; details.phone_numbers lists the E.164 numbers to re-point first."
    },
    {
      "code": "flow_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested flow does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "flow_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of flow slug taken."
    },
    {
      "code": "forbidden",
      "statuses": [
        403
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The authenticated caller is not allowed to complete the operation because of forbidden."
    },
    {
      "code": "group_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of group archived."
    },
    {
      "code": "group_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The group is still used by at least one live phone number or campaign and cannot be archived; details.phone_numbers and details.campaigns list what to re-point first."
    },
    {
      "code": "group_name_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of group name taken."
    },
    {
      "code": "group_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested group does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "guardrail_set_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of guardrail set archived."
    },
    {
      "code": "guardrail_set_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of guardrail set in use."
    },
    {
      "code": "guardrail_set_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested guardrail set does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "idempotency_capacity_exceeded",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of idempotency capacity exceeded; follow the registry retry policy."
    },
    {
      "code": "idempotency_conflict",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "idempotency",
      "description": "The idempotency key was already used for a request with a different canonical method, path, body, precondition, or security context."
    },
    {
      "code": "idempotency_identity_unavailable",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of idempotency identity unavailable; retain request_id for support correlation."
    },
    {
      "code": "idempotency_in_progress",
      "statuses": [
        409
      ],
      "retry": "after_retry_after",
      "details": "idempotency",
      "description": "An equivalent request with this idempotency key is still running; wait for Retry-After before replaying it."
    },
    {
      "code": "idempotency_key_required",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "idempotency",
      "description": "The request was rejected because of idempotency key required; correct the request before retrying."
    },
    {
      "code": "idempotency_misconfigured",
      "statuses": [
        500
      ],
      "retry": "never",
      "details": "none",
      "description": "The server detected idempotency misconfigured; retrying the same request cannot correct the stored or deployment state."
    },
    {
      "code": "idempotency_persistence_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of idempotency persistence failed; retain request_id for support correlation."
    },
    {
      "code": "idempotency_result_lost",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "idempotency",
      "description": "The operation reached a terminal state but its replay payload is unavailable; inspect the target resource instead of repeating the mutation."
    },
    {
      "code": "idempotency_result_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of idempotency result unavailable; follow the registry retry policy."
    },
    {
      "code": "idempotency_security_context_changed",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "idempotency",
      "description": "The idempotency key belongs to a different actor, permission set, or tenant security context."
    },
    {
      "code": "idempotency_unavailable",
      "statuses": [
        500,
        503
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of idempotency unavailable; retain request_id for support correlation."
    },
    {
      "code": "inference_async_disabled",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "New asynchronous transcription work is temporarily disabled. Existing job status, retained results, cancellation and deletion remain available. Retry when admission is enabled."
    },
    {
      "code": "inference_capacity_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The model could not accept this request. Inspect request status and retry with a new request identity when capacity recovers."
    },
    {
      "code": "inference_concurrency_exhausted",
      "statuses": [
        429
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "The workspace has reached its Inference concurrency limit. Retry after Retry-After."
    },
    {
      "code": "inference_content_expired",
      "statuses": [
        410
      ],
      "retry": "never",
      "details": "none",
      "description": "Transcription content expired or was deleted. Billing and job metadata remain, but the audio and transcript cannot be retrieved."
    },
    {
      "code": "inference_job_limit",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The workspace reached its outstanding asynchronous job, upload, or byte budget. Complete or delete existing work before submitting more."
    },
    {
      "code": "inference_model_not_found",
      "statuses": [
        404
      ],
      "retry": "never",
      "details": "none",
      "description": "No model with this name and modality is published to the workspace. List names with GET /inference/models."
    },
    {
      "code": "inference_model_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The model is published but has no available capacity right now. Retry later or ask an administrator."
    },
    {
      "code": "inference_quota_exhausted",
      "statuses": [
        402
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The workspace has insufficient credit for this modality: input characters for text to speech, audio minutes for speech to text. Add credit or wait for its next monthly grant."
    },
    {
      "code": "inference_request_exists",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "none",
      "description": "This Idempotency-Key already identifies a request. No new computation was started. Inspect request history; audio is never replayed."
    },
    {
      "code": "inference_result_not_ready",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "No committed transcription output is available yet. Poll job status with backoff before requesting its result."
    },
    {
      "code": "inference_storage_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "Transcription storage is temporarily unavailable. Retry the same logical operation with its original idempotency key."
    },
    {
      "code": "inference_unsupported_timestamps",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "This model does not support the requested timestamp granularity and language. Choose a combination advertised by GET /inference/models."
    },
    {
      "code": "inference_upload_expired",
      "statuses": [
        410
      ],
      "retry": "never",
      "details": "none",
      "description": "This upload expired. Start a new upload with a new idempotency key; expired source objects and multipart parts are cleaned up."
    },
    {
      "code": "inference_upstream_failed",
      "statuses": [
        502
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The model did not complete a valid response. Inspect request status before deciding to start another request."
    },
    {
      "code": "inference_voice_not_found",
      "statuses": [
        404
      ],
      "retry": "never",
      "details": "none",
      "description": "The voice is not approved for this model. List approved voices with GET /inference/voices."
    },
    {
      "code": "internal",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of internal; retain request_id for support correlation."
    },
    {
      "code": "internal_context_missing",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of internal context missing; retain request_id for support correlation."
    },
    {
      "code": "internal_error",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation; retain the request_id and retry only with the same idempotency key when applicable."
    },
    {
      "code": "invalid_call_policy",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request is syntactically valid but cannot be applied because of invalid call policy."
    },
    {
      "code": "invalid_header",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "header",
      "description": "The request was rejected because of invalid header; correct the request before retrying."
    },
    {
      "code": "invalid_idempotency_key",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of invalid idempotency key; correct the request before retrying."
    },
    {
      "code": "invalid_json",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The request was rejected because of invalid json; correct the request before retrying."
    },
    {
      "code": "invalid_multipart",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of invalid multipart; correct the request before retrying."
    },
    {
      "code": "invalid_outbound_policy",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "validation_fields",
      "description": "The request is syntactically valid but cannot be applied because of invalid outbound policy."
    },
    {
      "code": "invalid_path_parameter",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "parameter",
      "description": "The request was rejected because of invalid path parameter; correct the request before retrying."
    },
    {
      "code": "invalid_query_parameter",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "parameter",
      "description": "The request was rejected because of invalid query parameter; correct the request before retrying."
    },
    {
      "code": "invalid_range",
      "statuses": [
        416
      ],
      "retry": "after_correction",
      "details": "polymorphic_object",
      "description": "The requested byte range is invalid for the selected artifact."
    },
    {
      "code": "invalid_recipient_file",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The uploaded recipient file could not be parsed (not UTF-8, not valid CSV, or missing a header/data rows); the message names the first problem found."
    },
    {
      "code": "invalid_request_id",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "header",
      "description": "The request was rejected because of invalid request id; correct the request before retrying."
    },
    {
      "code": "invalid_uuid",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of invalid uuid; correct the request before retrying."
    },
    {
      "code": "kms_error",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of kms error; retain request_id for support correlation."
    },
    {
      "code": "knowledge_base_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of knowledge base archived."
    },
    {
      "code": "knowledge_base_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of knowledge base in use."
    },
    {
      "code": "knowledge_base_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested knowledge base does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "knowledge_base_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of knowledge base slug taken."
    },
    {
      "code": "knowledge_document_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested knowledge document does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "mcp_introspection_failed",
      "statuses": [
        409,
        500,
        502,
        504
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "The operation conflicts with current resource state because of mcp introspection failed."
    },
    {
      "code": "mcp_server_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of mcp server archived."
    },
    {
      "code": "mcp_server_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of mcp server in use."
    },
    {
      "code": "mcp_server_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested MCP server does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "mcp_server_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of mcp server slug taken."
    },
    {
      "code": "member_already_exists",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of member already exists."
    },
    {
      "code": "member_invitation_accepted",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of member invitation accepted."
    },
    {
      "code": "member_invitation_conflict",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of member invitation conflict."
    },
    {
      "code": "member_invitation_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested member invitation does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "member_invitation_revoked",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of member invitation revoked."
    },
    {
      "code": "member_last_owner",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of member last owner."
    },
    {
      "code": "member_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested member does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "method_not_allowed",
      "statuses": [
        405
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The route exists, but it does not support the requested HTTP method."
    },
    {
      "code": "minutes_quota_exhausted",
      "statuses": [
        429
      ],
      "retry": "after_retry_after",
      "details": "optional_object",
      "description": "The tenant has used its included call minutes for the current billing cycle. Calls already in progress are unaffected; new calls resume when the cycle rolls over or an operator grants more minutes. details.cycle_end is when the allowance resets."
    },
    {
      "code": "model_release_changed",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The transcription model release changed. Internal batch processing waits for the job's pinned release to become available."
    },
    {
      "code": "multiple_json_values",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of multiple json values; correct the request before retrying."
    },
    {
      "code": "name_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of name taken."
    },
    {
      "code": "no_agent_version",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of no agent version."
    },
    {
      "code": "no_draft",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of no draft."
    },
    {
      "code": "no_mutable_draft",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of no mutable draft."
    },
    {
      "code": "no_observed_tool_state",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of no observed tool state."
    },
    {
      "code": "no_org",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of no org; retain request_id for support correlation."
    },
    {
      "code": "no_production_version",
      "statuses": [
        422
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The request is syntactically valid but cannot be applied because of no production version."
    },
    {
      "code": "no_staging_version",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of no staging version."
    },
    {
      "code": "no_tx",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of no tx; retain request_id for support correlation."
    },
    {
      "code": "not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested route or resource does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "number_in_use",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of number in use."
    },
    {
      "code": "number_pool_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested outbound number pool does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "number_pool_unavailable",
      "statuses": [
        422
      ],
      "retry": "after_state_change",
      "details": "parameter",
      "description": "The request is syntactically valid but cannot be applied because of number pool unavailable."
    },
    {
      "code": "number_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of number taken."
    },
    {
      "code": "operation_not_available",
      "statuses": [
        404
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "The route exists for an internal or browser workflow but is not part of the reviewed public API."
    },
    {
      "code": "organization_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested organization does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "outbound_capacity_profile_conflict",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of outbound capacity profile conflict."
    },
    {
      "code": "outbound_capacity_profile_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of outbound capacity profile in use."
    },
    {
      "code": "outbound_capacity_profile_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested outbound capacity profile does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "outbound_destination_denied",
      "statuses": [
        403
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The SIP trunk's outbound allowlist does not permit this destination; add its prefix or SIP host to the trunk's allowed destinations."
    },
    {
      "code": "outbound_job_already_started",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of outbound job already started."
    },
    {
      "code": "outbound_job_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested outbound job does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "outbound_job_terminal",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of outbound job terminal."
    },
    {
      "code": "outbound_number_pool_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of outbound number pool in use."
    },
    {
      "code": "outbound_number_pool_name_conflict",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of outbound number pool name conflict."
    },
    {
      "code": "outbound_number_pool_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested outbound number pool does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "payload_encoding_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of payload encoding failed; retain request_id for support correlation."
    },
    {
      "code": "pcap_not_configured",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "A required service is unavailable because of pcap not configured; follow the registry retry policy."
    },
    {
      "code": "pcap_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of pcap unavailable; follow the registry retry policy."
    },
    {
      "code": "permission_escalation",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "polymorphic_object",
      "description": "The authenticated caller is not allowed to complete the operation because of permission escalation."
    },
    {
      "code": "phone_number_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of phone number archived."
    },
    {
      "code": "phone_number_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested phone number does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "phone_number_operation_in_progress",
      "statuses": [
        409
      ],
      "retry": "after_retry_after",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of phone number operation in progress."
    },
    {
      "code": "phone_number_provisioning",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of phone number provisioning."
    },
    {
      "code": "phone_number_unavailable",
      "statuses": [
        422
      ],
      "retry": "after_state_change",
      "details": "parameter",
      "description": "The request is syntactically valid but cannot be applied because of phone number unavailable."
    },
    {
      "code": "pii_access_already_granted",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "You already hold approved access to this call, so there is nothing to request. details carries the granting request_id."
    },
    {
      "code": "pii_access_approval_required",
      "statuses": [
        403
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "This workspace requires an approved break-glass request before sensitive call or transcription data can be read. Raise one in the dashboard (Settings → Access requests) and retry once it is approved."
    },
    {
      "code": "pii_access_mode_unavailable",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of pii access mode unavailable; retain request_id for support correlation."
    },
    {
      "code": "pii_access_request_exists",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "A request for this call from this user is already awaiting a decision. details carries its request_id."
    },
    {
      "code": "pii_access_request_not_actionable",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "The request is no longer in a state this decision applies to — only a pending request can be approved or rejected, and only a live approval can be revoked. details carries the current and required status."
    },
    {
      "code": "pii_access_request_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested break-glass access request does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "pii_access_request_requires_user",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "none",
      "description": "Break-glass requests must be raised by a signed-in user. An API key cannot be notified or approved, so keys holding pii-access:unmask supply a reason instead."
    },
    {
      "code": "pii_access_self_decision_forbidden",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "Approving your own request for sensitive data is not review. Another holder of pii-access:approve must decide it. Permitted only when the requester is the workspace's sole approver, where the request would otherwise be undecidable."
    },
    {
      "code": "precondition_failed",
      "statuses": [
        412
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The supplied conditional request no longer matches current resource state; fetch the latest ETag before retrying."
    },
    {
      "code": "preview_failed",
      "statuses": [
        502
      ],
      "retry": "safe",
      "details": "none",
      "description": "The TTS provider could not synthesize the preview clip. The table itself is unaffected and can still be saved; retry the preview or pick another voice."
    },
    {
      "code": "preview_unsupported",
      "statuses": [
        501
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "The selected voice does not support pronunciation preview audio yet. Pick another voice to hear the table; the table can still be saved."
    },
    {
      "code": "pronunciation_table_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of pronunciation table archived."
    },
    {
      "code": "pronunciation_table_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of pronunciation table in use."
    },
    {
      "code": "pronunciation_table_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested pronunciation table does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "protected_member",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "The membership belongs to the platform's protected owner account, which can never be removed or moved off the owner role through the API."
    },
    {
      "code": "provider_request_failed",
      "statuses": [
        502
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "An upstream provider request failed; use details.retryable to decide whether to retry."
    },
    {
      "code": "rate_limit_exceeded",
      "statuses": [
        429
      ],
      "retry": "after_retry_after",
      "details": "rate_limit",
      "description": "The caller exceeded an enforced limit; wait for Retry-After before retrying."
    },
    {
      "code": "rate_limited",
      "statuses": [
        429
      ],
      "retry": "after_retry_after",
      "details": "rate_limit",
      "description": "The caller exceeded an enforced limit; wait for Retry-After before retrying."
    },
    {
      "code": "reconciliation_service_unavailable",
      "statuses": [
        503
      ],
      "retry": "safe",
      "details": "none",
      "description": "A required service is unavailable because of reconciliation service unavailable; follow the registry retry policy."
    },
    {
      "code": "recording_blob_missing",
      "statuses": [
        410
      ],
      "retry": "never",
      "details": "none",
      "description": "The requested artifact is no longer retained because of recording blob missing."
    },
    {
      "code": "recording_decryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of recording decryption failed; retain request_id for support correlation."
    },
    {
      "code": "recording_failed",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of recording failed."
    },
    {
      "code": "recording_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested recording does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "recording_not_ready",
      "statuses": [
        409
      ],
      "retry": "after_retry_after",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of recording not ready."
    },
    {
      "code": "recording_storage_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of recording storage unavailable; follow the registry retry policy."
    },
    {
      "code": "recording_unavailable",
      "statuses": [
        503
      ],
      "retry": "safe",
      "details": "none",
      "description": "A required service is unavailable because of recording unavailable; follow the registry retry policy."
    },
    {
      "code": "referenced_resource_missing",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request is syntactically valid but cannot be applied because of referenced resource missing."
    },
    {
      "code": "request_body_read_failed",
      "statuses": [
        400
      ],
      "retry": "safe",
      "details": "none",
      "description": "The request was rejected because of request body read failed; correct the request before retrying."
    },
    {
      "code": "request_timeout",
      "statuses": [
        408
      ],
      "retry": "safe",
      "details": "none",
      "description": "The request body did not arrive before the server deadline; send a complete bounded body and retry."
    },
    {
      "code": "request_too_large",
      "statuses": [
        413
      ],
      "retry": "after_correction",
      "details": "polymorphic_object",
      "description": "The encoded request exceeds the endpoint limit; reduce it before retrying."
    },
    {
      "code": "resource_changed",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of resource changed."
    },
    {
      "code": "response_buffer_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of response buffer failed; retain request_id for support correlation."
    },
    {
      "code": "role_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of role in use."
    },
    {
      "code": "role_name_conflict",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of role name conflict."
    },
    {
      "code": "role_name_reserved",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The operation conflicts with current resource state because of role name reserved."
    },
    {
      "code": "role_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested role does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "route_mismatch",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "parameter",
      "description": "The request is syntactically valid but cannot be applied because of route mismatch."
    },
    {
      "code": "scheduling_unconfigured",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "A required service is unavailable because of scheduling unconfigured; follow the registry retry policy."
    },
    {
      "code": "secret_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of secret archived."
    },
    {
      "code": "secret_encryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of secret encryption failed; retain request_id for support correlation."
    },
    {
      "code": "secret_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of secret in use."
    },
    {
      "code": "secret_name_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of secret name taken."
    },
    {
      "code": "secret_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested secret does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "secret_resolution_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of secret resolution failed; retain request_id for support correlation."
    },
    {
      "code": "sip_pcap_blob_missing",
      "statuses": [
        410
      ],
      "retry": "never",
      "details": "none",
      "description": "The requested artifact is no longer retained because of sip pcap blob missing."
    },
    {
      "code": "sip_pcap_decryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of sip pcap decryption failed; retain request_id for support correlation."
    },
    {
      "code": "sip_pcap_failed",
      "statuses": [
        409
      ],
      "retry": "never",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of sip pcap failed."
    },
    {
      "code": "sip_pcap_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested SIP PCAP does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "sip_pcap_not_ready",
      "statuses": [
        409
      ],
      "retry": "after_retry_after",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of sip pcap not ready."
    },
    {
      "code": "sip_pcap_storage_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of sip pcap storage unavailable; follow the registry retry policy."
    },
    {
      "code": "sip_trunk_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of sip trunk archived."
    },
    {
      "code": "sip_trunk_credentials_unavailable",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of sip trunk credentials unavailable."
    },
    {
      "code": "sip_trunk_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of sip trunk in use."
    },
    {
      "code": "sip_trunk_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested SIP trunk does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "sip_trunk_operation_in_progress",
      "statuses": [
        409
      ],
      "retry": "after_retry_after",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of sip trunk operation in progress."
    },
    {
      "code": "sip_trunk_provisioning",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of sip trunk provisioning."
    },
    {
      "code": "slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of slug taken."
    },
    {
      "code": "stored_data_invalid",
      "statuses": [
        500
      ],
      "retry": "never",
      "details": "optional_object",
      "description": "The server detected stored data invalid; retrying the same request cannot correct the stored or deployment state."
    },
    {
      "code": "stored_policy_invalid",
      "statuses": [
        500
      ],
      "retry": "never",
      "details": "none",
      "description": "The server detected stored policy invalid; retrying the same request cannot correct the stored or deployment state."
    },
    {
      "code": "system_role_immutable",
      "statuses": [
        403
      ],
      "retry": "never",
      "details": "none",
      "description": "The authenticated caller is not allowed to complete the operation because of system role immutable."
    },
    {
      "code": "team_not_connected",
      "statuses": [
        403
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The connected app's grant does not include the team named by the Kejue-Org-Id header (or the user is no longer a member). List the teams the token reaches with GET /v1/auth/me, or reconnect and approve the team."
    },
    {
      "code": "tool_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of tool archived."
    },
    {
      "code": "tool_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of tool in use."
    },
    {
      "code": "tool_invocation_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested tool invocation does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "tool_io_decryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of tool io decryption failed; retain request_id for support correlation."
    },
    {
      "code": "tool_io_decryption_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "A required service is unavailable because of tool io decryption unavailable; follow the registry retry policy."
    },
    {
      "code": "tool_io_raw_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested raw tool I/O does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "tool_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested tool does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "tool_slug_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of tool slug taken."
    },
    {
      "code": "transcript_decryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of transcript decryption failed; retain request_id for support correlation."
    },
    {
      "code": "transcript_decryption_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "A required service is unavailable because of transcript decryption unavailable; follow the registry retry policy."
    },
    {
      "code": "transcript_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested transcript does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "transcript_raw_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested raw transcript does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "transcription_output_invalid",
      "statuses": [
        502
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "The transcription model returned an invalid result. Internal batch processing retries without committing or charging this output."
    },
    {
      "code": "transfer_already_terminal",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of transfer already terminal."
    },
    {
      "code": "transfer_cancel_outcome_unknown",
      "statuses": [
        504
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "An upstream operation timed out; use details.retryable to decide whether to retry."
    },
    {
      "code": "transfer_cancel_provider_failed",
      "statuses": [
        502
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "An upstream provider request failed; use details.retryable to decide whether to retry."
    },
    {
      "code": "transfer_cancel_unavailable",
      "statuses": [
        503
      ],
      "retry": "from_details",
      "details": "upstream_failure",
      "description": "A required service is unavailable because of transfer cancel unavailable; follow the registry retry policy."
    },
    {
      "code": "transfer_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested transfer does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "transport_mismatch",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "parameter",
      "description": "The request is syntactically valid but cannot be applied because of transport mismatch."
    },
    {
      "code": "trunk_busy",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of trunk busy."
    },
    {
      "code": "trunk_not_active",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of trunk not active."
    },
    {
      "code": "trunk_provider_not_ready",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of trunk provider not ready."
    },
    {
      "code": "turn_audio_expired",
      "statuses": [
        410
      ],
      "retry": "never",
      "details": "none",
      "description": "The requested artifact is no longer retained because of turn audio expired."
    },
    {
      "code": "turn_audio_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested turn audio does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "turn_audio_storage_unavailable",
      "statuses": [
        503
      ],
      "retry": "after_retry_after",
      "details": "none",
      "description": "A required service is unavailable because of turn audio storage unavailable; follow the registry retry policy."
    },
    {
      "code": "turn_audio_unavailable",
      "statuses": [
        503
      ],
      "retry": "safe",
      "details": "none",
      "description": "A required service is unavailable because of turn audio unavailable; follow the registry retry policy."
    },
    {
      "code": "twilio_inventory_unavailable",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "upstream_failure",
      "description": "The operation conflicts with current resource state because of twilio inventory unavailable."
    },
    {
      "code": "twilio_native_unconfigured",
      "statuses": [
        503
      ],
      "retry": "after_state_change",
      "details": "none",
      "description": "A required service is unavailable because of twilio native unconfigured; follow the registry retry policy."
    },
    {
      "code": "unauthorized",
      "statuses": [
        401
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "Authentication failed; provide exactly one valid, active credential before retrying."
    },
    {
      "code": "unexpected_body",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "request_body",
      "description": "The request was rejected because of unexpected body; correct the request before retrying."
    },
    {
      "code": "unknown_query_parameter",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "parameter",
      "description": "The request was rejected because of unknown query parameter; correct the request before retrying."
    },
    {
      "code": "unsupported_media_type",
      "statuses": [
        415
      ],
      "retry": "after_correction",
      "details": "media_type",
      "description": "The request Content-Type is unsupported; use the media type declared by the operation."
    },
    {
      "code": "unsupported_transport",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request is syntactically valid but cannot be applied because of unsupported transport."
    },
    {
      "code": "validation_failed",
      "statuses": [
        422
      ],
      "retry": "after_correction",
      "details": "validation_fields",
      "description": "One or more request fields failed validation; correct every entry in details.fields before retrying."
    },
    {
      "code": "value_too_long",
      "statuses": [
        400
      ],
      "retry": "after_correction",
      "details": "none",
      "description": "The request was rejected because of value too long; correct the request before retrying."
    },
    {
      "code": "version_locked",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of version locked."
    },
    {
      "code": "webhook_archived",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of webhook archived."
    },
    {
      "code": "webhook_delivery_in_progress",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "async_state",
      "description": "The operation conflicts with current resource state because of webhook delivery in progress."
    },
    {
      "code": "webhook_delivery_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested webhook delivery does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "webhook_delivery_payload_invalid",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of webhook delivery payload invalid."
    },
    {
      "code": "webhook_delivery_payload_missing",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of webhook delivery payload missing."
    },
    {
      "code": "webhook_in_use",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of webhook in use."
    },
    {
      "code": "webhook_inactive",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of webhook inactive."
    },
    {
      "code": "webhook_missing",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of webhook missing."
    },
    {
      "code": "webhook_name_taken",
      "statuses": [
        409
      ],
      "retry": "after_correction",
      "details": "resource_conflict",
      "description": "The operation conflicts with current resource state because of webhook name taken."
    },
    {
      "code": "webhook_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested webhook does not exist in the current workspace or is not visible to the caller."
    },
    {
      "code": "webhook_secret_encryption_failed",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of webhook secret encryption failed; retain request_id for support correlation."
    },
    {
      "code": "webhook_secret_missing",
      "statuses": [
        409
      ],
      "retry": "after_state_change",
      "details": "optional_object",
      "description": "The operation conflicts with current resource state because of webhook secret missing."
    },
    {
      "code": "workspace_contract_unavailable",
      "statuses": [
        500
      ],
      "retry": "safe",
      "details": "none",
      "description": "The server could not complete the operation because of workspace contract unavailable; retain request_id for support correlation."
    },
    {
      "code": "workspace_not_found",
      "statuses": [
        404
      ],
      "retry": "after_correction",
      "details": "optional_object",
      "description": "The requested workspace does not exist in the current workspace or is not visible to the caller."
    }
  ]
}
