# Messaging API FAQs

**Find answers to common questions about integrating the Messaging API, including authentication, conversation management, message synchronisation, attachments and troubleshooting.**

---

## General

What is the Messaging API?

The Messaging API lets affiliate partners exchange messages between guests and properties on behalf of their users.

You can retrieve conversations, retrieve recent messages, send messages, confirm receipt of messages, and upload or download attachments.

For an overview, see [About the Messaging API](/demand/docs/messaging/about-messaging).

Which Demand API version supports messaging?

The Messaging API is available in Demand API v3.3 Stable.

Can I create a new conversation using the Messaging API?

No. The Messaging API does not provide an endpoint for creating a conversation. It provides endpoints for retrieving existing conversations and sending messages to them.
A conversation is associated with an accommodation and a reservation. Conversation availability and creation timing depend on the reservation and messaging setup. The API can retrieve a conversation once it is available to your account.

Conversations are usually auto-created for every new reservation, usually within 5 minutes.

Use [/messages/conversations](/demand/docs/additional-services/messaging/messaging/conversations) to retrieve a conversation by its conversation ID or reservation ID.

---

## Authentication and access

How do I authenticate Messaging API requests?

All Messaging API requests require:

- A valid Bearer authentication token.
- Your affiliate identifier in the `X-Affiliate-Id` header.

For authentication instructions, see [Authentication](/demand/docs/development-guide/authentication).

Which conversations can I access?

You can retrieve conversations available to your authenticated affiliate account.

To retrieve a specific conversation, provide the accommodation ID together with either the conversation ID or the reservation ID. If you provide both IDs, the conversation ID takes precedence.

If a conversation cannot be retrieved, verify that the identifiers are correct and that the conversation is available to your affiliate account.

Can I test the Messaging API before using it in production?

Yes. Demand API provides a sandbox environment. Use the sandbox base URL:

`https://demandapi-sandbox.booking.com`

The **Demand API Messaging Test Hotel** (accommodation ID `13921698`) is configured for testing messaging scenarios, including automated welcome messages and responses to selected guest requests.

Follow the [Messaging API quick guide](/demand/docs/messaging/try-out-messages) to create a test reservation and retrieve your first message.

---

## Conversations and message identification

What is the difference between a reservation ID, conversation ID and message ID?

Each identifier refers to a different resource:

| Identifier | Description |
| --- | --- |
| `reservation` | Identifies the accommodation reservation associated with a conversation. |
| `conversation` | Identifies a messaging thread. Use it when the request requires or accepts a conversation ID. Some requests, including sending a message and uploading an attachment, can use a reservation ID instead. |
| `message` | Identifies an individual message. Use message IDs to track processed messages and confirm receipt. |

The exact response field depends on the endpoint. For example, /messages/latest returns the message identifier as `id`, while /messages/send returns it as `data.message`.

How do I retrieve a conversation associated with a reservation?

Use [/messages/conversations](/demand/docs/additional-services/messaging/messaging/conversations).

Provide:

- `accommodation`: The accommodation ID.
- `reservation`: The reservation ID.

Alternatively, provide `accommodation` and `conversation` if you already know the conversation ID. If both `reservation` and `conversation` are provided, the conversation ID takes precedence.

The response includes the conversation ID, associated reservation, messages and participants. Messages in this response are listed chronologically.

For an example, see [Use case 1 – Booking and welcome message](/demand/docs/messaging/manage-messages-use-case1).

How can I identify whether a message was sent by a guest or property?

The response differs between /messages/latest and /messages/conversations:

- In /messages/latest, each message includes a `sender` object. Its `participant` field identifies the participant, and `sender.metadata.type` indicates the sender type.

    - The values are `guest` and `property`.
    - The optional `sender.metadata.name` field contains a display name when available.
- In /messages/conversations, each message includes a sender ID. Match that ID to the `id` values in the conversation's `participants` array.

    - The participant metadata identifies the participant type as `guest` or `property` and may include a name.

---

## Sending and receiving messages

How do I send a message to a property?

Use [/messages/send](/demand/docs/additional-services/messaging/messaging/messages/send).

Provide the following fields:

- `accommodation`: The accommodation ID.
- Either `conversation` or `reservation`. If both are supplied, `conversation` takes precedence.
- At least one of `content` or `attachments`.

`content` contains the message text. `attachments` is an array of attachment IDs returned by a previous [/messages/attachments/upload](/demand/docs/additional-services/messaging/messaging/attachments/upload) request. You can provide text, attachments, or both.

A successful response returns the sent message ID in `data.message`.

For an implementation example, see [Manage messages](/demand/docs/messaging/manage-messages).

Is a conversation ID or a reservation ID required to send a message?

