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

# Get Script

> Retrieve a script with all tasks, agent settings, and task metadata.

Retrieves a script with its agent settings and its full task list, ordered by `order`. Each task is one section of the interview. A script made with [Create Script](/docs/api-reference/scripts/create-script.md) starts with the five Basic Interview tasks shown below.

`needed_variables` lists what a task reads. Only tasks whose `needed_variables` include `task.questions` ask the `questions` you set. The agent-settings fields (`initial_text_message`, `completed_text_message` and the others) are `null` when the script uses the default.

```bash cURL theme={null}
curl https://api.classet.ai/v2/scripts/3 \
  -H "X-API-KEY: your-api-key"
```

```json 200 theme={null}
{
  "data": {
    "id": 3,
    "name": "Electrician Screen",
    "description": "Screening script for electrician roles",
    "default": true,
    "completed_text_message": null,
    "initial_text_message": null,
    "filter_out_criteria": null,
    "custom_summary_instructions": null,
    "custom_summary_example": null,
    "transcript_parsing_instructions": null,
    "tasks": [
      {
        "id": 101,
        "task_id": 23,
        "name": "Introduction",
        "short_name": "Intro",
        "description": "When the call starts and the agent greets the candidate",
        "regular_description": "This marks the beginning of the call when the agent greets the candidate.",
        "order": 1,
        "questions": null,
        "qualifying_questions": null,
        "instructions": "Follow this script to start the call: \"Hi {candidate.firstname}, this is {recruiter_name} from {job.company}...\"",
        "removed": false,
        "needed_variables": [
          "candidate.firstname",
          "job.title",
          "job.company",
          "recruiter_name"
        ]
      },
      {
        "id": 102,
        "task_id": 24,
        "name": "AI Introduction",
        "short_name": "AI Intro",
        "description": "When the agent introduces themselves and the purpose of the call to the candidate",
        "regular_description": "Your recruiter introduces themselves as an AI and explains the purpose of the call to the candidate.",
        "order": 2,
        "questions": null,
        "qualifying_questions": null,
        "instructions": "Say the following: \"Ok, great! I am an AI-based recruiting assistant...\"",
        "removed": false,
        "needed_variables": [
          "job.company"
        ]
      },
      {
        "id": 103,
        "task_id": 25,
        "name": "Sell The Position",
        "short_name": "The Sell",
        "description": "When the agent gives a brief summary and describes the job",
        "regular_description": "Your recruiter gives a brief summary of the company, location, and job details to the candidate.",
        "order": 3,
        "questions": null,
        "qualifying_questions": null,
        "instructions": "Say the following: \"The position of {job.title} at {job.company}...\"",
        "removed": false,
        "needed_variables": [
          "job.title",
          "job.company",
          "job.location.city",
          "job.location.region",
          "job.employment_type",
          "job.wage_type",
          "wage_range"
        ]
      },
      {
        "id": 104,
        "task_id": 26,
        "name": "Learn the Basics about the Candidate",
        "short_name": "Basics",
        "description": "When the agent asks some basic background information.",
        "regular_description": "Your recruiter asks basic background questions that you define.",
        "order": 4,
        "questions": [
          "How many years of electrical experience do you have?",
          "Are you a journeyman or master electrician?"
        ],
        "qualifying_questions": null,
        "instructions": "Ask THESE questions: {task.questions}",
        "removed": false,
        "needed_variables": [
          "task.questions"
        ]
      },
      {
        "id": 105,
        "task_id": 27,
        "name": "Establish Next Steps",
        "short_name": "Next Steps",
        "description": "When the agent asks for information for a follow up call",
        "regular_description": "Your recruiter collects details on follow-up availability or the candidate's ideal start date.",
        "order": 5,
        "questions": [
          "Are you interested in moving forward with this position?",
          "If hired, when would you be able to start?"
        ],
        "qualifying_questions": null,
        "instructions": "Confirm the candidate's interest in moving forward... ASK THESE QUESTIONS: {task.questions}",
        "removed": false,
        "needed_variables": [
          "task.questions"
        ]
      }
    ]
  }
}
```


## OpenAPI

