Add Host
curl --request POST \
--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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
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 => "POST",
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("POST", 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.post("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::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyEvent Endpoints
Add Host
Grant a user host privileges on an event (host-only)
POST
/
:projectId
/
api
/
v7
/
events
/
:eventId
/
hosts
Add Host
curl --request POST \
--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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
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 => "POST",
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("POST", 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.post("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::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAdds a user to the event’s
See also: useAddHost
hostIds. Host-only — the caller must already be a host (service/master keys bypass this). The operation is idempotent (adding an existing host is a no-op) and takes a row-level lock to serialize concurrent host changes.
There is no requirement that the target be a space member or invitee — any user can be made a host.
Path Parameters
string
required
UUID of the event.
Body Parameters
string
required
The user to grant host on the event.
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" }
⌘I

