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

# Update task

> Update an existing task by id.



## OpenAPI

````yaml /openapi.json put /tasks/{id}
openapi: 3.1.0
info:
  title: OpenLoop API
  version: 0.1.0
  description: >-
    Unified reference for the OpenLoop Patient (clinical) and Payments & Revenue
    APIs.
servers:
  - url: https://api.openloophealth.com/v0.1
    description: Production partner edge
  - url: https://api-staging.openloophealth.com/v0.1
    description: Staging partner edge (sandbox credentials)
security: []
paths:
  /tasks/{id}:
    put:
      tags:
        - Tasks
      summary: Update task
      description: Update an existing task by id.
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 64
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                    - draft
                    - requested
                    - received
                    - accepted
                    - rejected
                    - ready
                    - cancelled
                    - in-progress
                    - on-hold
                    - failed
                    - completed
                    - entered-in-error
                intent:
                  type: string
                  enum:
                    - unknown
                    - proposal
                    - plan
                    - order
                    - original-order
                    - reflex-order
                    - filler-order
                    - instance-order
                    - option
                priority:
                  type: string
                  enum:
                    - routine
                    - urgent
                    - asap
                    - stat
                code:
                  type: object
                  properties:
                    system:
                      type: string
                      format: uri
                    code:
                      type: string
                      maxLength: 256
                    display:
                      type:
                        - string
                        - 'null'
                      maxLength: 500
                  required:
                    - code
                description:
                  type:
                    - string
                    - 'null'
                  maxLength: 2000
                focus:
                  type: object
                  properties:
                    id:
                      type: string
                      minLength: 1
                      maxLength: 64
                    type:
                      type: string
                      enum:
                        - Patient
                        - Practitioner
                        - PractitionerRole
                        - Organization
                        - RelatedPerson
                        - Device
                        - Group
                        - CareTeam
                        - HealthcareService
                        - ServiceRequest
                        - MedicationRequest
                        - CarePlan
                        - ClinicalImpression
                        - Encounter
                        - Appointment
                        - Questionnaire
                        - QuestionnaireResponse
                        - Coverage
                        - ClaimResponse
                        - Task
                        - Location
                        - DocumentReference
                  required:
                    - id
                    - type
                for:
                  type: object
                  properties:
                    id:
                      type: string
                      minLength: 1
                      maxLength: 64
                    type:
                      type: string
                      enum:
                        - Patient
                        - Practitioner
                        - PractitionerRole
                        - Organization
                        - RelatedPerson
                        - Device
                        - Group
                        - CareTeam
                        - HealthcareService
                        - ServiceRequest
                        - MedicationRequest
                        - CarePlan
                        - ClinicalImpression
                        - Encounter
                        - Appointment
                        - Questionnaire
                        - QuestionnaireResponse
                        - Coverage
                        - ClaimResponse
                        - Task
                        - Location
                        - DocumentReference
                  required:
                    - id
                    - type
                for_id:
                  type: string
                  minLength: 1
                  maxLength: 64
                requester:
                  type: object
                  properties:
                    id:
                      type: string
                      minLength: 1
                      maxLength: 64
                    type:
                      type: string
                      enum:
                        - Device
                        - Organization
                        - Patient
                        - Practitioner
                        - PractitionerRole
                        - RelatedPerson
                  required:
                    - id
                    - type
                owner:
                  type: object
                  properties:
                    id:
                      type: string
                      minLength: 1
                      maxLength: 64
                    type:
                      type: string
                      enum:
                        - Practitioner
                        - PractitionerRole
                        - Organization
                        - CareTeam
                        - HealthcareService
                        - Patient
                        - Device
                        - RelatedPerson
                  required:
                    - id
                    - type
                execution_period:
                  type: object
                  properties:
                    start:
                      type: string
                      pattern: >-
                        ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$
                    end:
                      type: string
                      pattern: >-
                        ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$
                authored_on:
                  type: string
                  pattern: >-
                    ^\d{4}(?:-\d{2}(?:-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2}))?)?)?$
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Task'
                  request_id:
                    type: string
                required:
                  - data
                  - request_id
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - serviceToken: []
        - userToken: []
components:
  schemas:
    Task:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 64
        status:
          type: string
          enum:
            - draft
            - requested
            - received
            - accepted
            - rejected
            - ready
            - cancelled
            - in-progress
            - on-hold
            - failed
            - completed
            - entered-in-error
        intent:
          type: string
          enum:
            - unknown
            - proposal
            - plan
            - order
            - original-order
            - reflex-order
            - filler-order
            - instance-order
            - option
        priority:
          type: string
          enum:
            - routine
            - urgent
            - asap
            - stat
        code:
          type: array
          items:
            type: object
            properties:
              system:
                type: string
                format: uri
              code:
                type: string
                minLength: 1
              display:
                type: string
                maxLength: 500
            required:
              - code
        description:
          type: string
          maxLength: 2000
        focus:
          type: object
          properties:
            id:
              type: string
              maxLength: 64
              pattern: ^[A-Za-z0-9\-.]{1,64}$
            type:
              type: string
              minLength: 1
              maxLength: 64
              pattern: ^[A-Z][A-Za-z]+$
          required:
            - id
            - type
        for:
          type: object
          properties:
            id:
              type: string
              maxLength: 64
              pattern: ^[A-Za-z0-9\-.]{1,64}$
            type:
              type: string
              minLength: 1
              maxLength: 64
              pattern: ^[A-Z][A-Za-z]+$
          required:
            - id
            - type
        requester:
          type: object
          properties:
            id:
              type: string
              maxLength: 64
              pattern: ^[A-Za-z0-9\-.]{1,64}$
            type:
              type: string
              minLength: 1
              maxLength: 64
              pattern: ^[A-Z][A-Za-z]+$
          required:
            - id
            - type
        owner:
          type: object
          properties:
            id:
              type: string
              maxLength: 64
              pattern: ^[A-Za-z0-9\-.]{1,64}$
            type:
              type: string
              minLength: 1
              maxLength: 64
              pattern: ^[A-Z][A-Za-z]+$
          required:
            - id
            - type
        execution_period:
          type: object
          properties:
            start:
              type: string
              pattern: >-
                ^\d{4}(?:-\d{2}(?:-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2}))?)?)?$
            end:
              type: string
              pattern: >-
                ^\d{4}(?:-\d{2}(?:-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2}))?)?)?$
        authored_on:
          type: string
          pattern: >-
            ^\d{4}(?:-\d{2}(?:-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2}))?)?)?$
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - status
        - intent
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            error_code:
              type: string
          required:
            - message
            - error_code
        request_id:
          type: string
      required:
        - error
        - request_id
  securitySchemes:
    serviceToken:
      type: oauth2
      description: >-
        Service (M2M) access token issued by POST /auth/token using the
        client_credentials grant. Required scopes, where known, are listed on
        each operation below.
      flows:
        clientCredentials:
          tokenUrl: https://api.openloophealth.com/v0.1/auth/token
          scopes: {}
    userToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        User access token issued by POST /auth/token via the verification-code
        grant (after Verify a one-time code) or the refresh_token grant.

````

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