Invites
Reply to invitation
Accepts or declines a workspace invitation. On accept the user becomes a member and the new membership is returned; on decline no membership is created.
POST
/
workspaces
/
{workspaceSlug}
/
invites
/
{inviteId}
/
Reply to invitation
curl --request POST \
--url https://api.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/ \
--header 'Content-Type: application/json' \
--data '
{
"acceptInvite": true
}
'import requests
url = "https://api.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/"
payload = { "acceptInvite": True }
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({acceptInvite: true})
};
fetch('https://api.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/', 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.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/",
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([
'acceptInvite' => true
]),
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.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/"
payload := strings.NewReader("{\n \"acceptInvite\": true\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.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/")
.header("Content-Type", "application/json")
.body("{\n \"acceptInvite\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/")
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 \"acceptInvite\": true\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2023-11-07T05:31:56Z",
"emailAddress": "<string>",
"has2fa": true,
"memberRole": "owner",
"username": "<string>",
"avatarUrl": "<string>",
"displayName": "<string>"
}{
"createdAt": "2023-11-07T05:31:56Z",
"emailAddress": "<string>",
"has2fa": true,
"memberRole": "owner",
"username": "<string>",
"avatarUrl": "<string>",
"displayName": "<string>"
}{
"message": "<string>",
"name": "<string>",
"resource": "<string>",
"suggestion": "<string>",
"validation": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"name": "<string>",
"resource": "<string>",
"suggestion": "<string>",
"validation": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"name": "<string>",
"resource": "<string>",
"suggestion": "<string>",
"validation": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"name": "<string>",
"resource": "<string>",
"suggestion": "<string>",
"validation": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"params": {}
}
]
}"<string>""<string>"Path Parameters
URL-safe workspace identifier.
Unique identifier of the invite.
Body
application/json
Request to respond to a workspace invitation.
Request to respond to a workspace invitation.
Whether to accept or decline the invitation.
Response
object | null
Represents a workspace member.
Timestamp when the member joined the workspace.
Email address of the member.
Whether the member has two-factor authentication enabled.
Role of the member in the workspace.
Allowed value:
"owner"Handle of the member's account.
Required string length:
3 - 32Pattern:
^[a-z0-9]+(?:-[a-z0-9]+)*$Serve path of the member's avatar, when set.
Display name of the member, when set.
Reply to invitation
curl --request POST \
--url https://api.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/ \
--header 'Content-Type: application/json' \
--data '
{
"acceptInvite": true
}
'import requests
url = "https://api.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/"
payload = { "acceptInvite": True }
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({acceptInvite: true})
};
fetch('https://api.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/', 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.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/",
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([
'acceptInvite' => true
]),
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.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/"
payload := strings.NewReader("{\n \"acceptInvite\": true\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.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/")
.header("Content-Type", "application/json")
.body("{\n \"acceptInvite\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/workspaces/{workspaceSlug}/invites/{inviteId}/")
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 \"acceptInvite\": true\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2023-11-07T05:31:56Z",
"emailAddress": "<string>",
"has2fa": true,
"memberRole": "owner",
"username": "<string>",
"avatarUrl": "<string>",
"displayName": "<string>"
}{
"createdAt": "2023-11-07T05:31:56Z",
"emailAddress": "<string>",
"has2fa": true,
"memberRole": "owner",
"username": "<string>",
"avatarUrl": "<string>",
"displayName": "<string>"
}{
"message": "<string>",
"name": "<string>",
"resource": "<string>",
"suggestion": "<string>",
"validation": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"name": "<string>",
"resource": "<string>",
"suggestion": "<string>",
"validation": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"name": "<string>",
"resource": "<string>",
"suggestion": "<string>",
"validation": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"params": {}
}
]
}{
"message": "<string>",
"name": "<string>",
"resource": "<string>",
"suggestion": "<string>",
"validation": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>",
"params": {}
}
]
}"<string>""<string>"