Authentication
Obtain an access token, authenticate your requests, and reuse tokens safely.
Before you start
Ask our dev team for a client ID and client secret. Use https://api.staging.thepalia.de for development and testing, and https://api.thepalia.de for production. Use the supplied credentials with the selected API server. Offer IDs and enrollment IDs must exist in that environment.
Keep credentials on your server
Call the API from your backend. Never expose your client secret or access token in frontend code, public repositories, or URLs. The documentation playground is for testing with your own credentials.
1. Obtain a token
The token endpoint implements the OAuth 2.0 client credentials grant, so standard OAuth client libraries work out of the box. Send POST /v1/oauth/token with your credentials in one of these formats:
JSON body (Content-Type: application/json):
{
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}Form data (Content-Type: application/x-www-form-urlencoded as defined by OAuth 2.0; multipart/form-data is accepted too):
POST /v1/oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRETHTTP Basic authentication (no body needed):
POST /v1/oauth/token
Authorization: Basic BASE64(YOUR_CLIENT_ID:YOUR_CLIENT_SECRET)grant_type is optional; client_credentials is the only supported grant.
Authorization header takes precedence
If the token request contains any Authorization header, it is parsed as HTTP Basic credentials and the body
is ignored. A leftover header such as Authorization: Bearer ... makes the request fail with 400, even when
the body contains valid credentials. Send no Authorization header when you use a JSON or form body.
A successful response contains a reusable token:
{
"access_token": "YOUR_ACCESS_TOKEN",
"token_type": "Bearer"
}See the token reference for the full schema and error responses. Use one credential method consistently.
2. Authenticate requests
Add this header to protected operations:
Authorization: Bearer YOUR_ACCESS_TOKENFor example, use the token with Create a course enrollment. In the playground, paste Bearer YOUR_ACCESS_TOKEN into Authorization using your staging token. The playground sends requests only to staging.
Your successful outcome is an authenticated API response rather than 401. The enrollment guide shows the complete request and expected response.
3. Reuse the token
Tokens last 24 hours. The response does not include an expires_in field; record the issuance time on your server and refresh shortly before the 24-hour lifetime ends. Share that cache across workers where practical so simultaneous requests do not each issue a token.
One token, many requests
Do not request a token for every API call. Token issuance is limited to 20 requests per minute per client IP. See Rate limits & retries.
Troubleshoot authentication
| Response | What to check |
|---|---|
400 from the token endpoint | Check the credential fields, and remove any non-Basic Authorization header when sending credentials in a body. |
401 | Verify credentials, token expiry, the Bearer prefix, and the selected environment. |
415 from the token endpoint | Use JSON, application/x-www-form-urlencoded, multipart/form-data, or HTTP Basic. |
429 from the token endpoint | Reuse an existing token and wait before requesting another. |
Use the reference for each operation's documented errors. An expired token can be replaced; retrying a failed enrollment creation needs additional care because creation is not idempotent.