BFF Messaging API
BFF Messaging API
The BFF (Backend-for-Frontend) layer exposes three messaging endpoints that proxy requests from the myProp client to the AgentOS / LETMC messaging API. All three endpoints accept a JSON body via POST to /api/bff/[...path].
v0.1.77 note: All three messaging endpoints were corrected in this release to use the proper upstream API path format. If you were testing messaging prior to
v0.1.77, requests were silently failing due to an incorrect path prefix.
Endpoint Reference
Fetch Messages
Retrieves a paginated list of messages (notes) for a given user.
BFF route: POST /api/bff/messaging/messages
Upstream path: GET /{clientName}/messaging/notes/{userID}/{offset}/{count}/
Request body:
{
"clientName": "your-agency",
"userID": "user-123",
"offset": 0,
"count": 10
}
| Field | Type | Required | Description |
|---|---|---|---|
clientName | string | ✅ | The agency's client identifier. |
userID | string | ✅ | The portal user's ID. |
offset | number | ❌ | Pagination offset. Defaults to 0. |
count | number | ❌ | Number of messages to return. Defaults to 10. |
Note:
offsetandcountare passed as path segments, not query parameters.
Send a Message
Submits a new message (note) on behalf of a user.
BFF route: POST /api/bff/messaging/message/send
Upstream path: POST /{clientName}/messaging/notes/submit/
Request body:
{
"clientName": "your-agency",
"payload": { ... }
}
| Field | Type | Required | Description |
|---|---|---|---|
clientName | string | ✅ | The agency's client identifier. |
payload | object | ❌ | The message payload forwarded to the upstream API. |
Respond to an Offer
Submits a response to an offer message.
BFF route: POST /api/bff/messaging/message/offer/respond
Upstream path: POST /{clientName}/messaging/notes/offer/submit/
Request body:
{
"clientName": "your-agency",
"payload": { ... }
}
| Field | Type | Required | Description |
|---|---|---|---|
clientName | string | ✅ | The agency's client identifier. |
payload | object | ❌ | The offer response payload forwarded to the upstream API. |
Path Encoding
The clientName value is always URI-encoded (via an internal encodePath() helper) before being interpolated into the upstream URL. Leading and trailing whitespace is trimmed first. This ensures agency identifiers containing spaces or special characters are handled safely.
Upstream API Prefix
Messaging endpoints use a direct path format — they do not go through the standard People Portal prefix (/v1/corporate/peopleportal/letmcletting/...) that other BFF handlers use. This is intentional and matches the AgentOS messaging API specification.