Documentation / OAuth tokens

OAuth tokens

Endpoints for the OAuth tokens resource. All calls require authentication and return the standard JSON envelope.

🔗

Base URL: https://companybelgium.be/api · Authentication

Obtain an access token#

POST/oauth/token

OAuth2 client_credentials grant for developer applications. Returns a bearer token usable as an alternative to the X-API-Key / X-API-Secret headers.

Form body

grant_type=client_credentials
client_id=app_xxx
client_secret=secret_xxx

Request

curl -X POST https://companybelgium.be/api/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d grant_type=client_credentials \
  -d client_id=app_xxx \
  -d client_secret=secret_xxx
const res = await fetch("https://companybelgium.be/api/oauth/token", {
  method: "POST",
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
  body: new URLSearchParams({"grant_type":"client_credentials","client_id":"app_xxx","client_secret":"secret_xxx"}),
});
const { data } = await res.json();

Response

{
  "success": true,
  "data": {
    "access_token": "eyJhbGciOi...redacted",
    "token_type": "Bearer",
    "expires_in": 3600
  },
  "error": null,
  "timestamp": "2026-06-05T09:00:00.000Z",
  "meta": null
}