Create group
POST
/api/groups/create
const url = 'http://localhost:3001/api/groups/create';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"avatar_chunk_id":1,"avatar_key":"example","description":"example","is_public":true,"members":["example"],"name":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3001/api/groups/create \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "avatar_chunk_id": 1, "avatar_key": "example", "description": "example", "is_public": true, "members": [ "example" ], "name": "example" }'Create a new group chat with an initial member list.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Group creation request
Media typeapplication/json
object
avatar_chunk_id
MeshStorage chunk ID for avatar
integer
avatar_key
Base64-encoded encryption key
string
description
Group description
string
is_public
Public or private group
boolean
members
Initial member addresses
Array<string>
name
Group name
string
Examplegenerated
{ "avatar_chunk_id": 1, "avatar_key": "example", "description": "example", "is_public": true, "members": [ "example" ], "name": "example"}Responses
Section titled “Responses”OK
Media typeapplication/json
object
group
object
avatar_chunk_id
integer
avatar_key
Array<integer>
avatar_url
Generated MeshStorage download URL
string
created_at
string
description
string
id
string
is_muted
Whether user muted this group
boolean
is_public
boolean
member_count
integer
members
All member addresses
Array<string>
name
string
owner_address
string
unread_count
Number of unread messages for requesting user
integer
updated_at
string
user_role
Role of requesting user: “owner”, “admin”, “member”
string
message
string
success
boolean
Examplegenerated
{ "group": { "avatar_chunk_id": 1, "avatar_key": [ 1 ], "avatar_url": "example", "created_at": "example", "description": "example", "id": "example", "is_muted": true, "is_public": true, "member_count": 1, "members": [ "example" ], "name": "example", "owner_address": "example", "unread_count": 1, "updated_at": "example", "user_role": "example" }, "message": "example", "success": true}Bad Request
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}Unauthorized
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}Conflict
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}Internal Server Error
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}