Skip to main content
Add Member
Makes a user an active member of the space at once. There is no request and no approval step: the user is a member as soon as this returns. The caller must be an active moderator or admin of the space. This is how users get into a private space: a private space can’t be joined, so its moderators and admins add its members. A user banned in a parent of this space can’t be added either (409 space/banned-in-parent): a ban in a space covers every space under it. A user can’t be added when there is a block between them and the caller, in either direction, or when they are suspended: 403 space/user-cannot-be-added. The response is the same for both reasons and doesn’t say which applies. Nothing is written and no notification is sent. This is checked before the cases in the table, so such a user gets this answer whatever their membership. A user who left the space can be added again. When the membership is created or becomes active, the added user gets a space-member-added notification (“You were added to ”). Nothing is sent when they were already an active member.

Path Parameters

string
required
UUID of the space.

Body Parameters

string
required
UUID of the user to add.
string
Required with a service key: the user this request acts as. The request has exactly that user’s permissions, so it is refused unless they are an active moderator or admin of the space, and it is recorded as theirs. A user token always acts as its own user and must not send it (400 space/acting-user-not-allowed).
The body takes no other fields: any other field is refused with 400 space/invalid-body.

Response

string
"User added to the space.", or "User is already a member of this space." when nothing changed.
object
The user’s membership.

Errors

Returned when spaceId isn’t a valid UUID. Checked before sign-in, permissions and the endpoint’s other checks.
A service key sent no actingUserId.
actingUserId is not a user id.
A user token sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
userId or actingUserId was sent in the query string. On this endpoint every field goes in the request body.
userId is missing or isn’t a UUID, or the body has a field this endpoint doesn’t take.
The space doesn’t exist, or the caller can’t see it (a private space they aren’t an active member of, or a space under one). Both answer the same way, before any permission check.
The caller (or the user named by actingUserId) is not an active moderator or admin of the space.
The caller (or the user named by actingUserId) is suspended.
The user in userId isn’t a user in this project, or a service key names an actingUserId that isn’t one. Both use the same code; the message tells them apart.
There is a block between the caller (or the user named by actingUserId) and the user in userId, in either direction, or that user is suspended. The response doesn’t say which.
The user is banned from this space. Unban them first (Unban Member), then add them.
The user is banned in a parent of this space; bannedSpaceIds lists where, nearest first.
See also: useAddMember