Send an email to invite a user to a team
curl --request POST \
--url https://api.hexclave.com/api/v1/team-invitations/send-code \
--header 'Content-Type: application/json' \
--data '
{
"team_id": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"email": "johndoe@example.com",
"callback_url": "https://example.com/handler/team-invitation"
}
'import requests
url = "https://api.hexclave.com/api/v1/team-invitations/send-code"
payload = {
"team_id": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"email": "johndoe@example.com",
"callback_url": "https://example.com/handler/team-invitation"
}
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({
team_id: 'ad962777-8244-496a-b6a2-e0c6a449c79e',
email: 'johndoe@example.com',
callback_url: 'https://example.com/handler/team-invitation'
})
};
fetch('https://api.hexclave.com/api/v1/team-invitations/send-code', 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.hexclave.com/api/v1/team-invitations/send-code",
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([
'team_id' => 'ad962777-8244-496a-b6a2-e0c6a449c79e',
'email' => 'johndoe@example.com',
'callback_url' => 'https://example.com/handler/team-invitation'
]),
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.hexclave.com/api/v1/team-invitations/send-code"
payload := strings.NewReader("{\n \"team_id\": \"ad962777-8244-496a-b6a2-e0c6a449c79e\",\n \"email\": \"johndoe@example.com\",\n \"callback_url\": \"https://example.com/handler/team-invitation\"\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.hexclave.com/api/v1/team-invitations/send-code")
.header("Content-Type", "application/json")
.body("{\n \"team_id\": \"ad962777-8244-496a-b6a2-e0c6a449c79e\",\n \"email\": \"johndoe@example.com\",\n \"callback_url\": \"https://example.com/handler/team-invitation\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hexclave.com/api/v1/team-invitations/send-code")
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 \"team_id\": \"ad962777-8244-496a-b6a2-e0c6a449c79e\",\n \"email\": \"johndoe@example.com\",\n \"callback_url\": \"https://example.com/handler/team-invitation\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "<string>"
}Teams
Send an email to invite a user to a team
The user receiving this email can join the team by clicking on the link in the email. If the user does not have an account yet, they will be prompted to create one.
POST
/
team-invitations
/
send-code
Send an email to invite a user to a team
curl --request POST \
--url https://api.hexclave.com/api/v1/team-invitations/send-code \
--header 'Content-Type: application/json' \
--data '
{
"team_id": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"email": "johndoe@example.com",
"callback_url": "https://example.com/handler/team-invitation"
}
'import requests
url = "https://api.hexclave.com/api/v1/team-invitations/send-code"
payload = {
"team_id": "ad962777-8244-496a-b6a2-e0c6a449c79e",
"email": "johndoe@example.com",
"callback_url": "https://example.com/handler/team-invitation"
}
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({
team_id: 'ad962777-8244-496a-b6a2-e0c6a449c79e',
email: 'johndoe@example.com',
callback_url: 'https://example.com/handler/team-invitation'
})
};
fetch('https://api.hexclave.com/api/v1/team-invitations/send-code', 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.hexclave.com/api/v1/team-invitations/send-code",
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([
'team_id' => 'ad962777-8244-496a-b6a2-e0c6a449c79e',
'email' => 'johndoe@example.com',
'callback_url' => 'https://example.com/handler/team-invitation'
]),
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.hexclave.com/api/v1/team-invitations/send-code"
payload := strings.NewReader("{\n \"team_id\": \"ad962777-8244-496a-b6a2-e0c6a449c79e\",\n \"email\": \"johndoe@example.com\",\n \"callback_url\": \"https://example.com/handler/team-invitation\"\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.hexclave.com/api/v1/team-invitations/send-code")
.header("Content-Type", "application/json")
.body("{\n \"team_id\": \"ad962777-8244-496a-b6a2-e0c6a449c79e\",\n \"email\": \"johndoe@example.com\",\n \"callback_url\": \"https://example.com/handler/team-invitation\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hexclave.com/api/v1/team-invitations/send-code")
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 \"team_id\": \"ad962777-8244-496a-b6a2-e0c6a449c79e\",\n \"email\": \"johndoe@example.com\",\n \"callback_url\": \"https://example.com/handler/team-invitation\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "<string>"
}Body
application/json
The unique identifier of the team
Example:
"ad962777-8244-496a-b6a2-e0c6a449c79e"
The email of the user to invite.
Example:
"johndoe@example.com"
The base callback URL to construct an invite link with. A query parameter code with the verification code will be appended to it. The page should then make a request to the /team-invitations/accept endpoint.
Example:
"https://example.com/handler/team-invitation"
⌘I