The /messages/send request requires an accommodation ID and either a conversation ID or a reservation ID. The two IDs identify the same conversation, so provide one; you do not need to provide both. If you provide both, the conversation ID takes precedence.

Can I send a message using a reservation ID without a conversation ID?

Yes. Provide `accommodation` and `reservation` in the /messages/send request.

A conversation ID is not required when you identify the conversation using the reservation.

If you provide both `conversation` and `reservation`, `conversation` takes precedence.

How do I retrieve the latest messages?

Use [/messages/latest](/demand/docs/additional-services/messaging/messaging/messages/latest).

Send a POST request with an empty JSON object:

```json
{}
```

The request body is ignored. The endpoint retrieves recent messages sent by guests and properties.

By default, it returns up to 100 messages in reverse chronological order, with the newest messages first.

Each message can include its ID, content, sender, timestamp, attachment IDs and associated conversation information.

Does /messages/latest return messages from a specific reservation?

No. /messages/latest retrieves recent messages available to your affiliate account; it is not restricted to a single reservation.

Each returned message includes conversation information that can identify the conversation, accommodation and reservation. Use these identifiers to associate messages with the correct reservation in your system.

To retrieve a conversation's message history, use [/messages/conversations](/demand/docs/additional-services/messaging/messaging/conversations).

Can I message any property?

You can message any property that has or previously had a reservation associated with your account.

There are no property-specific exceptions. You still need to identify the conversation using the required accommodation ID and either its conversation ID or reservation ID.

How do I receive new messages?

Use /messages/latest to poll for recent messages. A typical synchronisation workflow is:

1. Retrieve messages using /messages/latest.
2. Process the messages in your application.
3. Confirm receipt using /messages/latest/confirm.
4. Continue polling for subsequent messages.

Confirmation is required to continue receiving new messages through /messages/latest. Follow the applicable Demand API rate limits when polling.

Does every new reservation get a conversation automatically?

Yes. A conversation is created and assigned automatically for every new reservation, even if neither the partner nor the property has sent a message.

A conversation can therefore have no messages yet. In the /messages/conversations response, messages is an array and can be empty ([]).

How soon after a reservation is created does its conversation become available?

For 99.9% of reservations, the conversation is created within five minutes of order creation. A short delay may occur before the conversation is available through the API.

What happens if I send a message before the conversation has been created automatically?

You can send the message using the accommodation ID and reservation ID without providing a conversation ID.

If the conversation has not yet been created automatically, the send request creates it, so the request does not fail solely because the conversation is not yet available.

Are there limits on message length or content?

There is no limit on message length. Message content is treated as plain text. Any HTML tags included in the content are ignored.

Can I receive push notifications instead of polling?

The Messaging API schema provides /messages/latest for retrieving recent messages. It does not define a webhook or push-notification endpoint for new messages.

Use polling and receipt confirmation to synchronise messages with your application.

Is reply_to supported?

No. The Messaging API v3.3 does not currently accept reply_to. Message threading is not supported, so you cannot use this parameter to reply to a specific message. This is only supported in previous version 3.1.

Does the Messaging API support third-party inventory (TPI) reservations?

No. Unfortunately, Messaging is not available for TPI reservations. TPI inventory is sourced from an external wholesaler and handled through a separate system, so those reservations do not have access to Messaging API features.

---

## Message receipt confirmation

Why do I need to confirm message receipt?

You must confirm messages retrieved through /messages/latest before your integration can continue receiving new messages.

After processing messages, use [/messages/latest/confirm](/demand/docs/additional-services/messaging/messaging/messages/confirm) and provide their message IDs.

Confirming receipt helps your application manage message synchronisation; it does not indicate that a guest has read a message.

How many messages can I confirm in one request?

You can confirm between 1 and 100 message IDs in one request. Provide the IDs in the `messages` array.

How do I know which messages were successfully confirmed?

The /messages/latest/confirm response includes a `data.confirmedMessages` array containing the IDs confirmed by the API. Compare the returned IDs with the IDs submitted in your request.

IDs that do not match a message in your account are omitted. Messages that were already confirmed are included in `confirmedMessages`.

Is confirming receipt idempotent?

Yes. Confirming a message again returns it as confirmed. You can safely retry a confirmation request after a timeout or a 5xx error.

What happens if I receive the same message more than once?

Use the unique message ID to identify messages your application has already processed.

Store processed message IDs as needed to prevent duplicate processing.

Confirm messages only after successfully processing them, and check the `confirmedMessages` response before marking them as confirmed.

What happens if I confirm a well-formed message UUID that does not exist?

The response depends on the Demand API version:

- In v3.3, a message ID that does not match a message in your account is omitted from `data.confirmedMessages`. A repeated confirmation of a valid message ID is idempotent.
- In v3.1 and v3.2, a known issue can cause an unexpected response for a well-formed but non-existent message UUID: HTTP 200 in v3.1 or HTTP 500 in v3.2. A fix is tracked as ENBLRS-530 to return HTTP 400 for this case.

