Skip to content

Get Todos by Entity

Returns all todos linked to a specific entity such as a plan of care or authorization.

Endpoint

GET /todo-service/v1/todos/entity/{entity_type}/{entity_id}

Path Parameters

Parameter Type Required Description
entity_type string Yes Type of the entity. One of PLAN_OF_CARE, AUTHORIZATION, APPOINTMENT, SOAP
entity_id string Yes Unique identifier of the entity

Request

curl --location '{base_url}/todo-service/v1/todos/entity/PLAN_OF_CARE/poc-abc-123' \
  --header 'Authorization: Bearer JWT_TOKEN'

Response

Success Response

Code: 200 OK

Returns an array of todo objects. See Get Todo for full field descriptions.

[
  {
    "id": "td-9f3a1bc2-4e5d-4f6a-8b7c-123456789abc",
    "todo_type": "POC_EXPIRY",
    "patient_id": 12345,
    "case_id": null,
    "clinic_id": 1001,
    "organisation_id": 2001,
    "todo_status": "ACTIVE",
    "priority": "HIGH",
    "due_date": "2025-02-15T10:00:00Z",
    "days_until_due": 14,
    "is_overdue": false,
    "threshold_count": null,
    "current_count": null,
    "remaining_count": null,
    "assigned_to_user_id": null,
    "assigned_to_role": "PROVIDER",
    "entity_id": "poc-abc-123",
    "entity_type": "PLAN_OF_CARE",
    "context_data": {
      "plan_of_care_id": "poc-abc-123"
    },
    "actions": [],
    "polling_url": "/todo-service/v1/todos/td-9f3a1bc2-4e5d-4f6a-8b7c-123456789abc/status",
    "created_at": "2025-01-31T08:00:00Z",
    "updated_at": "2025-01-31T08:00:00Z",
    "version": 1,
    "deleted": false,
    "deleted_at": null
  }
]

Error Response

Code: 400 Bad Request

{
  "error": "entity_type and entity_id are required"
}