Publisert - 18.11.2026

Send Message

For detailed technical specifications, please refer to the Swagger documentation.

Send a New Message

Upload a message business document to be sent to the specified recipients.

POST /messages

Accepts a business document XML. The business document itself must be specified as a base64-encoded byte array of an XML document. Max size is 35 MB due to EDI limitations.

Note: Only ContentType: "application/xml" and Content-Transfer-Encoding: "base64" are supported.

Request

Property Type Required Description
senderHerId integer ✅ HER‑ID of the message sender.
receiverHerIds integer[] ✅ HER‑IDs of the intended receivers (minimum 1).
businessDocument string ✅ The raw business document payload encoded in Base64.
contentType string ✅ MIME type of the payload. Currently only "application/xml" is supported.
contentTransferEncoding string ✅ Encoding of the payload. Currently only "base64" is supported – the encoding used for businessDocument.
messageTypeIdentificator string ✅ Value that identifies the document type (e.g. from FinnKode 8279: "DIALOG_HELSEFAGLIG").
applicationName string ✅ Name of the calling application/EPJ.
applicationVersion string ✅ Version of the calling application/EPJ.
transportMetadataOverrides (optional) MessageTransportMetadataOverrides — Allows overriding some automatically derived EbXml fields. Use only when you have a non‑standard exchange requirement.

Response

Property Type Description
id string Reference ID for the shipment of the message.

A recipient using EDI 2.0 must provide id to retrieve their message.

You, the sender, can view the status of the message by providing id. Read more on the status endpoint page.

Request Validation

The request is validated in the order below and rejected at the first failing step. Multiple errors within the same step are aggregated in the validationErrors property of the error response.

Step What is checked On failure
1 Payload size ≤ 35 MB, a valid HelseID token, and a JSON body with all required fields. 413 / 401 / 400
2 Field rules: contentType = application/xml, contentTransferEncoding = base64, senderHerId and receiverHerIds within the valid HER-ID range, the nhn-source-system header, and the format of transportMetadataOverrides (HIS 1037). 400
3 The client is authorized for senderHerId (same or parent organization). 403
4 MSH configuration exists for the sender and is not locked to another client. 400 / 423
5 The sender and all receivers exist and are active in the Address Register. EDI address and certificate checks apply when a receiver is EDI-based. 400
6 businessDocument decodes as base64 and the result is well-formed XML. 400

Read more on the troubleshooting page for HTTP status codes, NHN error codes, and the error response object.

Send Message with Custom Metadata for the (EbXml) Envelope

For users who want control over the exact metadata in the EbXml envelope in the EbXml standard (HIS 1037:2011), this can be provided using transportMetadataOverrides.

Should only be used if you have a recipient with requirements or guidelines beyond the standards for the EbXml envelope. For example, NAV requires special handling of Service, Action, Role, CpaId, and compression (Gzip) in some of its exchanges. Configuration of NAV messages is agreed directly with NAV, which can be contacted at e-mottak@nav.no.

Below is an example of how one can override values used when building an EbXml envelope. The specific values to be used are then defined in an agreement between sender and recipient.

"transportMetadataOverrides":
{
    "cpaId": "nav:qass:123456789",
    "service": "BehandlerKrav",
    "serviceType": "string",
    "action": "OppgjorsMelding",
    "senderRole": "Behandler",
    "receiverRole": "KontrollUtbetaler",
    "compressPayload": true // XML will be Gzip-compressed before encryption
}

Søk i Utviklerportalen

Søket er fullført!