Skip to main content
DELETE
/
:projectId
/
api
/
v7
/
events
/
:eventId
/
hosts
Remove Host
curl --request DELETE \
  --url https://api.sublay.io/api/v6/:projectId/api/v7/events/:eventId/hosts \
  --header 'Content-Type: application/json' \
  --data '
{
  "userId": "<string>"
}
'
Removes a user from the event’s hostIds. Host-only (service/master keys bypass the check). The mutation runs under a row-level lock and enforces the at-least-one-host invariant: a removal that would leave the event with zero hosts is rejected with 409. The target user is supplied in the request body (symmetric with Withdraw RSVP).

Path Parameters

eventId
string
required
UUID of the event.

Body Parameters

userId
string
required
The host to remove.

Response

Returns the updated Event with the new hostIds.

Error Responses

{ "error": "Event not found", "code": "event/not-found" }
{ "error": "Only a host of this event may manage its hosts.", "code": "event/forbidden" }
{ "error": "An event must have at least one host.", "code": "event/last-host" }
See also: useRemoveHost