Running an org

Org API: everything the dashboard does

Org keys drive every dashboard action through the API: agents, budgets, approvals, receipts, billing, webhooks and team.

Anything a person can do in the dashboard, an agent can do through the API. Agent keys (sk_…) buy results; org keys (ok_…) run the org: make agents and set their budgets, decide approvals, read receipts, top up, manage webhooks and the team.

Org keys

Send it as Authorization: Bearer ok_…. The org's id is in the dashboard's URLs (?org=…) and in GET /v1/me.

Worked examples

Make an agent and read its key

curl
curl https://api.arettic.com/v1/orgs/$ORG_ID/agents \
  -H "Authorization: Bearer $ARETTIC_ORG_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Lead research", "mode": "live", "monthly_budget_credits": 100000 }'
# → { "agent": { "id": "…", … }, "key": "sk_live_…", "key_note": "…" }  (the key is shown once)
TypeScript
import { AretticOrg } from "@arettic/sdk";

const org = new AretticOrg({ apiKey: process.env.ARETTIC_ORG_KEY, orgId: "your-org-id" });
const { agent, key } = await org.agents.create({ name: "Lead research", mode: "live" });
await org.agents.update(agent.id, { monthly_budget_credits: 100_000, approval_threshold_credits: 20_000 });
Python
import os

from arettic import AretticOrg

org = AretticOrg(os.environ["ARETTIC_ORG_KEY"], os.environ["ARETTIC_ORG_ID"])
made = org.agents.create(name="Lead research", mode="live")
org.agents.update(made["agent"]["id"], monthly_budget_credits=100_000, approval_threshold_credits=20_000)

A month of receipts, and the CSV

TypeScript
const page = await org.receipts.list({ from: "2026-09-01", to: "2026-09-30", limit: 200 });
const csv = await org.receipts.exportCsv({ from: "2026-09-01", to: "2026-09-30" });
Python
page = org.receipts.list(from_="2026-09-01", to="2026-09-30", limit=200)
csv = org.receipts.export_csv(from_="2026-09-01", to="2026-09-30")

Decide an approval

curl
curl https://api.arettic.com/v1/orgs/$ORG_ID/approvals/$APPROVAL_ID/decision \
  -H "Authorization: Bearer $ARETTIC_ORG_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "decision": "approve", "note": "Q4 list" }'
TypeScript
const pending = await org.approvals.list({ status: "pending" });
for (const a of pending) await org.approvals.decide(a.approval_id, { decision: "approve" });
Python
for a in org.approvals.list(status="pending")["approvals"]:
    org.approvals.decide(a["approval_id"], "approve")

Add a webhook

TypeScript
const hook = await org.webhooks.create({ url: "https://example.com/arettic-hook", events: ["job.completed"] });
// hook.webhook.secret is shown once: store it to verify signatures
Python
hook = org.webhooks.create("https://example.com/arettic-hook", events=["job.completed"])
secret = hook["webhook"]["secret"]  # shown once

Verifying deliveries is on webhooks. The dashboard's overview numbers (balance, spend by day, agent and tool, items not charged, budgets, pending approvals and disputes) are GET /v1/orgs/{orgId}/dashboard.

Errors you'll meet

Every dashboard action and its endpoint

Generated from the list our tests check: every server action in the dashboard is here, every endpoint is in /openapi.json, and an org key is tested against every row marked yes.

