Skip to main content
Remove Host
Removes a user from the event’s hostIds. A service key acts as the user it names in actingUserId. The mutation runs under a row-level lock.
  • Removing another host is owner-only: the caller must be the event’s owner, and, for an event in a space, an active member of that space who isn’t banned in it or a space above it.
  • Stepping down (the path’s userId is the caller): any host other than the owner may step down, active member of the event’s space or not. The owner is always one of the event’s hosts and can’t step down or be removed (409 event/owner-is-host).
  • On an event whose owner’s account was deleted, nobody can remove another host, and its last remaining host can’t step down (409 event/last-host); they can cancel the event instead.

Path Parameters

string
required
UUID of the event.
string
required
The host to remove. A malformed id returns 400 event/invalid-params.

Query Parameters

A DELETE takes no body: every field besides the path goes in the query string.
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 (or, when stepping down, a host), 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. A host who stepped down from an event they can no longer see gets only:

Error Responses

The request carried a body. A DELETE takes no body: the host goes in the path and actingUserId in the query string.
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.
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 tried to step down from an event they don’t host.
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, removing another host, 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 owner tried to step down. The owner can’t be removed.
The last remaining host of an event whose owner’s account was deleted tried to step down.
DELETE /v8/:projectId/events/:eventId/hosts, with the host in a request body, is not a v8 route. Once the request passes the checks that run ahead of it (such as the bundle check and id validation), it gets this error, with or without a body.
See also: useRemoveHost