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

# Get task state

> Retrieves the state of a task. This is typically used for tasks that need to persist state across multiple requests.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/samplehc/openapi.documented.yml get /api/v2/tasks/{taskId}/state
openapi: 3.0.3
info:
  title: Sample Healthcare API
  description: API for Sample Healthcare
  version: 1.0.0
servers: []
security: []
paths:
  /api/v2/tasks/{taskId}/state:
    get:
      tags:
        - Task
      summary: Get task state
      description: >-
        Retrieves the state of a task. This is typically used for tasks that
        need to persist state across multiple requests.
      parameters:
        - schema:
            type: string
          in: path
          name: taskId
          required: true
          description: The unique identifier of the task to get the state of.
      responses:
        '200':
          description: The state of the task.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Not Found, the task with the specified ID was not found.
                required:
                  - error
                additionalProperties: false

````