Getting started with the k12panel API
The k12panel API lets your own programs read and update your organization's data — assets, check-ins/outs, and people — without going through the web interface. This article walks through creating a key and making your first call.
The API is Windows/agent-agnostic: it works the same whether your devices run the agent or are synced from an MDM. No changes are made to any device by these calls.
Before you start
- You need an administrator account in k12panel to create API keys.
- Calls are made over HTTPS to
https://<your-panel-domain>/api/public/v1/. - The full, always-current endpoint reference lives at
https://<your-panel-domain>/api/public/v1/docs(interactive) — this KB teaches the concepts and common workflows; the reference documents every field.
Create an API key
- Go to Settings → API Keys.
- Click Create API Key.
- Give it a name (for example, "Ticketing System") — this name appears in check-in/out history so you can tell API actions apart from staff actions.
- Choose the permissions the key should have (see below).
- Optionally set an expiration date (leave blank for a key that never expires).
- Click Create Key. Copy the key now — it is shown only once. If you lose it, rotate the key to get a new one.
Permissions
A key only has the permissions you grant it. Available permissions:
| Permission | Allows |
|---|---|
reference:read |
List your sites, groups, classes, and tags |
assets:read |
List and view assets |
assets:write |
Update an asset's site, notes, and asset tag |
checkouts:write |
Check devices in and out |
people:read |
View people and what they have checked out |
Create separate keys for separate purposes — for example, a read-only key for a reporting tool, and a read-write key for a system that checks devices in and out.
Make your first call
Send your key as a Bearer token in the Authorization header:
curl -H "Authorization: Bearer k12_live_xxxxxxxxxxxx_yyyy..." \
https://<your-panel-domain>/api/public/v1/sites
You'll get back your organization's sites, each with an id you can use in other calls. That id is the same id you see in the app and in CSV exports.
Next steps
- Key concepts — IDs, looking records up, and how checkout works.
- Common workflows — copy-paste examples for the most common tasks.
- Handling errors — including the "more than one match" case.