Getting Started
From zero to your first API call in under 10 minutes.
1. Issue an API token
In the Canopy app, go to /[workspaceSlug]/admin/api-tokens → New token, give it a name, pick a scope (read or read_write), and copy the token — it starts with cn_ and is shown once. See the Auth & Token Issuance guide for details.
2. Set it in your shell
export CANOPY_TOKEN=cn_xxxxxxxxxxxxxxxxxxxx3. Make your first call
List the issues your account can see. Reads return a { data, nextCursor, total } envelope.
cURL
curl -H "Authorization: Bearer $CANOPY_TOKEN" \
https://app.canopymethod.ai/api/v1/issuesTypeScript
const BASE = "https://app.canopymethod.ai/api/v1";
async function listAllIssues() {
let cursor: string | null = null;
const all: unknown[] = [];
do {
const url = new URL(BASE + "/issues");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.CANOPY_TOKEN}` },
});
const { data, nextCursor } = await res.json();
all.push(...data);
cursor = nextCursor; // follow the cursor until it is null
} while (cursor);
return all;
}Python
import os, requests, uuid
BASE = "https://app.canopymethod.ai/api/v1"
HEAD = {"Authorization": f"Bearer {os.environ['CANOPY_TOKEN']}"}
# read
issues = requests.get(f"{BASE}/issues", headers=HEAD).json()
print(issues["total"], "issues; next:", issues["nextCursor"])
# create (idempotent — Idempotency-Key is required on POST)
res = requests.post(
f"{BASE}/issues",
headers={**HEAD, "Idempotency-Key": str(uuid.uuid4())},
json={"projectId": "prj_123", "title": "Login broken"},
)
print(res.status_code, res.json()) # 201 on first callCreate example.
POST /api/v1/issues with an Idempotency-Key header and a body like {"projectId":"prj_123","title":"Login broken"} returns 201 the first time. See Idempotency & Concurrency.Next
- Browse the full API Reference.
- Learn safe writes in Idempotency & Concurrency.