Letters

Letters can be generated from templates and sent by email.

The letters model

Properties

  • Name
    id
    Type
    string
    Description

    Letter UUID.

  • Name
    patientId
    Type
    string
    Description

    Patient the letter concerns.

  • Name
    status
    Type
    string
    Description

    Draft or sent status.


GET/api/letters

List letters

Paginated letter list.

Request

GET
/api/letters
curl -X GET http://localhost:3000/api/letters \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "patientId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "status": "DRAFT",
      "subject": "Referral to specialist",
      "createdAt": "2026-10-05T06:30:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "pageSize": 20,
    "total": 1,
    "totalPages": 1
  }
}

POST/api/letters

Create letter

Create from template and patient context.

Request

POST
/api/letters
curl -X POST http://localhost:3000/api/letters \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "patientId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "status": "DRAFT"
}

GET/api/letters/:id

Retrieve letter

Letter body and metadata.

Request

GET
/api/letters/:id
curl -X GET http://localhost:3000/api/letters/:id \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "patientId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "bodyHtml": "Referral letter content…",
  "status": "DRAFT"
}

POST/api/letters/:id/email

Send email

Email the letter to recipients.

Request

POST
/api/letters/:id/email
curl -X POST http://localhost:3000/api/letters/:id/email \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "sent": true,
  "to": [
    "patient@example.com"
  ]
}

Was this page helpful?