{
  "openapi": "3.1.0",
  "info": {
    "title": "Cavenue API",
    "version": "1.0.0",
    "summary": "Connect your ATS, HRIS or careers site to Cavenue's AI interviews and hiring pipeline.",
    "description": "Every request needs an API key: `Authorization: Bearer cav_live_…`. Company admins and owners create keys in Settings → API. A key acts for its own company only.\n\nJSON in and out. Lists are newest first with cursor pagination. Each key may send 120 requests a minute. POST requests accept an Idempotency-Key.\n\nDecisions stay with people: moving, rejecting and hiring through the API should reflect a decision a person on your team made (pass performed_by to record who). Cavenue never rejects a candidate on its own.\n\nGuides: https://cavenue.co/developers/api",
    "contact": {
      "name": "Cavenue support",
      "url": "https://cavenue.co/support"
    },
    "termsOfService": "https://cavenue.co/terms"
  },
  "servers": [
    {
      "url": "https://cavenue.co/api/v1",
      "description": "Production"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "The key you are using."
    },
    {
      "name": "Jobs"
    },
    {
      "name": "Candidates",
      "description": "People who applied to your company. Personal data: only your company's keys see them."
    },
    {
      "name": "Applications",
      "description": "A candidate applying to a job, with its stage in your pipeline."
    },
    {
      "name": "Interviews",
      "description": "AI interviews: invitations, status, score and the report."
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getMe",
        "summary": "The API key and its company",
        "responses": {
          "200": {
            "description": "The key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKey"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/jobs": {
      "get": {
        "tags": [
          "Jobs"
        ],
        "operationId": "listJobs",
        "summary": "List jobs",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "open",
                "paused",
                "closed"
              ]
            },
            "description": "Only jobs with this status."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "next_cursor from the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Job"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Whether there is another page."
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= for the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "tags": [
          "Jobs"
        ],
        "operationId": "createJob",
        "summary": "Create a job",
        "description": "Starts as a draft unless you send status. Without interview_plan, the job gets one 15-minute HR round by voice in the candidate's language.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Your own unique value (a UUID works). Retrying with the same key and body replays the first answer for 24 hours instead of doing it twice."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "2 to 160 characters.",
                    "minLength": 2,
                    "maxLength": 160
                  },
                  "description": {
                    "type": "string",
                    "description": "The job description shown on the careers page and used by the AI interviewer.",
                    "maxLength": 30000
                  },
                  "department": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "location": {
                    "type": "string",
                    "maxLength": 160
                  },
                  "workplace": {
                    "type": "string",
                    "enum": [
                      "onsite",
                      "hybrid",
                      "remote"
                    ]
                  },
                  "employment_type": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "full_time",
                      "part_time",
                      "contract",
                      "temporary",
                      "internship",
                      "freelance"
                    ]
                  },
                  "language": {
                    "type": "string",
                    "description": "The job's language. Defaults to the company's language.",
                    "enum": [
                      "tr",
                      "en",
                      "hi",
                      "es",
                      "ur",
                      "id",
                      "ar",
                      "de",
                      "fr",
                      "pt"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "description": "Opening a job counts against your plan's open jobs (402 plan_job_limit when it doesn't fit).",
                    "enum": [
                      "draft",
                      "open",
                      "paused",
                      "closed"
                    ]
                  },
                  "is_public": {
                    "type": "boolean",
                    "description": "Listed on your careers page while open."
                  },
                  "auto_invite": {
                    "type": "boolean",
                    "description": "Invite every applicant from the careers page to the AI interview automatically."
                  },
                  "requirements": {
                    "type": "object",
                    "properties": {
                      "must": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "maxItems": 30
                      },
                      "nice": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "maxItems": 30
                      }
                    },
                    "required": [],
                    "description": "Replaces the lists given. Used by CV screening and the interview."
                  },
                  "interview_plan": {
                    "$ref": "#/components/schemas/InterviewPlanInput"
                  }
                },
                "required": [
                  "title"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/jobs/{job_id}": {
      "parameters": [
        {
          "name": "job_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "The job's id."
        }
      ],
      "get": {
        "tags": [
          "Jobs"
        ],
        "operationId": "getJob",
        "summary": "Get a job",
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "patch": {
        "tags": [
          "Jobs"
        ],
        "operationId": "updateJob",
        "summary": "Update a job",
        "description": "Send only the fields to change.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "2 to 160 characters.",
                    "minLength": 2,
                    "maxLength": 160
                  },
                  "description": {
                    "type": "string",
                    "description": "The job description shown on the careers page and used by the AI interviewer.",
                    "maxLength": 30000
                  },
                  "department": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "location": {
                    "type": "string",
                    "maxLength": 160
                  },
                  "workplace": {
                    "type": "string",
                    "enum": [
                      "onsite",
                      "hybrid",
                      "remote"
                    ]
                  },
                  "employment_type": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "full_time",
                      "part_time",
                      "contract",
                      "temporary",
                      "internship",
                      "freelance"
                    ]
                  },
                  "language": {
                    "type": "string",
                    "description": "The job's language. Defaults to the company's language.",
                    "enum": [
                      "tr",
                      "en",
                      "hi",
                      "es",
                      "ur",
                      "id",
                      "ar",
                      "de",
                      "fr",
                      "pt"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "description": "Opening a job counts against your plan's open jobs (402 plan_job_limit when it doesn't fit).",
                    "enum": [
                      "draft",
                      "open",
                      "paused",
                      "closed"
                    ]
                  },
                  "is_public": {
                    "type": "boolean",
                    "description": "Listed on your careers page while open."
                  },
                  "auto_invite": {
                    "type": "boolean",
                    "description": "Invite every applicant from the careers page to the AI interview automatically."
                  },
                  "requirements": {
                    "type": "object",
                    "properties": {
                      "must": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "maxItems": 30
                      },
                      "nice": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "maxItems": 30
                      }
                    },
                    "required": [],
                    "description": "Replaces the lists given. Used by CV screening and the interview."
                  },
                  "interview_plan": {
                    "$ref": "#/components/schemas/InterviewPlanInput"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/jobs/{job_id}/close": {
      "parameters": [
        {
          "name": "job_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "The job's id."
        }
      ],
      "post": {
        "tags": [
          "Jobs"
        ],
        "operationId": "closeJob",
        "summary": "Close a job",
        "description": "It leaves your careers page and stops taking applications. Safe to call again.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Your own unique value (a UUID works). Retrying with the same key and body replays the first answer for 24 hours instead of doing it twice."
          }
        ],
        "responses": {
          "200": {
            "description": "The closed job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/candidates": {
      "get": {
        "tags": [
          "Candidates"
        ],
        "operationId": "listCandidates",
        "summary": "List candidates",
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "Find a candidate by email address (case-insensitive)."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "next_cursor from the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of candidates.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Candidate"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Whether there is another page."
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= for the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/candidates/{candidate_id}": {
      "parameters": [
        {
          "name": "candidate_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "The candidate's id."
        }
      ],
      "get": {
        "tags": [
          "Candidates"
        ],
        "operationId": "getCandidate",
        "summary": "Get a candidate",
        "responses": {
          "200": {
            "description": "The candidate, with their applications' ids.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Candidate"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/applications": {
      "get": {
        "tags": [
          "Applications"
        ],
        "operationId": "listApplications",
        "summary": "List applications",
        "parameters": [
          {
            "name": "job_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only this job's applications."
          },
          {
            "name": "candidate_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only this candidate's applications."
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "applied",
                "screening",
                "ai_interview",
                "review",
                "interview",
                "offer",
                "hired"
              ]
            },
            "description": "Only applications in this stage."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "rejected",
                "withdrawn",
                "hired"
              ]
            },
            "description": "Only applications with this status."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "next_cursor from the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of applications.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Application"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Whether there is another page."
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= for the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      },
      "post": {
        "tags": [
          "Applications"
        ],
        "operationId": "createApplication",
        "summary": "Add a candidate to a job",
        "description": "Creates the candidate (or reuses the one with the same email in your company) and their application in the applied stage. 409 application_exists when they already applied to this job. Make sure you may share the candidate's data with Cavenue; the candidate sees Cavenue's notice and gives consent before any AI interview.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Your own unique value (a UUID works). Retrying with the same key and body replays the first answer for 24 hours instead of doing it twice."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "job_id": {
                    "type": "string",
                    "description": "The job's id.",
                    "format": "uuid"
                  },
                  "candidate": {
                    "type": "object",
                    "properties": {
                      "full_name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160
                      },
                      "email": {
                        "type": "string",
                        "format": "email",
                        "maxLength": 254
                      },
                      "phone": {
                        "type": "string",
                        "maxLength": 40
                      },
                      "location": {
                        "type": "string",
                        "maxLength": 160
                      }
                    },
                    "required": [
                      "full_name",
                      "email"
                    ],
                    "additionalProperties": false
                  },
                  "language": {
                    "type": "string",
                    "description": "The language emails to the candidate go in. Defaults to the job's.",
                    "enum": [
                      "tr",
                      "en",
                      "hi",
                      "es",
                      "ur",
                      "id",
                      "ar",
                      "de",
                      "fr",
                      "pt"
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": "Where the candidate came from, such as your ATS's name. Defaults to api.",
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,59}$"
                  }
                },
                "required": [
                  "job_id",
                  "candidate"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The application, with candidate_existed telling whether the candidate was already known.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/applications/{application_id}": {
      "parameters": [
        {
          "name": "application_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "The application's id."
        }
      ],
      "get": {
        "tags": [
          "Applications"
        ],
        "operationId": "getApplication",
        "summary": "Get an application",
        "responses": {
          "200": {
            "description": "The application.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/applications/{application_id}/stage": {
      "parameters": [
        {
          "name": "application_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "The application's id."
        }
      ],
      "post": {
        "tags": [
          "Applications"
        ],
        "operationId": "moveApplication",
        "summary": "Move to a stage",
        "description": "Moving to hired also marks the application hired. A rejected or withdrawn application answers 409 application_closed.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Your own unique value (a UUID works). Retrying with the same key and body replays the first answer for 24 hours instead of doing it twice."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stage": {
                    "type": "string",
                    "enum": [
                      "applied",
                      "screening",
                      "ai_interview",
                      "review",
                      "interview",
                      "offer",
                      "hired"
                    ]
                  },
                  "performed_by": {
                    "type": "string",
                    "description": "Who on your team decided, such as their email. Shown in the candidate's timeline.",
                    "maxLength": 254
                  }
                },
                "required": [
                  "stage"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The application.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/applications/{application_id}/reject": {
      "parameters": [
        {
          "name": "application_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "The application's id."
        }
      ],
      "post": {
        "tags": [
          "Applications"
        ],
        "operationId": "rejectApplication",
        "summary": "Reject",
        "description": "Unused interview links stop working. With notify_candidate, Cavenue emails the candidate your rejection template in their language.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Your own unique value (a UUID works). Retrying with the same key and body replays the first answer for 24 hours instead of doing it twice."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "requirements",
                      "experience",
                      "interview",
                      "position_filled",
                      "withdrew",
                      "other"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "description": "For your team; never sent to the candidate or in webhooks.",
                    "maxLength": 1000
                  },
                  "notify_candidate": {
                    "type": "boolean",
                    "default": false
                  },
                  "performed_by": {
                    "type": "string",
                    "description": "Who on your team decided.",
                    "maxLength": 254
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The application, with candidate_emailed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/applications/{application_id}/interviews": {
      "parameters": [
        {
          "name": "application_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "The application's id."
        }
      ],
      "post": {
        "tags": [
          "Interviews"
        ],
        "operationId": "inviteToInterview",
        "summary": "Invite to the AI interview",
        "description": "Emails the candidate a personal link to the round of the job's interview plan (an unused earlier link for that round stops working) and moves an application in applied or screening to ai_interview. interview_url is returned once; the candidate's credits are used only when they take the interview.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Your own unique value (a UUID works). Retrying with the same key and body replays the first answer for 24 hours instead of doing it twice."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "round": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3,
                    "default": 1
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The invitation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InterviewInvitation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/interviews": {
      "get": {
        "tags": [
          "Interviews"
        ],
        "operationId": "listInterviews",
        "summary": "List interviews",
        "parameters": [
          {
            "name": "application_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only this application's interviews."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "invited",
                "started",
                "completed",
                "expired",
                "terminated"
              ]
            },
            "description": "Only interviews with this status."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "next_cursor from the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of interviews.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Interview"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Whether there is another page."
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as ?cursor= for the next page; null on the last page."
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "has_more",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    },
    "/interviews/{interview_id}": {
      "parameters": [
        {
          "name": "interview_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "The interview's id."
        }
      ],
      "get": {
        "tags": [
          "Interviews"
        ],
        "operationId": "getInterview",
        "summary": "Get an interview, its score and report",
        "responses": {
          "200": {
            "description": "The interview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Interview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        }
      }
    }
  },
  "webhooks": {
    "application.created": {
      "post": {
        "summary": "application.created",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    },
    "application.stage_changed": {
      "post": {
        "summary": "application.stage_changed",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    },
    "application.rejected": {
      "post": {
        "summary": "application.rejected",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    },
    "application.hired": {
      "post": {
        "summary": "application.hired",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    },
    "application.reopened": {
      "post": {
        "summary": "application.reopened",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    },
    "interview.invited": {
      "post": {
        "summary": "interview.invited",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    },
    "interview.started": {
      "post": {
        "summary": "interview.started",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    },
    "interview.completed": {
      "post": {
        "summary": "interview.completed",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    },
    "interview.expired": {
      "post": {
        "summary": "interview.expired",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    },
    "interview.evaluated": {
      "post": {
        "summary": "interview.evaluated",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    },
    "job.created": {
      "post": {
        "summary": "job.created",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    },
    "job.updated": {
      "post": {
        "summary": "job.updated",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    },
    "job.deleted": {
      "post": {
        "summary": "job.deleted",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    },
    "candidate.deleted": {
      "post": {
        "summary": "candidate.deleted",
        "description": "Signed with your endpoint's secret: verify the Cavenue-Signature header before trusting the body.",
        "parameters": [
          {
            "name": "Cavenue-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"{t}.{raw body}\">"
          },
          {
            "name": "Cavenue-Event-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Cavenue-Event-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds marks the delivery done; anything else is retried."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "cav_live_…",
        "description": "An API key from Settings → API."
      }
    },
    "responses": {
      "E400": {
        "description": "The request is malformed (bad JSON, cursor, limit or query parameter).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E401": {
        "description": "No API key, or an invalid or revoked one.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E402": {
        "description": "Your plan doesn't allow it (plan_job_limit, plan_needed).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E403": {
        "description": "A read-only key tried to write (insufficient_scope).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E404": {
        "description": "No such resource in your company.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E409": {
        "description": "It conflicts with the current state (application_exists, application_closed, interview_in_progress, idempotency_in_progress).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E422": {
        "description": "The body didn't pass validation (validation_failed, idempotency_key_reused).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E429": {
        "description": "Rate limit reached: wait Retry-After seconds.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "authentication_error",
                  "permission_error",
                  "invalid_request_error",
                  "not_found_error",
                  "conflict_error",
                  "rate_limit_error",
                  "billing_error",
                  "api_error"
                ]
              },
              "code": {
                "type": "string",
                "description": "Stable, for programs: validation_failed, not_found, invalid_api_key, …"
              },
              "message": {
                "type": "string",
                "description": "For people reading logs."
              },
              "param": {
                "type": "string",
                "description": "The field or parameter at fault, when there is one."
              },
              "details": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "param": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "param",
                    "message"
                  ]
                }
              },
              "request_id": {
                "type": "string",
                "description": "Quote it when you contact support."
              }
            },
            "required": [
              "type",
              "code",
              "message",
              "request_id"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "api_key"
          },
          "id": {
            "type": "string",
            "description": "The key's id.",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string",
            "description": "cav_live_ and the key's first 8 characters."
          },
          "scope": {
            "type": "string",
            "enum": [
              "read",
              "write"
            ]
          },
          "organization": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "const": "organization"
              },
              "id": {
                "type": "string",
                "description": "The company's id.",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            },
            "required": [
              "object",
              "id",
              "name",
              "slug"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "prefix",
          "scope",
          "organization"
        ]
      },
      "InterviewPlanInput": {
        "type": "object",
        "properties": {
          "language": {
            "oneOf": [
              {
                "type": "string",
                "const": "candidate"
              },
              {
                "type": "string",
                "enum": [
                  "tr",
                  "en",
                  "hi",
                  "es",
                  "ur",
                  "id",
                  "ar",
                  "de",
                  "fr",
                  "pt"
                ]
              }
            ],
            "description": "candidate: the candidate picks the language."
          },
          "deadline_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60,
            "description": "How long an invitation link stays valid."
          },
          "rounds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 3,
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "hr",
                    "technical",
                    "manager",
                    "custom"
                  ]
                },
                "mode": {
                  "type": "string",
                  "enum": [
                    "voice",
                    "written"
                  ]
                },
                "minutes": {
                  "type": "integer",
                  "minimum": 10,
                  "maximum": 40
                },
                "questions": {
                  "type": "array",
                  "maxItems": 12,
                  "items": {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 500
                      },
                      "required": {
                        "type": "boolean",
                        "default": true
                      }
                    },
                    "required": [
                      "text"
                    ]
                  }
                }
              },
              "required": [
                "type"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [],
        "additionalProperties": false,
        "description": "Competencies per round come from the round type's defaults; edit them in Cavenue."
      },
      "Job": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "job"
          },
          "id": {
            "type": "string",
            "description": "The job's id.",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "department": {
            "type": [
              "string",
              "null"
            ]
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "workplace": {
            "type": "string",
            "enum": [
              "onsite",
              "hybrid",
              "remote"
            ]
          },
          "employment_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "full_time",
              "part_time",
              "contract",
              "temporary",
              "internship",
              "freelance"
            ]
          },
          "description": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "enum": [
              "tr",
              "en",
              "hi",
              "es",
              "ur",
              "id",
              "ar",
              "de",
              "fr",
              "pt"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "open",
              "paused",
              "closed"
            ]
          },
          "is_public": {
            "type": "boolean"
          },
          "auto_invite": {
            "type": "boolean"
          },
          "requirements": {
            "type": "object",
            "properties": {
              "must": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "nice": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "must",
              "nice"
            ]
          },
          "interview_plan": {
            "type": "object",
            "properties": {
              "language": {
                "type": "string"
              },
              "deadline_days": {
                "type": "integer"
              },
              "rounds": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "round": {
                      "type": "integer"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "hr",
                        "technical",
                        "manager",
                        "custom"
                      ]
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "voice",
                        "written"
                      ]
                    },
                    "minutes": {
                      "type": "integer"
                    },
                    "questions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "required": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "text",
                          "required"
                        ]
                      }
                    }
                  },
                  "required": [
                    "round",
                    "type",
                    "mode",
                    "minutes",
                    "questions"
                  ]
                }
              }
            },
            "required": [
              "language",
              "deadline_days",
              "rounds"
            ]
          },
          "careers_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The job's page on your careers site while it is open and public.",
            "format": "uri"
          },
          "created_at": {
            "type": "string",
            "description": "When it was created.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "When it last changed.",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "title",
          "slug",
          "department",
          "location",
          "workplace",
          "employment_type",
          "description",
          "language",
          "status",
          "is_public",
          "auto_invite",
          "requirements",
          "interview_plan",
          "careers_url",
          "created_at",
          "updated_at"
        ]
      },
      "Candidate": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "candidate"
          },
          "id": {
            "type": "string",
            "description": "The candidate's id.",
            "format": "uuid"
          },
          "full_name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "links": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "label",
                "url"
              ]
            }
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "application_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "On GET /candidates/{id} only."
          },
          "created_at": {
            "type": "string",
            "description": "When it was created.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "When it last changed.",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "full_name",
          "email",
          "phone",
          "location",
          "links",
          "source",
          "created_at",
          "updated_at"
        ]
      },
      "Application": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "application"
          },
          "id": {
            "type": "string",
            "description": "The application's id.",
            "format": "uuid"
          },
          "job_id": {
            "type": "string",
            "description": "The job's id.",
            "format": "uuid"
          },
          "candidate_id": {
            "type": "string",
            "description": "The candidate's id.",
            "format": "uuid"
          },
          "stage": {
            "type": "string",
            "enum": [
              "applied",
              "screening",
              "ai_interview",
              "review",
              "interview",
              "offer",
              "hired"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "rejected",
              "withdrawn",
              "hired"
            ]
          },
          "rejection_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "requirements",
              "experience",
              "interview",
              "position_filled",
              "withdrew",
              "other"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "cv_score": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100,
            "description": "The CV's match to the job, when it was screened."
          },
          "candidate": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The candidate's id.",
                "format": "uuid"
              },
              "full_name": {
                "type": "string"
              },
              "email": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "full_name",
              "email"
            ]
          },
          "candidate_existed": {
            "type": "boolean",
            "description": "POST /applications only."
          },
          "candidate_emailed": {
            "type": "boolean",
            "description": "POST …/reject only."
          },
          "created_at": {
            "type": "string",
            "description": "When the candidate applied.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "When it last changed.",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "job_id",
          "candidate_id",
          "stage",
          "status",
          "rejection_reason",
          "source",
          "cv_score",
          "created_at",
          "updated_at"
        ]
      },
      "Interview": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "interview"
          },
          "id": {
            "type": "string",
            "description": "The interview's id.",
            "format": "uuid"
          },
          "application_id": {
            "type": "string",
            "description": "The application's id.",
            "format": "uuid"
          },
          "round": {
            "type": "integer"
          },
          "type": {
            "type": "string",
            "enum": [
              "hr",
              "technical",
              "manager",
              "custom"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "voice",
              "written"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "tr",
              "en",
              "hi",
              "es",
              "ur",
              "id",
              "ar",
              "de",
              "fr",
              "pt"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "invited",
              "started",
              "completed",
              "expired",
              "terminated"
            ]
          },
          "invited_at": {
            "type": "string",
            "description": "When the link was sent.",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "description": "When the link stops working.",
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the candidate started.",
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the interview ended.",
            "format": "date-time"
          },
          "minutes_used": {
            "type": "number"
          },
          "score": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "recommendation": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "strong_yes",
              "yes",
              "mixed",
              "no",
              "strong_no"
            ]
          },
          "report_status": {
            "type": "string",
            "description": "pending: the interview ended and the report is being written (usually under a minute).",
            "enum": [
              "none",
              "pending",
              "ready",
              "error"
            ]
          },
          "report": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "status": {
                "type": "string",
                "description": "insufficient: the candidate said too little to score.",
                "enum": [
                  "ok",
                  "insufficient",
                  "failed"
                ]
              },
              "score": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "recommendation": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "summary": {
                "type": "string"
              },
              "strengths": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "concerns": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "competencies": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "weight": {
                      "type": "number"
                    },
                    "score": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 5
                    },
                    "rationale": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "label",
                    "weight",
                    "score",
                    "rationale"
                  ]
                }
              },
              "required_questions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string"
                    },
                    "asked": {
                      "type": "boolean"
                    },
                    "answered": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "text",
                    "asked",
                    "answered"
                  ]
                }
              },
              "red_flags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "language": {
                "type": "string",
                "enum": [
                  "tr",
                  "en",
                  "hi",
                  "es",
                  "ur",
                  "id",
                  "ar",
                  "de",
                  "fr",
                  "pt"
                ]
              },
              "interview_language": {
                "type": "string",
                "enum": [
                  "tr",
                  "en",
                  "hi",
                  "es",
                  "ur",
                  "id",
                  "ar",
                  "de",
                  "fr",
                  "pt"
                ]
              },
              "generated_at": {
                "type": "string",
                "description": "When the report was written.",
                "format": "date-time"
              }
            }
          },
          "report_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The full report with the transcript in Cavenue (team sign-in).",
            "format": "uri"
          },
          "created_at": {
            "type": "string",
            "description": "When it was created.",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "id",
          "application_id",
          "round",
          "type",
          "mode",
          "status",
          "invited_at",
          "expires_at",
          "score",
          "recommendation",
          "report_status",
          "report",
          "report_url",
          "created_at"
        ]
      },
      "InterviewInvitation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Interview"
          },
          {
            "type": "object",
            "properties": {
              "interview_url": {
                "type": "string",
                "description": "The candidate's personal link. Returned only here: Cavenue keeps just its hash.",
                "format": "uri"
              },
              "candidate_emailed": {
                "type": "boolean",
                "description": "Whether the invitation email went out."
              }
            },
            "required": [
              "interview_url",
              "candidate_emailed"
            ]
          }
        ]
      },
      "WebhookEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "evt_…: the same on every retry, so you can skip duplicates."
          },
          "type": {
            "type": "string",
            "enum": [
              "application.created",
              "application.stage_changed",
              "application.rejected",
              "application.hired",
              "application.reopened",
              "interview.invited",
              "interview.started",
              "interview.completed",
              "interview.expired",
              "interview.evaluated",
              "job.created",
              "job.updated",
              "job.deleted",
              "candidate.deleted"
            ]
          },
          "created_at": {
            "type": "string",
            "description": "When it happened.",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "description": "Ids and states only, never a candidate's name, email or answers: fetch what you need with your key.",
            "additionalProperties": true
          }
        },
        "required": [
          "id",
          "type",
          "created_at",
          "data"
        ]
      }
    }
  }
}