Skip to main content
Add Host
Adds a user to the event’s hostIds. Owner-only: the caller must be the event’s owner (userId), and, for an event in a space, an active member of that space who isn’t banned in it or a space above it. A service key acts as the user it names in actingUserId. The operation is idempotent (adding an existing host is a no-op) and takes a row-level lock to serialize concurrent host changes. For an event in a space, the target must be an active member of that space (409 event/host-not-member). For an event with no space, any user can be made a host. The owner is always kept in the stored hostIds.

Path Parameters

string
required
UUID of the event.

Body Parameters

string
required
The user to grant host on the event.
string
Required with a service key: the user this request acts as. It has exactly that user’s powers, so it is refused unless they are the event’s owner, and it is recorded as theirs. A user token always acts as its own user and must not send it (400 event/acting-user-not-allowed).

Response

Returns the updated Event with the new hostIds.

Error Responses

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.
actingUserId was sent in the query string. On this endpoint every field goes in the request body.
Returned when a service key names an actingUserId that isn’t a user in this project.
The event doesn’t exist, or the caller can’t see it and isn’t one of its hosts.
The caller isn’t the event’s owner. Other hosts can’t add or remove hosts; on an event whose owner’s account was deleted, nobody can.
The caller is the owner, but the event is in a space they aren’t an active member of, or they are banned in it or a space above it. One body for every case.
The target isn’t an active member of the event’s space (not a member, pending or banned — the same body for each).
See also: useAddHost