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

# Update Script Task

> Update questions, instructions, qualifying questions, or other fields on a script task. For questions and qualifying_questions, the task must support those fields (check needed_variables in the GET response).

Update an individual task within a script. Modify questions, instructions, qualifying questions, or soft-delete a task from the interview flow.

> [!NOTE]
>
> `questions` and `qualifying_questions` can only be updated on tasks that support them. Check the `needed_variables` array in the [Get Script](/docs/api-reference/scripts/get-script.md) response to see which fields are editable per task.

At least one field must be provided. All fields are optional.

```bash cURL theme={null}
curl -X PATCH https://api.classet.ai/v2/script-tasks/11 \
  -H "X-API-KEY: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "questions": [
      "How many years of experience do you have?",
      "What types of systems have you worked on?",
      "Do you have experience with VRF systems?"
    ],
    "instructions": "Probe for specifics on commercial vs residential experience.",
    "qualifying_questions": [
      {
        "question": "Do you have a valid driver'\''s license?",
        "disqualifyIf": "no"
      },
      {
        "question": "Are you authorized to work in the US?",
        "disqualifyIf": "no"
      }
    ]
  }'
```

```json 200 theme={null}
{
  "data": {
    "task_id": 11
  }
}
```


## OpenAPI

````yaml PATCH /v2/script-tasks/{taskId}
openapi: 3.1.0
info:
  title: Classet API
  version: 2.0.3
  description: >-
    AI-powered recruiting and phone screening API.


    **API key scopes.** `read` covers every GET; any other method needs `write`
    (403 `insufficient_scope`); starting or stopping an interview also needs
    `interviews:send`. A branch-limited key sees and writes only jobs in its
    branches (not jobs with no branch) and their candidates, applications and
    calls; anything outside is a 404. An organization-group key is read-only
    across every organization in its group. Branch-limited and group keys cannot
    use organization configuration (scripts, knowledge, webhooks, message
    automations, agent settings, AI generation, organization): 403
    `restricted_key_unsupported`. `GET /v2/me` reports what the calling key can
    do.
servers:
  - url: https://api.classet.ai
    description: Production
  - url: http://localhost:8081
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /v2/script-tasks/{taskId}:
    patch:
      tags:
        - Scripts
      summary: Update a script task
      description: >-
        Update questions, instructions, qualifying questions, or other fields on
        a script task. For questions and qualifying_questions, the task must
        support those fields (check needed_variables in the GET response).
      parameters:
        - schema:
            type: string
          required: true
          name: taskId
          in: path
          description: The ID of the task to update.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                questions:
                  type: array
                  items:
                    type: string
                  description: >-
                    Questions to ask during this task. Replaces existing
                    questions. Only for tasks where `needed_variables` includes
                    `"task.questions"`.
                removed:
                  type: boolean
                  description: >-
                    Set to `true` to skip this task during interviews. Set back
                    to `false` to re-enable.
                qualifying_questions:
                  type: array
                  items:
                    type: object
                    properties:
                      question:
                        type: string
                        minLength: 1
                      disqualifyIf:
                        type: string
                        minLength: 1
                    required:
                      - question
                      - disqualifyIf
                  description: >-
                    Pass/fail questions. Each element has `question` (string)
                    and `disqualifyIf` (string — the answer that triggers
                    disqualification, e.g. `"no"`). Only for tasks where
                    `needed_variables` includes `"qualifying_questions"`.
                instructions:
                  type: string
                  description: >-
                    Additional instructions for the AI agent during this task.
                    Use this to guide the agent's behavior (e.g. "Probe for
                    specifics on commercial vs residential experience").
                name:
                  type: string
                  description: Display name of the task.
                description:
                  type: string
                  description: Description of what the task covers.
                order:
                  type: integer
                  description: >-
                    Position in the interview flow (0-indexed). Use [Reorder
                    Tasks](/api-reference/scripts/reorder-tasks) to update
                    multiple tasks at once.
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      task_id:
                        type: integer
                    required:
                      - task_id
                required:
                  - data
        '400':
          description: Field not allowed for this task
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Resource not found
                  code:
                    type: string
                    enum:
                      - not_found
                      - validation_error
                      - unauthorized
                      - forbidden
                      - insufficient_scope
                      - restricted_key_unsupported
                      - branch_out_of_scope
                      - key_misconfigured
                      - quota_exceeded
                      - rate_limited
                      - rate_limit_unavailable
                      - conflict
                      - idempotency_key_reuse
                      - candidate_opted_out
                      - recently_contacted
                      - request_in_progress
                      - unprocessable
                      - bad_request
                      - payload_too_large
                      - internal_error
                      - service_unavailable
                    example: not_found
                    description: Stable machine-readable error code.
                  request_id:
                    type: string
                    example: 9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f
                    description: >-
                      Request ID, also echoed in the X-Request-Id response
                      header. Include it when reporting issues.
                required:
                  - error
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Resource not found
                  code:
                    type: string
                    enum:
                      - not_found
                      - validation_error
                      - unauthorized
                      - forbidden
                      - insufficient_scope
                      - restricted_key_unsupported
                      - branch_out_of_scope
                      - key_misconfigured
                      - quota_exceeded
                      - rate_limited
                      - rate_limit_unavailable
                      - conflict
                      - idempotency_key_reuse
                      - candidate_opted_out
                      - recently_contacted
                      - request_in_progress
                      - unprocessable
                      - bad_request
                      - payload_too_large
                      - internal_error
                      - service_unavailable
                    example: not_found
                    description: Stable machine-readable error code.
                  request_id:
                    type: string
                    example: 9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f
                    description: >-
                      Request ID, also echoed in the X-Request-Id response
                      header. Include it when reporting issues.
                required:
                  - error
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Resource not found
                  code:
                    type: string
                    enum:
                      - not_found
                      - validation_error
                      - unauthorized
                      - forbidden
                      - insufficient_scope
                      - restricted_key_unsupported
                      - branch_out_of_scope
                      - key_misconfigured
                      - quota_exceeded
                      - rate_limited
                      - rate_limit_unavailable
                      - conflict
                      - idempotency_key_reuse
                      - candidate_opted_out
                      - recently_contacted
                      - request_in_progress
                      - unprocessable
                      - bad_request
                      - payload_too_large
                      - internal_error
                      - service_unavailable
                    example: not_found
                    description: Stable machine-readable error code.
                  request_id:
                    type: string
                    example: 9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f
                    description: >-
                      Request ID, also echoed in the X-Request-Id response
                      header. Include it when reporting issues.
                required:
                  - error
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Your Classet API key. Create and rotate keys in Settings → API.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.