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

# Get a task



## OpenAPI

````yaml api-reference/doc-tool/ipd-api/protocol-openapi.json get /protocol/workflow/tasks/{id}
openapi: 3.1.0
info:
  title: Eka Protocol API
  version: '1.0'
  description: >-
    Hospital workflows for IPD: rules, the tasks they create, and the forms
    filled on an admission.
servers:
  - description: Production
    url: https://api.eka.care
  - description: Stage/Sandbox
    url: https://api.dev.eka.care
security: []
tags:
  - name: Tasks
    description: >-
      Workflow tasks at a hospital. Rules create them; users claim, release,
      complete and cancel them here. Task documents are also readable live from
      Firestore (`protocol/{bid}/tasks`) through `@orbi/protocol-sdk`; every
      change goes through this API.
  - name: Forms
    description: >-
      Forms filled on an entity (today: an admission, the IPD Forms tab) and
      what happened to each.
  - name: Rules
    description: >-
      Hospital workflow rules: events → conditions → tasks. Each save is a new
      version, compiled to a workflow.
  - name: Catalog
    description: The events and fields rules are written against.
  - name: Events
    description: 'Fire an event for a scope: every active rule on it starts a run.'
  - name: SA forms
    description: >-
      The hospital's SA forms (its own and the system ones), with versions and
      archiving.
  - name: SA form drafts
    description: SA forms saved before they are ready. Not offered in IPD until published.
  - name: AI drafts
    description: Draft an SA form from a prompt or a file with AI.
paths:
  /protocol/workflow/tasks/{id}:
    get:
      tags:
        - Tasks
      summary: Get a task
      operationId: getTasksId
      parameters:
        - name: auth
          in: header
          required: true
          description: >-
            The access token. The gateway verifies it and passes the user and
            the business on.
          schema:
            type: string
        - name: id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    $ref: '#/components/schemas/TaskView'
                required:
                  - status
                  - data
        '401':
          description: No signed-in user, or no business on the session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: The request failed validation; `details` names each invalid path.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    TaskView:
      type: object
      properties:
        scope:
          $ref: '#/components/schemas/Scope'
        type:
          type: string
        status:
          type: string
          enum:
            - IN_PROGRESS
            - COMPLETED
            - MISSED
            - CANCELLED
            - PENDING
        meta:
          $ref: '#/components/schemas/TaskMeta'
        title:
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
        payload:
          $ref: '#/components/schemas/JsonObject'
        requiredness:
          type: string
          enum:
            - MANDATORY
            - OPTIONAL
        blocking:
          type: boolean
        audience_keys:
          type: array
          items:
            type: string
        estimate:
          anyOf:
            - type: string
            - type: 'null'
        escalation:
          anyOf:
            - $ref: '#/components/schemas/Escalation'
            - type: 'null'
        task_id:
          type: string
        bid:
          type: string
        assignee:
          anyOf:
            - type: string
            - type: 'null'
        assignee_name:
          anyOf:
            - type: string
            - type: 'null'
        source:
          $ref: '#/components/schemas/TaskSource'
        parent_task_id:
          anyOf:
            - type: string
            - type: 'null'
        child_task_ids:
          type: array
          items:
            type: string
        completed_by:
          anyOf:
            - $ref: '#/components/schemas/Actor'
            - type: 'null'
        due_at:
          anyOf:
            - type: string
            - type: 'null'
        scheduled_at:
          type: string
        last_action:
          type: object
          properties:
            action:
              type: string
              enum:
                - COMPLETED
                - MISSED
                - CANCELLED
                - CREATED
                - CLAIMED
                - RELEASED
                - ESCALATED
            at:
              type: string
            by:
              $ref: '#/components/schemas/Actor'
          required:
            - action
            - at
            - by
        started_at:
          anyOf:
            - type: string
            - type: 'null'
        completed_at:
          anyOf:
            - type: string
            - type: 'null'
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - scope
        - type
        - status
        - meta
        - title
        - description
        - payload
        - requiredness
        - blocking
        - audience_keys
        - estimate
        - escalation
        - task_id
        - bid
        - assignee
        - assignee_name
        - source
        - parent_task_id
        - child_task_ids
        - completed_by
        - due_at
        - scheduled_at
        - last_action
        - started_at
        - completed_at
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        status:
          type: string
          const: error
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  path:
                    type: string
                  message:
                    type: string
                required:
                  - path
                  - message
          required:
            - code
            - message
      required:
        - status
        - error
    Scope:
      type: object
      properties:
        type:
          type: string
          enum:
            - ADMISSION
            - DISCHARGE
            - APPOINTMENT
            - PRESCRIPTION
            - PATIENT
        id:
          type: string
      required:
        - type
        - id
    TaskMeta:
      type: object
      properties:
        form_kind:
          type: string
          enum:
            - SA
            - CONSENT
            - MCERT
        sa_id:
          type: string
        template_id:
          type: string
    JsonObject:
      type: object
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/Json'
    Escalation:
      type: object
      properties:
        after:
          type: string
        audience_keys:
          type: array
          items:
            type: string
        title:
          type: string
      required:
        - after
        - audience_keys
    TaskSource:
      type: object
      properties:
        kind:
          $ref: '#/components/schemas/TaskSourceKind'
        event_id:
          type: string
        event_name:
          type: string
        fired_by:
          $ref: '#/components/schemas/Actor'
        rule_id:
          type: string
        rule_version:
          type: number
        run_id:
          type: string
        index:
          type: number
        iteration:
          anyOf:
            - type: number
            - type: 'null'
      required:
        - kind
        - event_id
        - event_name
        - fired_by
        - rule_id
        - rule_version
        - run_id
        - index
        - iteration
    Actor:
      type: object
      properties:
        oid:
          type: string
        name:
          type: string
        ps:
          type: string
          enum:
            - D
            - S
            - AD
            - SYSTEM
        s:
          type: string
      required:
        - oid
        - name
        - ps
        - s
    Json:
      anyOf:
        - anyOf:
            - type: string
            - type: number
            - type: boolean
              const: false
            - type: boolean
              const: true
            - $ref: '#/components/schemas/JsonObject'
            - type: array
              items:
                $ref: '#/components/schemas/Json'
        - type: 'null'
    TaskSourceKind:
      type: string
      enum:
        - SYSTEM
        - RULE
        - ADHOC
        - ESCALATION

````

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