````yaml GET /v2/scripts/{scriptId}
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/scripts/{scriptId}:
    get:
      tags:
        - Scripts
      summary: Get script with tasks
      description: Retrieve a script with all tasks, agent settings, and task metadata.
      parameters:
        - schema:
            type: string
          required: true
          name: scriptId
          in: path
          description: The ID of the script to retrieve.
      responses:
        '200':
          description: Script details
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ScriptDetail'
                required:
                  - data
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Resource not found
                  code:
                    type: string
                    enum:
                      - not_found
                      - validation_error
                      - unauthorized
                      - forbidden
                      - insufficient_scope
                      - restricted_key_unsupported
                      - branch_out_of_scope
                      - key_misconfigured
                      - quota_exceeded
                      - rate_limited
                      - rate_limit_unavailable
                      - conflict
                      - idempotency_key_reuse
                      - candidate_opted_out
                      - recently_contacted
                      - request_in_progress
                      - unprocessable
                      - bad_request
                      - payload_too_large
                      - internal_error
                      - service_unavailable
                    example: not_found
                    description: Stable machine-readable error code.
                  request_id:
                    type: string
                    example: 9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f
                    description: >-
                      Request ID, also echoed in the X-Request-Id response
                      header. Include it when reporting issues.
                required:
                  - error
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Resource not found
                  code:
                    type: string
                    enum:
                      - not_found
                      - validation_error
                      - unauthorized
                      - forbidden
                      - insufficient_scope
                      - restricted_key_unsupported
                      - branch_out_of_scope
                      - key_misconfigured
                      - quota_exceeded
                      - rate_limited
                      - rate_limit_unavailable
                      - conflict
                      - idempotency_key_reuse
                      - candidate_opted_out
                      - recently_contacted
                      - request_in_progress
                      - unprocessable
                      - bad_request
                      - payload_too_large
                      - internal_error
                      - service_unavailable
                    example: not_found
                    description: Stable machine-readable error code.
                  request_id:
                    type: string
                    example: 9f2c1d7e-4a3b-4c8d-9e0f-1a2b3c4d5e6f
                    description: >-
                      Request ID, also echoed in the X-Request-Id response
                      header. Include it when reporting issues.
                required:
                  - error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ScriptDetail:
      allOf:
        - $ref: '#/components/schemas/ScriptSummary'
        - type: object
          properties:
            tasks:
              type: array
              items:
                $ref: '#/components/schemas/ScriptTask'
              description: >-
                Ordered list of tasks that make up the interview flow. Each task
                contains:
            completed_text_message:
              type: string
              nullable: true
              description: Post-call text message sent to candidates
            initial_text_message:
              type: string
              nullable: true
              description: Initial outreach message sent to candidates
            filter_out_criteria:
              type: string
              nullable: true
              description: Criteria for automatically disqualifying candidates
            custom_summary_instructions:
              type: string
              nullable: true
              description: Instructions for AI summary generation format
            custom_summary_example:
              type: string
              nullable: true
              description: Example summary for the AI to follow
            transcript_parsing_instructions:
              type: string
              nullable: true
              description: Instructions for extracting custom data from transcripts
          required:
            - tasks
      description: Script with tasks and agent settings
    ScriptSummary:
      type: object
      properties:
        id:
          type: integer
          description: The script ID.
        name:
          type: string
          nullable: true
          description: The name of the script.
        description:
          type: string
          nullable: true
          description: A description of the script's purpose.
        default:
          type: boolean
          description: Whether this is the default script for new jobs.
      required:
        - id
        - name
        - description
        - default
      description: Script summary
    ScriptTask:
      type: object
      properties:
        id:
          type: integer
          description: The task ID.
        task_id:
          type: integer
          nullable: true
        name:
          type: string
          nullable: true
          description: Display name of the task.
        short_name:
          type: string
          nullable: true
          description: Short identifier for the task.
        description:
          type: string
          nullable: true
          description: Description of what the task covers.
        regular_description:
          type: string
          nullable: true
          description: >-
            Human-readable description of what this task covers during the
            interview
        order:
          type: integer
          nullable: true
          description: Position in the interview flow (0-indexed).
        questions:
          nullable: true
          description: List of questions to ask during this task.
        qualifying_questions:
          nullable: true
          description: >-
            Questions with pass/fail criteria. Each has `question` (string) and
            `disqualifyIf` (string) fields.
        instructions:
          type: string
          nullable: true
          description: Additional instructions for the AI agent during this task.
        removed:
          type: boolean
          nullable: true
          description: Whether this task has been soft-deleted from the script.
        needed_variables:
          nullable: true
          description: >-
            Array of variable names this task supports (e.g. "task.questions",
            "qualifying_questions"). Use to determine which fields can be
            updated.
      required:
        - id
        - task_id
        - name
        - short_name
        - description
        - regular_description
        - order
        - instructions
        - removed
      description: Interview script task
  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.