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>"
}
'import requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/events/:eventId/hosts"
payload = { "userId": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({userId: '<string>'})
};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/events/:eventId/hosts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/api/v6/:projectId/api/v7/events/:eventId/hosts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'userId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/api/v6/:projectId/api/v7/events/:eventId/hosts"
payload := strings.NewReader("{\n \"userId\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.sublay.io/api/v6/:projectId/api/v7/events/:eventId/hosts")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/events/:eventId/hosts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyEvent Endpoints
Remove Host
Revoke a user’s host privileges on an event (host-only)
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>"
}
'import requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/events/:eventId/hosts"
payload = { "userId": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({userId: '<string>'})
};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/events/:eventId/hosts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/api/v6/:projectId/api/v7/events/:eventId/hosts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'userId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/api/v6/:projectId/api/v7/events/:eventId/hosts"
payload := strings.NewReader("{\n \"userId\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.sublay.io/api/v6/:projectId/api/v7/events/:eventId/hosts")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/events/:eventId/hosts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyRemoves a user from the event’s
See also: useRemoveHost
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
UUID of the event.
Body Parameters
The host to remove.
Response
Returns the updated Event with the newhostIds.
Error Responses
Not Found — 404
Not Found — 404
{ "error": "Event not found", "code": "event/not-found" }
Forbidden (not a host) — 403
Forbidden (not a host) — 403
{ "error": "Only a host of this event may manage its hosts.", "code": "event/forbidden" }
Last Host — 409
Last Host — 409
{ "error": "An event must have at least one host.", "code": "event/last-host" }
⌘I

