> ## Documentation Index
> Fetch the complete documentation index at: https://docs.interview.qode.world/llms.txt
> Use this file to discover all available pages before exploring further.

# Create coding interview

> Create a coding interview for a candidate against a job — supplying coding tasks either as explicit ids or a random-generation spec (topic, difficulty, language, count).



## OpenAPI

````yaml POST /coding-interviews
openapi: 3.1.0
info:
  title: Tracy Interview API
  description: >-
    Programmatically schedule AI-powered candidate interviews. Authenticate with
    an API key, list the jobs you can hire for, and create an interview by
    supplying the candidate's contact details, a CV link, and the job id.
  version: 1.0.0
  contact:
    name: Interview API support
    url: https://interview.gomu.ai
servers:
  - url: https://interview.qode.world/api/v1
    description: Production
  - url: https://interview.gomu.ai/api/v1
    description: Staging
security:
  - ApiKeyAuth: []
tags:
  - name: Interviews
    description: >-
      Create AI interviews for your candidates and list the jobs you can hire
      for.
  - name: Coding Interviews
    description: >-
      List the coding task bank and create or adjust coding interviews — either
      by picking explicit task ids or generating them randomly by topic,
      difficulty, and programming language.
  - name: System
    description: Service health.
paths:
  /coding-interviews:
    post:
      tags:
        - Coding Interviews
      summary: Create a coding interview
      description: >-
        Schedules a coding interview for a candidate against one of your jobs.
        Like `POST /interviews`, supply the candidate's email, name, CV link,
        and the `qodeJobId`.


        Provide the coding tasks in **exactly one** of two ways:

        - `coding_task_ids` — an explicit list of coding task ids (from `GET
        /coding-tasks`), attached in the given order.

        - `generate` — a filter (`topics`, `difficulty`, `languages`) plus a
        `count`; the backend picks that many matching tasks at random. `topics`
        and `languages` are arrays where each entry is a slug or name from `GET
        /coding-topics` and `GET /coding-languages`.


        The response returns a candidate-facing `interview_link` plus the
        `interview_id` you can later pass to `PATCH
        /coding-interviews/{interview_id}/coding-tasks`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCodingInterviewRequest'
            examples:
              explicitIds:
                summary: Explicit coding task ids
                value:
                  candidate_email: thanh.le+dev@qode.world
                  candidate_name: Le Phuoc Thanh
                  cv_link: >-
                    https://cdn.qode.gg/ptp-ms-file-store/production/cv_container/resume.pdf
                  qodeJobId: 478e8e8b-87c9-4c2a-926f-ebce52442d39
                  coding_task_ids:
                    - 123e4567-e89b-42d3-a456-426614174000
              randomGeneration:
                summary: Random generation by filter
                value:
                  candidate_email: thanh.le+dev@qode.world
                  candidate_name: Le Phuoc Thanh
                  cv_link: >-
                    https://cdn.qode.gg/ptp-ms-file-store/production/cv_container/resume.pdf
                  qodeJobId: 478e8e8b-87c9-4c2a-926f-ebce52442d39
                  ai_assisted: true
                  generate:
                    topics:
                      - backtracking
                    difficulty: MEDIUM
                    languages:
                      - java
                    count: 3
      responses:
        '200':
          description: >-
            Coding interview created. A candidate-facing link and the interview
            id are returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCodingInterviewResponse'
              example:
                success: true
                data:
                  interview_link: https://qode.world/interview/abc123
                  name: Tracy interview | Le Phuoc Thanh - Software Engineer
                  interview_id: a1b2c3d4-0000-4000-8000-000000000000
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            Validation failed — body failed Zod validation, or neither/both of
            `coding_task_ids` and `generate` were supplied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            The supplied `qodeJobId` does not exist or has no interview template
            configured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateCodingInterviewRequest:
      type: object
      required:
        - candidate_email
        - candidate_name
        - cv_link
        - qodeJobId
      description: Provide exactly one of `coding_task_ids` or `generate`.
      properties:
        candidate_email:
          type: string
          format: email
          description: Candidate's email. Used as the interview attendee.
        candidate_name:
          type: string
          minLength: 1
          description: Candidate's full name. Used to build the interview title.
        cv_link:
          type: string
          format: uri
          description: Public URL to the candidate's CV (PDF or DOCX).
        qodeJobId:
          type: string
          minLength: 1
          description: Job identifier returned by `GET /jobs`.
        ai_assisted:
          type: boolean
          default: false
          description: >-
            Enable AI-assisted autocomplete in the candidate's coding IDE.
            Defaults to `false` (off).
        coding_task_ids:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Explicit coding task ids to attach, in order. Mutually exclusive
            with `generate`.
        generate:
          allOf:
            - $ref: '#/components/schemas/CodingTaskGeneration'
          description: Random-generation spec. Mutually exclusive with `coding_task_ids`.
    CreateCodingInterviewResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          properties:
            interview_link:
              type: string
              format: uri
              description: Candidate-facing interview URL. Share this with the candidate.
            name:
              type: string
              description: Auto-generated interview title.
            interview_id:
              type: string
              description: >-
                The coding interview id. Pass to `PATCH
                /coding-interviews/{interview_id}/coding-tasks` to adjust tasks
                later.
    Error:
      type: object
      properties:
        status:
          type: integer
          example: 401
        errors:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
          description: Either a human-readable string or a list of Zod validation issues.
    CodingTaskGeneration:
      type: object
      required:
        - count
      description: >-
        Random-generation spec: pick `count` coding tasks matching the supplied
        filters.
      properties:
        topics:
          type: array
          items:
            type: string
          description: >-
            Restrict generation to these topics — each a `slug` or `name` from
            `GET /coding-topics`.
        difficulty:
          type: string
          enum:
            - EASY
            - MEDIUM
            - HARD
          description: Restrict generation to this difficulty.
        languages:
          type: array
          items:
            type: string
          description: >-
            Restrict generation to tasks available in these programming
            languages — each a `slug` or `name` from `GET /coding-languages`.
        count:
          type: integer
          minimum: 1
          maximum: 3
          description: How many tasks to generate (maximum 3).
  responses:
    Unauthorized:
      description: API key missing, malformed, expired, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 401
            errors: Invalid API key
    ServerError:
      description: Unexpected server-side failure. Safe to retry with exponential backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: Opaque token (starts with `qint_`)
      description: >-
        Provide the API key issued to you by your organization admin. Send it as
        `Authorization: Bearer <api-key>` on every request.

````