Add member(s) to a channel
Adds one or more members to a standard channel. Upsert and idempotent:
re-adding an existing member updates their claims and is not an error.
Membership may precede any connection — the channel appears in each added
user's inbox immediately.
Send either a single { userId, claims? } or a batch { members: [...] }
(up to 100 members per request). claims is an optional display snapshot
(for example username, avatar) recorded at add time; a row otherwise
fills in when the user first connects.
claims is a display snapshot, not permissions — a session's
capabilities come from the authz callback's allow(capabilities)
verdict at connect, and nothing here grants them. Unknown fields
(capabilities among them) are rejected with validation_failed rather
than silently ignored.
Path Parameters
- Type: stringchannel
Id requiredThe channel id. Channels are not created explicitly — they exist by being used.
Body
Send a single member or a batch.
Send a single member or a batch.
- Type: stringuser
Id required - Type: objectclaimsProperties: 1
Optional display snapshot (for example
username,avatar).
Responses
- application/json
- application/json
- application/json
- application/json
curl https://api.useportal.co/v1/channels/chat-general/members \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"userId": "u_456",
"claims": {
"username": "grace"
}
}'
{
"added": 2
}