Agency API: create and manage accounts from your system
Create, suspend, and manage your customers' accounts without entering the panel.
This is a different API from the one your customers use inside their account. This one is higher level: it lets you create accounts, change their plan, suspend them, add their users, check your billing, and receive alerts about what happens.
This is what lets you sell from your own website with your own checkout, without anyone on your team manually setting up accounts.
It authenticates with a master key in the X-ACCESS-TOKEN header (or Authorization: Bearer). Master keys are created in Developers, in your agency panel, and the network panel API shows those same ones: there's no separate agency key and operator key. What changes from one thing to the other is the endpoint.
A master key enters ALL your customer accounts, but it can't read their contacts or conversations: that's what the API for each account is for, with that account's key.
The Developers screen has two tabs: API, with your master keys, and Embedded, for putting modules inside your website. In API you create a key with New key and a name; it's shown in full only once, so save it before you close: after that you'll only see its first characters. Each key shows when it was last used. Below you see what address it hangs from, the same example in curl, JavaScript and Python, the list of endpoints to test them from the browser, Activity with your calls and the ones that failed, and Latest failures with the reason for each one.
What you can do
- Create a customer account with its owner and plan from your website.
- Check the status, plan, and data of an account, or list them all.
- Suspend an account if it stops paying, and reactivate it later.
- Change its plan, name, time zone, or language.
- Add users to your customers' accounts and change their role.
- Receive alerts on your server when an account is created, suspended, reactivated, or canceled, when it changes plan, or when a user is added.
The endpoints
| Endpoint | What it's for |
|---|---|
| GET /api/v1/partner/me | Check that the key works and which account it's from. |
| GET /api/v1/partner/accounts | List your accounts with their plan and status. |
| POST /api/v1/partner/accounts | Create a new account with its owner. |
| GET /api/v1/partner/accounts/{id} | See the detail of an account. |
| PATCH /api/v1/partner/accounts/{id} | Change its name, time zone, or language. |
| DELETE /api/v1/partner/accounts/{id} | Delete it. Can't be undone. |
| POST .../accounts/{id}/suspend | Suspend it: its users can't log in. |
| POST .../accounts/{id}/activate | Reactivate it: gives it back access and puts it in PRO. |
Create an account when someone pays you
curl -X POST https://platform.chatlevel.ai/api/v1/partner/accounts \
-H "X-ACCESS-TOKEN: tu_master_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Tienda de Ana",
"ownerEmail": "ana@sutienda.com",
"planTier": "PRO"
}'
# planTier: TRIAL (7 días de prueba, el de por defecto), PRO o ANNUAL
# → { "id": "…", "name": "Tienda de Ana", "status": "active", "planTier": "PRO", … }Suspend it if they stop paying, and reactivate after
# deja de pagar → suspendes
curl -X POST https://platform.chatlevel.ai/api/v1/partner/accounts/ID_DE_LA_CUENTA/suspend \
-H "X-ACCESS-TOKEN: tu_master_key"
# vuelve a pagar → reactivas
curl -X POST https://platform.chatlevel.ai/api/v1/partner/accounts/ID_DE_LA_CUENTA/activate \
-H "X-ACCESS-TOKEN: tu_master_key"An example
Sell on autopilot from your website
- A customer chooses the Pro plan on your website and pays with your gateway.
- Your server receives the payment alert and calls POST /partner/accounts with the name, the owner's email, and the plan.
- Save the id we return you together with that customer, in your own system.
- If a month the charge fails, call /suspend and their users can't log in.
- When they pay, call /activate and they're back in.
Recommendations
- Create the account when payment is confirmed, not when checkout starts. Otherwise you end up with open accounts that nobody paid for.
- Save the id we return you together with your customer in your system: it's the key to everything else.
- Suspend instead of delete. A suspended account is reactivated; a deleted one doesn't come back.
- One key per system, and test first with GET /partner/me.
- Always call from your server, never from the browser: the master key enters all your accounts.
- Before you code anything, test the endpoints from the browser in the API screen of your panel: you put the key in once and run real calls. If it works there and not in your code, the problem is yours.
Watch out for this
- This key enters ALL your customer accounts: if it leaks, someone can create, suspend, or delete accounts in your name. If it happens, delete it in your panel and create another.
- If the account pays for the app and has an active subscription, its plan comes from the payment: suspending it, reactivating it, or changing its plan through the API returns a 409 error.
- /activate puts it in PRO even if it was in trial before: it doesn't remember what plan it had before you suspended it.
- Changing its plan to a live one doesn't lift a suspension. To give it back access there's /activate.
- DELETE deletes the entire account and can't be undone.
- The billing summary gives the same amount as Your next invoice on your panel and as whoever bills you sees. As of Oct 25, 2026, peakAccounts, billableAccounts, seatsCents, and estimatedMonthlyCents come from that same account, so they may show a different number than before, and there are new fields with the breakdown: gifted AI credits, channels given, tier change, your profit, whether you pay outside, and whether you're charged automatically.
- There's no endpoint to list or check your resellers: only to add them, and only if your account is Unlimited.