---

## Attachments

Which attachment formats and sizes are supported?

The Messaging API supports PNG and JPEG images.

| Requirement | Supported value |
| --- | --- |
| File formats | PNG, JPG and JPEG. |
| MIME types | `image/png` and `image/jpeg`. |
| Maximum file size | 1,048,576 bytes (1 MiB). |
| Encoding | Base64-encoded file content. |

The file size limit applies to the original binary file, before base64 encoding. Other file formats, such as PDFs and videos, are not supported by the current schema.

How do I send an image attachment?

Follow these steps:

1. Upload the image using [/messages/attachments/upload](/demand/docs/additional-services/messaging/messaging/attachments/upload). Provide the accommodation ID and either a conversation ID or reservation ID, along with the file details.
2. Retrieve the attachment ID from `data.attachment` in the response.
3. Include the attachment ID in the `attachments` array when calling [/messages/send](/demand/docs/additional-services/messaging/messaging/messages/send).

Uploading an image does not send it as a message. For detailed instructions, see [Manage attachments](/demand/docs/messaging/manage-attachments).

Can I include multiple images in one message?

Yes. Upload each image separately using /messages/attachments/upload, then include the returned attachment IDs in the `attachments` array of your /messages/send request.

Each uploaded image must meet the supported format and file size requirements. The /messages/send request can contain attachments without message text.

How do I retrieve attachment metadata?

Use [/messages/attachments/metadata](/demand/docs/additional-services/messaging/messaging/attachments/metadata). The YAML request example includes the accommodation, conversation and attachment identifiers for the file you want to inspect.

The response contains `data.metadata`, which can include:

- `file_name`: The original file name.
- `file_type`: The MIME type of the attachment.
- `file_size`: The attachment size in bytes.

The metadata response does not contain the file itself.

How do I download an attachment?

Use [/messages/attachments/download](/demand/docs/additional-services/messaging/messaging/attachments/download). The YAML request example includes the accommodation, conversation and attachment identifiers for the file to download.

The response includes the base64-encoded file content in `data.file_content`, together with the conversation and attachment identifiers. Decode the base64 content to restore the original file.

For implementation examples, see [Manage attachments](/demand/docs/messaging/manage-attachments).

Can I delete an attachment using the Messaging API?

No. The current Messaging API schema does not define an endpoint for deleting attachments.

If you store downloaded attachments in your own systems, manage their retention and deletion according to your applicable data-protection requirements.

## Troubleshooting and best practices

Why am I not receiving new messages?

Check the following:

- **Message confirmation:** Confirm that previously retrieved messages have been confirmed using /messages/latest/confirm.
- **Conversation access:** Check that the expected conversation is available to your affiliate account.
- **Message availability:** Confirm that a new message has been sent. Automated responses might not be available immediately.
- **Authentication:** Verify your Bearer token and `X-Affiliate-Id` header.
- **API errors:** Review the HTTP status code and response details.

For additional guidance, see [Messaging troubleshooting](/demand/docs/messaging/messaging-troubleshooting).

What should I do if a message confirmation fails?

Compare the submitted message IDs with `data.confirmedMessages` in the response. IDs for messages that do not match a message in your account are omitted.

If an ID is missing, check the API response and do not mark that message as confirmed in your system. Confirmation is idempotent, so you can retry after a timeout or 5xx error.

Are there rate limits on Messaging API requests?

Follow the applicable Demand API rate limits when sending requests or polling for messages. If you receive HTTP 429 Too Many Requests, apply the recommended rate-limit handling and retry strategy.

For more information, see [Error handling](/demand/docs/support/error-handling/about-errors).

Should I store messages and attachments in my own system?

Store messages and attachments only when needed to support your application's communication workflows. Apply appropriate access controls, security measures, data-retention and deletion policies, and protection for guest and reservation information.

Use message IDs to detect duplicates. Avoid storing sensitive message content or base64-encoded attachments in application logs.

## Additional resources

- [About the Messaging API](/demand/docs/messaging/about-messaging) – Review messaging capabilities and available endpoints.
- [Messaging API quick guide](/demand/docs/messaging/try-out-messages) – Test the API using the Demand API Messaging Test Hotel.
- [Manage messages](/demand/docs/messaging/manage-messages) – Learn how to retrieve conversations, send messages and confirm receipt.
- [Manage attachments](/demand/docs/messaging/manage-attachments) – Learn how to upload, send and retrieve image attachments.
- [Messaging best practices](/demand/docs/messaging/messaging-best-practices) – Review recommendations for reliable integrations.
- [Messaging troubleshooting](/demand/docs/messaging/messaging-troubleshooting) – Troubleshoot common messaging issues.
