Create doctor letter
Creates a new doctor letter.
Note: This endpoint requires a user-scoped OAuth token. A pure
client_credentialstoken without user context will be rejected. The treating user is automatically derived from the token and cannot be set manually.
Request
POST /api/oauth/v2/resource/doctor-letters
Header
| Header | Value |
|---|---|
Authorization | Bearer {access_token} |
Content-Type | application/json |
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
customerUuid | string | Yes | UUID of the assigned customer |
name | string | No | Name of the doctor letter |
text | string | No | Content of the doctor letter |
printed | boolean | No | Whether the letter has been printed |
date | string | No | Date of the doctor letter (YYYY-MM-DD, default: today) |
receiver | object | No | Recipient of the doctor letter |
receiver.title | string | No | Title |
receiver.firstName | string | No | First name |
receiver.lastName | string | No | Last name |
receiver.institute | string | No | Institute or facility |
receiver.street | string | No | Street |
receiver.zip | string | No | Postal code |
receiver.city | string | No | City |
receiver.country | string | No | Country (ISO 3166-1 alpha-2) |
receiver.tel | string | No | Phone number |
receiver.telCode | string | No | Phone country code |
receiver.fax | string | No | Fax number |
receiver.email | string | No | Email address |
Response
Success (201 Created)
json
{
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Referral letter",
"text": "Dear colleague, I am writing to report on the patient Anna Muster...",
"date": "2026-06-09",
"printed": false,
"customer": {
"id": "f0e1d2c3-b4a5-6789-fedc-ba9876543210",
"firstName": "Anna",
"lastName": "Muster"
},
"treatingUser": {
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"firstName": "Dr. Maria",
"lastName": "Huber"
},
"receiver": {
"title": "Dr.",
"firstName": "Klaus",
"lastName": "Berger",
"institute": "Internal Medicine Specialist Practice",
"street": "Hauptstraße 12",
"zip": "4020",
"city": "Linz",
"country": "AT",
"tel": "0732123456",
"telCode": "+43",
"fax": null,
"email": "k.berger@example.at"
}
}
}Response fields
See Get doctor letter for the full field description.
Beispiele
bash
curl -X POST "https://my.offisy.at/api/oauth/v2/resource/doctor-letters" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"customerUuid": "b2c3d4e5-f6a7-8901-bcde-f01234567890",
"name": "Muster GmbH",
"text": "beispiel",
"printed": "beispiel",
"date": "2026-04-15T10:00:00",
"receiver.title": "beispiel",
"receiver.firstName": "Muster GmbH",
"receiver.lastName": "Muster GmbH",
"receiver.institute": "beispiel",
"receiver.street": "Musterstraße 1",
"receiver.zip": "4020",
"receiver.city": "Linz",
"receiver.country": "AT",
"receiver.tel": "+43 664 1234567",
"receiver.telCode": "+43 664 1234567",
"receiver.fax": "beispiel",
"receiver.email": "anna.muster@example.com"
}'Parameter
Zuerst Token anfordern
Possible errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Invalid request data (e.g. customerUuid missing) |
| 401 | invalid_client | Invalid or missing access token |
| 403 | insufficient_scope | Scope medicals not present |
| 404 | not_found | Customer not found |