Skip to main content

Your first request

With your token in hand, list the products your account can access — a safe, read-only call that confirms auth works.

TOKEN="<your-token>"

curl -s https://api.sance.ai/v1/products/ \
-H "Authorization: Bearer $TOKEN"
import requests

BASE = "https://api.sance.ai/v1"
headers = {"Authorization": f"Bearer <your-token>"}

products = requests.get(f"{BASE}/products/", headers=headers).json()
for p in products["items"]:
print(p["id"], p["name"])
const BASE = "https://api.sance.ai/v1";
const res = await fetch(`${BASE}/products/`, {
headers: { Authorization: `Bearer <your-token>` },
});
const { items } = await res.json();
console.log(items);

A successful response is a paginated list:

{ "items": [ { "id": 42, "name": "Acme Sales Bot", "is_active": true } ],
"page": 1, "limit": 50, "total": 1, "pages": 1 }

Note the product_id you'll use in later calls. Next, head to the Cookbook for end-to-end flows.