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

# Update task state

> Updates the state of a task.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/samplehc/openapi.documented.yml post /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:
    post:
      tags:
        - Task
      summary: Update task state
      description: Updates the state of a task.
      parameters:
        - schema:
            type: string
          in: path
          name: taskId
          required: true
          description: The unique identifier of the task to update the state of.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                key:
                  type: string
                value: {}
              required:
                - key
              additionalProperties: false
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                required:
                  - success
                additionalProperties: false
        '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

````