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[].public_idis the company id to pass asX-Nucleo-Companyto the AI tools and to use in URLs.org_public_idslists the same companies in the order oforg_ids.orgs[].id,org_ids,apps[].org_idandorg_idare the numeric company ids: deprecated, kept for compatibility next to their public ids (orgs[].public_id,org_public_ids,apps[].org_public_id,org_public_id). Do not store them.apps[]lists module access per company (org_public_id: nullandorg_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 numeric 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 numeric 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_public_idis the company of the token (passed to/oauth/authorize), ornull; the same value as theorg_public_idclaim of the access token (org_id: the same company as a deprecated numeric id). A hint for the active company, not a permission.impersonatoris non-null only when Nucleo staff is acting as the user.apps[]entries of the modulesbrain,catalog,commerceandintelligencecan also carryrole_key(a preset role such assales_rep, orcustom-<id>for a role the company created),role_name(in the person's language) andpermissions: the permission keys of that role in that company,<module>.<section>.<action>(for examplebrain.deals.edit,brain.system.settings.manage).rolestays the base level. Legacy slugs never carry them. Whenpermissionsis present it is what the module enforces for that company.
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 integerdeprecatedNumeric company ids (deprecated): use
org_public_ids.org_public_idsarray of string (uuid)Public ids of the user's companies, in the order of
org_ids.orgsarray of objectAttributes of each item
public_idstring (uuid)Public id of the company
idintegerdeprecatedNumeric company id (deprecated): use
public_id.slugstringnamestringlogo_urlstring (uri) | nullrolestringExample:admin
app_accessarray of stringModule slugs the user can open.
appsarray of objectAttributes of each item
slugstringExample:catalogrolestringExample:editororg_public_idstring (uuid) | nullPublic id of the company;
null= global access for Nucleo staff.org_idinteger | nulldeprecatedNumeric company id (deprecated): use
org_public_id.role_keystringKey of the role: a preset level, or
custom-<id>for a custom role of the company. Module entries only (brain, catalog, commerce, intelligence), not legacy slugs.Example:editorrole_namestringRole name in the person's language.
Example:Editorpermissionsarray of stringPermission keys granted by the role in that company (
<module>.<section>.<action>, e.g.brain.deals.edit).
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_public_idstring (uuid) | nullPublic id of the company 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.org_idinteger | nulldeprecatedThe company of the token as a numeric id (deprecated: use
org_public_id). 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
],
"org_public_ids": [
"0199e5c2-7a1b-7c3d-8e4f-a1b2c3d4e5f6"
],
"orgs": [
{
"id": 7,
"public_id": "0199e5c2-7a1b-7c3d-8e4f-a1b2c3d4e5f6",
"slug": "acme",
"name": "Acme Apparel",
"logo_url": "https://cdn.acme.example/logo.png",
"role": "admin"
}
],
"app_access": [
"catalog",
"commerce",
"brain"
],
"apps": [
{
"slug": "catalog",
"role": "editor",
"org_id": 7,
"org_public_id": "0199e5c2-7a1b-7c3d-8e4f-a1b2c3d4e5f6",
"role_key": "editor",
"role_name": "Editor",
"permissions": [
"catalog.products.view",
"catalog.products.edit"
]
},
{
"slug": "commerce",
"role": "viewer",
"org_id": 7,
"org_public_id": "0199e5c2-7a1b-7c3d-8e4f-a1b2c3d4e5f6"
},
{
"slug": "brain",
"role": "sales_rep",
"org_id": 7,
"org_public_id": "0199e5c2-7a1b-7c3d-8e4f-a1b2c3d4e5f6",
"role_key": "sales_rep",
"role_name": "Commerciale",
"permissions": [
"brain.contacts.view",
"brain.deals.view",
"brain.deals.edit"
]
}
],
"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,
"org_public_id": "0199e5c2-7a1b-7c3d-8e4f-a1b2c3d4e5f6",
"impersonator": null
}{
"message": "Unauthenticated."
}