addMember() and removeMember() to manage a group chat’s members, and leaveSpace() to make the agent’s own account leave the chat. All three are fire-and-forget: space.send(...) resolves to undefined.
space.add(users), space.remove(users), and space.leave() are sugar for the canonical forms above.
addMember() and removeMember() accept : a resolved by the current platform or a raw id, either alone or in a batch. Ids use the same platform handle format space.create accepts (for iMessage: an E.164 phone number or email); they are passed to the provider verbatim, with no resolution step. Both return a that validates when it builds — an empty member list rejects at space.send(...) time, not at construction.
Per-platform constraints surface as an from the provider’s send action. iMessage requires remote mode and a group chat — a DM cannot be converted into a group, so on a DM the error points you at creating a group via space.create instead.
Inbound membership events
On platforms that report membership changes (iMessage remote mode today), the same content types arrive as inbound values onapp.messages — what you send is what you observe when someone else does it:
message.senderis the acting user — who added or removed the members. It isundefinedwhen the platform recorded no actor. A self-join surfaces with the joiner as both sender and member.- A voluntary leave and a removal are distinct types:
leaveSpace(sender = the leaver) vsremoveMember(sender = the remover,members= who was removed). membersare platform handles in the same formatspace.createaccepts — compare them againstspace.getMembers()or feed them back intospace.add(...).- The agent’s own actions are suppressed:
space.add(...)does not echo back as an inbound event.