{
  "openapi": "3.1.0",
  "info": {
    "title": "Classet API",
    "version": "2.0.3",
    "description": "AI-powered recruiting and phone screening API.\n\n**API key scopes.** `read` covers every GET; any other method needs `write` (403 `insufficient_scope`); starting or stopping an interview also needs `interviews:send`. A branch-limited key sees and writes only jobs in its branches (not jobs with no branch) and their candidates, applications and calls; anything outside is a 404. An organization-group key is read-only across every organization in its group. Branch-limited and group keys cannot use organization configuration (scripts, knowledge, webhooks, message automations, agent settings, AI generation, organization): 403 `restricted_key_unsupported`. `GET /v2/me` reports what the calling key can do."
  },
  "servers": [
    {
      "url": "https://api.classet.ai",
      "description": "Production"
    },
    {
      "url": "http://localhost:8081",
      "description": "Local development"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY",
        "description": "Your Classet API key. Create and rotate keys in Settings → API."
      }
    },
    "schemas": {
      "WebhookEnvelope": {
        "type": "object",
        "properties": {
          "event_id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique id for this delivery event."
          },
          "type": {
            "type": "string",
            "enum": [
              "interview.completed",
              "application.created",
              "application.stage_changed",
              "application.rejected",
              "candidate.hired",
              "candidate.updated",
              "job.created",
              "job.updated",
              "webhook.test"
            ],
            "description": "Event type.",
            "example": "interview.completed"
          },
          "created_at": {
            "type": "string",
            "description": "ISO 8601 timestamp when the event was emitted."
          },
          "org_id": {
            "type": "string",
            "description": "Organization the event belongs to."
          },
          "api_version": {
            "type": "string",
            "enum": [
              "v2"
            ],
            "description": "Webhook payload schema version."
          },
          "data": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            },
            "description": "Event-specific payload. Shape depends on `type` (see InterviewDetail, ApplicationCreatedData, etc.)."
          }
        },
        "required": [
          "event_id",
          "type",
          "created_at",
          "org_id",
          "api_version",
          "data"
        ],
        "description": "The signed webhook envelope. The raw serialized body is HMAC-SHA256 signed and sent as X-Classet-Signature (and the legacy x-classet-webhook-signature header). X-Classet-Signature-V2 signs `${timestamp}.${body}` with X-Classet-Timestamp, so a captured delivery can be rejected as a replay. During a signing-secret rotation both headers carry two comma-separated signatures — accept either."
      },
      "InterviewDetail": {
        "type": "object",
        "properties": {
          "candidate_id": {
            "type": "string",
            "example": "cand_abc123"
          },
          "job_id": {
            "type": "string",
            "nullable": true,
            "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either. Identical in the interview.completed webhook."
          },
          "job_shortcode": {
            "type": "string",
            "nullable": true,
            "description": "The v1 shortcode of the job."
          },
          "job_title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "not_sent",
              "in_progress",
              "completed"
            ],
            "description": "not_sent = no interview requested yet; in_progress = sent/awaiting completion; completed = processed."
          },
          "outcome": {
            "type": "string",
            "nullable": true,
            "example": "pass",
            "description": "Final interview outcome (e.g. pass, fail, ai_stopped_override), or null until completed."
          },
          "summary": {
            "type": "string",
            "nullable": true,
            "description": "AI-generated interview summary (the primary consumable)."
          },
          "sent_at": {
            "type": "string",
            "nullable": true
          },
          "completed_at": {
            "type": "string",
            "nullable": true
          },
          "question_answers": {
            "nullable": true,
            "description": "Aggregated screening question answers from the interview."
          },
          "custom_data": {
            "nullable": true
          },
          "call_count": {
            "type": "integer",
            "example": 1,
            "description": "Number of underlying call attempts aggregated into this interview."
          },
          "recording_url": {
            "type": "string",
            "nullable": true,
            "description": "Recording of the most recent completed call (advanced)."
          },
          "transcript": {
            "nullable": true,
            "description": "Transcript of the most recent completed call (advanced)."
          }
        },
        "required": [
          "candidate_id",
          "job_id",
          "job_shortcode",
          "job_title",
          "status",
          "outcome",
          "summary",
          "sent_at",
          "completed_at",
          "call_count",
          "recording_url"
        ],
        "description": "A candidate's interview as a single aggregated result (summary + outcome), not multiple raw calls."
      },
      "ApplicationCreatedData": {
        "type": "object",
        "properties": {
          "candidate_id": {
            "type": "string",
            "example": "cand_abc123"
          },
          "job_id": {
            "type": "string",
            "nullable": true,
            "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
          },
          "job_title": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "first_name": {
            "type": "string",
            "nullable": true
          },
          "last_name": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "phone_number": {
            "type": "string",
            "nullable": true,
            "deprecated": true,
            "description": "Deprecated alias for `phone`."
          },
          "location": {
            "nullable": true
          },
          "resume_url": {
            "type": "string",
            "nullable": true
          },
          "disqualified": {
            "type": "boolean",
            "nullable": true
          },
          "disqualification_reason": {
            "type": "string",
            "nullable": true
          },
          "stage": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "candidate_id",
          "job_id",
          "job_title",
          "email",
          "first_name",
          "last_name",
          "phone",
          "phone_number",
          "resume_url",
          "disqualified",
          "disqualification_reason",
          "stage",
          "created_at"
        ],
        "description": "Newly created application/candidate"
      },
      "ApplicationStageChangedData": {
        "type": "object",
        "properties": {
          "application_id": {
            "type": "string"
          },
          "candidate_id": {
            "type": "string"
          },
          "job_id": {
            "type": "string",
            "nullable": true,
            "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
          },
          "stage": {
            "type": "string",
            "description": "The stage the application moved into."
          },
          "previous_stage": {
            "type": "string",
            "nullable": true
          },
          "changed_at": {
            "type": "string"
          }
        },
        "required": [
          "application_id",
          "candidate_id",
          "job_id",
          "stage",
          "previous_stage",
          "changed_at"
        ],
        "description": "An application moved between stages"
      },
      "ApplicationRejectedData": {
        "type": "object",
        "properties": {
          "application_id": {
            "type": "string"
          },
          "candidate_id": {
            "type": "string"
          },
          "job_id": {
            "type": "string",
            "nullable": true,
            "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
          },
          "rejection_reason": {
            "type": "string",
            "nullable": true
          },
          "rejected_at": {
            "type": "string"
          }
        },
        "required": [
          "application_id",
          "candidate_id",
          "job_id",
          "rejection_reason",
          "rejected_at"
        ],
        "description": "An application was disqualified"
      },
      "CandidateHiredData": {
        "type": "object",
        "properties": {
          "application_id": {
            "type": "string"
          },
          "candidate_id": {
            "type": "string"
          },
          "job_id": {
            "type": "string",
            "nullable": true,
            "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
          },
          "stage": {
            "type": "string",
            "nullable": true
          },
          "hired_at": {
            "type": "string"
          }
        },
        "required": [
          "application_id",
          "candidate_id",
          "job_id",
          "stage",
          "hired_at"
        ],
        "description": "A candidate reached the hired stage"
      },
      "CandidateUpdatedData": {
        "type": "object",
        "properties": {
          "candidate_id": {
            "type": "string",
            "example": "cand_abc123"
          },
          "job_id": {
            "type": "string",
            "nullable": true,
            "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "first_name": {
            "type": "string",
            "nullable": true
          },
          "last_name": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "nullable": true,
            "description": "Location object, matching the candidate resource."
          },
          "stage": {
            "type": "string",
            "nullable": true
          },
          "disqualified": {
            "type": "boolean",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "nullable": true
          },
          "changed_fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The API fields supplied in the PATCH that triggered this event."
          }
        },
        "required": [
          "candidate_id",
          "job_id",
          "email",
          "first_name",
          "last_name",
          "phone",
          "stage",
          "disqualified",
          "updated_at",
          "changed_fields"
        ],
        "description": "Candidate core fields (current values) after an update, plus the changed-field set"
      },
      "JobUpdatedData": {
        "type": "object",
        "properties": {
          "job_id": {
            "type": "string",
            "example": "job_abc123",
            "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
          },
          "external_id": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true,
            "example": "published"
          },
          "updated_at": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "job_id",
          "external_id",
          "title",
          "state",
          "updated_at"
        ],
        "description": "Job core fields after a create, update or archive"
      },
      "HealthResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "ok"
          },
          "version": {
            "type": "string",
            "example": "2.0.3"
          },
          "timestamp": {
            "type": "string",
            "example": "2026-04-11T00:00:00.000Z"
          }
        },
        "required": [
          "status",
          "version",
          "timestamp"
        ]
      },
      "JobSummary": {
        "type": "object",
        "properties": {
          "job_id": {
            "type": "string",
            "example": "abc123def",
            "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
          },
          "external_id": {
            "type": "string",
            "nullable": true,
            "example": "CC-REQ-48217",
            "description": "Your internal job ID, if set."
          },
          "title": {
            "type": "string",
            "example": "Senior Software Engineer"
          },
          "state": {
            "type": "string",
            "nullable": true,
            "example": "published",
            "description": "Raw job lifecycle state. `published` is active."
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "nullable": true
          },
          "benefits": {
            "type": "string",
            "nullable": true
          },
          "wage_lower_bound": {
            "type": "number",
            "nullable": true
          },
          "wage_upper_bound": {
            "type": "number",
            "nullable": true
          },
          "wage_type": {
            "type": "string",
            "nullable": true
          },
          "wage_currency": {
            "type": "string",
            "nullable": true,
            "example": "USD"
          },
          "application_questions": {
            "nullable": true
          },
          "faqs": {
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "nullable": true,
            "example": "2026-06-20T14:00:00Z",
            "description": "Last-modified timestamp (use with updated_since for delta sync)."
          },
          "created_at": {
            "type": "string",
            "nullable": true
          },
          "employment_type": {
            "type": "string",
            "nullable": true
          },
          "department": {
            "type": "string",
            "nullable": true
          },
          "branch_id": {
            "type": "string",
            "nullable": true,
            "description": "Branch (location / department) this job belongs to."
          },
          "hires_needed": {
            "type": "number",
            "nullable": true
          },
          "application_url": {
            "type": "string",
            "nullable": true,
            "description": "Public apply URL for this job."
          },
          "slug": {
            "type": "string",
            "nullable": true,
            "example": "master-craftsman-burke-9f3kd0m2p1qx",
            "description": "URL slug of the candidate-facing Classet job page."
          },
          "job_url": {
            "type": "string",
            "nullable": true,
            "example": "https://call.classet.ai/job/master-craftsman-burke-9f3kd0m2p1qx",
            "description": "Candidate-facing Classet job page. Returned for every lifecycle state, including `draft` and `archived` — check `state` before sharing it. Null only for a job with no slug, which the database does not currently allow."
          },
          "script": {
            "type": "object",
            "nullable": true,
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string",
                "nullable": true
              },
              "default": {
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "name",
              "description",
              "default"
            ]
          }
        },
        "required": [
          "job_id",
          "external_id",
          "title",
          "state",
          "description",
          "benefits",
          "wage_lower_bound",
          "wage_upper_bound",
          "wage_type",
          "wage_currency",
          "updated_at",
          "slug",
          "job_url",
          "script"
        ],
        "description": "Job summary in list view. Includes wage, benefits, and application_questions so the list endpoint is self-sufficient (no per-job follow-up calls required)."
      },
      "JobDetail": {
        "type": "object",
        "properties": {
          "job_id": {
            "type": "string",
            "example": "abc123def",
            "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
          },
          "external_id": {
            "type": "string",
            "nullable": true,
            "example": "CC-REQ-48217",
            "description": "Your internal job ID, if set."
          },
          "title": {
            "type": "string",
            "example": "Senior Software Engineer"
          },
          "state": {
            "type": "string",
            "nullable": true,
            "example": "published",
            "description": "Raw job lifecycle state. `published` is active."
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "nullable": true
          },
          "requirements": {
            "nullable": true
          },
          "benefits": {
            "type": "string",
            "nullable": true
          },
          "wage_lower_bound": {
            "type": "number",
            "nullable": true
          },
          "wage_upper_bound": {
            "type": "number",
            "nullable": true
          },
          "wage_type": {
            "type": "string",
            "nullable": true
          },
          "wage_currency": {
            "type": "string",
            "nullable": true,
            "example": "USD"
          },
          "script": {
            "type": "object",
            "nullable": true,
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string",
                "nullable": true
              },
              "default": {
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "name",
              "description",
              "default"
            ]
          },
          "faqs": {
            "nullable": true
          },
          "application_questions": {
            "nullable": true
          },
          "additional_subscriber_emails": {
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "nullable": true
          },
          "employment_type": {
            "type": "string",
            "nullable": true
          },
          "department": {
            "type": "string",
            "nullable": true
          },
          "branch_id": {
            "type": "string",
            "nullable": true,
            "description": "Branch (location / department) this job belongs to."
          },
          "hires_needed": {
            "type": "number",
            "nullable": true
          },
          "application_url": {
            "type": "string",
            "nullable": true,
            "description": "Public apply URL for this job."
          },
          "slug": {
            "type": "string",
            "nullable": true,
            "example": "master-craftsman-burke-9f3kd0m2p1qx",
            "description": "URL slug of the candidate-facing Classet job page."
          },
          "job_url": {
            "type": "string",
            "nullable": true,
            "example": "https://call.classet.ai/job/master-craftsman-burke-9f3kd0m2p1qx",
            "description": "Candidate-facing Classet job page. Returned for every lifecycle state, including `draft` and `archived` — check `state` before sharing it. Null only for a job with no slug, which the database does not currently allow."
          },
          "custom_data": {
            "nullable": true
          }
        },
        "required": [
          "job_id",
          "external_id",
          "title",
          "state",
          "description",
          "benefits",
          "wage_lower_bound",
          "wage_upper_bound",
          "wage_type",
          "wage_currency",
          "script",
          "slug",
          "job_url"
        ],
        "description": "Full job details"
      },
      "Location": {
        "type": "object",
        "properties": {
          "coords": {
            "type": "object",
            "nullable": true,
            "properties": {
              "longitude": {
                "type": "number",
                "minimum": -180,
                "maximum": 180
              },
              "latitude": {
                "type": "number",
                "minimum": -90,
                "maximum": 90
              }
            },
            "required": [
              "longitude",
              "latitude"
            ]
          },
          "city": {
            "type": "string",
            "example": "San Francisco"
          },
          "region": {
            "type": "string",
            "example": "California"
          },
          "country": {
            "type": "string",
            "example": "United States"
          },
          "zip_code": {
            "type": "string",
            "example": "94105"
          },
          "region_code": {
            "type": "string",
            "example": "CA"
          },
          "country_code": {
            "type": "string",
            "example": "US"
          },
          "location_str": {
            "type": "string",
            "example": "San Francisco, CA"
          },
          "workplace_type": {
            "type": "string",
            "enum": [
              "remote",
              "onsite",
              "hybrid"
            ],
            "example": "onsite"
          }
        },
        "required": [
          "workplace_type"
        ],
        "description": "Job location details"
      },
      "FAQ": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string",
            "minLength": 1,
            "example": "What are the working hours?"
          },
          "answer": {
            "type": "string",
            "minLength": 1,
            "example": "Monday to Friday, 9am-5pm"
          }
        },
        "required": [
          "question",
          "answer"
        ],
        "description": "Frequently asked question"
      },
      "ApplicationQuestion": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string",
            "example": "Do you have a valid driver's license?",
            "description": "Question text (v2 format)"
          },
          "type": {
            "type": "string",
            "enum": [
              "yes_no",
              "text",
              "multiple_choice"
            ],
            "example": "yes_no"
          },
          "required": {
            "type": "boolean",
            "default": true
          },
          "disqualify_on": {
            "type": "string",
            "example": "No",
            "description": "Answer that disqualifies the candidate"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "Yes",
              "No"
            ],
            "description": "Options for multiple choice questions"
          },
          "id": {
            "type": "string",
            "description": "Unique question ID from your system (v1 format)"
          },
          "remote_id": {
            "type": "string",
            "nullable": true,
            "description": "Question ID in your ATS"
          },
          "title": {
            "type": "string",
            "description": "Question text (v1 format — alias for question)"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Elaboration on the question"
          },
          "format": {
            "nullable": true,
            "description": "Display format object (v1 format — TEXT, SINGLE_SELECT, BOOLEAN, etc.)"
          },
          "index": {
            "type": "number",
            "nullable": true,
            "description": "Display order in application"
          },
          "precondition_question_id": {
            "type": "string",
            "nullable": true,
            "description": "ID of preceding conditional question"
          },
          "precondition_options": {
            "nullable": true,
            "description": "Conditional answer options"
          }
        },
        "description": "Screening/knockout question. Accepts both v2 simplified and v1 complex ATS formats."
      },
      "CandidateSummary": {
        "type": "object",
        "properties": {
          "candidate_id": {
            "type": "string",
            "example": "cand_abc123"
          },
          "first_name": {
            "type": "string",
            "nullable": true
          },
          "last_name": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone_number": {
            "type": "string",
            "nullable": true,
            "deprecated": true,
            "description": "Deprecated v1 alias for `phone`. Will be removed in a future version."
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "nullable": true
          },
          "job_id": {
            "type": "string",
            "nullable": true,
            "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
          },
          "job_shortcode": {
            "type": "string",
            "nullable": true,
            "description": "The v1 shortcode of the job."
          },
          "job_title": {
            "type": "string",
            "nullable": true
          },
          "stage": {
            "type": "string",
            "nullable": true
          },
          "stage_kind": {
            "type": "string",
            "nullable": true,
            "description": "Coarse classification of `stage`."
          },
          "ats_stage_name": {
            "type": "string",
            "nullable": true,
            "description": "Stage name in the connected ATS, when one is synced."
          },
          "source": {
            "type": "string",
            "nullable": true,
            "example": "indeed",
            "description": "Acquisition source."
          },
          "tags": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            }
          },
          "hired_at": {
            "type": "string",
            "nullable": true,
            "description": "Set when the candidate was marked hired. The terminal signal in Classet — there is no Offer object."
          },
          "disqualified": {
            "type": "boolean",
            "nullable": true
          },
          "disqualification_reason": {
            "type": "string",
            "nullable": true
          },
          "disqualified_at": {
            "type": "string",
            "nullable": true
          },
          "ai_opt_out": {
            "type": "boolean",
            "nullable": true,
            "description": "True when the candidate has opted out of AI outreach. Do not message them."
          },
          "resume_url": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "nullable": true,
            "example": "2026-06-20T14:00:00Z",
            "description": "Last-modified timestamp of the candidate record itself. Not the delta-sync cursor: a candidate whose call changed but whose record did not keeps an older updated_at. Use changed_at."
          },
          "changed_at": {
            "type": "string",
            "nullable": true,
            "example": "2026-06-21T09:15:00Z",
            "description": "The later of updated_at and the newest interview call change (results, transcript, tags, evaluations). This is what updated_since filters on. Use it to detect change; advance your cursor to a pre-poll timestamp minus a safety lag, not to the maximum of this field."
          },
          "custom_data": {
            "nullable": true
          },
          "remote_candidate_id": {
            "type": "string",
            "nullable": true
          },
          "remote_application_id": {
            "type": "string",
            "nullable": true
          },
          "remote_job_id": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "candidate_id",
          "first_name",
          "last_name",
          "email",
          "phone_number",
          "phone",
          "job_id",
          "job_shortcode",
          "job_title",
          "stage",
          "disqualified",
          "disqualification_reason",
          "resume_url",
          "created_at",
          "updated_at",
          "changed_at"
        ],
        "description": "Candidate summary"
      },
      "CandidateDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CandidateSummary"
          },
          {
            "type": "object",
            "properties": {
              "source": {
                "type": "string",
                "nullable": true
              },
              "notes": {
                "type": "string",
                "nullable": true
              },
              "experience": {
                "nullable": true,
                "deprecated": true,
                "description": "Deprecated v1 alias for `experience_entries`. Will be removed in a future version."
              },
              "experience_entries": {
                "nullable": true
              },
              "education_entries": {
                "nullable": true
              },
              "skills": {
                "nullable": true
              },
              "summary": {
                "type": "string",
                "nullable": true
              },
              "interview_outcome": {
                "type": "string",
                "nullable": true
              },
              "interview_sent_at": {
                "type": "string",
                "nullable": true
              },
              "interview_completed_at": {
                "type": "string",
                "nullable": true
              },
              "interview_custom_data": {
                "nullable": true
              },
              "interview_summary": {
                "type": "string",
                "nullable": true
              },
              "cover_letter": {
                "type": "string",
                "nullable": true
              },
              "screening_answers": {
                "nullable": true
              },
              "answers": {
                "nullable": true,
                "description": "Application question answers supplied at apply time."
              },
              "preferred_language": {
                "type": "string",
                "nullable": true
              },
              "calls": {
                "type": "array",
                "nullable": true,
                "items": {
                  "nullable": true
                },
                "description": "Null unless ?include=calls is passed. v1 parity — raw call records."
              }
            },
            "required": [
              "source",
              "notes",
              "summary",
              "interview_outcome",
              "interview_sent_at",
              "interview_completed_at",
              "interview_summary",
              "calls"
            ]
          }
        ],
        "description": "Full candidate details"
      },
      "Message": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "example": 918273,
            "description": "Stable message id. Use it to dedupe on re-sync."
          },
          "direction": {
            "type": "string",
            "enum": [
              "outbound",
              "inbound"
            ]
          },
          "sender_type": {
            "type": "string",
            "enum": [
              "user",
              "candidate",
              "auto",
              "smart_connect",
              "ai_recruiter"
            ],
            "example": "ai_recruiter",
            "description": "Who sent it. `user` is a human recruiter in the Classet inbox, `ai_recruiter` is Joy, `auto` is a message automation, `candidate` is the candidate. `smart_connect` is retired and appears only on historical rows."
          },
          "automated": {
            "type": "boolean",
            "example": true,
            "description": "True when no human typed this message — i.e. sender_type is not `user` or `candidate`."
          },
          "text": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "message_type": {
            "type": "string",
            "enum": [
              "sms",
              "email",
              "whatsapp",
              "linkedin"
            ]
          },
          "delivery_status": {
            "type": "string",
            "nullable": true,
            "example": "delivered",
            "description": "Carrier or provider delivery state, from the channel that carried the message. Null while in flight or when the provider reported nothing."
          }
        },
        "required": [
          "id",
          "direction",
          "sender_type",
          "automated",
          "text",
          "timestamp",
          "message_type",
          "delivery_status"
        ],
        "description": "Candidate message"
      },
      "DuplicateCandidateError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "conflict"
            ]
          },
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "candidate_id": {
                "type": "string"
              },
              "webcall_url": {
                "type": "string",
                "nullable": true,
                "description": "URL for the candidate to take the interview via web call"
              },
              "interview_panel_url": {
                "type": "string",
                "nullable": true,
                "description": "Recruiter-shareable interview panel link (v1 parity)."
              }
            },
            "required": [
              "candidate_id",
              "webcall_url",
              "interview_panel_url"
            ],
            "description": "The existing candidate. Use it instead of creating another, or retry with force_create."
          }
        },
        "required": [
          "error",
          "code",
          "data"
        ]
      },
      "CandidateOptedOutError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "candidate_opted_out"
            ]
          },
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "candidate_id": {
                "type": "string"
              }
            },
            "required": [
              "candidate_id"
            ],
            "description": "The opted-out candidate."
          }
        },
        "required": [
          "error",
          "code",
          "data"
        ]
      },
      "RecentlyContactedError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "recently_contacted"
            ]
          },
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "candidate_id": {
                "type": "string"
              },
              "retry_at": {
                "type": "string",
                "nullable": true,
                "description": "When a send to this person on this job is accepted again."
              }
            },
            "required": [
              "candidate_id",
              "retry_at"
            ],
            "description": "The candidate that was contacted. Nothing was created or sent."
          }
        },
        "required": [
          "error",
          "code",
          "data"
        ]
      },
      "InviteLimitError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "example": "Resource not found"
          },
          "code": {
            "type": "string",
            "enum": [
              "not_found",
              "validation_error",
              "unauthorized",
              "forbidden",
              "insufficient_scope",
              "restricted_key_unsupported",
              "branch_out_of_scope",
              "key_misconfigured",
              "quota_exceeded",
              "rate_limited",
              "rate_limit_unavailable",
              "conflict",
              "idempotency_key_reuse",
              "candidate_opted_out",
              "recently_contacted",
              "request_in_progress",
              "unprocessable",
              "bad_request",
              "payload_too_large",
              "internal_error",
              "service_unavailable"
            ],
            "example": "not_found",
            "description": "Stable machine-readable error code."
          },
          "request_id": {
            "type": "string",
            "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
            "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
          },
          "message": {
            "type": "string",
            "description": "Which cap was hit, in words."
          },
          "exceeded_window": {
            "type": "string",
            "enum": [
              "burst",
              "sustained",
              "daily",
              "monthly"
            ],
            "description": "The send-cap window that was exceeded."
          },
          "limit": {
            "type": "integer",
            "description": "The cap for that window."
          },
          "retry_at": {
            "type": "string",
            "description": "ISO-8601 time the window frees a slot. Mirrors the Retry-After header."
          }
        },
        "required": [
          "error",
          "message"
        ]
      },
      "ApplicationSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "app_abc123"
          },
          "candidate_id": {
            "type": "string"
          },
          "job_id": {
            "type": "string",
            "nullable": true,
            "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
          },
          "job_shortcode": {
            "type": "string",
            "nullable": true,
            "description": "The v1 shortcode of the job."
          },
          "stage": {
            "type": "string",
            "nullable": true
          },
          "interview_outcome": {
            "type": "string",
            "nullable": true
          },
          "interview_sent_at": {
            "type": "string",
            "nullable": true
          },
          "interview_completed_at": {
            "type": "string",
            "nullable": true
          },
          "disqualified": {
            "type": "boolean",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "nullable": true
          },
          "applied_at": {
            "type": "string",
            "nullable": true,
            "description": "When the application was created."
          },
          "updated_at": {
            "type": "string",
            "nullable": true,
            "description": "Last change to the application row itself."
          },
          "changed_at": {
            "type": "string",
            "nullable": true,
            "description": "What `updated_since` filters on: the later of the application row and its newest interview call, so a result landing on a call counts as a change. Can be newer than updated_at."
          },
          "rejected_at": {
            "type": "string",
            "nullable": true
          },
          "rejection_reason": {
            "type": "string",
            "nullable": true
          },
          "hired_at": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true,
            "enum": [
              "active",
              "hired",
              "rejected",
              null
            ],
            "description": "Terminal state of the application. hired when hired_at is set, rejected when disqualified, otherwise active."
          },
          "first_name": {
            "type": "string",
            "nullable": true
          },
          "last_name": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "remote_application_id": {
            "type": "string",
            "nullable": true
          },
          "remote_candidate_id": {
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "nullable": true
          },
          "answers": {
            "nullable": true
          },
          "candidate_custom_data": {
            "nullable": true,
            "description": "Customer-supplied candidate metadata."
          },
          "interview_custom_data": {
            "nullable": true,
            "description": "Structured fields extracted by the recruiter during the interview."
          }
        },
        "required": [
          "id",
          "candidate_id",
          "job_id",
          "job_shortcode",
          "stage",
          "interview_outcome",
          "interview_sent_at",
          "interview_completed_at",
          "disqualified",
          "created_at",
          "source"
        ],
        "description": "Application summary"
      },
      "ApplicationDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ApplicationSummary"
          },
          {
            "type": "object",
            "properties": {
              "candidate": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "first_name": {
                    "type": "string",
                    "nullable": true
                  },
                  "last_name": {
                    "type": "string",
                    "nullable": true
                  },
                  "email": {
                    "type": "string",
                    "nullable": true
                  },
                  "phone": {
                    "type": "string",
                    "nullable": true
                  }
                },
                "required": [
                  "id",
                  "first_name",
                  "last_name",
                  "email",
                  "phone"
                ]
              },
              "screening_answers": {
                "nullable": true
              },
              "screen_summary": {
                "type": "string",
                "nullable": true
              }
            },
            "required": [
              "candidate",
              "screen_summary"
            ]
          }
        ],
        "description": "Full application details"
      },
      "Note": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "1042"
          },
          "candidate_id": {
            "type": "string"
          },
          "job_id": {
            "type": "string",
            "nullable": true,
            "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
          },
          "body": {
            "type": "string",
            "nullable": true
          },
          "note_type": {
            "type": "string",
            "nullable": true,
            "example": "recruiter_note",
            "description": "What produced the note — a recruiter comment, an AI review, a screening decision."
          },
          "rating": {
            "type": "number",
            "nullable": true,
            "description": "Score on the reviewer's scale, when one was given."
          },
          "rating_scale": {
            "type": "string",
            "nullable": true,
            "example": "1-5"
          },
          "outcome": {
            "type": "string",
            "nullable": true
          },
          "author_id": {
            "type": "string",
            "nullable": true,
            "description": "The reviewing user, when a person wrote it."
          },
          "author_name": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "candidate_id",
          "job_id",
          "body",
          "note_type",
          "rating",
          "rating_scale",
          "outcome",
          "author_id",
          "author_name",
          "created_at",
          "updated_at"
        ],
        "description": "A note or review recorded against a candidate."
      },
      "Attachment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "candidate_id": {
            "type": "string"
          },
          "file_name": {
            "type": "string",
            "nullable": true
          },
          "content_type": {
            "type": "string",
            "nullable": true
          },
          "file_size_bytes": {
            "type": "number",
            "nullable": true
          },
          "attachment_type": {
            "type": "string",
            "nullable": true,
            "example": "resume"
          },
          "source": {
            "type": "string",
            "nullable": true,
            "description": "Where the file came from — an apply flow, an upload, an ATS sync."
          },
          "uploaded_at": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "nullable": true,
            "description": "Time-limited download URL, or null when the file cannot be served. Sign a fresh one rather than storing this — it expires."
          },
          "url_expires_in_seconds": {
            "type": "number",
            "nullable": true
          }
        },
        "required": [
          "id",
          "candidate_id",
          "file_name",
          "content_type",
          "file_size_bytes",
          "attachment_type",
          "source",
          "uploaded_at",
          "url",
          "url_expires_in_seconds"
        ],
        "description": "A file attached to a candidate."
      },
      "Activity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "candidate_id": {
            "type": "string",
            "nullable": true
          },
          "job_id": {
            "type": "string",
            "nullable": true,
            "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
          },
          "action": {
            "type": "string",
            "nullable": true,
            "example": "stage_changed"
          },
          "stage_name": {
            "type": "string",
            "nullable": true
          },
          "body": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "nullable": true,
            "description": "What performed the action — a user, an automation, an ATS sync."
          },
          "created_at": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "candidate_id",
          "job_id",
          "action",
          "stage_name",
          "body",
          "user_id",
          "source",
          "created_at"
        ],
        "description": "One entry in a candidate's activity feed."
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "first_name": {
            "type": "string",
            "nullable": true
          },
          "last_name": {
            "type": "string",
            "nullable": true
          },
          "full_name": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "access_level": {
            "type": "string",
            "nullable": true
          },
          "user_type": {
            "type": "string",
            "nullable": true
          },
          "branch_ids": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            }
          },
          "archived_at": {
            "type": "string",
            "nullable": true,
            "description": "Non-null for a deactivated user."
          },
          "created_at": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "first_name",
          "last_name",
          "full_name",
          "email",
          "access_level",
          "user_type",
          "branch_ids",
          "archived_at",
          "created_at"
        ],
        "description": "A recruiter or admin in your organization."
      },
      "Branch": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "branch_name": {
            "type": "string",
            "nullable": true
          },
          "branch_code": {
            "type": "string",
            "nullable": true
          },
          "branch_type": {
            "type": "string",
            "nullable": true
          },
          "zipcode": {
            "type": "string",
            "nullable": true
          },
          "archived_at": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "branch_name",
          "branch_code",
          "branch_type",
          "zipcode",
          "archived_at",
          "created_at"
        ],
        "description": "A branch — Classet's unit of location and team scoping. The closest analogue to an ATS office or department."
      },
      "Tag": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "candidate_count": {
            "type": "integer"
          }
        },
        "required": [
          "name",
          "candidate_count"
        ],
        "description": "A candidate tag in use in your organization."
      },
      "CallDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CallSummary"
          },
          {
            "type": "object",
            "properties": {
              "recording_url": {
                "type": "string",
                "nullable": true
              },
              "transcript": {
                "nullable": true
              },
              "summary": {
                "type": "string",
                "nullable": true
              },
              "call_details": {
                "nullable": true
              },
              "questions": {
                "nullable": true,
                "description": "Question answers (v1-compatible alias)"
              },
              "questionAnswers": {
                "nullable": true,
                "description": "Question answers"
              },
              "outcome_reason": {
                "type": "string",
                "nullable": true
              },
              "evaluations": {
                "nullable": true
              },
              "disconnection_reason": {
                "type": "string",
                "nullable": true
              },
              "latest_task_completion": {
                "nullable": true
              },
              "job_id": {
                "type": "string",
                "nullable": true,
                "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
              },
              "job_shortcode": {
                "type": "string",
                "nullable": true,
                "description": "The v1 shortcode of the job."
              },
              "job_title": {
                "type": "string",
                "nullable": true,
                "description": "Associated job title"
              }
            },
            "required": [
              "recording_url",
              "summary",
              "outcome_reason",
              "disconnection_reason",
              "job_id",
              "job_shortcode",
              "job_title"
            ]
          }
        ],
        "description": "Full call details with transcript and recording"
      },
      "CallSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "call_id": {
            "type": "string",
            "nullable": true,
            "description": "v1-compatible call identifier (recruiter_calls.external_id)."
          },
          "provider_call_id": {
            "type": "string",
            "nullable": true,
            "description": "The voice provider's own call id (advanced)."
          },
          "candidate_id": {
            "type": "string",
            "nullable": true
          },
          "call_status": {
            "type": "string",
            "nullable": true,
            "example": "call_complete",
            "description": "Call status: flow_initiated, call_initiated, call_incomplete, call_complete, call_error"
          },
          "outcome_status": {
            "type": "string",
            "nullable": true
          },
          "call_type": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "call_id",
          "candidate_id",
          "call_status",
          "outcome_status",
          "call_type",
          "created_at"
        ],
        "description": "Call summary"
      },
      "ScriptListItem": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ScriptSummary"
          },
          {
            "type": "object",
            "properties": {
              "tasks": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ScriptTask"
                },
                "description": "Present only when include_tasks=true."
              },
              "deleted_at": {
                "type": "string",
                "nullable": true,
                "description": "Non-null when the script has been deleted. Only ever non-null with include_deleted=true."
              }
            },
            "required": [
              "deleted_at"
            ]
          }
        ],
        "description": "Script summary"
      },
      "ScriptTask": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "task_id": {
            "type": "integer",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "short_name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "regular_description": {
            "type": "string",
            "nullable": true,
            "description": "Human-readable description of what this task covers during the interview"
          },
          "order": {
            "type": "integer",
            "nullable": true
          },
          "questions": {
            "nullable": true
          },
          "qualifying_questions": {
            "nullable": true
          },
          "instructions": {
            "type": "string",
            "nullable": true
          },
          "removed": {
            "type": "boolean",
            "nullable": true
          },
          "needed_variables": {
            "nullable": true,
            "description": "Array of variable names this task supports (e.g. \"task.questions\", \"qualifying_questions\"). Use to determine which fields can be updated."
          }
        },
        "required": [
          "id",
          "task_id",
          "name",
          "short_name",
          "description",
          "regular_description",
          "order",
          "instructions",
          "removed"
        ],
        "description": "Interview script task"
      },
      "ScriptSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "default": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "default"
        ],
        "description": "Script summary"
      },
      "ScriptDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ScriptSummary"
          },
          {
            "type": "object",
            "properties": {
              "tasks": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ScriptTask"
                }
              },
              "completed_text_message": {
                "type": "string",
                "nullable": true,
                "description": "Post-call text message sent to candidates"
              },
              "initial_text_message": {
                "type": "string",
                "nullable": true,
                "description": "Initial outreach message sent to candidates"
              },
              "filter_out_criteria": {
                "type": "string",
                "nullable": true,
                "description": "Criteria for automatically disqualifying candidates"
              },
              "custom_summary_instructions": {
                "type": "string",
                "nullable": true,
                "description": "Instructions for AI summary generation format"
              },
              "custom_summary_example": {
                "type": "string",
                "nullable": true,
                "description": "Example summary for the AI to follow"
              },
              "transcript_parsing_instructions": {
                "type": "string",
                "nullable": true,
                "description": "Instructions for extracting custom data from transcripts"
              }
            },
            "required": [
              "tasks"
            ]
          }
        ],
        "description": "Script with tasks and agent settings"
      },
      "KnowledgeEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "scope": {
            "type": "string",
            "enum": [
              "org",
              "branch",
              "job",
              "script"
            ],
            "example": "org",
            "description": "Scope level: org-wide, branch-specific, job-specific, or script-specific"
          },
          "scope_id": {
            "type": "string",
            "nullable": true,
            "description": "Your organization ID for org scope, the branch ID for branch scope, the v2 job ID for job scope; null for script scope."
          },
          "script_id": {
            "type": "integer",
            "nullable": true,
            "description": "The script a script-scope entry belongs to."
          },
          "entry_type": {
            "type": "string",
            "enum": [
              "qa",
              "context",
              "document"
            ],
            "example": "qa"
          },
          "question": {
            "type": "string",
            "nullable": true,
            "example": "What are the working hours?"
          },
          "answer": {
            "type": "string",
            "nullable": true,
            "example": "Monday to Friday, 9am to 5pm"
          },
          "content": {
            "type": "string",
            "nullable": true,
            "description": "Free-form content for context/document types"
          },
          "created_at": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "scope",
          "scope_id",
          "script_id",
          "entry_type",
          "question",
          "answer",
          "content",
          "created_at"
        ],
        "description": "Knowledge base entry"
      },
      "WebhookConfig": {
        "type": "object",
        "properties": {
          "event_webhook_url": {
            "type": "string",
            "nullable": true,
            "description": "URL to receive candidate/call event notifications"
          },
          "results_webhook_url": {
            "type": "string",
            "nullable": true,
            "description": "URL to receive call result/completion notifications"
          },
          "has_signing_secret": {
            "type": "boolean",
            "description": "Whether a webhook signing secret is configured"
          }
        },
        "required": [
          "event_webhook_url",
          "results_webhook_url",
          "has_signing_secret"
        ],
        "description": "Organization webhook configuration"
      },
      "WebhookEventSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The event_id carried in the delivered envelope."
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivered",
              "failed"
            ],
            "description": "pending = queued or still retrying; delivered = your endpoint returned 2xx; failed = retries exhausted, or the URL was rejected before we sent."
          },
          "target_url": {
            "type": "string",
            "nullable": true
          },
          "attempt_count": {
            "type": "integer"
          },
          "response_status": {
            "type": "integer",
            "nullable": true,
            "description": "The last HTTP status your endpoint returned."
          },
          "last_error": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "nullable": true
          },
          "delivered_at": {
            "type": "string",
            "nullable": true
          },
          "failed_at": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "target_url",
          "attempt_count",
          "response_status",
          "last_error",
          "created_at",
          "delivered_at",
          "failed_at"
        ],
        "description": "One outbound delivery."
      },
      "MessageAutomation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "is_default": {
            "type": "boolean",
            "nullable": true
          },
          "agent_identity": {
            "type": "string",
            "nullable": true
          },
          "agent_config_id": {
            "type": "integer",
            "nullable": true
          },
          "created_at": {
            "type": "string"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageAutomationStep"
            }
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "is_default",
          "agent_identity",
          "agent_config_id",
          "created_at",
          "steps"
        ],
        "description": "Message automation with its steps"
      },
      "MessageAutomationStep": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "channel": {
            "type": "string",
            "nullable": true,
            "enum": [
              "sms",
              "email",
              "whatsapp",
              null
            ],
            "description": "Messaging channel"
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "delay_hours": {
            "type": "number"
          },
          "enabled": {
            "type": "boolean",
            "nullable": true
          },
          "order": {
            "type": "integer"
          },
          "message_automation_id": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "channel",
          "message",
          "delay_hours",
          "enabled",
          "order",
          "message_automation_id"
        ],
        "description": "A single step in a message automation sequence"
      },
      "MessageAutomationSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "is_default": {
            "type": "boolean",
            "nullable": true
          },
          "agent_identity": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "is_default",
          "agent_identity",
          "created_at"
        ],
        "description": "Message automation summary"
      },
      "AgentSettings": {
        "type": "object",
        "properties": {
          "agent_name": {
            "type": "string",
            "nullable": true,
            "description": "Name the AI recruiter uses for itself with candidates",
            "example": "Joy"
          },
          "voice_id": {
            "type": "string",
            "nullable": true,
            "description": "Voice the recruiter speaks with. `null` when no voice is set for a voice model other than the default one.",
            "example": "Ashley"
          },
          "voice_model": {
            "type": "string",
            "description": "Text-to-speech model behind the voice. Read-only: Classet sets it for your organization.",
            "example": "inworld/inworld-tts-2-flash"
          },
          "voice_speed": {
            "type": "number",
            "nullable": true,
            "description": "Speaking rate, where 1.0 is the natural pace of the voice. `null` when the voice model has no rate control.",
            "example": 1.1
          },
          "pronunciations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentPronunciation"
            },
            "description": "Words the recruiter says a specific way, such as your company name"
          },
          "available_voices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentVoiceOption"
            },
            "description": "The voices you can set as `voice_id` on the current voice model"
          }
        },
        "required": [
          "agent_name",
          "voice_id",
          "voice_model",
          "voice_speed",
          "pronunciations",
          "available_voices"
        ],
        "description": "Name, voice and pronunciations of your AI recruiter"
      },
      "AgentPronunciation": {
        "type": "object",
        "properties": {
          "word": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "description": "The word or name as it appears in what the recruiter says. Matched case-insensitively.",
            "example": "Nguyen Mechanical"
          },
          "phoneme": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "How to say it, in IPA. Must not contain `<`, `>`, `|`, `/` or `\\`.",
            "example": "wɪn məˈkænɪkəl"
          }
        },
        "required": [
          "word",
          "phoneme"
        ],
        "additionalProperties": false
      },
      "AgentVoiceOption": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Pass this as `voice_id`",
            "example": "Ashley"
          },
          "name": {
            "type": "string",
            "example": "Ashley"
          },
          "description": {
            "type": "string",
            "example": "Warm, natural American female"
          },
          "language": {
            "type": "string",
            "description": "Language and accent of the voice",
            "example": "en-US"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "language"
        ]
      },
      "Organization": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "7e7c5180-3326-496e-ad83-0cab8da44b9a"
          },
          "name": {
            "type": "string",
            "example": "Acme Staffing"
          },
          "account_type": {
            "type": "string",
            "nullable": true
          },
          "domain": {
            "type": "string",
            "nullable": true
          },
          "careers_page_url": {
            "type": "string",
            "nullable": true
          },
          "branch_count": {
            "type": "integer",
            "description": "Active branches. Greater than zero means jobs and users are branch-scoped — see GET /v2/branches."
          },
          "capabilities": {
            "$ref": "#/components/schemas/OrganizationCapabilities"
          },
          "voice": {
            "$ref": "#/components/schemas/OrganizationVoice"
          },
          "limits": {
            "$ref": "#/components/schemas/OrganizationLimits"
          },
          "webhooks": {
            "$ref": "#/components/schemas/OrganizationWebhooks"
          },
          "api_version": {
            "type": "string",
            "example": "2.0.0"
          }
        },
        "required": [
          "id",
          "name",
          "account_type",
          "domain",
          "careers_page_url",
          "branch_count",
          "capabilities",
          "voice",
          "limits",
          "webhooks",
          "api_version"
        ],
        "description": "The caller's organization and its configuration"
      },
      "OrganizationCapabilities": {
        "type": "object",
        "properties": {
          "candidate_messaging": {
            "type": "boolean",
            "description": "Two-way SMS/email with candidates is available in the UI for this org."
          },
          "interview_scheduling": {
            "type": "boolean"
          },
          "instant_interview": {
            "type": "boolean",
            "description": "Candidates can start a screen immediately on applying, rather than waiting for outreach."
          },
          "campaigns": {
            "type": "boolean"
          },
          "careers_page": {
            "type": "boolean"
          },
          "indeed": {
            "type": "boolean"
          },
          "multi_language": {
            "type": "boolean",
            "description": "Calls use language detection and a single callback number. See `voice.languages`."
          },
          "call_recording": {
            "type": "boolean"
          }
        },
        "required": [
          "candidate_messaging",
          "interview_scheduling",
          "instant_interview",
          "campaigns",
          "careers_page",
          "indeed",
          "multi_language",
          "call_recording"
        ]
      },
      "OrganizationVoice": {
        "type": "object",
        "properties": {
          "agent_name": {
            "type": "string",
            "nullable": true,
            "example": "Joy"
          },
          "phone_number": {
            "type": "string",
            "nullable": true,
            "example": "+15555555555",
            "description": "The number candidates are called from and can call back on."
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "en",
              "es"
            ],
            "description": "Languages this org has an agent configured for. An empty list means English only."
          }
        },
        "required": [
          "agent_name",
          "phone_number",
          "languages"
        ]
      },
      "OrganizationLimits": {
        "type": "object",
        "properties": {
          "rate_limit_sustained": {
            "type": "integer",
            "nullable": true,
            "description": "Sustained requests per minute for this org. Null means the platform default applies."
          },
          "rate_limit_burst": {
            "type": "integer",
            "nullable": true
          },
          "daily_interview_invite_cap": {
            "type": "integer",
            "nullable": true,
            "description": "Maximum interview invitations per day. Null means uncapped."
          },
          "monthly_interview_invite_cap": {
            "type": "integer",
            "nullable": true
          },
          "allowed_phone_regions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "US",
              "CA"
            ],
            "description": "ISO country codes this org accepts candidate phone numbers from. A number outside this list is rejected at candidate creation. Empty means no restriction is configured."
          }
        },
        "required": [
          "rate_limit_sustained",
          "rate_limit_burst",
          "daily_interview_invite_cap",
          "monthly_interview_invite_cap",
          "allowed_phone_regions"
        ]
      },
      "OrganizationWebhooks": {
        "type": "object",
        "properties": {
          "event_webhook_url_configured": {
            "type": "boolean"
          },
          "results_webhook_url_configured": {
            "type": "boolean"
          },
          "has_signing_secret": {
            "type": "boolean",
            "description": "Whether deliveries are signed. Verify signatures — see GET /v2/webhooks."
          },
          "available_events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every event type this API can deliver. All of them go to the configured event webhook URL; there is no per-event subscription."
          }
        },
        "required": [
          "event_webhook_url_configured",
          "results_webhook_url_configured",
          "has_signing_secret",
          "available_events"
        ]
      },
      "Me": {
        "type": "object",
        "properties": {
          "api_key_id": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "The name the key was created with."
          },
          "organization_id": {
            "type": "string",
            "description": "The organization that owns the key."
          },
          "org_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Organizations the key can read: its own, or every member of its organization group."
          },
          "branch_ids": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            },
            "description": "Branches the key is limited to, or null for the whole organization. A branch-limited key sees only jobs in these branches and their candidates; jobs with no branch are outside it."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "write",
                "interviews:send"
              ]
            },
            "description": "`read` for GETs, `write` for any other method, `interviews:send` to start or stop an interview."
          },
          "capabilities": {
            "type": "object",
            "properties": {
              "mcp_writes": {
                "type": "boolean",
                "description": "The Classet MCP offers its write tools to this key."
              },
              "mcp_interviews": {
                "type": "boolean",
                "description": "The Classet MCP offers its send/stop interview tools to this key."
              }
            },
            "required": [
              "mcp_writes",
              "mcp_interviews"
            ],
            "description": "What the Classet MCP server should offer this key. Each needs its rollout flag and the matching scope."
          }
        },
        "required": [
          "api_key_id",
          "name",
          "organization_id",
          "org_ids",
          "branch_ids",
          "scopes",
          "capabilities"
        ],
        "description": "The calling API key: what it can see and do. Never includes key material."
      }
    },
    "parameters": {}
  },
  "paths": {
    "/v2/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Health check",
        "responses": {
          "200": {
            "description": "API is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/jobs": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "summary": "List jobs",
        "description": "Retrieve a paginated list of jobs for your organization. Supports incremental sync via `updated_since` and lookup by your own `external_id`. The list includes wage, benefits, and application_questions, so a per-job follow-up call is not needed. Deleting a job archives it rather than removing the row, so an `updated_since` sync sees the deletion as a job whose `state` became `archived` — filter on `state` rather than treating a disappearance as a delete. A branch-limited key lists only jobs in its branches; a job with no branch is outside every branch-limited key. An organization-group key lists jobs across every organization in its group.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "default": "1",
              "example": "1",
              "description": "Page number (1-based). Defaults to 1."
            },
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "default": "20",
              "example": "20",
              "description": "Results per page. Defaults to 20, maximum 50."
            },
            "required": false,
            "description": "Results per page. Defaults to 20, maximum 50.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-06-01T00:00:00Z",
              "description": "ISO-8601 timestamp. Only return jobs whose updated_at is greater than or equal to this — use for incremental/delta sync."
            },
            "required": false,
            "description": "ISO-8601 timestamp. Only return jobs whose updated_at is greater than or equal to this — use for incremental/delta sync.",
            "name": "updated_since",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "example": "CC-REQ-48217",
              "description": "Return only jobs whose external_id matches exactly (your internal job ID)."
            },
            "required": false,
            "description": "Return only jobs whose external_id matches exactly (your internal job ID).",
            "name": "external_id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "example": "2026-06-01",
              "description": "Inclusive lower bound on created_at (YYYY-MM-DD or ISO-8601)."
            },
            "required": false,
            "description": "Inclusive lower bound on created_at (YYYY-MM-DD or ISO-8601).",
            "name": "created_after",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "example": "2026-07-01",
              "description": "Inclusive upper bound on created_at. A YYYY-MM-DD date includes that whole day (UTC); an ISO-8601 timestamp is inclusive to that instant."
            },
            "required": false,
            "description": "Inclusive upper bound on created_at. A YYYY-MM-DD date includes that whole day (UTC); an ISO-8601 timestamp is inclusive to that instant.",
            "name": "created_before",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "published",
                "closed",
                "archived",
                "user_draft",
                "parsing"
              ],
              "example": "published",
              "description": "Filter by lifecycle state. Archived jobs are returned by default; pass state=published to list only active jobs."
            },
            "required": false,
            "description": "Filter by lifecycle state. Archived jobs are returned by default; pass state=published to list only active jobs.",
            "name": "state",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Only jobs belonging to this branch."
            },
            "required": false,
            "description": "Only jobs belonging to this branch.",
            "name": "branch_id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/JobSummary"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "example": 1
                        },
                        "limit": {
                          "type": "integer",
                          "example": 20
                        },
                        "total": {
                          "type": "integer",
                          "example": 42,
                          "description": "Estimated, not exact. Do not page until page * limit >= total — follow meta.next_cursor instead."
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Present when the request used ?cursor=. Pass back to fetch the next page."
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Jobs"
        ],
        "summary": "Create a job",
        "description": "Create a new job posting for your organization.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "example": "Senior Software Engineer"
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1,
                    "example": "We are looking for..."
                  },
                  "external_id": {
                    "type": "string",
                    "minLength": 1,
                    "example": "CC-REQ-48217",
                    "description": "Your own internal job identifier. Stored as-is and searchable via GET /v2/jobs?external_id=. Independent of any ATS sync."
                  },
                  "location": {
                    "$ref": "#/components/schemas/Location"
                  },
                  "wage_lower_bound": {
                    "type": "number",
                    "example": 120000
                  },
                  "wage_upper_bound": {
                    "type": "number",
                    "example": 180000
                  },
                  "wage_type": {
                    "type": "string",
                    "enum": [
                      "hourly",
                      "daily",
                      "weekly",
                      "monthly",
                      "annually"
                    ],
                    "example": "annually"
                  },
                  "script_id": {
                    "type": "integer",
                    "example": 42
                  },
                  "benefits": {
                    "type": "string",
                    "example": "Health insurance, 401k, unlimited PTO"
                  },
                  "faqs": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/FAQ"
                    },
                    "minItems": 1
                  },
                  "application_questions": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ApplicationQuestion"
                    }
                  },
                  "additional_subscriber_emails": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "nullable": true,
                          "description": "Subscriber ID from your system"
                        },
                        "email": {
                          "type": "string",
                          "format": "email"
                        },
                        "first_name": {
                          "type": "string"
                        },
                        "last_name": {
                          "type": "string"
                        },
                        "remote_id": {
                          "type": "string",
                          "nullable": true,
                          "description": "Remote subscriber ID from ATS"
                        },
                        "hiring_team_roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Hiring team roles"
                        }
                      },
                      "required": [
                        "email"
                      ]
                    }
                  },
                  "custom_data": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": {
                      "nullable": true
                    }
                  },
                  "full_title": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Override the derived display title."
                  },
                  "full_description": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Override the full description; otherwise description is used."
                  },
                  "requirements": {
                    "type": "string",
                    "nullable": true
                  },
                  "geo": {
                    "type": "string",
                    "nullable": true,
                    "example": "POINT(-97.74 30.27)"
                  },
                  "employment_type": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1
                  },
                  "wage_currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$",
                    "example": "USD"
                  },
                  "company": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Display company name; defaults to your organization name."
                  },
                  "branch_id": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "description": "An active branch belonging to your organization, or null for no branch."
                  },
                  "code": {
                    "type": "string",
                    "nullable": true
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "published",
                      "closed",
                      "archived",
                      "user_draft",
                      "parsing"
                    ],
                    "description": "Job lifecycle state. New jobs default to published."
                  },
                  "url": {
                    "type": "string",
                    "nullable": true,
                    "format": "uri"
                  },
                  "screening_requirements": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": {
                      "nullable": true
                    }
                  },
                  "interview_script_id": {
                    "type": "integer",
                    "minimum": 0,
                    "exclusiveMinimum": true,
                    "description": "Alias for script_id. If both are supplied they must match."
                  },
                  "ats_ai_recruiter_on": {
                    "type": "boolean",
                    "description": "Enable or pause AI screening. Enabling requires the applicable plan entitlement and an API key with the `interviews:send` scope."
                  },
                  "subscribers": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "User IDs in your organization with access to the job branch. Replaces the subscriber list."
                  },
                  "benefits_array": {
                    "type": "array",
                    "nullable": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "languages_enabled": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[a-z]{2}$"
                    },
                    "description": "Interview languages. Newly enabled languages must be included in your organization entitlement."
                  }
                },
                "required": [
                  "title",
                  "description",
                  "location"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Job created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "job_id": {
                          "type": "string",
                          "example": "abc123def",
                          "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
                        }
                      },
                      "required": [
                        "job_id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Language or AI screening entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/jobs/{jobId}": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "summary": "Get job details",
        "description": "Retrieve detailed information about a specific job. `{jobId}` accepts a v2 job ID or a v1 job shortcode.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "example": "abc123def",
              "description": "v2 job ID or v1 job shortcode."
            },
            "required": true,
            "description": "v2 job ID or v1 job shortcode.",
            "name": "jobId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Job details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/JobDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Jobs"
        ],
        "summary": "Update a job",
        "description": "Update an existing job posting.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "example": "abc123def"
            },
            "required": true,
            "name": "jobId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1
                  },
                  "external_id": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "example": "CC-REQ-48217",
                    "description": "Your own internal job identifier (pass null to clear)."
                  },
                  "location": {
                    "$ref": "#/components/schemas/Location"
                  },
                  "wage_lower_bound": {
                    "type": "number"
                  },
                  "wage_upper_bound": {
                    "type": "number"
                  },
                  "wage_type": {
                    "type": "string",
                    "enum": [
                      "hourly",
                      "daily",
                      "weekly",
                      "monthly",
                      "annually"
                    ]
                  },
                  "script_id": {
                    "type": "integer"
                  },
                  "benefits": {
                    "type": "string"
                  },
                  "faqs": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/FAQ"
                    },
                    "minItems": 1
                  },
                  "application_questions": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ApplicationQuestion"
                    }
                  },
                  "additional_subscriber_emails": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": "string",
                          "format": "email"
                        },
                        "first_name": {
                          "type": "string"
                        },
                        "last_name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "email"
                      ]
                    }
                  },
                  "custom_data": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": {
                      "nullable": true
                    }
                  },
                  "full_title": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Override the derived display title."
                  },
                  "full_description": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Override the full description; otherwise description is used."
                  },
                  "requirements": {
                    "type": "string",
                    "nullable": true
                  },
                  "geo": {
                    "type": "string",
                    "nullable": true,
                    "example": "POINT(-97.74 30.27)"
                  },
                  "employment_type": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1
                  },
                  "wage_currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$",
                    "example": "USD"
                  },
                  "company": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Display company name; defaults to your organization name."
                  },
                  "branch_id": {
                    "type": "string",
                    "nullable": true,
                    "minLength": 1,
                    "description": "An active branch belonging to your organization, or null for no branch."
                  },
                  "code": {
                    "type": "string",
                    "nullable": true
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "published",
                      "closed",
                      "archived",
                      "user_draft",
                      "parsing"
                    ],
                    "description": "Job lifecycle state. New jobs default to published."
                  },
                  "url": {
                    "type": "string",
                    "nullable": true,
                    "format": "uri"
                  },
                  "screening_requirements": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": {
                      "nullable": true
                    }
                  },
                  "interview_script_id": {
                    "type": "integer",
                    "minimum": 0,
                    "exclusiveMinimum": true,
                    "description": "Alias for script_id. If both are supplied they must match."
                  },
                  "ats_ai_recruiter_on": {
                    "type": "boolean",
                    "description": "Enable or pause AI screening. Enabling requires the applicable plan entitlement and an API key with the `interviews:send` scope."
                  },
                  "subscribers": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "User IDs in your organization with access to the job branch. Replaces the subscriber list."
                  },
                  "benefits_array": {
                    "type": "array",
                    "nullable": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "languages_enabled": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[a-z]{2}$"
                    },
                    "description": "Interview languages. Newly enabled languages must be included in your organization entitlement."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "job_id": {
                          "type": "string",
                          "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
                        }
                      },
                      "required": [
                        "job_id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid script, custom data, branch or subscribers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Language or AI screening entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Jobs"
        ],
        "summary": "Delete a job",
        "description": "Soft-delete a job posting (sets state to archived).",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "example": "abc123def"
            },
            "required": true,
            "name": "jobId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Job deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Job archived"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/jobs/{jobId}/stages": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "summary": "List a job's pipeline stages",
        "description": "The stage names valid for this job, in pipeline order where one is configured. Use these with PUT /v2/applications/{applicationId}/stage. Most jobs have no explicitly configured pipeline, in which case this returns the stages actually in use on the job (source: `in_use`). `{jobId}` accepts a v2 job ID or a v1 job shortcode.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "v2 job ID or v1 job shortcode."
            },
            "required": true,
            "description": "v2 job ID or v1 job shortcode.",
            "name": "jobId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Stage catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "example": "Phone Screened"
                          },
                          "order": {
                            "type": "integer",
                            "nullable": true
                          },
                          "application_count": {
                            "type": "integer",
                            "nullable": true
                          }
                        },
                        "required": [
                          "name",
                          "order",
                          "application_count"
                        ]
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "string",
                          "enum": [
                            "default_stage_names",
                            "ats_stages",
                            "in_use"
                          ],
                          "description": "Where the list came from. `in_use` means it was derived from live applications."
                        }
                      },
                      "required": [
                        "source"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/candidates": {
      "get": {
        "tags": [
          "Candidates"
        ],
        "summary": "List candidates",
        "description": "Retrieve a paginated list of candidates for your organization. Each candidate is linked to a job via shortcode, so only candidates associated with your org's jobs are returned. Supports incremental sync via `updated_since` — use it instead of re-walking the full list on a schedule.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "default": "1",
              "example": "1",
              "description": "Page number (1-based). Defaults to 1."
            },
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "default": "20",
              "example": "20",
              "description": "Results per page. Defaults to 20, maximum 50."
            },
            "required": false,
            "description": "Results per page. Defaults to 20, maximum 50.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by email"
            },
            "required": false,
            "description": "Filter by email",
            "name": "email",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by phone"
            },
            "required": false,
            "description": "Filter by phone",
            "name": "phone",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Comma-separated list of candidate IDs to filter",
              "example": "cand_abc123,cand_def456"
            },
            "required": false,
            "description": "Comma-separated list of candidate IDs to filter",
            "name": "candidate_ids",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Search by name, email, or phone"
            },
            "required": false,
            "description": "Search by name, email, or phone",
            "name": "search",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Only candidates on this job. Accepts a v2 job ID or a v1 job shortcode."
            },
            "required": false,
            "description": "Only candidates on this job. Accepts a v2 job ID or a v1 job shortcode.",
            "name": "job_id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by pipeline stage, e.g. Applied."
            },
            "required": false,
            "description": "Filter by pipeline stage, e.g. Applied.",
            "name": "stage",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by acquisition source, e.g. indeed."
            },
            "required": false,
            "description": "Filter by acquisition source, e.g. indeed.",
            "name": "source",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ],
              "description": "Filter to only disqualified or only active candidates."
            },
            "required": false,
            "description": "Filter to only disqualified or only active candidates.",
            "name": "disqualified",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-06-01T00:00:00Z",
              "description": "ISO-8601 timestamp. Only return candidates whose `changed_at` is greater than or equal to this — use for incremental/delta sync instead of paginating the whole list. `changed_at` covers the candidate record AND its interview calls, so interview results, transcripts, tags and evaluations landing on an existing candidate are picked up. Advance your cursor to a timestamp captured before the poll started, minus a safety lag (5 minutes), never to max(changed_at): results are ordered by created_at, so a row changed mid-poll can land on a page you already fetched."
            },
            "required": false,
            "description": "ISO-8601 timestamp. Only return candidates whose `changed_at` is greater than or equal to this — use for incremental/delta sync instead of paginating the whole list. `changed_at` covers the candidate record AND its interview calls, so interview results, transcripts, tags and evaluations landing on an existing candidate are picked up. Advance your cursor to a timestamp captured before the poll started, minus a safety lag (5 minutes), never to max(changed_at): results are ordered by created_at, so a row changed mid-poll can land on a page you already fetched.",
            "name": "updated_since",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Opaque cursor from a previous response's meta.next_cursor. Prefer this over `page` for full syncs — offset pages shift under you when rows are being written."
            },
            "required": false,
            "description": "Opaque cursor from a previous response's meta.next_cursor. Prefer this over `page` for full syncs — offset pages shift under you when rows are being written.",
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of candidates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CandidateSummary"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "example": 1
                        },
                        "limit": {
                          "type": "integer",
                          "example": 20
                        },
                        "total": {
                          "type": "integer",
                          "example": 42,
                          "description": "Estimated, not exact. Do not page until page * limit >= total — follow meta.next_cursor instead."
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Present when the request used ?cursor=. Pass back to fetch the next page."
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Candidates"
        ],
        "summary": "Create a candidate",
        "description": "Create a new candidate and associate them with a job. Optionally trigger interview outreach via SMS and/or email. If neither send_sms nor send_email is set, the candidate is created without initiating the interview — use the returned webcall_url to share the interview link through your own channels. When outreach is sent, `call_id` is the id GET /v2/calls/{callId} resolves (v1 parity); it is null when nothing was sent. A 409 means a candidate with the same email or phone already exists on this job — its links are under `data`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "nullable": true,
                    "format": "email",
                    "example": "jane@example.com"
                  },
                  "first_name": {
                    "type": "string",
                    "minLength": 1,
                    "example": "Jane"
                  },
                  "last_name": {
                    "type": "string",
                    "minLength": 1,
                    "example": "Doe"
                  },
                  "phone": {
                    "type": "string",
                    "nullable": true,
                    "pattern": "^\\+[1-9]\\d{1,14}$",
                    "example": "+15555555555"
                  },
                  "location": {
                    "type": "object",
                    "properties": {
                      "city": {
                        "type": "string"
                      },
                      "region": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string"
                      },
                      "zip_code": {
                        "type": "string"
                      },
                      "region_code": {
                        "type": "string",
                        "nullable": true
                      },
                      "country_code": {
                        "type": "string",
                        "nullable": true
                      },
                      "location_str": {
                        "type": "string"
                      }
                    }
                  },
                  "resume_url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://storage.example.com/resumes/ada.pdf",
                    "description": "HTTPS URL we can fetch the resume from. Internal and private addresses are rejected."
                  },
                  "experience_entries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "company": {
                          "type": "string"
                        },
                        "current": {
                          "type": "boolean"
                        },
                        "summary": {
                          "type": "string"
                        },
                        "start_date": {
                          "type": "string"
                        },
                        "end_date": {
                          "type": "string",
                          "nullable": true
                        },
                        "industry": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "title"
                      ]
                    }
                  },
                  "education_entries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "school": {
                          "type": "string"
                        },
                        "degree": {
                          "type": "string"
                        },
                        "field_of_study": {
                          "type": "string"
                        },
                        "start_date": {
                          "type": "string"
                        },
                        "end_date": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "skills": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "summary": {
                    "type": "string"
                  },
                  "candidate_summary": {
                    "type": "string",
                    "description": "Alias for `summary` (v1 compatibility)."
                  },
                  "custom_data": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": {
                      "nullable": true
                    }
                  },
                  "external_id": {
                    "type": "string",
                    "minLength": 1,
                    "example": "ats-applicant-8812",
                    "description": "Your own id for this applicant. Stored and returned as remote_application_id / remote_candidate_id. Not unique and not used to deduplicate: use an Idempotency-Key header to make a retry safe."
                  },
                  "job_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Job ID to associate the candidate with. v1 job shortcode is also accepted during migration."
                  },
                  "phone_number": {
                    "type": "string",
                    "pattern": "^\\+[1-9]\\d{1,14}$",
                    "deprecated": true,
                    "description": "Deprecated v1 alias for `phone`. Will be removed in a future version."
                  },
                  "experience": {
                    "type": "array",
                    "items": {
                      "nullable": true
                    },
                    "deprecated": true,
                    "description": "Deprecated v1 alias for `experience_entries`. Will be removed in a future version."
                  },
                  "send_sms": {
                    "type": "boolean",
                    "default": false,
                    "description": "Send SMS to initiate interview outreach"
                  },
                  "send_email": {
                    "type": "boolean",
                    "default": false,
                    "description": "Send email to initiate interview outreach"
                  },
                  "force_create": {
                    "type": "boolean",
                    "default": false,
                    "description": "Create even if candidate with same email or phone exists for this job"
                  },
                  "answers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "object",
                          "properties": {
                            "body": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "body"
                          ]
                        },
                        "answer": {
                          "type": "object",
                          "properties": {
                            "body": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "body"
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "answer"
                      ]
                    },
                    "description": "Pre-filled answers to application questions"
                  }
                },
                "required": [
                  "first_name",
                  "last_name",
                  "job_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replayed: this repeats a create from the last 12 hours for the same person (same phone, email and name) and job. The existing candidate is returned with `replayed: true` and no candidate is created. If the request asks for outreach and that candidate was never contacted, the outreach is started on it and `interview_status` is `in_progress`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "candidate_id": {
                          "type": "string"
                        },
                        "webcall_url": {
                          "type": "string",
                          "nullable": true,
                          "description": "URL for the candidate to take the interview via web call"
                        },
                        "interview_panel_url": {
                          "type": "string",
                          "nullable": true,
                          "description": "Recruiter-shareable interview panel link (v1 parity)."
                        },
                        "call_id": {
                          "type": "string",
                          "nullable": true
                        },
                        "replayed": {
                          "type": "boolean",
                          "enum": [
                            true
                          ],
                          "description": "Present when this request repeated a create from the last 12 hours for the same person and job. The existing candidate is returned and none is created. Read `interview_status` for whether outreach has started."
                        },
                        "interview_status": {
                          "type": "string",
                          "enum": [
                            "not_sent",
                            "in_progress",
                            "completed"
                          ],
                          "description": "With `replayed`: the returned candidate's interview status, as GET /v2/candidates/{id}/interview reports it. `in_progress` covers an interview that is queued as well as one that was sent. If `not_sent`, start one with POST /v2/candidates/{id}/interview."
                        }
                      },
                      "required": [
                        "candidate_id",
                        "webcall_url",
                        "interview_panel_url",
                        "call_id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "201": {
            "description": "Candidate created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "candidate_id": {
                          "type": "string"
                        },
                        "webcall_url": {
                          "type": "string",
                          "nullable": true,
                          "description": "URL for the candidate to take the interview via web call"
                        },
                        "interview_panel_url": {
                          "type": "string",
                          "nullable": true,
                          "description": "Recruiter-shareable interview panel link (v1 parity)."
                        },
                        "call_id": {
                          "type": "string",
                          "nullable": true,
                          "description": "The flow_initiated call this send created (v1 parity). Null when no outreach was sent."
                        }
                      },
                      "required": [
                        "candidate_id",
                        "webcall_url",
                        "interview_panel_url",
                        "call_id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Free-trial interview allowance exhausted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Candidate already exists (`conflict`); outreach was requested for a candidate on this job who opted out of AI (`candidate_opted_out`, regardless of force_create); or outreach was requested for a phone number (an email, for a candidate with no phone) contacted on this job in the last 12 hours (`recently_contacted`, regardless of force_create)",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/DuplicateCandidateError"
                    },
                    {
                      "$ref": "#/components/schemas/CandidateOptedOutError"
                    },
                    {
                      "$ref": "#/components/schemas/RecentlyContactedError"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string",
                          "example": "Resource not found"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found",
                            "validation_error",
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "restricted_key_unsupported",
                            "branch_out_of_scope",
                            "key_misconfigured",
                            "quota_exceeded",
                            "rate_limited",
                            "rate_limit_unavailable",
                            "conflict",
                            "idempotency_key_reuse",
                            "candidate_opted_out",
                            "recently_contacted",
                            "request_in_progress",
                            "unprocessable",
                            "bad_request",
                            "payload_too_large",
                            "internal_error",
                            "service_unavailable"
                          ],
                          "example": "not_found",
                          "description": "Stable machine-readable error code."
                        },
                        "request_id": {
                          "type": "string",
                          "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                          "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                        }
                      },
                      "required": [
                        "error"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Candidate is unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Interview invite limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteLimitError"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "External mutations or invite rate limiting are not available",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/candidates/{candidateId}": {
      "get": {
        "tags": [
          "Candidates"
        ],
        "summary": "Get candidate details",
        "description": "Retrieve a single candidate. By default `calls` is null — pass `include=calls` to embed the raw call records (transcript, recording, questions) the way v1 did. Prefer GET /candidates/{candidateId}/interview, which returns the one aggregated result most integrators actually want.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "candidateId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "example": "calls",
              "description": "Comma-separated list of extra data to embed. Supported: `calls` (v1 parity — embeds the raw call records)."
            },
            "required": false,
            "description": "Comma-separated list of extra data to embed. Supported: `calls` (v1 parity — embeds the raw call records).",
            "name": "include",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Candidate details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CandidateDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Candidates"
        ],
        "summary": "Update a candidate",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "candidateId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "first_name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "last_name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "phone": {
                    "type": "string",
                    "pattern": "^\\+[1-9]\\d{1,14}$"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "job_id": {
                    "type": "string",
                    "description": "Reassign candidate to a different job"
                  },
                  "location": {
                    "type": "object",
                    "properties": {
                      "city": {
                        "type": "string"
                      },
                      "region": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string"
                      },
                      "zip_code": {
                        "type": "string"
                      },
                      "region_code": {
                        "type": "string",
                        "nullable": true
                      },
                      "country_code": {
                        "type": "string",
                        "nullable": true
                      },
                      "location_str": {
                        "type": "string"
                      }
                    }
                  },
                  "resume_url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://storage.example.com/resumes/ada.pdf",
                    "description": "HTTPS URL we can fetch the resume from. Internal and private addresses are rejected."
                  },
                  "experience_entries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "company": {
                          "type": "string"
                        },
                        "current": {
                          "type": "boolean"
                        },
                        "summary": {
                          "type": "string"
                        },
                        "start_date": {
                          "type": "string"
                        },
                        "end_date": {
                          "type": "string",
                          "nullable": true
                        },
                        "industry": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "title"
                      ]
                    }
                  },
                  "education_entries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "school": {
                          "type": "string"
                        },
                        "degree": {
                          "type": "string"
                        },
                        "field_of_study": {
                          "type": "string"
                        },
                        "start_date": {
                          "type": "string"
                        },
                        "end_date": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "skills": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "summary": {
                    "type": "string"
                  },
                  "candidate_summary": {
                    "type": "string",
                    "description": "Alias for summary (v1 compatibility)"
                  },
                  "answers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "object",
                          "properties": {
                            "body": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "body"
                          ]
                        },
                        "answer": {
                          "type": "object",
                          "properties": {
                            "body": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "body"
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "answer"
                      ]
                    },
                    "description": "Application question answers"
                  },
                  "custom_data": {
                    "type": "object",
                    "nullable": true,
                    "additionalProperties": {
                      "nullable": true
                    },
                    "description": "Top-level merge on update; null values delete individual keys and null clears the object."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "External mutations are not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/candidates/{candidateId}/interview": {
      "get": {
        "tags": [
          "Candidates"
        ],
        "summary": "Get the candidate's interview",
        "description": "Returns the candidate's interview as a single aggregated result (status, outcome, summary) rather than a list of raw call rows. This is the recommended way to consume screening results — poll it or, preferably, receive the interview.completed webhook. Use GET /candidates/:id/calls only for raw per-attempt call records (advanced).",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "candidateId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Aggregated interview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterviewDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Candidates"
        ],
        "summary": "Send interview to candidate",
        "description": "Initiate the AI interview outreach sequence for an existing candidate. At least one of send_sms or send_email must be true.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "candidateId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "send_sms": {
                    "type": "boolean",
                    "default": false,
                    "description": "Send SMS outreach"
                  },
                  "send_email": {
                    "type": "boolean",
                    "default": false,
                    "description": "Send email outreach"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Interview initiated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "candidate_id": {
                          "type": "string"
                        },
                        "webcall_url": {
                          "type": "string"
                        },
                        "interview_panel_url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "candidate_id",
                        "webcall_url",
                        "interview_panel_url"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Interview already initiated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Free-trial interview allowance exhausted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Candidate not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Candidate opted out of AI outreach (`candidate_opted_out`), or another record with the same phone number on this job was contacted in the last 12 hours (`recently_contacted`)",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CandidateOptedOutError"
                    },
                    {
                      "$ref": "#/components/schemas/RecentlyContactedError"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string",
                          "example": "Resource not found"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found",
                            "validation_error",
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "restricted_key_unsupported",
                            "branch_out_of_scope",
                            "key_misconfigured",
                            "quota_exceeded",
                            "rate_limited",
                            "rate_limit_unavailable",
                            "conflict",
                            "idempotency_key_reuse",
                            "candidate_opted_out",
                            "recently_contacted",
                            "request_in_progress",
                            "unprocessable",
                            "bad_request",
                            "payload_too_large",
                            "internal_error",
                            "service_unavailable"
                          ],
                          "example": "not_found",
                          "description": "Stable machine-readable error code."
                        },
                        "request_id": {
                          "type": "string",
                          "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                          "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                        }
                      },
                      "required": [
                        "error"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Must provide send_sms or send_email",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Interview invite limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteLimitError"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "External mutations or invite rate limiting are not available",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/candidates/{candidateId}/messages": {
      "get": {
        "tags": [
          "Candidates"
        ],
        "summary": "List candidate messages",
        "description": "Retrieve SMS, email, and other messages for a candidate.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "candidateId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "default": "1",
              "example": "1",
              "description": "Page number (1-based). Defaults to 1."
            },
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "default": "50",
              "example": "50",
              "description": "Results per page. Defaults to 50, maximum 100."
            },
            "required": false,
            "description": "Results per page. Defaults to 50, maximum 100.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-06-01T00:00:00Z",
              "description": "Only messages created at or after this timestamp."
            },
            "required": false,
            "description": "Only messages created at or after this timestamp.",
            "name": "start_date",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-07-01T00:00:00Z",
              "description": "Only messages created at or before this timestamp."
            },
            "required": false,
            "description": "Only messages created at or before this timestamp.",
            "name": "end_date",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc",
              "description": "Sort by created_at. Defaults to asc (oldest first), matching v1."
            },
            "required": false,
            "description": "Sort by created_at. Defaults to asc (oldest first), matching v1.",
            "name": "order",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated messages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Message"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "example": 1
                        },
                        "limit": {
                          "type": "integer",
                          "example": 20
                        },
                        "total": {
                          "type": "integer",
                          "example": 42,
                          "description": "Estimated, not exact. Do not page until page * limit >= total — follow meta.next_cursor instead."
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Present when the request used ?cursor=. Pass back to fetch the next page."
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/candidates/{candidateId}/stop-interview": {
      "post": {
        "tags": [
          "Candidates"
        ],
        "summary": "Stop an active interview",
        "description": "Stop an active interview for a candidate. Optionally send a final SMS or email message. If only_stop_outreach is true, the outreach sequence is cancelled without sending messages.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "candidateId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sms_message_to_candidate": {
                    "type": "string",
                    "description": "Final SMS message to send"
                  },
                  "email_message_to_candidate": {
                    "type": "string",
                    "description": "Final email message to send"
                  },
                  "only_stop_outreach": {
                    "type": "boolean",
                    "default": false,
                    "description": "Only stop outreach without sending messages"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Interview stopped",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "candidate_id": {
                          "type": "string"
                        },
                        "stopped": {
                          "type": "boolean"
                        },
                        "already_stopped": {
                          "type": "boolean"
                        },
                        "sms_sent_success": {
                          "type": "boolean",
                          "nullable": true
                        },
                        "email_sent_success": {
                          "type": "boolean",
                          "nullable": true
                        }
                      },
                      "required": [
                        "candidate_id",
                        "stopped"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Candidate not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Interview not active or outcome already determined",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "External mutations are not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/jobs/{jobId}/applications": {
      "get": {
        "tags": [
          "Applications"
        ],
        "summary": "List applications for a job",
        "description": "Retrieve candidates who have applied to a specific job. `{jobId}` accepts a v2 job ID or a v1 job shortcode. To delta-sync, poll with `updated_since` and advance your cursor to a timestamp captured before the poll started, minus 5 minutes — never to max(updated_at), because results are ordered by created_at.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "v2 job ID or v1 job shortcode."
            },
            "required": true,
            "description": "v2 job ID or v1 job shortcode.",
            "name": "jobId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "default": "1",
              "example": "1",
              "description": "Page number (1-based). Defaults to 1."
            },
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "default": "20",
              "example": "20",
              "description": "Results per page. Defaults to 20, maximum 50."
            },
            "required": false,
            "description": "Results per page. Defaults to 20, maximum 50.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by pipeline stage"
            },
            "required": false,
            "description": "Filter by pipeline stage",
            "name": "stage",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "candidate_not_interested",
                "ai_opt_out",
                "qualified",
                "unqualified",
                "candidate_not_responsive",
                "completed",
                "not_sent_duplicate",
                "not_sent_already_completed",
                "not_sent_unreachable",
                "ai_stopped_override"
              ],
              "description": "Filter by interview outcome."
            },
            "required": false,
            "description": "Filter by interview outcome.",
            "name": "outcome",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Comma-separated list of candidate IDs to filter",
              "example": "cand_abc123,cand_def456"
            },
            "required": false,
            "description": "Comma-separated list of candidate IDs to filter",
            "name": "candidate_ids",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Created on or before this date (YYYY-MM-DD, whole day) or instant (ISO-8601).",
              "example": "2026-04-01"
            },
            "required": false,
            "description": "Created on or before this date (YYYY-MM-DD, whole day) or instant (ISO-8601).",
            "name": "created_before",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Created on or after this date (YYYY-MM-DD) or instant (ISO-8601).",
              "example": "2026-03-01"
            },
            "required": false,
            "description": "Created on or after this date (YYYY-MM-DD) or instant (ISO-8601).",
            "name": "created_after",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Interview sent on or before this date (YYYY-MM-DD, whole day) or instant (ISO-8601)."
            },
            "required": false,
            "description": "Interview sent on or before this date (YYYY-MM-DD, whole day) or instant (ISO-8601).",
            "name": "interview_sent_before",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Interview sent on or after this date (YYYY-MM-DD) or instant (ISO-8601)."
            },
            "required": false,
            "description": "Interview sent on or after this date (YYYY-MM-DD) or instant (ISO-8601).",
            "name": "interview_sent_after",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "hired",
                "rejected"
              ],
              "description": "Filter by terminal state."
            },
            "required": false,
            "description": "Filter by terminal state.",
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-06-01T00:00:00Z",
              "description": "ISO-8601 timestamp. Only applications whose `changed_at` is at or after this — the application row AND its interview calls, so results landing on an existing application are picked up. Advance your cursor to a timestamp captured before the poll started, minus 5 minutes, never to max(updated_at) or max(changed_at): results are ordered by created_at, so a row changed mid-poll can land on a page you already fetched."
            },
            "required": false,
            "description": "ISO-8601 timestamp. Only applications whose `changed_at` is at or after this — the application row AND its interview calls, so results landing on an existing application are picked up. Advance your cursor to a timestamp captured before the poll started, minus 5 minutes, never to max(updated_at) or max(changed_at): results are ordered by created_at, so a row changed mid-poll can land on a page you already fetched.",
            "name": "updated_since",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Applications",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApplicationSummary"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "example": 1
                        },
                        "limit": {
                          "type": "integer",
                          "example": 20
                        },
                        "total": {
                          "type": "integer",
                          "example": 42,
                          "description": "Estimated, not exact. Do not page until page * limit >= total — follow meta.next_cursor instead."
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Present when the request used ?cursor=. Pass back to fetch the next page."
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/applications/{applicationId}": {
      "get": {
        "tags": [
          "Applications"
        ],
        "summary": "Get application details",
        "description": "Retrieve full details of an application including candidate info and screening results.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "applicationId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Application details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApplicationDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Applications"
        ],
        "summary": "Update application stage",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "applicationId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stage": {
                    "type": "string",
                    "minLength": 1,
                    "example": "Interviewing",
                    "description": "Pipeline stage. Validated against the job like PUT /applications/{applicationId}/stage."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No field to update",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Stage is not valid for this job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/applications/{applicationId}/disqualify": {
      "post": {
        "tags": [
          "Applications"
        ],
        "summary": "Disqualify an application",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "applicationId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "example": "Does not meet minimum requirements"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Disqualified",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "ATS disqualification stage is not configured",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "502": {
            "description": "Disqualification service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "External mutations are not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/applications": {
      "get": {
        "tags": [
          "Applications"
        ],
        "summary": "List applications",
        "description": "Every application across your organization, newest first. This is the endpoint to delta-sync a pipeline: poll with `updated_since`, and advance your cursor to a timestamp captured before the poll started, minus 5 minutes — never to max(updated_at), because results are ordered by created_at and a row changed mid-poll can land on a page you already fetched. `updated_since` filters on `changed_at`, which also moves when an interview result lands. Filter by `job_id`, `stage`, `status` (active/hired/rejected), or `source`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "default": "1",
              "example": "1",
              "description": "Page number (1-based). Defaults to 1."
            },
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "default": "20",
              "example": "20",
              "description": "Results per page. Defaults to 20, maximum 50."
            },
            "required": false,
            "description": "Results per page. Defaults to 20, maximum 50.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Only applications on this job (v2 job ID or v1 shortcode)."
            },
            "required": false,
            "description": "Only applications on this job (v2 job ID or v1 shortcode).",
            "name": "job_id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by pipeline stage."
            },
            "required": false,
            "description": "Filter by pipeline stage.",
            "name": "stage",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "candidate_not_interested",
                "ai_opt_out",
                "qualified",
                "unqualified",
                "candidate_not_responsive",
                "completed",
                "not_sent_duplicate",
                "not_sent_already_completed",
                "not_sent_unreachable",
                "ai_stopped_override"
              ],
              "description": "Filter by interview outcome."
            },
            "required": false,
            "description": "Filter by interview outcome.",
            "name": "outcome",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "example": "indeed",
              "description": "Filter by acquisition source."
            },
            "required": false,
            "description": "Filter by acquisition source.",
            "name": "source",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "hired",
                "rejected"
              ],
              "description": "Filter by terminal state."
            },
            "required": false,
            "description": "Filter by terminal state.",
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-06-01T00:00:00Z",
              "description": "ISO-8601 timestamp. Only applications whose `changed_at` is at or after this — the application row AND its interview calls, so results landing on an existing application are picked up. Advance your cursor to a timestamp captured before the poll started, minus 5 minutes, never to max(updated_at) or max(changed_at): results are ordered by created_at, so a row changed mid-poll can land on a page you already fetched."
            },
            "required": false,
            "description": "ISO-8601 timestamp. Only applications whose `changed_at` is at or after this — the application row AND its interview calls, so results landing on an existing application are picked up. Advance your cursor to a timestamp captured before the poll started, minus 5 minutes, never to max(updated_at) or max(changed_at): results are ordered by created_at, so a row changed mid-poll can land on a page you already fetched.",
            "name": "updated_since",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Applications created on or after this date (YYYY-MM-DD) or instant (ISO-8601)."
            },
            "required": false,
            "description": "Applications created on or after this date (YYYY-MM-DD) or instant (ISO-8601).",
            "name": "created_after",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Applications created on or before this date (YYYY-MM-DD, whole day) or instant (ISO-8601)."
            },
            "required": false,
            "description": "Applications created on or before this date (YYYY-MM-DD, whole day) or instant (ISO-8601).",
            "name": "created_before",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Opaque cursor from a previous response's meta.next_cursor. Prefer this over `page` for full syncs — offset pages shift under you when rows are being written."
            },
            "required": false,
            "description": "Opaque cursor from a previous response's meta.next_cursor. Prefer this over `page` for full syncs — offset pages shift under you when rows are being written.",
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Applications",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApplicationSummary"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "example": 1
                        },
                        "limit": {
                          "type": "integer",
                          "example": 20
                        },
                        "total": {
                          "type": "integer",
                          "example": 42,
                          "description": "Estimated, not exact. Do not page until page * limit >= total — follow meta.next_cursor instead."
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Present when the request used ?cursor=. Pass back to fetch the next page."
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid cursor or filter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/applications/{applicationId}/stage": {
      "put": {
        "tags": [
          "Applications"
        ],
        "summary": "Move an application to a stage",
        "description": "Move an application into a pipeline stage. Use GET /v2/jobs/{jobId}/stages to discover the stage names valid for the job. This writes the Classet pipeline stage only — it does not move the candidate in a connected ATS.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "applicationId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stage": {
                    "type": "string",
                    "minLength": 1,
                    "example": "Interviewing",
                    "description": "Target stage name."
                  }
                },
                "required": [
                  "stage"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stage updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "stage": {
                          "type": "string"
                        },
                        "previous_stage": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "id",
                        "stage",
                        "previous_stage"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Application not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Stage is not valid for this job",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/candidates/{candidateId}/notes": {
      "get": {
        "tags": [
          "Notes"
        ],
        "summary": "List notes on a candidate",
        "description": "Recruiter comments and AI reviews recorded against a candidate, newest first. `candidates.notes` is a single free-text field and is unrelated to this list.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "candidateId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "default": "1",
              "example": "1",
              "description": "Page number (1-based). Defaults to 1."
            },
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "default": "20",
              "example": "20",
              "description": "Results per page. Defaults to 20, maximum 50."
            },
            "required": false,
            "description": "Results per page. Defaults to 20, maximum 50.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by note type."
            },
            "required": false,
            "description": "Filter by note type.",
            "name": "note_type",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Notes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Note"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "example": 1
                        },
                        "limit": {
                          "type": "integer",
                          "example": 20
                        },
                        "total": {
                          "type": "integer",
                          "example": 42,
                          "description": "Estimated, not exact. Do not page until page * limit >= total — follow meta.next_cursor instead."
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Present when the request used ?cursor=. Pass back to fetch the next page."
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Candidate not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/candidates/{candidateId}/attachments": {
      "get": {
        "tags": [
          "Attachments"
        ],
        "summary": "List a candidate's attachments",
        "description": "Files attached to a candidate — resumes and anything else uploaded or synced. Each carries a short-lived signed `url`; sign a fresh one when you need it rather than storing the URL.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "candidateId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "default": "1",
              "example": "1",
              "description": "Page number (1-based). Defaults to 1."
            },
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "default": "20",
              "example": "20",
              "description": "Results per page. Defaults to 20, maximum 50."
            },
            "required": false,
            "description": "Results per page. Defaults to 20, maximum 50.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "example": "resume",
              "description": "Filter by attachment type."
            },
            "required": false,
            "description": "Filter by attachment type.",
            "name": "attachment_type",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Attachments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Attachment"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "example": 1
                        },
                        "limit": {
                          "type": "integer",
                          "example": 20
                        },
                        "total": {
                          "type": "integer",
                          "example": 42,
                          "description": "Estimated, not exact. Do not page until page * limit >= total — follow meta.next_cursor instead."
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Present when the request used ?cursor=. Pass back to fetch the next page."
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Candidate not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/candidates/{candidateId}/activity": {
      "get": {
        "tags": [
          "Activity"
        ],
        "summary": "List a candidate's activity",
        "description": "What has happened to this candidate, newest first — stage moves, dispositions, and other recorded actions. This is the source of truth for \"last activity\" on an application.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "candidateId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "default": "1",
              "example": "1",
              "description": "Page number (1-based). Defaults to 1."
            },
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "default": "20",
              "example": "20",
              "description": "Results per page. Defaults to 20, maximum 50."
            },
            "required": false,
            "description": "Results per page. Defaults to 20, maximum 50.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by action."
            },
            "required": false,
            "description": "Filter by action.",
            "name": "action",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Activity feed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Activity"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "example": 1
                        },
                        "limit": {
                          "type": "integer",
                          "example": 20
                        },
                        "total": {
                          "type": "integer",
                          "example": 42,
                          "description": "Estimated, not exact. Do not page until page * limit >= total — follow meta.next_cursor instead."
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Present when the request used ?cursor=. Pass back to fetch the next page."
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Candidate not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "List users",
        "description": "The recruiters and admins in your organization. Use these ids to resolve the author of a note or the actor on an activity entry. Deactivated users carry a non-null `archived_at` and are excluded unless you pass include_archived.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "default": "1",
              "example": "1",
              "description": "Page number (1-based). Defaults to 1."
            },
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "default": "20",
              "example": "20",
              "description": "Results per page. Defaults to 20, maximum 50."
            },
            "required": false,
            "description": "Results per page. Defaults to 20, maximum 50.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ],
              "description": "Include deactivated users. Defaults to false."
            },
            "required": false,
            "description": "Include deactivated users. Defaults to false.",
            "name": "include_archived",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Only users with access to this branch."
            },
            "required": false,
            "description": "Only users with access to this branch.",
            "name": "branch_id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/User"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "example": 1
                        },
                        "limit": {
                          "type": "integer",
                          "example": 20
                        },
                        "total": {
                          "type": "integer",
                          "example": 42,
                          "description": "Estimated, not exact. Do not page until page * limit >= total — follow meta.next_cursor instead."
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Present when the request used ?cursor=. Pass back to fetch the next page."
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/branches": {
      "get": {
        "tags": [
          "Branches"
        ],
        "summary": "List branches",
        "description": "Your organization's branches. A branch is Classet's unit of location and team scoping — the closest analogue to an office or department elsewhere. Jobs carry a branch_id, and the jobs and users lists can be filtered by it.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "default": "1",
              "example": "1",
              "description": "Page number (1-based). Defaults to 1."
            },
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "default": "20",
              "example": "20",
              "description": "Results per page. Defaults to 20, maximum 50."
            },
            "required": false,
            "description": "Results per page. Defaults to 20, maximum 50.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ],
              "description": "Include archived branches. Defaults to false."
            },
            "required": false,
            "description": "Include archived branches. Defaults to false.",
            "name": "include_archived",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Branches",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Branch"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "example": 1
                        },
                        "limit": {
                          "type": "integer",
                          "example": 20
                        },
                        "total": {
                          "type": "integer",
                          "example": 42,
                          "description": "Estimated, not exact. Do not page until page * limit >= total — follow meta.next_cursor instead."
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Present when the request used ?cursor=. Pass back to fetch the next page."
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/tags": {
      "get": {
        "tags": [
          "Tags"
        ],
        "summary": "List candidate tags",
        "description": "Every tag in use across your candidates, with how many carry it. Tags are free-form strings on the candidate rather than a managed catalog, so this is derived from live data. Counts are sampled from up to 10,000 tagged candidates, so on a larger org they are a lower bound and a rare tag can be missing.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Tags in use",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Tag"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/calls": {
      "post": {
        "tags": [
          "Calls"
        ],
        "summary": "Register call (deprecated)",
        "description": "Deprecated v1-compatible endpoint. Creates or reuses a candidate, records a flow_initiated call, and starts interview outreach. Prefer POST /v2/candidates with send_sms/send_email for new integrations.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "first_name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "last_name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "email": {
                    "type": "string",
                    "nullable": true,
                    "format": "email"
                  },
                  "phone_number": {
                    "type": "string",
                    "pattern": "^\\+[1-9]\\d{1,14}$",
                    "description": "Phone number in E.164 format"
                  },
                  "job_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "v1 job shortcode or v2 job ID"
                  },
                  "external_id": {
                    "type": "string"
                  },
                  "location": {
                    "nullable": true
                  },
                  "experience": {
                    "type": "array",
                    "items": {
                      "nullable": true
                    }
                  },
                  "force_create": {
                    "type": "boolean",
                    "default": false
                  },
                  "answers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "object",
                          "properties": {
                            "body": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "body"
                          ]
                        },
                        "answer": {
                          "type": "object",
                          "properties": {
                            "body": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "body"
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "answer"
                      ]
                    }
                  },
                  "send_sms": {
                    "type": "boolean",
                    "deprecated": true,
                    "description": "Accepted for compatibility. If omitted, call registration uses the org/script default channel behavior."
                  },
                  "send_email": {
                    "type": "boolean",
                    "deprecated": true,
                    "description": "Accepted for compatibility. If omitted, call registration uses the org/script default channel behavior."
                  }
                },
                "required": [
                  "first_name",
                  "last_name",
                  "phone_number",
                  "job_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Call registered. When the same person was already contacted on this job in the last 12 hours, that candidate is returned with `replayed: true` and nothing is created or sent. A repeat for a record the API made in the last 12 hours that was never contacted sends on that record.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "candidate_id": {
                          "type": "string"
                        },
                        "call_id": {
                          "type": "string",
                          "nullable": true
                        },
                        "webcall_url": {
                          "type": "string"
                        },
                        "interview_panel_url": {
                          "type": "string"
                        },
                        "replayed": {
                          "type": "boolean",
                          "enum": [
                            true
                          ],
                          "description": "Present when this request repeated a create from the last 12 hours for the same person and job. The existing candidate is returned and none is created. Read `interview_status` for whether outreach has started."
                        },
                        "interview_status": {
                          "type": "string",
                          "enum": [
                            "not_sent",
                            "in_progress",
                            "completed"
                          ],
                          "description": "With `replayed`: the returned candidate's interview status, as GET /v2/candidates/{id}/interview reports it. `in_progress` covers an interview that is queued as well as one that was sent. If `not_sent`, start one with POST /v2/candidates/{id}/interview."
                        }
                      },
                      "required": [
                        "candidate_id",
                        "call_id",
                        "webcall_url",
                        "interview_panel_url"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Interview already in flight for this candidate (only when the screening-claim rollout is on)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Free-trial interview allowance exhausted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "A candidate on this job matching the phone or email opted out of AI outreach (`candidate_opted_out`, regardless of force_create), or the phone number was contacted on this job in the last 12 hours through another person's record (`recently_contacted`)",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CandidateOptedOutError"
                    },
                    {
                      "$ref": "#/components/schemas/RecentlyContactedError"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string",
                          "example": "Resource not found"
                        },
                        "code": {
                          "type": "string",
                          "enum": [
                            "not_found",
                            "validation_error",
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "restricted_key_unsupported",
                            "branch_out_of_scope",
                            "key_misconfigured",
                            "quota_exceeded",
                            "rate_limited",
                            "rate_limit_unavailable",
                            "conflict",
                            "idempotency_key_reuse",
                            "candidate_opted_out",
                            "recently_contacted",
                            "request_in_progress",
                            "unprocessable",
                            "bad_request",
                            "payload_too_large",
                            "internal_error",
                            "service_unavailable"
                          ],
                          "example": "not_found",
                          "description": "Stable machine-readable error code."
                        },
                        "request_id": {
                          "type": "string",
                          "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                          "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                        }
                      },
                      "required": [
                        "error"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Interview invite limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteLimitError"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "External mutations or invite rate limiting are not available",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/calls/{callId}": {
      "get": {
        "tags": [
          "Calls"
        ],
        "summary": "Get call details",
        "description": "Retrieve full details of a call including transcript and recording.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Call ID (numeric or provider ID)"
            },
            "required": true,
            "description": "Call ID (numeric or provider ID)",
            "name": "callId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Call details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/candidates/{candidateId}/calls": {
      "get": {
        "tags": [
          "Calls"
        ],
        "summary": "List calls for a candidate",
        "description": "Retrieve all call attempts for a specific candidate.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "candidateId",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "default": "1",
              "example": "1",
              "description": "Page number (1-based). Defaults to 1."
            },
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "default": "20",
              "example": "20",
              "description": "Results per page. Defaults to 20, maximum 50."
            },
            "required": false,
            "description": "Results per page. Defaults to 20, maximum 50.",
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Calls",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CallSummary"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "example": 1
                        },
                        "limit": {
                          "type": "integer",
                          "example": 20
                        },
                        "total": {
                          "type": "integer",
                          "example": 42,
                          "description": "Estimated, not exact. Do not page until page * limit >= total — follow meta.next_cursor instead."
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Present when the request used ?cursor=. Pass back to fetch the next page."
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Candidate not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/calls/{callId}/recording": {
      "get": {
        "tags": [
          "Calls"
        ],
        "summary": "Download a call recording",
        "description": "Stream the audio for a completed call. `recording_url` on the call and candidate endpoints points at the storage provider and the link behind it expires, so it cannot be stored and replayed later. This endpoint is authenticated with your API key, does not expire, and returns the bytes — fetch it whenever you need the audio, or pipe it straight into your own storage. Responds 404 while a call is still in progress or was never recorded.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Call ID (numeric or provider ID)"
            },
            "required": true,
            "description": "Call ID (numeric or provider ID)",
            "name": "callId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Recording audio",
            "content": {
              "audio/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Call not found, or the call has no recording",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "502": {
            "description": "The recording exists but the storage provider did not return it",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/scripts": {
      "get": {
        "tags": [
          "Scripts"
        ],
        "summary": "List interview scripts",
        "description": "List all scripts for your organization. Use include_tasks=true to include full task details (v1 parity). Deleted scripts are omitted unless include_deleted=true — a synchronising client needs them, otherwise a script that disappears from this list is indistinguishable from one that never existed.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ],
              "description": "Set to \"true\" to include tasks in the response",
              "example": "false"
            },
            "required": false,
            "description": "Set to \"true\" to include tasks in the response",
            "name": "include_tasks",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ],
              "description": "Set to \"true\" to include deleted scripts. Each carries a non-null `deleted_at`, so a client mirroring this list can retire its own copy.",
              "example": "false"
            },
            "required": false,
            "description": "Set to \"true\" to include deleted scripts. Each carries a non-null `deleted_at`, so a client mirroring this list can retire its own copy.",
            "name": "include_deleted",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Scripts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ScriptListItem"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Scripts"
        ],
        "summary": "Create a new interview script",
        "description": "Create a script from a template. Pass questions keyed by task name or short_name.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "example": "Technical Screen"
                  },
                  "description": {
                    "type": "string"
                  },
                  "default": {
                    "type": "boolean"
                  },
                  "questions": {
                    "type": "object",
                    "additionalProperties": {
                      "nullable": true
                    },
                    "description": "Custom questions keyed by task name or short_name. Both formats accepted."
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "script_id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "script_id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/scripts/{scriptId}": {
      "get": {
        "tags": [
          "Scripts"
        ],
        "summary": "Get script with tasks",
        "description": "Retrieve a script with all tasks, agent settings, and task metadata.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "scriptId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Script details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ScriptDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Scripts"
        ],
        "summary": "Update a script",
        "description": "Update script metadata and agent settings (outreach messages, summary instructions, etc).",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "scriptId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "default": {
                    "type": "boolean"
                  },
                  "completed_text_message": {
                    "type": "string",
                    "nullable": true,
                    "description": "Post-call text message sent to candidates. Set to null to use default."
                  },
                  "initial_text_message": {
                    "type": "string",
                    "nullable": true,
                    "description": "Initial outreach message. Set to null to use default."
                  },
                  "filter_out_criteria": {
                    "type": "string",
                    "nullable": true,
                    "description": "Disqualification criteria for the AI"
                  },
                  "custom_summary_instructions": {
                    "type": "string",
                    "nullable": true,
                    "description": "How to format the AI-generated interview summary"
                  },
                  "custom_summary_example": {
                    "type": "string",
                    "nullable": true,
                    "description": "Example summary for the AI to follow"
                  },
                  "transcript_parsing_instructions": {
                    "type": "string",
                    "nullable": true,
                    "description": "Instructions for extracting custom data from call transcripts"
                  },
                  "customization": {
                    "nullable": true,
                    "description": "Additional customization settings (JSON object)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "script_id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "script_id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Scripts"
        ],
        "summary": "Delete a script",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "scriptId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "script_id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "script_id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/scripts/{scriptId}/duplicate": {
      "post": {
        "tags": [
          "Scripts"
        ],
        "summary": "Duplicate an existing script",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "scriptId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Optional name for the duplicate"
                  },
                  "description": {
                    "type": "string",
                    "description": "Optional description for the duplicate"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Duplicated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "script_id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "script_id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/scripts/{scriptId}/tasks": {
      "post": {
        "tags": [
          "Scripts"
        ],
        "summary": "Add a task to a script",
        "description": "Create a new task within an existing script.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "scriptId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "example": "Technical Assessment",
                    "description": "Display name for the task"
                  },
                  "short_name": {
                    "type": "string",
                    "example": "technical",
                    "description": "Short identifier for the task"
                  },
                  "description": {
                    "type": "string",
                    "description": "What this task covers"
                  },
                  "questions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Questions to ask during this task"
                  },
                  "qualifying_questions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string"
                        },
                        "disqualifyIf": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "question",
                        "disqualifyIf"
                      ]
                    }
                  },
                  "instructions": {
                    "type": "string",
                    "description": "Instructions for the AI agent"
                  },
                  "order": {
                    "type": "integer",
                    "description": "Position in the interview flow. Defaults to end."
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Task created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "task_id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "task_id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Script not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/scripts/{scriptId}/reorder-tasks": {
      "put": {
        "tags": [
          "Scripts"
        ],
        "summary": "Reorder script tasks",
        "description": "Update the order of all tasks within a script.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "scriptId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tasks": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "task_id": {
                          "type": "integer",
                          "description": "Task ID"
                        },
                        "order": {
                          "type": "integer",
                          "description": "New order position (0-indexed)"
                        }
                      },
                      "required": [
                        "task_id",
                        "order"
                      ]
                    },
                    "description": "Array of task ID + order pairs"
                  }
                },
                "required": [
                  "tasks"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reordered",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "updated": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "updated"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Script not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/script-tasks/{taskId}": {
      "patch": {
        "tags": [
          "Scripts"
        ],
        "summary": "Update a script task",
        "description": "Update questions, instructions, qualifying questions, or other fields on a script task. For questions and qualifying_questions, the task must support those fields (check needed_variables in the GET response).",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "taskId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "questions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Questions to ask during this task. Only for tasks where needed_variables includes \"task.questions\"."
                  },
                  "removed": {
                    "type": "boolean",
                    "description": "Soft-delete: set to true to skip this task during interviews"
                  },
                  "qualifying_questions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1
                        },
                        "disqualifyIf": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "question",
                        "disqualifyIf"
                      ]
                    },
                    "description": "Pass/fail questions. Only for tasks where needed_variables includes \"qualifying_questions\"."
                  },
                  "instructions": {
                    "type": "string",
                    "description": "Additional instructions for the AI agent during this task"
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name of the task"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of what the task covers"
                  },
                  "order": {
                    "type": "integer",
                    "description": "Position in the interview flow (0-indexed)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "task_id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "task_id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Field not allowed for this task",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/knowledge": {
      "get": {
        "tags": [
          "Knowledge Base"
        ],
        "summary": "List knowledge entries",
        "description": "Retrieve knowledge base entries. Supports filtering by scope, type, and associated entity.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "default": "1",
              "example": "1",
              "description": "Page number (1-based). Defaults to 1."
            },
            "required": false,
            "description": "Page number (1-based). Defaults to 1.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "default": "20",
              "example": "20",
              "description": "Results per page. Defaults to 20, maximum 50."
            },
            "required": false,
            "description": "Results per page. Defaults to 20, maximum 50.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "org",
                "branch",
                "job",
                "script"
              ],
              "description": "Filter by scope level: org-wide, branch-, job-, or script-specific. Omit to return all scopes."
            },
            "required": false,
            "description": "Filter by scope level: org-wide, branch-, job-, or script-specific. Omit to return all scopes.",
            "name": "scope",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter to a specific scoped entity: your org id (org scope), a branch id, a job id or v1 shortcode, or a script id (script scope). Used with scope."
            },
            "required": false,
            "description": "Filter to a specific scoped entity: your org id (org scope), a branch id, a job id or v1 shortcode, or a script id (script scope). Used with scope.",
            "name": "scope_id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "qa",
                "context",
                "document"
              ],
              "description": "Filter by entry type: qa (question/answer), context, or document."
            },
            "required": false,
            "description": "Filter by entry type: qa (question/answer), context, or document.",
            "name": "entry_type",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Knowledge entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/KnowledgeEntry"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer",
                          "example": 1
                        },
                        "limit": {
                          "type": "integer",
                          "example": 20
                        },
                        "total": {
                          "type": "integer",
                          "example": 42,
                          "description": "Estimated, not exact. Do not page until page * limit >= total — follow meta.next_cursor instead."
                        },
                        "next_cursor": {
                          "type": "string",
                          "nullable": true,
                          "description": "Present when the request used ?cursor=. Pass back to fetch the next page."
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Knowledge Base"
        ],
        "summary": "Create a knowledge entry",
        "description": "Add a new entry to the knowledge base. Entries can be scoped to org, branch, job, or script level.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "enum": [
                      "org",
                      "branch",
                      "job",
                      "script"
                    ],
                    "default": "org"
                  },
                  "scope_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "Required for branch and job scope: the branch id, or the job id (a v1 job shortcode is accepted and stored as the v2 job id). Must belong to your organization. Ignored for org scope (your organization id is stored) and script scope."
                  },
                  "entry_type": {
                    "type": "string",
                    "enum": [
                      "qa",
                      "context",
                      "document"
                    ],
                    "default": "qa"
                  },
                  "question": {
                    "type": "string",
                    "description": "Required for qa type"
                  },
                  "answer": {
                    "type": "string",
                    "description": "Required for qa type"
                  },
                  "content": {
                    "type": "string",
                    "description": "Required for context/document types"
                  },
                  "script_id": {
                    "type": "integer",
                    "description": "Required for script scope, and only used there. Must be a script in your organization."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/knowledge/{entryId}": {
      "patch": {
        "tags": [
          "Knowledge Base"
        ],
        "summary": "Update a knowledge entry",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "entryId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "question": {
                    "type": "string"
                  },
                  "answer": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string"
                  },
                  "entry_type": {
                    "type": "string",
                    "enum": [
                      "qa",
                      "context",
                      "document"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Knowledge Base"
        ],
        "summary": "Delete a knowledge entry",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "entryId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/jobs/generate": {
      "post": {
        "tags": [
          "AI"
        ],
        "summary": "Generate a job posting with AI",
        "description": "Uses AI to generate a complete job posting from a title and optional description. Returns structured data ready to create via POST /v2/jobs.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "example": "Senior Software Engineer"
                  },
                  "location": {
                    "type": "string",
                    "example": "San Francisco, CA"
                  },
                  "brief_description": {
                    "type": "string",
                    "example": "Looking for a senior full-stack engineer to lead our payments team"
                  },
                  "company_name": {
                    "type": "string",
                    "example": "Acme Corp"
                  }
                },
                "required": [
                  "title"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated job data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string",
                          "description": "Full HTML job description"
                        },
                        "location": {
                          "nullable": true
                        },
                        "benefits": {
                          "type": "string",
                          "nullable": true
                        },
                        "faqs": {
                          "type": "array",
                          "nullable": true,
                          "items": {
                            "type": "object",
                            "properties": {
                              "question": {
                                "type": "string"
                              },
                              "answer": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "question",
                              "answer"
                            ]
                          }
                        },
                        "application_questions": {
                          "type": "array",
                          "nullable": true,
                          "items": {
                            "type": "object",
                            "properties": {
                              "question": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "disqualify_on": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "question",
                              "type"
                            ]
                          }
                        }
                      },
                      "required": [
                        "title",
                        "description",
                        "benefits",
                        "faqs",
                        "application_questions"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/scripts/generate": {
      "post": {
        "tags": [
          "AI"
        ],
        "summary": "Generate an interview script with AI",
        "description": "Uses AI to generate a structured interview script with tasks and questions tailored to the role.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "job_title": {
                    "type": "string",
                    "minLength": 1,
                    "example": "Senior Software Engineer"
                  },
                  "job_description": {
                    "type": "string",
                    "example": "Full-stack role building payment infrastructure..."
                  },
                  "focus_areas": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "example": [
                      "technical skills",
                      "cultural fit",
                      "leadership"
                    ]
                  }
                },
                "required": [
                  "job_title"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated script data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "tasks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "questions": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "qualifying_questions": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "question": {
                                      "type": "string"
                                    },
                                    "disqualifyIf": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "question",
                                    "disqualifyIf"
                                  ]
                                }
                              },
                              "order": {
                                "type": "integer"
                              }
                            },
                            "required": [
                              "name",
                              "description",
                              "questions",
                              "order"
                            ]
                          }
                        }
                      },
                      "required": [
                        "name",
                        "description",
                        "tasks"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/onboard": {
      "post": {
        "tags": [
          "AI"
        ],
        "summary": "AI-powered onboarding",
        "description": "Set up an organization from a company description. Creates jobs, scripts, and knowledge base entries using AI.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company_name": {
                    "type": "string",
                    "minLength": 1,
                    "example": "Acme Corp"
                  },
                  "company_description": {
                    "type": "string",
                    "example": "We build payment infrastructure for startups"
                  },
                  "roles_to_hire": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "example": [
                      "Senior Software Engineer",
                      "Product Designer"
                    ],
                    "description": "Job titles to create. If empty, AI will suggest based on company description."
                  },
                  "industry": {
                    "type": "string",
                    "example": "Technology"
                  }
                },
                "required": [
                  "company_name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Onboarding complete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "jobs_created": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "job_id": {
                                "type": "string",
                                "description": "The v2 job ID (`jobs.id`), as GET /v2/jobs returns it. `job_shortcode`, where present, is the v1 shortcode of the same job; every `{jobId}` and `job_id` input accepts either."
                              },
                              "title": {
                                "type": "string"
                              },
                              "script_id": {
                                "type": "integer",
                                "nullable": true
                              }
                            },
                            "required": [
                              "job_id",
                              "title",
                              "script_id"
                            ]
                          }
                        },
                        "knowledge_entries_created": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "jobs_created",
                        "knowledge_entries_created"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Organization setup is incomplete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Get webhook configuration",
        "description": "Retrieve the current webhook URLs and signing secret status for your organization.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook config",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookConfig"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Update webhook configuration",
        "description": "Update the webhook URLs for your organization. Existing signing secret is preserved.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event_webhook_url": {
                    "type": "string",
                    "nullable": true,
                    "format": "uri",
                    "example": "https://example.com/webhooks/classet",
                    "description": "URL for event webhooks. Set to null to disable."
                  },
                  "results_webhook_url": {
                    "type": "string",
                    "nullable": true,
                    "format": "uri",
                    "example": "https://example.com/webhooks/results",
                    "description": "URL for results webhooks. Set to null to disable."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookConfig"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid URL (SSRF protection)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "External mutations are not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/webhooks/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a test webhook",
        "description": "Send a test event to your configured webhook URL to verify delivery. `type: event` sends a real v2 envelope (`type: webhook.test`), signed exactly like a live event — X-Classet-Signature, X-Classet-Signature-V2 and X-Classet-Timestamp when a signing secret is set — so it exercises your signature verification too. `type: results` sends the legacy unsigned test payload to the results URL.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "event",
                      "results"
                    ],
                    "default": "event",
                    "description": "Which webhook URL to test"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Test sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "webhook_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "response_status": {
                      "type": "integer",
                      "description": "HTTP status your endpoint returned. Always 2xx — a non-2xx is reported as a 400."
                    }
                  },
                  "required": [
                    "message",
                    "webhook_url",
                    "response_status"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No webhook configured",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "External mutations are not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/webhooks/events": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhook deliveries",
        "description": "Your outbound webhook deliveries, newest first. Filter by `status` to find what did not land. The payload is omitted here — fetch a single event to see it.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "default": "1"
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "default": "20"
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "delivered",
                "failed"
              ]
            },
            "required": false,
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Filter by event type, e.g. interview.completed."
            },
            "required": false,
            "description": "Filter by event type, e.g. interview.completed.",
            "name": "type",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "required": false,
            "name": "created_since",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Deliveries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookEventSummary"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "page",
                        "limit",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/webhooks/events/{eventId}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Get a webhook delivery",
        "description": "A single delivery, including the exact envelope that was signed and sent. Envelopes are retained for a limited window — past it `payload` is null and `payload_purged_at` says when it was dropped, while the delivery record itself is kept.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "eventId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Delivery",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/WebhookEventSummary"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "payload": {
                              "nullable": true
                            },
                            "payload_purged_at": {
                              "type": "string",
                              "nullable": true
                            }
                          },
                          "required": [
                            "payload_purged_at"
                          ]
                        }
                      ],
                      "description": "One outbound delivery."
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/message-automations": {
      "get": {
        "tags": [
          "Message Automations"
        ],
        "summary": "List message automations",
        "description": "List all message automations (drip sequences) for your organization, including their steps.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Message automations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MessageAutomation"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Message Automations"
        ],
        "summary": "Create a message automation",
        "description": "Create a new message automation (drip sequence). By default, includes the standard 5-step SMS + email sequence. Set include_default_steps to false to create an empty automation.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "example": "HVAC Candidate Outreach",
                    "description": "Name of the automation"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of the automation purpose"
                  },
                  "is_default": {
                    "type": "boolean",
                    "description": "Set as the default automation for new candidates"
                  },
                  "agent_identity": {
                    "type": "string",
                    "nullable": true,
                    "description": "Custom agent personality/identity for outreach messages"
                  },
                  "include_default_steps": {
                    "type": "boolean",
                    "default": true,
                    "description": "If true (default), creates the automation with standard 5-step SMS+email drip sequence. Set false to create empty."
                  }
                },
                "required": [
                  "title"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MessageAutomation"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/message-automations/{automationId}": {
      "get": {
        "tags": [
          "Message Automations"
        ],
        "summary": "Get a message automation",
        "description": "Get a single message automation with all its steps.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "automationId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Automation details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MessageAutomation"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Message Automations"
        ],
        "summary": "Update a message automation",
        "description": "Update automation metadata (title, description, default status, agent identity).",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "automationId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Name of the automation"
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description of the automation purpose"
                  },
                  "is_default": {
                    "type": "boolean",
                    "description": "Set as the default automation. Only one automation can be default — setting this unsets others."
                  },
                  "agent_identity": {
                    "type": "string",
                    "nullable": true,
                    "description": "Custom agent personality/identity for outreach messages. Set to null to clear."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MessageAutomationSummary"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Message Automations"
        ],
        "summary": "Delete a message automation",
        "description": "Delete a message automation and all its steps. Candidates currently using this automation will not receive further messages.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "automationId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "automation_id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "automation_id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/message-automations/{automationId}/duplicate": {
      "post": {
        "tags": [
          "Message Automations"
        ],
        "summary": "Duplicate a message automation",
        "description": "Create a copy of an existing message automation with all its steps.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "automationId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Title for the duplicate. Defaults to \"Original Title (Copy)\"."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Duplicated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MessageAutomation"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/message-automations/{automationId}/steps": {
      "put": {
        "tags": [
          "Message Automations"
        ],
        "summary": "Bulk update automation steps",
        "description": "Update multiple steps at once. Each step is identified by its ID. Only provided fields are updated.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "automationId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "steps": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Step ID"
                        },
                        "message": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "delay_hours": {
                          "type": "number",
                          "minimum": 0
                        },
                        "enabled": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "description": "Array of step updates"
                  }
                },
                "required": [
                  "steps"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "updated": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "updated"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/message-automations/{automationId}/set-default": {
      "post": {
        "tags": [
          "Message Automations"
        ],
        "summary": "Set as default automation",
        "description": "Set this automation as the default. The previous default will be unset.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "automationId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Set as default",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "automation_id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "automation_id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/scripts/{scriptId}/link-automation": {
      "post": {
        "tags": [
          "Message Automations"
        ],
        "summary": "Link automation to script",
        "description": "Link a message automation to an interview script. Candidates interviewed with this script will use the linked automation for follow-up messages. Set automation_id to null to unlink.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "scriptId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "automation_id": {
                    "type": "integer",
                    "nullable": true,
                    "description": "Automation ID to link, or null to unlink"
                  }
                },
                "required": [
                  "automation_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Linked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "script_id": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "script_id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/agent-settings": {
      "get": {
        "tags": [
          "Agent Settings"
        ],
        "summary": "Get agent settings",
        "description": "Retrieve the name, voice and pronunciations of your organization's AI recruiter, and the voices you can switch to.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Agent settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AgentSettings"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Agent Settings"
        ],
        "summary": "Update agent settings",
        "description": "Change your AI recruiter's name, voice, speaking rate or pronunciations. Only the fields you send change, and they apply to the next call. Requires an API key with the `write` scope.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agent_name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40,
                    "description": "Name the AI recruiter uses for itself with candidates. 1-40 characters.",
                    "example": "Joy"
                  },
                  "voice_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "description": "One of the `id` values in `available_voices`",
                    "example": "Ashley"
                  },
                  "voice_speed": {
                    "type": "number",
                    "minimum": 0.9,
                    "maximum": 1.2,
                    "description": "Speaking rate, 0.9 to 1.2. Stored to two decimal places. Only for voice models with rate control (`voice_speed` is not `null`).",
                    "example": 1.1
                  },
                  "pronunciations": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/AgentPronunciation"
                    },
                    "maxItems": 100,
                    "description": "Replaces the whole list. Send `[]` to clear it. Each word may appear once."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AgentSettings"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, a field that cannot be changed, or a voice that is not in `available_voices`",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `write` scope, or is limited to some branches",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "The settings changed while this request ran. Read them again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/organization": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Get your organization",
        "description": "The organization your API key belongs to, with the configuration that governs the rest of the API: which channels are enabled, the number candidates see, the phone regions accepted on candidate creation, your rate limit, and whether webhooks are configured and signed. Call this first to verify a key.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Your organization",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Organization"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/me": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Describe the calling API key",
        "description": "Which organizations and branches the key can reach, its scopes, and which Classet MCP tools it should be offered. Works for every key kind, including branch-limited and organization-group keys.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The calling key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Me"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or expired key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Resource not found"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "not_found",
                        "validation_error",
                        "unauthorized",
                        "forbidden",
                        "insufficient_scope",
                        "restricted_key_unsupported",
                        "branch_out_of_scope",
                        "key_misconfigured",
                        "quota_exceeded",
                        "rate_limited",
                        "rate_limit_unavailable",
                        "conflict",
                        "idempotency_key_reuse",
                        "candidate_opted_out",
                        "recently_contacted",
                        "request_in_progress",
                        "unprocessable",
                        "bad_request",
                        "payload_too_large",
                        "internal_error",
                        "service_unavailable"
                      ],
                      "example": "not_found",
                      "description": "Stable machine-readable error code."
                    },
                    "request_id": {
                      "type": "string",
                      "example": "9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f",
                      "description": "Request ID, also echoed in the X-Request-Id response header. Include it when reporting issues."
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}
