> For the complete documentation index, see [llms.txt](https://knowledgebase.fabricdata.com/insights/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.fabricdata.com/insights/api/origin-insights-new-generation/authentication.md).

# Authentication

Obtaining Auth0 access tokens for the API

## Obtain an access token (client credentials)

> Machine-to-machine token from Auth0. Post your M2M application's credentials\
> with the API audience; the returned \`access\_token\` goes in the \`Authorization: Bearer\`\
> header of every API request.\
> \
> \*\*Note:\*\* M2M tokens carry no user claims → unrestricted access. To test claims-based\
> authorization, obtain a \*user\* token instead: Authorization Code + PKCE flow against this\
> tenant with the Origin Insights application's client\_id and the same \`audience\` — the\
> post-login Action then injects the \`countries\`/\`platforms\`/\`products\`/\`role\` claims.\
> Tokens expire (default 24h); fetch a fresh one rather than storing them.

```json
{"openapi":"3.0.3","info":{"title":"Insights API","version":"1.0.0"},"tags":[{"name":"Authentication","description":"Obtaining Auth0 access tokens for the API"}],"servers":[{"url":"https://dev-lpjrjy1zlx337dil.eu.auth0.com","description":"Auth0 tenant (NOT the API host)"}],"security":[],"paths":{"/oauth/token":{"post":{"summary":"Obtain an access token (client credentials)","description":"Machine-to-machine token from Auth0. Post your M2M application's credentials\nwith the API audience; the returned `access_token` goes in the `Authorization: Bearer`\nheader of every API request.\n\n**Note:** M2M tokens carry no user claims → unrestricted access. To test claims-based\nauthorization, obtain a *user* token instead: Authorization Code + PKCE flow against this\ntenant with the Origin Insights application's client_id and the same `audience` — the\npost-login Action then injects the `countries`/`platforms`/`products`/`role` claims.\nTokens expire (default 24h); fetch a fresh one rather than storing them.","operationId":"getToken","tags":["Authentication"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["grant_type","client_id","client_secret","audience"],"properties":{"grant_type":{"type":"string","enum":["client_credentials"]},"client_id":{"type":"string","description":"M2M application client ID"},"client_secret":{"type":"string","description":"M2M application client secret"},"audience":{"type":"string","enum":["https://api.origin-insights-new.fabric.com"]}}}}}},"responses":{"200":{"description":"Token issued","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"integer"}}}}}},"401":{"description":"Invalid client credentials","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}}}}}}}}}}}
```
