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

# Get task

> Fetch the latest status and details for a task.

Look up a task by **id** (UUID) or **slug**.


## OpenAPI

````yaml /openapi.json GET /tasks/{taskIdOrSlug}
openapi: 3.0.3
info:
  title: Twill API
  version: 1.0.0
  description: Programmatically create and manage Twill tasks via REST API.
servers:
  - url: https://twill.ai/api/v1
security:
  - bearerAuth: []
tags:
  - name: Tasks
    description: Create and manage tasks.
paths:
  /tasks/{taskIdOrSlug}:
    get:
      tags:
        - Tasks
      summary: Get task
      description: Get task details by task id or slug.
      operationId: getTask
      parameters:
        - name: taskIdOrSlug
          in: path
          required: true
          schema:
            type: string
          description: Task id (UUID) or task slug.
      responses:
        '200':
          description: Task detail
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTaskResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '429':
          $ref: '#/components/responses/RateLimitedError'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    GetTaskResponse:
      type: object
      required:
        - task
        - latestJob
      properties:
        task:
          $ref: '#/components/schemas/TaskDetail'
        latestJob:
          $ref: '#/components/schemas/LatestJob'
    TaskDetail:
      type: object
      required:
        - id
        - slug
        - title
        - url
        - repositoryUrl
        - baseBranch
        - featureBranch
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        slug:
          type: string
        title:
          type: string
        url:
          type: string
        repositoryUrl:
          type: string
        baseBranch:
          type: string
        featureBranch:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    LatestJob:
      type: object
      nullable: true
      required:
        - id
        - status
        - type
        - agentProvider
        - startedAt
        - completedAt
        - pr
        - plan
        - planOutcome
      properties:
        id:
          type: string
        status:
          $ref: '#/components/schemas/JobStatus'
        type:
          type: string
        agentProvider:
          type: string
          nullable: true
          description: Provider/model id used for the latest job.
        startedAt:
          type: string
          format: date-time
          nullable: true
        completedAt:
          type: string
          format: date-time
          nullable: true
        pr:
          type: object
          nullable: true
          required:
            - url
            - number
            - title
          properties:
            url:
              type: string
            number:
              type: integer
            title:
              type: string
        plan:
          type: string
          nullable: true
        planOutcome:
          type: string
          nullable: true
    ApiErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details: {}
    JobStatus:
      type: string
      enum:
        - PENDING
        - IN_PROGRESS
        - COMPLETED
        - FAILED
        - CANCELLED
  responses:
    UnauthorizedError:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            error:
              code: unauthorized
              message: Invalid or missing API key
    NotFoundError:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            error:
              code: not_found
              message: Task not found
    RateLimitedError:
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            error:
              code: rate_limited
              message: Rate limit exceeded. Max 100 requests per minute.
    InternalError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            error:
              code: internal_error
              message: Server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````