# Method: messages.ingest

**Full name**: projects.locations.datasets.hl7V2Stores.messages.ingest

Parses and stores an HL7v2 message. This method triggers an asynchronous notification to any Pub/Sub topic configured in `https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1beta1/projects.locations.datasets.hl7V2Stores#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. If the method is successful, it generates a response containing an HL7v2 acknowledgment(`ACK`) message. If the method encounters an error, it returns a negative acknowledgment(`NACK`) message. This behavior is suitable for replying to HL7v2 interface systems that expect these acknowledgments.

### HTTP request

`POST https://healthcare.googleapis.com/v1beta1/{parent=projects/*/locations/*/datasets/*/hl7V2Stores/*}/messages:ingest`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The name of the HL7v2 store this message belongs to. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `parent`: - `healthcare.hl7V2Messages.ingest` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "message": { object(`https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1beta1/projects.locations.datasets.hl7V2Stores.messages#Message`) } } ``` |

| Fields ||
|---|---|
| `message` | ``object(`https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1beta1/projects.locations.datasets.hl7V2Stores.messages#Message`)`` Required. HL7v2 message to ingest. |

### Response body

Acknowledges that a message has been ingested into the specified HL7v2 store.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "hl7Ack": string, "message": { object(`https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1beta1/projects.locations.datasets.hl7V2Stores.messages#Message`) } } ``` |

| Fields ||
|---|---|
| `hl7Ack` | `string (https://developers.google.com/discovery/v1/type-format format)` HL7v2 ACK message. A base64-encoded string. |
| `message` | ``object(`https://docs.cloud.google.com/healthcare-api/docs/reference/rest/v1beta1/projects.locations.datasets.hl7V2Stores.messages#Message`)`` Created message resource. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-healthcare`
- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).