Dashboard ↔ API
ActionDashboard pageEndpointOrg key
Email me a sign-in link/appPOST /auth/email/startno: a person signed in
Sign out/appPOST /auth/logoutno: a person signed in
Create an org/appPOST /v1/orgsno: a person signed in
Accept an invite/invitePOST /v1/invites/acceptno: a person signed in
Balance, spend and refund rate/appGET /v1/orgs/{orgId}/dashboardyes
List agents/app/agentsGET /v1/orgs/{orgId}/agentsyes
Add an agent (key shown once)/app/agentsPOST /v1/orgs/{orgId}/agentsyes
Change name, budget, approval threshold, IP allowlist or status/app/agentsPATCH /v1/orgs/{orgId}/agents/{agentId}yes
Rotate an agent key/app/agentsPOST /v1/orgs/{orgId}/agents/{agentId}/rotate-keyyes
Revoke an agent key/app/agentsPOST /v1/orgs/{orgId}/agents/{agentId}/revoke-keyyes
Approval requests/app/approvalsGET /v1/orgs/{orgId}/approvalsyes
Approve or reject a purchase/app/approvalsPOST /v1/orgs/{orgId}/approvals/{id}/decisionyes
Receipt explorer/app/receiptsGET /v1/orgs/{orgId}/receiptsyes
One receipt/app/receipts/[id]GET /v1/orgs/{orgId}/receipts/{id}yes
Export receipts as CSV/app/receiptsGET /v1/orgs/{orgId}/exports/receipts.csvyes
Dispute a charged item/app/receipts/[id]POST /v1/orgs/{orgId}/disputesyes
Disputes and their decisions/app/disputesGET /v1/orgs/{orgId}/disputesyes
Invoices/app/invoicesGET /v1/orgs/{orgId}/invoicesyes
One invoice (JSON or printable HTML)/app/invoicesGET /v1/orgs/{orgId}/invoices/{id}yes
Balance and credit lots/app/billingGET /v1/orgs/{orgId}/balanceyes
Top-up history/app/billingGET /v1/orgs/{orgId}/topupsyes
Buy credits (returns a checkout link)/app/billingPOST /v1/orgs/{orgId}/topupsyes
Auto-reload settings/app/billingGET /v1/orgs/{orgId}/auto-reloadyes
Turn auto-reload on or off/app/billingPUT /v1/orgs/{orgId}/auto-reloadyes
Low-balance alert level/app/billingPUT /v1/orgs/{orgId}/notificationsyes
Plan, limits and subscriptions/app/billingGET /v1/orgs/{orgId}/planyes
Start the Pro plan (returns a checkout link)/app/billingPOST /v1/orgs/{orgId}/subscriptionsyes
Cancel a plan at period end/app/billingDELETE /v1/orgs/{orgId}/subscriptions/{plan}yes
Billing name, address, country and tax ID/app/billingPATCH /v1/orgs/{orgId}/billingyes
Webhook endpoints and event types/app/webhooksGET /v1/orgs/{orgId}/webhooksyes
Recent deliveries/app/webhooksGET /v1/orgs/{orgId}/webhook-deliveriesyes
Recent events/app/webhooksGET /v1/orgs/{orgId}/eventsyes
Add an endpoint (secret shown once)/app/webhooksPOST /v1/orgs/{orgId}/webhooksyes
Send a test event/app/webhooksPOST /v1/orgs/{orgId}/webhooks/{id}/testyes
Delete an endpoint/app/webhooksDELETE /v1/orgs/{orgId}/webhooks/{id}yes
Members and pending invites/app/teamGET /v1/orgs/{orgId}/membersyes
Invite by email/app/teamPOST /v1/orgs/{orgId}/invitesyes
Withdraw an invite/app/teamDELETE /v1/orgs/{orgId}/invites/{inviteId}yes
Make a member an owner, or back/app/teamPATCH /v1/orgs/{orgId}/members/{userId}yes
Remove a member, or leave/app/teamDELETE /v1/orgs/{orgId}/members/{userId}yes
Org API keys/app/teamGET /v1/orgs/{orgId}/keysno: a person signed in
Make an org API key (shown once)/app/teamPOST /v1/orgs/{orgId}/keysno: a person signed in
Revoke an org API key/app/teamDELETE /v1/orgs/{orgId}/keys/{id}no: a person signed in
Data-deletion requests/app/teamGET /v1/orgs/{orgId}/deletion-requestsyes
Ask us to delete stored inputs and results (within 24 hours)/app/teamPOST /v1/orgs/{orgId}/deletion-requestsno: a person signed in
Private test sets and included calls/app/benchmarksGET /v1/orgs/{orgId}/test-setsyes
Private benchmark runs/app/benchmarksGET /v1/orgs/{orgId}/benchmarksyes
One run: per-case results, segments, failure reasons/app/benchmarks/[id]GET /v1/orgs/{orgId}/benchmarks/{id}yes
Make a private test set (JSON Lines)/app/benchmarksPOST /v1/orgs/{orgId}/test-setsyes
Add cases to a test set/app/benchmarksPOST /v1/orgs/{orgId}/test-sets/{id}/casesyes
Delete a test set and its results/app/benchmarksDELETE /v1/orgs/{orgId}/test-sets/{id}yes
Run tools against a test set/app/benchmarksPOST /v1/orgs/{orgId}/benchmarksyes
Your tools' scores, inputs and rank (read-only)/app/providerGET /v1/orgs/{orgId}/provideryes
Claim a provider/app/providerPOST /v1/orgs/{orgId}/provider/claimsyes
Ask for a re-test (Insights, Pro)/app/providerPOST /v1/orgs/{orgId}/provider/retestsyes

Updated 2026-09-30 · This page as Markdown · JSON