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

# Update Task Metadata.

> Update a task's metadata.  Only set properties you wish to change and omit others.



## OpenAPI

````yaml /api-reference/openapi.json patch /task/{uuid}/update
openapi: 3.1.0
info:
  title: Synthpop API
  description: >-
    The Synthpop public API. Create and manage Tasks, upload documents, and
    retrieve structured results.
  version: 1.0.0pre
servers:
  - url: https://app.synthpop.ai/public/v1
    description: Production
  - url: https://stage.synthpop.ai/public/v1
    description: Staging
security: []
tags:
  - name: Authentication
    description: |-

      API endpoints to obtain credentials.
              
  - name: Tasks
    description: >

      API endpoints to create, update and fetch Tasks and Task metadata.


      All the endpoints in this section other than "Get File Download Link"
      return a `TaskDetail`

      object. It contains the following:

      * Summary information for the task, such as IDs, a user friendly name, the
      Task's current
        status and time stamps.
      * Data Items associated with the Task:
        * Data Items are either Text, JSON or a link to a file.
        * A Data Item has a `group` tag. Tasks will have an `inputs` group (for Data Items uploaded)
          or an `outputs` group (for Data Items generated). There might be other tags for
          intermediate output for specific types of Tasks.
        * When analyzing the content of a data item, the result of the analysis is represented as
          `record_groups` within the Data Item. Record groups have:
          * A Record Type, identifying the type of data detected (e.g: insurance card, patient
            form, ...)
          * An optional timestamp that is derived from the content, signifying when the record
            group was created (eg.: date of service for a clinical visit).
  - name: Task List
    description: Retrieve a filtered and ordered list of Tasks.
paths:
  /task/{uuid}/update:
    patch:
      tags:
        - Tasks
      summary: Update Task Metadata.
      description: >-
        Update a task's metadata.  Only set properties you wish to change and
        omit others.
      operationId: p_api_update_task_task__uuid__update_patch
      parameters:
        - name: uuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Unique ID of the Task to update.
            title: Uuid
          description: Unique ID of the Task to update.
        - name: should_resume
          in: query
          required: false
          schema:
            type: boolean
            description: Resume the task if True. Defaults to False (no resume).
            default: false
            title: Should Resume
          description: Resume the task if True. Defaults to False (no resume).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskUpdateRequest'
              description: >-
                Task properties to update. Only set properties you wish to
                change and omit others.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskDetails'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
