Get started
Your first API request
Create a scoped key, copy your base URL and verify the connection with cURL, JavaScript or Python.
Prepare the connection
In Squario, choose the workspace and open Settings → API → Keys. API access requires an eligible plan and the api.access permission. Owners and administrators have that permission by default.
- Create a named key with a mandatory expiry, choosing the smallest access and resource scope your integration needs.
- Copy the secret when it is shown. You cannot retrieve it later.
- Copy the base URL from the connection details. Keep its
/v1suffix. - Store the key in your server’s secret manager or environment. Start with a read-only key.
read -r -p 'API base URL from Settings → API: ' SQUARIO_API_BASE
SQUARIO_API_BASE="${SQUARIO_API_BASE%/}"
read -r -s -p 'API key: ' SQUARIO_API_KEY
printf '\n'
export SQUARIO_API_BASE SQUARIO_API_KEYCheck your identity
These examples use SQUARIO_API_BASE for the copied base URL and SQUARIO_API_KEY for the secret. Set them in your local environment. /me returns your key’s metadata, workspace and member, plus current quota and rate-limit information. It never returns the secret.
curl --fail-with-body "$SQUARIO_API_BASE/me" \
--header "Authorization: Bearer $SQUARIO_API_KEY"const base = process.env.SQUARIO_API_BASE?.replace(/\/$/, "");
const key = process.env.SQUARIO_API_KEY;
if (!base || !key) throw new Error("Set SQUARIO_API_BASE and SQUARIO_API_KEY");
const response = await fetch(`${base}/me`, {
headers: { Authorization: `Bearer ${key}` },
signal: AbortSignal.timeout(30_000),
});
const body = await response.json();
if (!response.ok) {
throw new Error(`${body.error.code}: ${body.error.message} (${body.error.request_id})`);
}
console.log(body.data);import json
import os
from urllib.request import Request, urlopen
base = os.environ["SQUARIO_API_BASE"].rstrip("/")
key = os.environ["SQUARIO_API_KEY"]
request = Request(f"{base}/me", headers={"Authorization": f"Bearer {key}"})
with urlopen(request, timeout=30) as response:
body = json.load(response)
print(body["data"])Find a resource and its schema
/resources returns catalog entries with key, label, read_only, searchable and requires_model_id. The catalog is filtered by the key’s resource allowlist; resource permissions are still checked when you access the data. Describe a resource before relying on its fields or writing records.
curl --fail-with-body "$SQUARIO_API_BASE/resources" \
--header "Authorization: Bearer $SQUARIO_API_KEY"
curl --fail-with-body "$SQUARIO_API_BASE/resources/companies" \
--header "Authorization: Bearer $SQUARIO_API_KEY"Inspect the contract without a key
The version root and /openapi.json are public. Use them to identify the API and fetch its OpenAPI 3.1 contract. These public calls do not consume your workspace’s request allowance. The copy in this documentation is a release snapshot; the deployed API’s document reflects its deployment.
curl --fail-with-body "$SQUARIO_API_BASE"
curl --fail-with-body "$SQUARIO_API_BASE/openapi.json"Make your integration reliable
Continue with filters and pagination for reads, or safe writes for creation and updates. Read the error guide before adding retries. Use an Idempotency-Key for write retries and honour Retry-After.