Preview an invitation
Shows what an invitation link is for (organization, realm, role, who invited, whether the invitee already has an account), for the page the link opens. Needs no sign-in; the token is the secret.
No authentication: anyone can call this. Token is the secret; used, revoked and expired invites answer with their status.
POST
/
v1
/
invitations
/
get_by_token
Preview an invitation
curl --request POST \
--url https://{host}/v1/invitations/get_by_token \
--header 'Content-Type: application/json' \
--data '
{
"token": "inv_8f2c…"
}
'import requests
url = "https://{host}/v1/invitations/get_by_token"
payload = { "token": "inv_8f2c…" }
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({token: 'inv_8f2c…'})
};
fetch('https://{host}/v1/invitations/get_by_token', 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://{host}/v1/invitations/get_by_token",
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([
'token' => 'inv_8f2c…'
]),
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://{host}/v1/invitations/get_by_token"
payload := strings.NewReader("{\n \"token\": \"inv_8f2c…\"\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://{host}/v1/invitations/get_by_token")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"inv_8f2c…\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/v1/invitations/get_by_token")
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 \"token\": \"inv_8f2c…\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"invite_id": "3e4f5a6b-7c8d-4e9f-8a0b-1c2d3e4f5a6b",
"kind": "org_member",
"status": "pending",
"org": {
"slug": "acme",
"display_name": "Acme Inc."
},
"realm": null,
"role": "member",
"inviter": {
"display_name": "Sapan"
},
"invitee_email": "jdoe@acme.example",
"account_exists": false,
"expires_at": "2026-10-14T10:00:00Z"
}
}{
"ok": false,
"error": "Invite not found",
"code": "not_found"
}{
"ok": false,
"error": "token: Required",
"code": "invalid_params"
}{
"ok": false,
"error": "Internal server error",
"code": "internal_error"
}⌘I
Preview an invitation
curl --request POST \
--url https://{host}/v1/invitations/get_by_token \
--header 'Content-Type: application/json' \
--data '
{
"token": "inv_8f2c…"
}
'import requests
url = "https://{host}/v1/invitations/get_by_token"
payload = { "token": "inv_8f2c…" }
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({token: 'inv_8f2c…'})
};
fetch('https://{host}/v1/invitations/get_by_token', 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://{host}/v1/invitations/get_by_token",
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([
'token' => 'inv_8f2c…'
]),
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://{host}/v1/invitations/get_by_token"
payload := strings.NewReader("{\n \"token\": \"inv_8f2c…\"\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://{host}/v1/invitations/get_by_token")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"inv_8f2c…\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/v1/invitations/get_by_token")
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 \"token\": \"inv_8f2c…\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"invite_id": "3e4f5a6b-7c8d-4e9f-8a0b-1c2d3e4f5a6b",
"kind": "org_member",
"status": "pending",
"org": {
"slug": "acme",
"display_name": "Acme Inc."
},
"realm": null,
"role": "member",
"inviter": {
"display_name": "Sapan"
},
"invitee_email": "jdoe@acme.example",
"account_exists": false,
"expires_at": "2026-10-14T10:00:00Z"
}
}{
"ok": false,
"error": "Invite not found",
"code": "not_found"
}{
"ok": false,
"error": "token: Required",
"code": "invalid_params"
}{
"ok": false,
"error": "Internal server error",
"code": "internal_error"
}