Generate Private Registration Preview
curl --request POST \
--url https://api.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"revision": 123
}
'import requests
url = "https://api.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview"
payload = { "revision": 123 }
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({revision: 123})
};
fetch('https://api.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview', 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.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview",
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([
'revision' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Api-Key: <api-key>"
],
]);
$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.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview"
payload := strings.NewReader("{\n \"revision\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Api-Key", "<api-key>")
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.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"revision\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"revision\": 123\n}"
response = http.request(request)
puts response.read_bodyAgent Number Registration (v2)
Generate Private Registration Preview
Queue a private hosted-form preview for the exact registration revision.
POST
/
v2
/
agent
/
number-requests
/
{request_id}
/
preview
Generate Private Registration Preview
curl --request POST \
--url https://api.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"revision": 123
}
'import requests
url = "https://api.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview"
payload = { "revision": 123 }
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({revision: 123})
};
fetch('https://api.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview', 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.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview",
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([
'revision' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Api-Key: <api-key>"
],
]);
$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.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview"
payload := strings.NewReader("{\n \"revision\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Api-Key", "<api-key>")
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.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"revision\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tracklysms.com/api/v2/agent/number-requests/{request_id}/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"revision\": 123\n}"
response = http.request(request)
puts response.read_bodyRequires the same API-audience registration authority and request binding as creation. This queues private generation; it does not publish a site or submit registration.
Returns
string
required
The request ID returned by creation.
string
required
1–255 printable ASCII characters, retained for this exact preview operation.
integer
required
Current positive draft revision. The JSON body must contain only this field and be at most 64 KiB; duplicate fields and query overrides are rejected.
202 with {"request": ...}. Read the request to observe completion and the owner’s next action. Only one preview may be in flight per request; each account is limited to 10 preview intents per rolling hour. A 429 includes Retry-After: 3600.
Replay the current operation key to read its result; superseded keys return 409 idempotency_conflict. Keys remain recorded after the budget window expires. failed or unknown requires the documented recovery and owner decision; never switch keys or create a new draft simply to retry an ambiguous generation.
Errors include 400 invalid input, 401 invalid bearer, 403 missing authority, 404 binding mismatch, 409 revision/idempotency or preview-state conflict, 413 oversized body, 422 incomplete or unsupported details, 429 preview limit, and 503 unavailable dependencies/indexes. The owner reviews the exact frozen preview before publication, handles optional domain-provider consent, and separately approves final paid registration submission.