Contents
Identity
The signed-in person, their companies and module access (OpenID Connect UserInfo).
Base URL, authentication and conventions of this API are on the OAuth & OpenID Connect API page.
/api/oauth/userinfoGet the signed-in user
openid scope.OpenID Connect UserInfo. Returns who the token belongs to, the companies (organizations) they belong to and the Nucleo modules they can use, with their role.
subis the stable user id: key your local records on it, never onemail.orgs[].idis the company id to pass asX-Nucleo-Companyto the AI tools.apps[]lists module access per company (org_id: null= global access for Nucleo staff). During the module migration legacy slugs may appear next tobrain,catalog,commerce,intelligence: ignore slugs you do not know.disabled_sectionslists, per company id, the sub-modules switched off for that company. When no company has a sub-module switched off it is an empty array[], not an object.ai_connector_disabledlists, per company id, the modules whose AI connector that company has switched off (only companies with something switched off;[]when there are none). AI clients get403 ai_connector_disabledfrom those modules' AI tools in that company.scopeis the effective scope of the token:nucleo.ai_toolsmarks a token of a self-registered (AI) client.org_idis the company of the token (passed to/oauth/authorize), ornull; the same value as theorg_idclaim of the access token. A hint for the active company, not a permission.impersonatoris non-null only when Nucleo staff is acting as the user.apps[]entries ofcatalog,commerceandintelligencecan also carryrole_key,role_name(in the person's language) andpermissions(the permission keys of that role).
Available to self-registered clients' tokens. A token of a deactivated account answers 401
with error: invalid_token.
Responses
200The user.application/json
substringrequiredStable user id.
namestringemailstring (email)requiredemail_verifiedbooleanavatar_urlstring (uri) | nulllanguagestringExample:enthemestringOne oflightdarkis_internalbooleanTrue only for Nucleo staff with access to every company.
is_ownerbooleanorg_idsarray of integerorgsarray of objectAttributes of each item
idintegerslugstringnamestringlogo_urlstring (uri) | nullrolestringExample:admin
app_accessarray of stringModule slugs the user can open.
appsarray of objectAttributes of each item
slugstringExample:catalogrolestringExample:editororg_idinteger | nullrole_keystringKey of the role (a preset level or a custom role). Catalog, Commerce and Intelligence only.
Example:editorrole_namestringRole name in the person's language.
Example:Editorpermissionsarray of stringPermission keys granted by the role.
disabled_sectionsobject | array of stringCompany id → list of disabled sub-module slugs. An empty array
[]when nothing is switched off.ai_connector_disabledobject | array of anyCompany id → modules (
brain,catalog,commerce,intelligence) whose AI connector the company has switched off. Only the user's companies with something switched off (every company for Nucleo staff); an empty array[]when there are none. A missing claim means nothing is switched off.client_idstring | nullscopestringEffective scopes of the token
org_idinteger | nullCompany of the token: the
org_idpassed to/oauth/authorize(when the person belongs to it), kept by every refresh;nullotherwise. A missing claim (older Core) meansnull.impersonatorobject | nullChild attributes
idintegernamestringemailstring (email)expires_atstring (date-time)
401Missing, expired or revoked access token.application/json
messagestring
curl -X GET https://auth.nucleoplatform.com/api/oauth/userinfo \
-H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
-H 'Accept: application/json'const res = await fetch("https://auth.nucleoplatform.com/api/oauth/userinfo", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.NUCLEO_ACCESS_TOKEN}`,
Accept: "application/json",
},
});
const data = await res.json();
console.log(res.status, data);<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://auth.nucleoplatform.com/api/oauth/userinfo', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('NUCLEO_ACCESS_TOKEN'),
'Accept' => 'application/json',
],
'http_errors' => false,
]);
echo $response->getStatusCode(), PHP_EOL;
echo $response->getBody();{
"sub": "42",
"name": "Giulia Rossi",
"email": "giulia.rossi@acme.example",
"email_verified": true,
"avatar_url": "https://cdn.acme.example/avatars/42.png",
"language": "it",
"theme": "light",
"is_internal": false,
"is_owner": false,
"org_ids": [
7
],
"orgs": [
{
"id": 7,
"slug": "acme",
"name": "Acme Apparel",
"logo_url": "https://cdn.acme.example/logo.png",
"role": "admin"
}
],
"app_access": [
"catalog",
"commerce"
],
"apps": [
{
"slug": "catalog",
"role": "editor",
"org_id": 7,
"role_key": "editor",
"role_name": "Editor",
"permissions": [
"catalog.products.view",
"catalog.products.edit"
]
},
{
"slug": "commerce",
"role": "viewer",
"org_id": 7
}
],
"disabled_sections": {
"7": [
"pos"
]
},
"ai_connector_disabled": {
"7": [
"intelligence"
]
},
"client_id": "9d3f2b1c-6a4e-4f7b-9c2d-1e8a7b6c5d4f",
"scope": "openid profile email offline_access nucleo.ai_tools",
"org_id": 7,
"impersonator": null
}{
"message": "Unauthenticated."
}