Claim a sandbox into your account
curl --request POST \
--url https://api.zinc.com/sandbox/claim \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>"
}
'import requests
url = "https://api.zinc.com/sandbox/claim"
payload = { "token": "<string>" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({token: '<string>'})
};
fetch('https://api.zinc.com/sandbox/claim', 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.zinc.com/sandbox/claim",
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([
'token' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.zinc.com/sandbox/claim"
payload := strings.NewReader("{\n \"token\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.zinc.com/sandbox/claim")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zinc.com/sandbox/claim")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"claimed": true,
"orders_moved": 123,
"keys_moved": 123,
"message": "<string>"
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"details": {}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Agent Sandbox
Claim a Sandbox
Fold a provisional sandbox — its order history and its API key — into a real Zinc account without breaking the agent that created it.
POST
/
sandbox
/
claim
Claim a sandbox into your account
curl --request POST \
--url https://api.zinc.com/sandbox/claim \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>"
}
'import requests
url = "https://api.zinc.com/sandbox/claim"
payload = { "token": "<string>" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({token: '<string>'})
};
fetch('https://api.zinc.com/sandbox/claim', 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.zinc.com/sandbox/claim",
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([
'token' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.zinc.com/sandbox/claim"
payload := strings.NewReader("{\n \"token\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.zinc.com/sandbox/claim")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zinc.com/sandbox/claim")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"claimed": true,
"orders_moved": 123,
"keys_moved": 123,
"message": "<string>"
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"details": {}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Folds a provisional sandbox into the authenticated account. This is what the
The response reports the counts (
claim_url from the mint response leads to: a human signs in, and the agent’s sandbox becomes part of their Zinc account.
Claiming is always a merge — signing in creates the account if it didn’t exist, so by the time this endpoint runs there is always a real account to merge into.
What moves
| Result | |
|---|---|
| Sandbox orders | Repointed to the claiming account. The test history survives. |
| API keys | Reassigned, not revoked. Whatever the agent hardcoded keeps working. |
orders_moved, keys_moved) plus a human-readable message.
Not revoking the key is the whole point of claiming rather than starting over. An agent that has been running against a sandbox for a week doesn’t need redeployment to keep going.
Errors
| Status | Cause |
|---|---|
404 | Unknown, already-used, or expired claim token. Tokens are single-use and die with the sandbox they belong to. |
403 | A sandbox key tried to claim a sandbox. This endpoint needs a signed-in Zinc account, not a zn_test_ key. |
The claim token is returned once, in the
claim_url at mint time — only its hash is stored, so the URL cannot be regenerated. If it’s lost, mint a new sandbox.After claiming
A claimed key still only reaches the sandbox. To place real orders, the account owner mints azn_live_ key in the dashboard and funds a wallet. The agent can confirm the claim landed with GET /sandbox/status.Authorizations
Zinc API key (Bearer zn_...)
Headers
Body
application/json
The raw claim token from a claim URL.
Required string length:
1 - 128
