Create an embed token
curl --request POST \
--url https://platform.tolt.dev/v2/embed-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"partner_id": "<string>"
}
'import requests
url = "https://platform.tolt.dev/v2/embed-tokens"
payload = { "partner_id": "<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({partner_id: '<string>'})
};
fetch('https://platform.tolt.dev/v2/embed-tokens', 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://platform.tolt.dev/v2/embed-tokens",
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([
'partner_id' => '<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://platform.tolt.dev/v2/embed-tokens"
payload := strings.NewReader("{\n \"partner_id\": \"<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://platform.tolt.dev/v2/embed-tokens")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"partner_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.tolt.dev/v2/embed-tokens")
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 \"partner_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Embed token created",
"data": {
"token": "example-embed-token",
"expires_at": "2026-10-01T12:00:00Z",
"partner_id": "part_8fKq2LmZx7RtYw3nVbHc5dPj"
}
}{
"success": false,
"message": "request: Invalid input: expected object, received null",
"code": "validation_error",
"doc_url": "https://docs.tolt.com/errors#validation_error",
"errors": [
{
"field": "request",
"message": "Invalid input: expected object, received null"
}
]
}{
"success": false,
"message": "Unauthorized",
"code": "unauthorized",
"doc_url": "https://docs.tolt.com/errors#unauthorized"
}{
"success": false,
"message": "No such partner, the partner is invited, suspended or rejected, or the program isn't active",
"code": "not_found",
"doc_url": "https://docs.tolt.com/errors#not_found"
}{
"success": false,
"message": "Request body exceeds 1 MB",
"code": "payload_too_large",
"doc_url": "https://docs.tolt.com/errors#payload_too_large"
}{
"success": false,
"message": "Too many requests. Retry after the window resets.",
"code": "rate_limited",
"doc_url": "https://docs.tolt.com/errors#rate_limited"
}Embed
Create an embed token
Mint a short-lived, partner-scoped token for the embedded referral dashboard. Safe to send to the browser. With partner (email and program_id), the partner is created when the program has none with that email, so one call covers a user’s first visit.
POST
/
v2
/
embed-tokens
Create an embed token
curl --request POST \
--url https://platform.tolt.dev/v2/embed-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"partner_id": "<string>"
}
'import requests
url = "https://platform.tolt.dev/v2/embed-tokens"
payload = { "partner_id": "<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({partner_id: '<string>'})
};
fetch('https://platform.tolt.dev/v2/embed-tokens', 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://platform.tolt.dev/v2/embed-tokens",
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([
'partner_id' => '<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://platform.tolt.dev/v2/embed-tokens"
payload := strings.NewReader("{\n \"partner_id\": \"<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://platform.tolt.dev/v2/embed-tokens")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"partner_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.tolt.dev/v2/embed-tokens")
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 \"partner_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Embed token created",
"data": {
"token": "example-embed-token",
"expires_at": "2026-10-01T12:00:00Z",
"partner_id": "part_8fKq2LmZx7RtYw3nVbHc5dPj"
}
}{
"success": false,
"message": "request: Invalid input: expected object, received null",
"code": "validation_error",
"doc_url": "https://docs.tolt.com/errors#validation_error",
"errors": [
{
"field": "request",
"message": "Invalid input: expected object, received null"
}
]
}{
"success": false,
"message": "Unauthorized",
"code": "unauthorized",
"doc_url": "https://docs.tolt.com/errors#unauthorized"
}{
"success": false,
"message": "No such partner, the partner is invited, suspended or rejected, or the program isn't active",
"code": "not_found",
"doc_url": "https://docs.tolt.com/errors#not_found"
}{
"success": false,
"message": "Request body exceeds 1 MB",
"code": "payload_too_large",
"doc_url": "https://docs.tolt.com/errors#payload_too_large"
}{
"success": false,
"message": "Too many requests. Retry after the window resets.",
"code": "rate_limited",
"doc_url": "https://docs.tolt.com/errors#rate_limited"
}Authorizations
Tolt API key sent as a bearer token.
Body
application/json
Send exactly one of partner_id or partner. Sending both or neither returns 400.
Id of an existing partner (part_...). Send this or partner, not both.
Minimum string length:
1Find the partner by email within the program, or create them (active, with a referral link) when the program has no partner with that email. Send this or partner_id, not both.
Show child attributes
Show child attributes

