API Overview
Authentication, errors and organisation scoping that apply to every api/v1 endpoint.
KPass exposes a versioned JSON API at /api/v1 for every resource you can manage — Users, User Groups, Permissions, Apps, and API Clients each have their own section below with copyable examples. This page covers what's common across all of them. If you haven't logged a user in yet, start with Login Flow instead — everything here assumes you already have an API client.
Authentication
Every api/v1 request is authenticated with two headers from one of your app's API Clients — never with a browser session or cookie:
X-Client-Id: YOUR_CLIENT_ID X-Api-Secret: YOUR_API_SECRET
Missing or invalid credentials return 401 Unauthorized. Keep the secret private — it's shown once, at creation/regeneration time, and never again. The one exception is /api/v1/authorise (part of Login Flow), which takes these as query parameters instead — everything else uses the headers above.
Errors
Validation and not-found errors share one shape:
{
"error": {
"code": "not_found",
"message": "User not found.",
"details": null
}
}
Everything is scoped to your organisation
Your API Client's organisation is resolved from the credentials you send — you never pass an orgId yourself, and you can only see or change records that belong to your own organisation.
Where to go next
See Login Flow first if you haven't logged a user in yet. Then Users, User Groups, Permissions, Apps, and API Clients below have the full endpoint list and copyable examples for each — read Permissions in particular before wiring up anything that gates access to a real feature.