Skip to content

Overview & Authentication

import { Aside } from ‘@astrojs/starlight/components’;

The Kotauth REST API v1 is a machine-to-machine interface for managing workspace resources programmatically. It covers the full lifecycle of users, roles, groups, applications, sessions, and audit logs.

Base URL:

{baseUrl}/t/{workspaceSlug}/api/v1

For example: https://auth.yourdomain.com/t/my-app/api/v1

An interactive Swagger UI is also available on any running instance at:

/t/{workspaceSlug}/api/v1/docs

All API endpoints require an API key passed as a Bearer token:

Authorization: Bearer kauth_my-app_abcdef1234567890

API keys are created and managed in the admin console under Settings → API Keys for each workspace. The key format is kauth_<workspaceSlug>_<random> — the prefix makes them easy to identify in logs and secret scanners.

Each API key carries a set of scopes that restrict which operations it may perform. Attempting an operation without the required scope returns 403 Forbidden.

ScopeGrants access to
users:readList and retrieve users
users:writeCreate, update, disable users; assign and remove roles
roles:readList and retrieve roles
roles:writeCreate, update, delete roles
groups:readList and retrieve groups
groups:writeCreate, update, delete groups; manage members
applications:readList and retrieve applications
applications:writeUpdate and disable applications
sessions:readList active sessions
sessions:writeRevoke sessions
audit_logs:readRead audit log events

Always issue API keys with the minimum scope required. A key used for read-only reporting should not have write scopes.

List endpoints return paginated results with a meta object:

{
"data": [...],
"meta": {
"total": 143,
"offset": 0,
"limit": 20
}
}

Use offset and limit query parameters to paginate:

GET /users?offset=20&limit=20

All errors follow RFC 7807 Problem Details with Content-Type: application/problem+json:

{
"type": "https://kotauth.dev/errors/422",
"title": "Validation Error",
"status": 422,
"detail": "Username may only contain letters, digits, dots, underscores, and hyphens."
}
StatusMeaning
400Bad request — malformed JSON or missing required fields
401Missing or invalid API key
403Valid key but insufficient scope
404Resource not found
409Conflict — resource already exists (e.g. duplicate username)
422Validation error — request is well-formed but semantically invalid
429Rate limit exceeded
500Internal server error