---
title: "POST /v1/{+parent}/messages"
method: POST
path: "/v1/{+parent}/messages"
tags: ["projects"]
---

# POST /v1/{+parent}/messages

`POST /v1/{+parent}/messages`

Parses and stores an HL7v2 message. This method triggers an asynchronous notification to any Pub/Sub topic configured in Hl7V2Store.Hl7V2NotificationConfig, if the filtering matches the message. If an MLLP adapter is configured to listen to a Pub/Sub topic, the adapter transmits the message when a notification is received.

## Path parameters

- `parent` string, required

## Request body

- CreateMessageRequest — Creates a new message.
  - `message` Message — A complete HL7v2 message. See [Introduction to HL7 Standards] (https://www.hl7.org/implement/standards/index.cfm?ref=common) for details on the standard.
    - `messageType` string — Output only. The message type for this message. MSH-9.1.
    - `patientIds` PatientId[] — Output only. All patient IDs listed in the PID-2, PID-3, and PID-4 segments of this message.
      - `value` string — The patient's unique identifier.
      - `type` string — ID type. For example, MRN or NHS.
    - `name` string — Output only. Resource name of the Message, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`.
    - `sendTime` string, google-datetime — Output only. The datetime the sending application sent this message. MSH-7.
    - `sendFacility` string — Output only. The hospital that this message came from. MSH-4.
    - `data` string, byte — Required. Raw message bytes.
    - `parsedData` ParsedData — The content of a HL7v2 message in a structured format.
      - `segments` Segment[]
        - `setId` string — Set ID for segments that can be in a set. This can be empty if it's missing or isn't applicable.
        - `segmentId` string — A string that indicates the type of segment. For example, EVN or PID.
        - `fields` object — A mapping from the positional location to the value. The key string uses zero-based indexes separated by dots to identify Fields, components and sub-components. A bracket notation is also used to identify different instances of a repeated field. Regex for key: (\d+)(\[\d+\])?(.\d+)?(.\d+)? Examples of (key, value) pairs: * (0.1, "hemoglobin") denotes that the first component of Field 0 has the value "hemoglobin". * (1.1.2, "CBC") denotes that the second sub-component of the first component of Field 1 has the value "CBC". * (1[0].1, "HbA1c") denotes that the first component of the first Instance of Field 1, which is repeated, has the value "HbA1c".
    - `schematizedData` SchematizedData — The content of an HL7v2 message in a structured format as specified by a schema.
      - `error` string — The error output of the parser.
      - `data` string — JSON output of the parser.
    - `createTime` string, google-datetime — Output only. The datetime when the message was created. Set by the server.
    - `labels` object — User-supplied key-value pairs used to organize HL7v2 stores. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: \p{Ll}\p{Lo}{0,62} Label values are optional, must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be associated with a given store.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/healthcare.md) · [All operations](https://skmtc.net/google/apis/healthcare/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/healthcare/versions/cdec6fe2315f/schema)
