Generate a terms of service link
curl --request POST \
--url https://production.hifi.com/v3/tos-link \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"redirectUrl": "<string>"
}
'import requests
url = "https://production.hifi.com/v3/tos-link"
payload = {
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"redirectUrl": "<string>"
}
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({
idempotencyKey: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
templateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
redirectUrl: '<string>'
})
};
fetch('https://production.hifi.com/v3/tos-link', 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://production.hifi.com/v3/tos-link",
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([
'idempotencyKey' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'templateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'redirectUrl' => '<string>'
]),
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://production.hifi.com/v3/tos-link"
payload := strings.NewReader("{\n \"idempotencyKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"redirectUrl\": \"<string>\"\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://production.hifi.com/v3/tos-link")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotencyKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"redirectUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.hifi.com/v3/tos-link")
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 \"idempotencyKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"redirectUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://app.hifi.com/tos?sessionToken=03402692-0fdf-4bbd-8axd-5658d87c6c2d&redirectUrl=https%3A%2F%2Fwww.google.com&templateId=12345426-65x9-4b4b-9e8f-2867a724e2d9&sandbox=true",
"id": "34d07807-e590-4d4a-b125-6267862a68f2",
"signed": true,
"sessionToken": "12345672-0fdf-4cbc-9a0d-5658d87c6a3c",
"createdAt": "2026-07-09T17:58:19.651Z",
"expiredAt": "2026-07-14T17:58:19.053Z"
}{
"type": "UNAUTHORIZED",
"message": "Authentication required"
}{
"type": "RESOURCE_NOT_FOUND",
"message": "<string>",
"fields": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"type": "INTERNAL_SERVER_ERROR",
"message": "An internal server error occurred"
}Users
Generate a terms of service link
Generate a hosted Terms of Service link that can be used before creating a user.
POST
/
v3
/
tos-link
Generate a terms of service link
curl --request POST \
--url https://production.hifi.com/v3/tos-link \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"redirectUrl": "<string>"
}
'import requests
url = "https://production.hifi.com/v3/tos-link"
payload = {
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"redirectUrl": "<string>"
}
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({
idempotencyKey: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
templateId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
redirectUrl: '<string>'
})
};
fetch('https://production.hifi.com/v3/tos-link', 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://production.hifi.com/v3/tos-link",
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([
'idempotencyKey' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'templateId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'redirectUrl' => '<string>'
]),
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://production.hifi.com/v3/tos-link"
payload := strings.NewReader("{\n \"idempotencyKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"redirectUrl\": \"<string>\"\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://production.hifi.com/v3/tos-link")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotencyKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"redirectUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.hifi.com/v3/tos-link")
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 \"idempotencyKey\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"templateId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"redirectUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://app.hifi.com/tos?sessionToken=03402692-0fdf-4bbd-8axd-5658d87c6c2d&redirectUrl=https%3A%2F%2Fwww.google.com&templateId=12345426-65x9-4b4b-9e8f-2867a724e2d9&sandbox=true",
"id": "34d07807-e590-4d4a-b125-6267862a68f2",
"signed": true,
"sessionToken": "12345672-0fdf-4cbc-9a0d-5658d87c6a3c",
"createdAt": "2026-07-09T17:58:19.651Z",
"expiredAt": "2026-07-14T17:58:19.053Z"
}{
"type": "UNAUTHORIZED",
"message": "Authentication required"
}{
"type": "RESOURCE_NOT_FOUND",
"message": "<string>",
"fields": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"type": "INTERNAL_SERVER_ERROR",
"message": "An internal server error occurred"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I