Skip to content

Individual messages

Send SMS, email, NHS App, and Hero-only messages to patients. Supports write-to-record to persist messages in the patient's EHR.

Get Message

Request

Retrieves a message by its ID. An acting admin without the required policy still receives the message, with the link removed from every attachment.

Security
apiKeyAuth and practiceGroupId
Path
idstringrequired
curl -i -X GET \
  'https://developer.herohealth.net/_mock/apis/public-api/openapi/v1/messages/{id}' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -H 'x-practice-group-id: YOUR_API_KEY_HERE'

Responses

Ok

Bodyapplication/json
idstring^\d+$required
patientobjectrequired
write_to_recordobjectrequired
campaignobject or nullrequired
created_atstring or null, (date-time)required
sent_atstring or null, (date-time)required
scheduled_atstring or null, (date-time)required
statusstringrequired
Enum:"delivered""declined""sent""pending""retry""fatal"
sent_by_adminobjectrequired
recipient_contact_detailstringrequired
message_typestringrequired
messagestring or nullrequired
attachmentsArray of objects
fallback_attemptsArray of objects
status_codestring or null

Why the message failed, set only when status is retry or fatal. Use unknown when no specific reason is available.

Enum:"insufficient_credits""invalid_number""number_not_recognised""missing_contact_number""declined_by_network""provider_configuration_error""invalid_sender_name""invalid_message_content""invalid_send_time""send_failed"
Response
{ "id": "string", "patient": { "id": "string", "title": "Baron", "first_name": "string", "last_name": "string" }, "write_to_record": { "write_to_record_at": "2019-08-24T14:15:22Z", "status": "string", "failure_reason": "string", "snomed_code": "string" }, "short_link": { "id": "string", "type": "string", "name": "string", "status": "string" }, "campaign": { "id": "string", "name": "string" }, "created_at": "2019-08-24T14:15:22Z", "sent_at": "2019-08-24T14:15:22Z", "scheduled_at": "2019-08-24T14:15:22Z", "status": "delivered", "sent_by_admin": { "id": "string", "first_name": "string", "last_name": "string" }, "recipient_contact_detail": "string", "message_type": "string", "message": "string", "attachments": [ { … } ], "fallback_attempts": [ { … } ], "status_code": "insufficient_credits" }