> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuro-tech.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

The Messaging endpoints expose XMPP messaging features over HTTP — no persistent XMPP connection required. Use these endpoints to send chat messages, manage presence subscriptions, maintain your contact roster, and retrieve queued messages.

All endpoints require a valid JWT bearer token. Messages are sent and received as XMPP stanzas via the authenticated account.

## Endpoints

| Endpoint                                                                                         | Description                                                                                                                |
| ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
| [Send text message](/neuron-api/api-reference/messaging/send-text-message)                       | Send a plain text chat message to an XMPP recipient.                                                                       |
| [Send formatted message](/neuron-api/api-reference/messaging/send-formatted-message)             | Send a rich/formatted XMPP message (e.g. with XML content).                                                                |
| [Send presence subscription](/neuron-api/api-reference/messaging/send-presence-subscription)     | Request a presence subscription from a contact.                                                                            |
| [Send presence unsubscription](/neuron-api/api-reference/messaging/send-presence-unsubscription) | Cancel an existing presence subscription.                                                                                  |
| [Send subscription accepted](/neuron-api/api-reference/messaging/send-subscription-accepted)     | Accept an incoming presence subscription request.                                                                          |
| [Send subscription declined](/neuron-api/api-reference/messaging/send-subscription-declined)     | Decline an incoming presence subscription request.                                                                         |
| [Presence probe](/neuron-api/api-reference/messaging/presence-probe)                             | Probe the presence of a contact to retrieve their current status and full JID.                                             |
| [Get roster](/neuron-api/api-reference/messaging/get-roster)                                     | Retrieve the full contact roster for the authenticated account.                                                            |
| [Get roster item](/neuron-api/api-reference/messaging/get-roster-item)                           | Retrieve a single contact entry from the roster.                                                                           |
| [Set roster item](/neuron-api/api-reference/messaging/set-roster-item)                           | Add or update a contact in the roster.                                                                                     |
| [Remove roster item](/neuron-api/api-reference/messaging/remove-roster-item)                     | Remove a contact from the roster.                                                                                          |
| [Clear messages](/neuron-api/api-reference/messaging/clear-messages)                             | Delete queued offline messages stored on the broker.                                                                       |
| [Pop messages](/neuron-api/api-reference/messaging/pop-messages)                                 | Retrieve and remove queued messages from the broker (up to a specified count).                                             |
| [Information query](/neuron-api/api-reference/messaging/information-query)                       | Send an XMPP IQ (get or set) to a contact using their full JID.                                                            |
| [Register event handler](/neuron-api/api-reference/messaging/register-event-handler)             | Register (or unregister) a client-side event handler for incoming XMPP messages of a given type, namespace, or local name. |

## Message retrieval

The Neuron broker queues messages for accounts that are not actively polling. Use [Pop messages](/neuron-api/api-reference/messaging/pop-messages) to retrieve queued messages and remove them from the server in one call. Use [Clear messages](/neuron-api/api-reference/messaging/clear-messages) to discard queued messages without reading them.

For real-time push delivery, [Register event handler](/neuron-api/api-reference/messaging/register-event-handler) lets you bind a JavaScript function to incoming message types via the `/Events.js` mechanism.

## Presence and roster

Before you can probe a contact's presence or send them an IQ, you need a mutual presence subscription. The typical flow:

1. Call [Send presence subscription](/neuron-api/api-reference/messaging/send-presence-subscription) to request access.
2. The contact accepts — call [Send subscription accepted](/neuron-api/api-reference/messaging/send-subscription-accepted) on your end.
3. Call [Presence probe](/neuron-api/api-reference/messaging/presence-probe) to get their full JID for IQ queries.

## Related

* [Messaging guide](/neuron-api/guides/messaging) — step-by-step walkthrough of sending messages.
* [Authentication & sessions](/neuron-api/api-reference/authentication-and-sessions/overview) — obtain the JWT required by all messaging endpoints.
