curl --request POST \
--url https://{controlPlaneURL}/api/svc/v1/users/register \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com",
"sendInviteEmail": false,
"skipIfUserExists": false,
"dryRun": false,
"acceptInviteClientURL": "https://app.example.com/invite-accept"
}
'import requests
url = "https://{controlPlaneURL}/api/svc/v1/users/register"
payload = {
"email": "user@example.com",
"sendInviteEmail": False,
"skipIfUserExists": False,
"dryRun": False,
"acceptInviteClientURL": "https://app.example.com/invite-accept"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'user@example.com',
sendInviteEmail: false,
skipIfUserExists: false,
dryRun: false,
acceptInviteClientURL: 'https://app.example.com/invite-accept'
})
};
fetch('https://{controlPlaneURL}/api/svc/v1/users/register', 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://{controlPlaneURL}/api/svc/v1/users/register",
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([
'email' => 'user@example.com',
'sendInviteEmail' => false,
'skipIfUserExists' => false,
'dryRun' => false,
'acceptInviteClientURL' => 'https://app.example.com/invite-accept'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{controlPlaneURL}/api/svc/v1/users/register"
payload := strings.NewReader("{\n \"email\": \"user@example.com\",\n \"sendInviteEmail\": false,\n \"skipIfUserExists\": false,\n \"dryRun\": false,\n \"acceptInviteClientURL\": \"https://app.example.com/invite-accept\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{controlPlaneURL}/api/svc/v1/users/register")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"user@example.com\",\n \"sendInviteEmail\": false,\n \"skipIfUserExists\": false,\n \"dryRun\": false,\n \"acceptInviteClientURL\": \"https://app.example.com/invite-accept\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/svc/v1/users/register")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"user@example.com\",\n \"sendInviteEmail\": false,\n \"skipIfUserExists\": false,\n \"dryRun\": false,\n \"acceptInviteClientURL\": \"https://app.example.com/invite-accept\"\n}"
response = http.request(request)
puts response.read_body{}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}Register a user
Add a user to the current tenant by email. The user gets the Member role and joins the “everyone” team; grant other roles afterwards. Set sendInviteEmail to email them a link to set a password (only when TrueFoundry manages login); leave it false for users who sign in through SSO. Fails if the email is already in the tenant, unless skipIfUserExists is set.
curl --request POST \
--url https://{controlPlaneURL}/api/svc/v1/users/register \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com",
"sendInviteEmail": false,
"skipIfUserExists": false,
"dryRun": false,
"acceptInviteClientURL": "https://app.example.com/invite-accept"
}
'import requests
url = "https://{controlPlaneURL}/api/svc/v1/users/register"
payload = {
"email": "user@example.com",
"sendInviteEmail": False,
"skipIfUserExists": False,
"dryRun": False,
"acceptInviteClientURL": "https://app.example.com/invite-accept"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'user@example.com',
sendInviteEmail: false,
skipIfUserExists: false,
dryRun: false,
acceptInviteClientURL: 'https://app.example.com/invite-accept'
})
};
fetch('https://{controlPlaneURL}/api/svc/v1/users/register', 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://{controlPlaneURL}/api/svc/v1/users/register",
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([
'email' => 'user@example.com',
'sendInviteEmail' => false,
'skipIfUserExists' => false,
'dryRun' => false,
'acceptInviteClientURL' => 'https://app.example.com/invite-accept'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{controlPlaneURL}/api/svc/v1/users/register"
payload := strings.NewReader("{\n \"email\": \"user@example.com\",\n \"sendInviteEmail\": false,\n \"skipIfUserExists\": false,\n \"dryRun\": false,\n \"acceptInviteClientURL\": \"https://app.example.com/invite-accept\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{controlPlaneURL}/api/svc/v1/users/register")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"user@example.com\",\n \"sendInviteEmail\": false,\n \"skipIfUserExists\": false,\n \"dryRun\": false,\n \"acceptInviteClientURL\": \"https://app.example.com/invite-accept\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/svc/v1/users/register")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"user@example.com\",\n \"sendInviteEmail\": false,\n \"skipIfUserExists\": false,\n \"dryRun\": false,\n \"acceptInviteClientURL\": \"https://app.example.com/invite-accept\"\n}"
response = http.request(request)
puts response.read_body{}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}{
"statusCode": 123,
"message": "<string>",
"code": 123,
"details": [
{}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Email address of the user to register.
"user@example.com"
When true, sends an invite email to the user after registration.
When true, silently skips registration if the user already exists instead of returning an error.
When true, validates the request without persisting changes.
URL the user is redirected to when they accept the invite. Required when sendInviteEmail is true: pass the control plane URL followed by /invite-accept.
"https://app.example.com/invite-accept"
Response
The user has been successfully registered.
The response is of type RegisterUsersResponse · object.
Was this page helpful?