Skip to main content

Participants and users

Users belong to the tenant; participants are users who belong to a particular chat. The examples use the client from Getting started.

Chat participants​

await emby.addParticipantsToChat('support-42', [
{ id: 'u-2', name: 'Bob' },
{ id: 'u-3', name: 'Carol', rights: { send_messages: false } },
]);

const { participants } = await emby.getChatParticipants('support-42', {
page: 1,
limit: 100,
});
console.log(participants);

await emby.removeParticipantFromChat('support-42', 'u-2');

Add up to 100 participants per call. Unknown users are created; known users are updated. Removing an existing user who is not in this chat returns removed: false rather than failing. For a complete participant list, use iterateChatParticipants.

Participant rights​

Rights set through the API override the user's signed-link rights for this chat. Changes apply to open chats immediately.

await emby.updateParticipantRights('support-42', 'u-3', {
send_messages: false,
pin_messages: 'for_everyone',
edit_messages: null,
});

const { rights } = await emby.getParticipantRights('support-42', 'u-3');
console.log(rights);

await emby.deleteParticipantRights('support-42', 'u-3');

Set a right to null to remove that override. deleteParticipantRights() removes all overrides. At least one right is required for an update; an empty object is rejected.

Users​

await emby.createUser({
id: 'u-4',
name: 'Dana',
email: 'dana@example.com',
});

const { user } = await emby.getUser('u-4');
await emby.updateUser('u-4', { name: 'Dana Smith' });

const result = await emby.getUserChats('u-4', {
page: 1,
limit: 50,
order: 'desc',
with_last_message: true,
});
console.log(result.chats);

Creating a user requires id and name; an existing ID produces HTTP 409. Use await emby.deleteUser('u-4') to delete the user. User-chat lists support at most 250 items per page. Use emby.api.userChats() for filters that the convenience method does not expose, including with_owner and with_participants.

See Participant, User and the client reference for input types and signatures.