Connect to the API
Everything you need to make your first authenticated request: base URL, authentication schemes, request conventions, pagination, and error handling.
All API endpoints are relative to the versioned base URL.
https://app.schole.ai/api/v1/
Content-Type: application/json and all
responses are JSON. File uploads use multipart/form-data.
The API supports two authentication schemes. Both produce a standard
Authorization: Bearer <token> header.
Short-lived access token obtained by posting credentials. Good for user-delegated access and internal tooling.
simplejwtServer-to-server token flow. No human credentials stored in your pipeline. Scoped to a registered application.
RFC 6749 §4.4JWT Bearer Tokens
Post credentials to obtain an access / refresh token pair.
Access tokens expire after 5 minutes; refresh tokens after 24 hours.
curl -X POST https://app.schole.ai/auth/jwt/create/ \
-H "Content-Type: application/json" \
-d '{
"email": "service-account@yourcompany.com",
"password": "••••••"
}'
{
"access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
curl https://app.schole.ai/api/v1/users/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
curl -X POST https://app.schole.ai/auth/jwt/refresh/ \
-H "Content-Type: application/json" \
-d '{"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}'
OAuth2 Client Credentials
The recommended flow for machine-to-machine integrations. Your application gets its own client_id and client_secret; no user password leaves your system.
Ask your Scholé administrator to create an Application in the admin panel
(/admin/oauth2_provider/application/add/) with:
| Field | Value |
|---|---|
| Client type | Confidential |
| Authorization grant type | Client credentials |
| Name | e.g. Swisscom MIS Integration |
You will receive a client_id and client_secret.
curl -X POST https://app.schole.ai/oauth/token/ \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET"
{
"access_token": "xxxxxxxxxxxxxxxxxxx",
"token_type": "Bearer",
"expires_in": 36000,
"scope": "read write"
}
curl https://app.schole.ai/api/v1/hr/employees/ \
-H "Authorization: Bearer xxxxxxxxxxxxxxxxxxx"
Tokens expire after expires_in seconds. Simply repeat step 2 to obtain a fresh token —
the client credentials flow has no refresh token.
Collection endpoints that grow with your organisation (users, curricula,
assignments, the course catalogue, audit logs, …) return a page-number
envelope. Pass ?page=2 and optionally ?page_size=50
(default 100, max 200). A few small fixed-size lists (e.g. feature toggles
and agent configurations) return a plain array instead.
{
"count": 342,
"next": "https://app.schole.ai/api/v1/users/?page=2",
"previous": null,
"results": [ ... ]
}
| Parameter | Default | Max | Description |
|---|---|---|---|
page | 1 | — | Page number (1-based) |
page_size | 100 | 200 | Items per page |
Iterate over all pages by following next until it is null.
Errors return a JSON body with a detail field (and sometimes a structured
errors map for validation failures).
{
"detail": "Validation error",
"errors": {
"email": ["Enter a valid email address."],
"team_id": ["Object with id=99 does not exist."]
}
}
| Status | Meaning |
|---|---|
| 200 OK / 201 Created | Request succeeded |
| 204 No Content | Delete or deactivate succeeded (empty body) |
| 400 Bad Request | Malformed JSON or missing required fields |
| 401 Unauthorized | Missing or invalid Authorization header |
| 403 Forbidden | Token is valid but lacks permission for this resource |
| 404 Not Found | Resource doesn't exist or belongs to another company |
| 422 Unprocessable Entity | Field-level validation failure — check the errors map |
| 429 Too Many Requests | Rate limit exceeded — Retry-After header present |
| 500 Internal Server Error | Unexpected server error — contact support |