Publisert - 15.04.2026

Send Message

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

Overview

Upload a business document message 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.

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

The API request and the business document passes through some validation before being accepted by EDI 2.0. Read about the validation on the page for possible error scenarios.

The endpoint responds with an ID reference (id) for the shipment. Recipients using EDI 2.0 must provide this in order to retrieve their message. You as the sender can also use this to follow up on the status of the message. Read about retrieving status further down the page.

Send with custom metadata for the EbXml envelope (recipients with requirements beyond the standards)

If you want control over which metadata is sent with the EbXml envelope in the EbXml standard (HIS 1037:2011), these can be specified using EbxmlOverrides. This will be necessary for communication with businesses and services that have their own requirements and guidelines for the EbXml envelope beyond the standard.

For example, NAV requires special handling of Service, Action, Role, CpaId, and compression (Gzip) in some of its exchanges. The fields in EbxmlOverrides set the corresponding values in the EbXml envelope. 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.

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

Send message with reference to attachment in the file transport service (DEFT)

Messages sent with EDI 2.0 must be backward compatible with traditional EDI. The size of the shipment is therefore limited. Read about EDI limitations on the page for EDI limitations.

One strategy for sending a message with attachments is, for example, to use a file reference (FileReference) instead of embedding the attachment in the message (Base64Container), provided that the recipient also supports file references. The attachment can, for example, be uploaded to the Objects API in the file sharing service DEFT, which uses the same addressing and authorization as the Message Handler for EDI 2.0. Read more about DEFT on its own developer portal page.

Below is an example of how one can specify attachments in an EbXml, both as a file reference and as base64.

<RefDoc>
    <IssueDate V="2023-10-03T08:32:13.4909691Z" />
    <MsgType V="A" DN="Vedlegg" />
    <MimeType>image/png</MimeType>
    <Description>CT scan from monday</Description>
    <FileReference>https://api.deft.prod.nhn.no/Objects/dda2fbfc-271f-4794-8ae3-191c6f75232a_capture.png.</FileReference>
</RefDoc>
<RefDoc>
    <IssueDate V="2023-10-03T08:32:13.4884712Z" />
    <MsgType V="A" DN="Vedlegg" />
    <MimeType>image/png</MimeType>
    <Description>CT scan from monday</Description>
    <Content>
        <Base64Container
            xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance"
            xmlns="http://www.kith.no/xmlstds/base64container">iVBORw0KGgoAA\....uQmCC</Base64Container>
    </Content>
</RefDoc>

Retrieve status of sent message

GET /messages/{id}/status

Provides the delivery status of the message. Read more about status types and values on the troubleshooting page. Each recipient of the message will have its own status.

Søk i Utviklerportalen

Søket er fullført!