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

# Tasks by entity



## OpenAPI

````yaml /openapi/assignment.yaml get /api/v1/tasks/entity/{entity_type}/{entity_id}
openapi: 3.1.0
info:
  title: Assignment Service
  description: Centralised task-assignment hub for workflow-driven organisations.
  version: 1.0.0
servers:
  - url: https://api.capedigital.co.ke/assignment
    description: Production
  - url: http://localhost:8000
    description: Local
security: []
paths:
  /api/v1/tasks/entity/{entity_type}/{entity_id}:
    get:
      tags:
        - tasks
      summary: Tasks by entity
      operationId: get_tasks_by_entity_api_v1_tasks_entity__entity_type___entity_id__get
      parameters:
        - name: entity_type
          in: path
          required: true
          schema:
            type: string
            title: Entity Type
        - name: entity_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Entity Id
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/TaskStatus'
              - type: 'null'
            title: Status
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cursor
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 10
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CursorPage_TaskResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TaskStatus:
      type: string
      enum:
        - OPEN
        - IN_PROGRESS
        - DONE
        - BLOCKED
        - CANCELLED
      title: TaskStatus
    CursorPage_TaskResponse_:
      properties:
        next:
          anyOf:
            - type: string
            - type: 'null'
          title: Next
        previous:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous
        results:
          items:
            $ref: '#/components/schemas/TaskResponse'
          type: array
          title: Results
      type: object
      required:
        - results
      title: CursorPage[TaskResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        status:
          type: string
          enum:
            - OPEN
            - IN_PROGRESS
            - DONE
            - BLOCKED
            - CANCELLED
          title: Status
        priority:
          type: string
          enum:
            - LOW
            - MEDIUM
            - HIGH
            - URGENT
          title: Priority
        engine_request:
          anyOf:
            - type: string
            - type: 'null'
          title: Engine Request
        workflow_node_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Node Code
        node_preview_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Node Preview Name
        node_instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Node Instructions
        required_permissions_snapshot:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          title: Required Permissions Snapshot
        assigned_to:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Assigned To
        assigned_to_user:
          anyOf:
            - type: object
            - type: 'null'
          title: Assigned To User
        assigned_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Assigned At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        due_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Due At
        escalation_level:
          type: integer
          title: Escalation Level
          default: 0
        source_service:
          type: string
          title: Source Service
        entity_type:
          type: string
          title: Entity Type
        entity_id:
          type: string
          format: uuid
          title: Entity Id
        entity_reference:
          anyOf:
            - type: string
            - type: 'null'
          title: Entity Reference
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
      type: object
      required:
        - id
        - status
        - priority
        - engine_request
        - workflow_node_code
        - node_preview_name
        - node_instructions
        - required_permissions_snapshot
        - assigned_to
        - assigned_at
        - completed_at
        - due_at
        - source_service
        - entity_type
        - entity_id
        - entity_reference
        - created_at
        - updated_at
        - deleted_at
      title: TaskResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````