Download OpenAPI specification:Download
REST API for user management, authentication, groups, presence, and messaging in the Aoba chat backend.
Most endpoints require authentication via JWT token. The token is provided:
auth_token) after login?token=) for mobile appsCreates a new user account with username and password
| username required | string [ 3 .. 255 ] characters ^[a-zA-Z0-9_-]+$ Username (alphanumeric with _ or -) |
| password required | string >= 8 characters Password (at least 8 characters) |
{- "username": "alice",
- "password": "password123"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "username": "alice",
- "created_at": "2025-11-27T10:30:00Z"
}Authenticates user credentials and returns a JWT token
| username required | string |
| password required | string |
{- "username": "alice",
- "password": "password123"
}{- "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
- "expires_at": "2025-11-28T10:30:00Z",
- "user": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "username": "alice",
- "created_at": "2025-11-27T10:30:00Z"
}
}Changes the current user's username
| username required | string [ 3 .. 255 ] characters ^[a-zA-Z0-9_-]+$ New username |
{- "username": "alice_new"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "username": "alice",
- "created_at": "2025-11-27T10:30:00Z"
}Changes the current user's password
| current_password required | string Current password for verification |
| new_password required | string >= 8 characters New password (at least 8 characters) |
{- "current_password": "string",
- "new_password": "stringst"
}{- "message": "Password updated successfully"
}Retrieves public information about a user
| username required | string Username to retrieve |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "username": "alice",
- "created_at": "2025-11-27T10:30:00Z"
}Search for users by username with pagination
| q required | string [ 2 .. 100 ] characters Search query (minimum 2 characters) |
| page | integer >= 1 Default: 1 Page number |
| limit | integer [ 1 .. 100 ] Default: 20 Results per page (max 100) |
| exclude | string Comma-separated UUIDs to exclude (max 100) |
{- "users": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "username": "alice"
}
], - "total": 42,
- "page": 1,
- "limit": 20,
- "total_pages": 3
}Retrieves user metadata for JID resolution. Used to display usernames from UUIDs in XMPP messages.
| userId required | string <uuid> User UUID |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "username": "alice",
- "domain": "aoba.chat",
- "displayName": "string",
}Retrieves metadata for multiple users in a single request (max 100)
| userIds required | Array of strings <uuid> <= 100 items [ items <uuid > ] List of user UUIDs (max 100) |
{- "userIds": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
]
}{- "users": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "username": "alice",
- "domain": "aoba.chat",
- "displayName": "string",
}
]
}Creates a new group chat. Creator becomes owner. Optionally invite initial members.
| name required | string [ 1 .. 100 ] characters Group name |
| initial_members | Array of strings Usernames to invite (will receive invitations) |
{- "name": "Engineering Team",
- "initial_members": [
- "bob",
- "charlie"
]
}{- "group": {
- "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
- "name": "Engineering Team",
- "member_count": 5,
- "created_at": "2019-08-24T14:15:22Z"
}, - "invitations_sent": [
- {
- "username": "string",
- "status": "pending",
- "error": "string"
}
]
}Retrieves information about a group including members
| groupId required | string <uuid> Group ID |
{- "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
- "name": "Engineering Team",
- "owner_username": "alice",
- "members": [
- {
- "username": "alice",
- "role": "owner",
- "joined_at": "2019-08-24T14:15:22Z"
}
], - "created_at": "2025-11-27T11:00:00Z"
}Retrieves detailed group info for administration purposes
| groupId required | string <uuid> Group ID |
{- "group": {
- "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
- "name": "Engineering Team",
- "member_count": 5,
- "created_at": "2019-08-24T14:15:22Z"
}, - "members": [
- {
- "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
- "username": "alice",
- "role": "member",
- "joined_at": "2019-08-24T14:15:22Z",
- "is_online": true
}
], - "currentUserRole": "owner",
- "ownerCount": 1,
- "adminCount": 2
}Transfer ownership to another member. Only current owner can do this.
| groupId required | string <uuid> Group ID |
| newOwner required | string Username of new owner |
{- "newOwner": "string"
}{- "message": "Ownership transferred successfully",
- "previousOwner": "alice",
- "newOwner": "bob"
}Get all members of a group with their roles and online status
| groupId required | string <uuid> Group ID |
{- "members": [
- {
- "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
- "username": "alice",
- "role": "member",
- "joined_at": "2019-08-24T14:15:22Z",
- "is_online": true
}
], - "total_count": 5
}Directly add a member to a group. Only admins and owners can add members.
| groupId required | string <uuid> Group ID |
| username required | string Username to add |
| role | string Default: "member" Enum: "admin" "member" Role for the new member |
{- "username": "bob",
- "role": "admin"
}{- "username": "alice",
- "role": "owner",
- "joined_at": "2019-08-24T14:15:22Z"
}Remove a member from a group. Only admins and owners can remove members.
| groupId required | string <uuid> Group ID |
| username required | string Username to remove |
{- "error": "Unauthorized",
- "message": "Invalid username or password"
}Update a member's role. Only owner can change roles.
| groupId required | string <uuid> Group ID |
| username required | string Username to update |
| role required | string Enum: "admin" "member" New role (owner cannot be set this way) |
{- "role": "admin"
}{- "error": "Unauthorized",
- "message": "Invalid username or password"
}Send a group invitation to a user. Any member can invite.
| groupId required | string <uuid> Group ID |
| username required | string Username to invite |
{- "username": "string"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
- "group_name": "string",
- "inviter_username": "string",
- "invitee_username": "string",
- "status": "pending",
- "created_at": "2019-08-24T14:15:22Z",
- "responded_at": "2019-08-24T14:15:22Z"
}Get all pending invitations for the current user
{- "invitations": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
- "group_name": "string",
- "inviter_username": "string",
- "invitee_username": "string",
- "status": "pending",
- "created_at": "2019-08-24T14:15:22Z",
- "responded_at": "2019-08-24T14:15:22Z"
}
], - "count": 0
}Accept a group invitation and join the group
| invitationId required | string <uuid> Invitation ID |
{- "message": "Invitation accepted",
- "group": {
- "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
- "name": "Engineering Team",
- "member_count": 5,
- "created_at": "2019-08-24T14:15:22Z"
}, - "membership": {
- "role": "owner",
- "joined_at": "2019-08-24T14:15:22Z"
}
}Get presence for multiple users by username (max 100)
| usernames required | Array of strings <= 100 items |
{- "usernames": [
- "string"
]
}{- "presence": {
- "property1": {
- "status": "online",
- "lastSeen": "2019-08-24T14:15:22Z"
}, - "property2": {
- "status": "online",
- "lastSeen": "2019-08-24T14:15:22Z"
}
}
}Get online/offline status for a user by UUID
| userId required | string <uuid> User UUID |
{- "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
- "status": "online",
- "lastSeen": "2019-08-24T14:15:22Z"
}Get presence for multiple users by UUID (max 100)
| userIds required | Array of strings <uuid> <= 100 items [ items <uuid > ] |
{- "userIds": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
]
}{- "presence": {
- "property1": {
- "status": "online",
- "lastSeen": "2019-08-24T14:15:22Z"
}, - "property2": {
- "status": "online",
- "lastSeen": "2019-08-24T14:15:22Z"
}
}
}Send a message to a user or group via REST API (alternative to XMPP)
| to required | string Recipient username or group ID |
| content required | string <= 10240 characters Message content (max 10KB) |
| type | string Default: "chat" Enum: "chat" "groupchat" Message type |
{- "to": "bob",
- "content": "string",
- "type": "chat"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "from_id": "bc3fe72f-b766-4da9-a758-da6fa33e2040",
- "to_id": "2ecf1ac0-da2d-4b33-9f21-a773ddaca1ba",
- "from": "string",
- "to": "string",
- "content": "string",
- "type": "chat",
- "timestamp": "2019-08-24T14:15:22Z",
- "status": "sent"
}Retrieve message history with pagination
| limit | integer [ 1 .. 100 ] Default: 50 Number of messages to retrieve |
| offset | integer >= 0 Default: 0 Offset for pagination |
{- "messages": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "from_id": "bc3fe72f-b766-4da9-a758-da6fa33e2040",
- "to_id": "2ecf1ac0-da2d-4b33-9f21-a773ddaca1ba",
- "from": "string",
- "to": "string",
- "content": "string",
- "type": "chat",
- "timestamp": "2019-08-24T14:15:22Z",
- "status": "sent"
}
], - "total": 0,
- "offset": 0,
- "limit": 0
}