components:
  schemas:
    TaskUpdateRequest:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Set a task's user friendly name.
        cleared:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Cleared
          description: >-
            Set/unset the task's 'cleared' flag, indicating that your
            organization has/has not performed follow-up work items applicable
            to this task.
        external_id:
          anyOf:
            - type: string
              maxLength: 1024
            - type: 'null'
          title: External Id
          description: Set or change the external ID associated with this task.
        new_data_item:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: New Data Item
          description: >-
            Add a new data item to the task. The data item must be a JSON object
            with the 
      type: object
      title: TaskUpdateRequest
    TaskDetails:
      properties:
        uuid:
          type: string
          format: uuid
          title: Uuid
          description: A unique ID for the Task.
        external_id:
          anyOf:
            - type: string
              maxLength: 1024
            - type: 'null'
          title: External Id
          description: An optional third party assigned ID for the task.
        task_type:
          type: string
          title: Task Type
          description: >-
            A Task's type. Determines what kind of processing is performed on
            the input data.
        status:
          $ref: '#/components/schemas/TaskStatus'
        name:
          type: string
          title: Name
          description: A user friendly name, based on information extracted from inputs.
        cleared:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Cleared
          description: >-
            `cleared` can be set to a timestamp indicating when follow-ups (work
            external to Synthpop) related to this Task have been completed.
            Initialized to `null` upon Task creation.
        created:
          type: string
          format: date-time
          title: Created
          description: Timestamp indicating when this task was created.
        latest_status_change:
          type: string
          format: date-time
          title: Latest Status Change
          description: >-
            Timestamp indicating when the latest status change for this task
            occurred. This indicates when a Task entered `processing`,
            `waiting`, `completed` or `failed` state. For `pending` tasks this
            is set to the same value as `created`.
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
          description: Suggested task category, as determined by the medical records found.
        data_items:
          items:
            anyOf:
              - $ref: '#/components/schemas/DataItemFile'
              - $ref: '#/components/schemas/DataItemJSON'
              - $ref: '#/components/schemas/DataItemText'
          type: array
          title: Data Items
        issues:
          items:
            oneOf:
              - $ref: '#/components/schemas/TaskIssueGenericLLM'
              - $ref: '#/components/schemas/TaskIssueGenericLogic'
              - $ref: '#/components/schemas/TaskIssueGenericWarning'
              - $ref: '#/components/schemas/TaskIssueDataMissing'
              - $ref: '#/components/schemas/TaskIssueMissingRecord'
              - $ref: '#/components/schemas/TaskIssueIncorrectDocumentSequence'
              - $ref: '#/components/schemas/TaskIssueInconsistentData'
              - $ref: '#/components/schemas/TaskIssueExpired'
              - $ref: '#/components/schemas/MedicalRecordIssueDataMissing'
            discriminator:
              propertyName: key
              mapping:
                medical_record.data.missing:
                  $ref: '#/components/schemas/MedicalRecordIssueDataMissing'
                task.data.inconsistent:
                  $ref: '#/components/schemas/TaskIssueInconsistentData'
                task.data.missing:
                  $ref: '#/components/schemas/TaskIssueDataMissing'
                task.llm.other:
                  $ref: '#/components/schemas/TaskIssueGenericLLM'
                task.logic.fail:
                  $ref: '#/components/schemas/TaskIssueGenericLogic'
                task.logic.warning:
                  $ref: '#/components/schemas/TaskIssueGenericWarning'
                task.medical_record.expired:
                  $ref: '#/components/schemas/TaskIssueExpired'
                task.medical_record.incorrect_sequence:
                  $ref: '#/components/schemas/TaskIssueIncorrectDocumentSequence'
                task.medical_record.missing:
                  $ref: '#/components/schemas/TaskIssueMissingRecord'
          type: array
          title: Issues
          description: Issues detected with this task or any medical records of it.
        verdicts:
          items:
            $ref: '#/components/schemas/Verdict'
          type: array
          title: Verdicts
          description: List of verdicts for the task.
        interceptions:
          anyOf:
            - additionalProperties:
                items: {}
                type: array
              type: object
            - type: 'null'
          title: Interceptions
          description: >-
            Optional interception data including structured_data with
            pages-details.
        verdict_summaries:
          items:
            $ref: '#/components/schemas/VerdictSummary'
          type: array
          title: Verdict Summaries
          description: Per-code referral-validation conclusion summaries.
      type: object
      required:
        - uuid
        - task_type
        - status
        - name
        - cleared
        - created
        - latest_status_change
        - category
        - data_items
        - issues
      title: TaskDetails
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskStatus:
      type: string
      enum:
        - pending
        - processing
        - waiting
        - completed
        - failed
        - invalid
        - deferred
      title: TaskStatus
      description: >-
        Current state of a task.


        - `pending`: The task is waiting to be processed.

        - `processing`: The task is currently being processed.

        - `waiting`: The task is waiting for additional input.

        - `completed`: The task has completed processing.

        - `failed`: An error occurred while the task was being processed.

        - `invalid`: The data uploaded does not provide any information
        pertaining to
           the task to be performed.
        - `deferred`: The bulk processing task has been put into a deferred
        state due to high load
    DataItemFile:
      properties:
        uuid:
          type: string
          format: uuid
          title: Uuid
          description: Unique ID of the data item.
        group:
          type: string
          title: Group
          description: >-
            The name of the group this data item is part of. `inputs` and
            `outputs` are present in each type of task, but different task types
            might add additional data groups.
          examples:
            - inputs
        tag:
          type: string
          title: Tag
          description: >-
            An identifier specifying the type of data. Useful for identifying
            the type of content for data items created during processing. (for
            example, a clinical-notes group, a supporting-documents group, or a
            missing-items group).
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: >-
            An optional user-friendly name. Might be derived from the file name
            for files.
        data_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Format
          description: >-
            Optional description of the format of the data. For JSON fields this
            might include an identifier of the expected JSONSchema.
        created:
          type: string
          format: date-time
          title: Created
          description: Time when this data item was uploaded.
        medical_records:
          anyOf:
            - items:
                $ref: '#/components/schemas/MedicalRecord'
              type: array
            - type: 'null'
          title: Medical Records
          description: Medical records found within this data item.
        data_type:
          type: string
          const: file
          title: Data Type
        alias:
          anyOf:
            - type: string
            - type: 'null'
          title: Alias
          description: >-
            If present, alias consisting of {task_id}/{data_item_id}, referring
            to the original data item.
      type: object
      required:
        - uuid
        - group
        - tag
        - created
        - data_type
      title: DataItemFile
    DataItemJSON:
      properties:
        uuid:
          type: string
          format: uuid
          title: Uuid
          description: Unique ID of the data item.
        group:
          type: string
          title: Group
          description: >-
            The name of the group this data item is part of. `inputs` and
            `outputs` are present in each type of task, but different task types
            might add additional data groups.
          examples:
            - inputs
        tag:
          type: string
          title: Tag
          description: >-
            An identifier specifying the type of data. Useful for identifying
            the type of content for data items created during processing. (for
            example, a clinical-notes group, a supporting-documents group, or a
            missing-items group).
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: >-
            An optional user-friendly name. Might be derived from the file name
            for files.
        data_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Format
          description: >-
            Optional description of the format of the data. For JSON fields this
            might include an identifier of the expected JSONSchema.
        created:
          type: string
          format: date-time
          title: Created
          description: Time when this data item was uploaded.
        medical_records:
          anyOf:
            - items:
                $ref: '#/components/schemas/MedicalRecord'
              type: array
            - type: 'null'
          title: Medical Records
          description: Medical records found within this data item.
        data_type:
          type: string
          const: json
          title: Data Type
        data:
          additionalProperties: true
          type: object
          title: Data
      type: object
      required:
        - uuid
        - group
        - tag
        - created
        - data_type
        - data
      title: DataItemJSON
      description: A data item that contains JSON.
    DataItemText:
      properties:
        uuid:
          type: string
          format: uuid
          title: Uuid
          description: Unique ID of the data item.
        group:
          type: string
          title: Group
          description: >-
            The name of the group this data item is part of. `inputs` and
            `outputs` are present in each type of task, but different task types
            might add additional data groups.
          examples:
            - inputs
        tag:
          type: string
          title: Tag
          description: >-
            An identifier specifying the type of data. Useful for identifying
            the type of content for data items created during processing. (for
            example, a clinical-notes group, a supporting-documents group, or a
            missing-items group).
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: >-
            An optional user-friendly name. Might be derived from the file name
            for files.
        data_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Format
          description: >-
            Optional description of the format of the data. For JSON fields this
            might include an identifier of the expected JSONSchema.
        created:
          type: string
          format: date-time
          title: Created
          description: Time when this data item was uploaded.
        medical_records:
          anyOf:
            - items:
                $ref: '#/components/schemas/MedicalRecord'
              type: array
            - type: 'null'
          title: Medical Records
          description: Medical records found within this data item.
        data_type:
          type: string
          const: text
          title: Data Type
        data:
          type: string
          title: Data
          description: The text represented by this data item
      type: object
      required:
        - uuid
        - group
        - tag
        - created
        - data_type
        - data
      title: DataItemText
      description: A data item that contains text.
    TaskIssueGenericLLM:
      properties:
        message:
          type: string
          title: Message
          description: A user-friendly English text representing the issue.
        key:
          type: string
          const: task.llm.other
          title: Key
          description: >-
            A generic task issue reported by the LLM that currently does not
            have a specific error type.
          default: task.llm.other
      type: object
      required:
        - message
      title: TaskIssueGenericLLM
      description: A generic task issue reported by the LLM.
    TaskIssueGenericLogic:
      properties:
        message:
          type: string
          title: Message
          description: A user-friendly English text representing the issue.
        key:
          type: string
          const: task.logic.fail
          title: Key
          description: A generic issue reported by a logic check performed on the code.
          default: task.logic.fail
        code:
          type: string
          title: Code
          description: The HCPC or other code that failed the logic check
      type: object
      required:
        - message
        - code
      title: TaskIssueGenericLogic
      description: A generic task issue reported by a logic check performed on the code.
    TaskIssueGenericWarning:
      properties:
        message:
          type: string
          title: Message
          description: A user-friendly English text representing the issue.
        key:
          type: string
          const: task.logic.warning
          title: Key
          description: A generic warning for a logic check performed on the code.
          default: task.logic.warning
        code:
          type: string
          title: Code
          description: The HCPC or other code needs human review for logic check
      type: object
      required:
        - message
        - code
      title: TaskIssueGenericWarning
      description: A generic warning for a logic check performed on the code.
    TaskIssueDataMissing:
      properties:
        message:
          type: string
          title: Message
          description: A user-friendly English text representing the issue.
        key:
          type: string
          const: task.data.missing
          title: Key
          description: >-
            A data item required for the task to be processed is missing from
            the input.
          default: task.data.missing
        property:
          type: string
          title: Property
          description: Type of required information that is missing.
      type: object
      required:
        - message
        - property
      title: TaskIssueDataMissing
      description: >-
        A data item required for the task to be processed is missing from the
        input.
    TaskIssueMissingRecord:
      properties:
        medical_record_type:
          type: string
          title: Medical Record Type
          description: The type of medical record to which the issue applies.
        message:
          type: string
          title: Message
          description: A user-friendly English text representing the issue.
        key:
          type: string
          const: task.medical_record.missing
          title: Key
          description: A required medical record type is missing.
          default: task.medical_record.missing
      type: object
      required:
        - medical_record_type
        - message
      title: TaskIssueMissingRecord
      description: A required medical record type is missing.
    TaskIssueIncorrectDocumentSequence:
      properties:
        medical_record_type:
          type: string
          title: Medical Record Type
          description: The type of medical record to which the issue applies.
        message:
          type: string
          title: Message
          description: A user-friendly English text representing the issue.
        key:
          type: string
          const: task.medical_record.incorrect_sequence
          title: Key
          description: The sequence of documents provided does not meet requirements.
          default: task.medical_record.incorrect_sequence
      type: object
      required:
        - medical_record_type
        - message
      title: TaskIssueIncorrectDocumentSequence
      description: The sequence of documents provided does not meet requirements.
    TaskIssueInconsistentData:
      properties:
        property:
          type: string
          title: Property
          description: Data property exhibiting the issue.
        message:
          type: string
          title: Message
          description: A user-friendly English text representing the issue.
        key:
          type: string
          const: task.data.inconsistent
          title: Key
          description: Inconsistent data found across medical documents in the task.
          default: task.data.inconsistent
      type: object
      required:
        - property
        - message
      title: TaskIssueInconsistentData
      description: Inconsistent data found across medical documents in the task.
    TaskIssueExpired:
      properties:
        medical_record_type:
          type: string
          title: Medical Record Type
          description: The type of medical record to which the issue applies.
        message:
          type: string
          title: Message
          description: A user-friendly English text representing the issue.
        key:
          type: string
          const: task.medical_record.expired
          title: Key
          description: A medical record's service date is too far in the past.
          default: task.medical_record.expired
      type: object
      required:
        - medical_record_type
        - message
      title: TaskIssueExpired
      description: A medical record's service date is too far in the past.
    MedicalRecordIssueDataMissing:
      properties:
        property:
          type: string
          title: Property
          description: Data property exhibiting the issue.
        medical_record_type:
          type: string
          title: Medical Record Type
          description: The type of medical record to which the issue applies.
        message:
          type: string
          title: Message
          description: A user-friendly English text representing the issue.
        key:
          type: string
          const: medical_record.data.missing
          title: Key
          description: >-
            Information that is required to be provided for a certain type of
            medical record is missing
          default: medical_record.data.missing
      type: object
      required:
        - property
        - medical_record_type
        - message
      title: MedicalRecordIssueDataMissing
      description: >-
        Information that is required to be provided for a certain type of
        medical record is missing.
    Verdict:
      properties:
        code:
          type: string
          title: Code
          description: Code to be evaluated (such as HCPCS, or Exxxx codes).
        approved:
          type: boolean
          title: Approved
          description: Was the code approved?
        issues:
          items:
            type: integer
          type: array
          title: Issues
          description: >-
            A list of indices referring to the TaskDetails.issues list,
            indicating which issues affect this Verdict and might have caused to
            not be approved.
      type: object
      required:
        - code
        - approved
        - issues
      title: Verdict
      description: A verdict for a task.
    VerdictSummary:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Code the conclusion summary applies to (such as HCPCS or Exxxx
            codes).
        conclusion:
          type: string
          title: Conclusion
          description: Human-readable conclusion summary for this code.
      type: object
      required:
        - code
        - conclusion
      title: VerdictSummary
      description: A per-code referral-validation conclusion summary.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    MedicalRecord:
      properties:
        id:
          type: integer
          title: Id
          description: Unique ID of this record.
        record_type:
          type: string
          title: Record Type
          description: Type of record such as `insurance-card` or `patient-visit`.
        sections:
          items:
            $ref: '#/components/schemas/MedicalRecordSection'
          type: array
          minItems: 1
          title: Sections
          description: Sections (pages) that this medical record is comprised of.
        timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Timestamp
          description: >-
            A timestamp representing when this record was created. This is *not*
            the document upload or processing time, but the creation date of the
            medical information within this record. ("When did the patient visit
            happen?")
        fields:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Fields
          description: >-
            The aggregate of fields extracted from sections in is medical
            record.
      type: object
      required:
        - id
        - record_type
        - sections
      title: MedicalRecord
      description: A medical record as extracted from a part of a document.
    MedicalRecordSection:
      properties:
        start:
          type: integer
          title: Start
          description: >-
            Start offset within the document the medical record was extracted
            from. For PDF documents this is a page number. For audio recordings
            this is a recording offset (in seconds).
        length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Length
          description: >-
            Length from `start` within the document corresponding to this
            medical record. Pages for PDFs, seconds for audio recordings. A
            value of `null` indicates until the end of the document.
        content:
          anyOf:
            - type: string
            - type: 'null'
          title: Content
          description: >-
            Extracted relevant content, such as OCR, extracted form data or a
            voice transcript.
        fields:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Fields
          description: Extracted fields.
      type: object
      required:
        - start
        - length
        - content
      title: MedicalRecordSection
      description: A section of a medical record, such as a page of a PDF.
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````