Messaging
In-app direct and group messaging between users, with typed errors and SDK examples.
Amba provides in-app messaging for direct and group conversations between users. Every endpoint returns a typed error envelope — no opaque 500s.
SDK example: 1:1 conversation
The common shape — two users, one conversation, a thread of messages:
The full messaging surface — createConversation, getConversations, listConversations, sendMessage, listMessages, markRead — ships in @layers/amba-web@1.0.3+, @layers/amba-node@1.0.3+, @layers/amba-react-native@2.1.0+, and @layers/amba-expo@2.1.0+.
Typed errors
Branch on error.code for actionable handling:
Error codes the messaging surface returns:
| Code | When |
|---|---|
INVALID_JSON | Request body wasn't parseable JSON. |
INVALID_PAYLOAD | Required field missing or malformed. error.details.missing lists the fields. |
USER_NOT_FOUND | One or more participant_ids don't exist. error.details.missing_user_ids enumerates them. |
INVALID_CONVERSATION_ID | Conversation id isn't a valid UUID. |
CONVERSATION_NOT_FOUND | Conversation doesn't exist. |
NOT_A_PARTICIPANT | Caller isn't in the conversation's participant list. |
Client API reference
| Method | Path | Description |
|---|---|---|
POST | /client/messaging/conversations | Create a conversation |
GET | /client/messaging/conversations | List user's conversations |
POST | /client/messaging/conversations/:id/messages | Send a message |
GET | /client/messaging/conversations/:id/messages | Get messages (paginated) |
POST | /client/messaging/conversations/:id/read | Mark conversation as read |
Create a conversation
Send a message
MCP tools
| Tool | Description |
|---|---|
amba_messaging_get_stats | Get messaging statistics (total conversations, messages, active count) |