> ## 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.

# Update coding interview tasks

> Replace all coding tasks on an existing coding interview — full replace, accepting either explicit task ids or a random-generation spec.



## OpenAPI

````yaml PATCH /coding-interviews/{interview_id}/coding-tasks
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/{interview_id}/coding-tasks:
    patch:
      tags:
        - Coding Interviews
      summary: Update coding interview tasks
      description: >-
        Replaces **all** coding tasks on an existing coding interview. This is a
        full replace, not a merge — the previous tasks are removed.


        Provide the new tasks in **exactly one** of two ways: an explicit
        `coding_task_ids` list, or a `generate` filter + `count` for random
        selection (`topics` / `languages` are arrays where each entry is a slug
        or name from `GET /coding-topics` and `GET /coding-languages`). Obtain
        `interview_id` from the `interview_id` returned by `POST
        /coding-interviews`.
      parameters:
        - name: interview_id
          in: path
          description: >-
            The coding interview id (`interview_id` from `POST
            /coding-interviews`).
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCodingInterviewTasksRequest'
            examples:
              explicitIds:
                summary: Replace with explicit ids
                value:
                  coding_task_ids:
                    - 123e4567-e89b-42d3-a456-426614174000
              randomGeneration:
                summary: Replace with random generation
                value:
                  generate:
                    topics:
                      - dynamic-programming
                    difficulty: HARD
                    count: 2
      responses:
        '200':
          description: Coding tasks replaced.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateCodingInterviewTasksResponse'
              example:
                success: true
                data:
                  interview_id: a1b2c3d4-0000-4000-8000-000000000000
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ValidationError'
        '404':
          description: >-
            No coding interview found for the supplied `interview_id`, or it is
            not owned by the caller.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpdateCodingInterviewTasksRequest:
      type: object
      description: Provide exactly one of `coding_task_ids` or `generate`.
      properties:
        coding_task_ids:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Explicit coding task ids to set, in order. Mutually exclusive with
            `generate`.
        generate:
          allOf:
            - $ref: '#/components/schemas/CodingTaskGeneration'
          description: Random-generation spec. Mutually exclusive with `coding_task_ids`.
    UpdateCodingInterviewTasksResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          properties:
            interview_id:
              type: string
    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
    ValidationError:
      description: >-
        Request body failed Zod validation. The `errors` field contains the
        issue list.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    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.

````