API reference
Profile
The user the credential acts on behalf of.
Retrieve the profile
api.niucore.com/api/v1/meScope: profile:read
The API's “who am I?”: it confirms the token works and states which permissions and effective scopes the credential will operate with.
Tip
It is the first request worth making when integrating. If scopes comes back narrower than you asked for, the user's role narrowed the scope — and that explains any later 403.
Returns
idintegerOwning user's id.
namestringName.
emailstringEmail.
company_idintegerCompany.
rolestringPlatform role.
permissionsstring[]The user's effective permissions right now.
scopesstring[]Effective scopes = token scopes ∩ what the permissions allow.
tokenobjectThe credential in use: id, client_id and type (user or admin).
curl -sS -X GET 'https://api.niucore.com/api/v1/me' \
-H "Authorization: Bearer $NIUCORE_ACCESS_TOKEN"{
"status": "success",
"message": "Operación exitosa",
"message_code": "api_v1_ok",
"data": {
"id": 2099,
"name": "Integraciones ACME",
"email": "integraciones@acme.com",
"phone": "+54 11 5555 0000",
"job_title": "Cuenta de servicio",
"timezone": "America/Argentina/Buenos_Aires",
"company_id": 2149,
"role": "admin",
"permissions": [
"sidebar.chat",
"workspaces.read.all",
"skills.read.all"
],
"scopes": [
"chat:read",
"chat:write",
"libraries:read",
"profile:read"
],
"token": {
"id": 412,
"client_id": "nc_7f3c1a9b8e2d4056",
"type": "user"
}
},
"meta": {
"request_id": "9f1c0a3e-7b2d-4f18-9a55-2c6e0d1b4a77"
}
}Update the profile
api.niucore.com/api/v1/meScope: profile:write
Updates the owning user's data. Only the listed fields: sending role or email returns 422 instead of being silently ignored.
Request body
namestringUp to 100 characters.
phonestringUp to 32 characters.
documentstringDocument.
document_typestringDocument type. Free text up to 16 characters: there is no catalog or closed list, so store whatever value your organization uses (DNI, CUIT, RUT, passport…).
country_idintegerCountry. Valid ids come from `GET /catalog/countries`.
job_titlestringJob title.
timezonestringIANA time zone.
Errors
- 422
api_v1_validation_errorA field the API does not accept was sent, or one out of range.
curl -sS -X PATCH 'https://api.niucore.com/api/v1/me' \
-H "Authorization: Bearer $NIUCORE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"job_title": "Cuenta de servicio",
"timezone": "America/Argentina/Buenos_Aires"
}'{
"status": "success",
"message": "Operación exitosa",
"message_code": "api_v1_ok",
"data": {
"id": 2099,
"name": "Integraciones ACME",
"email": "integraciones@acme.com",
"phone": "+54 11 5555 0000",
"job_title": "Cuenta de servicio",
"timezone": "America/Argentina/Buenos_Aires",
"company_id": 2149,
"role": "admin",
"permissions": [
"sidebar.chat",
"workspaces.read.all",
"skills.read.all"
],
"scopes": [
"chat:read",
"chat:write",
"libraries:read",
"profile:read"
],
"token": {
"id": 412,
"client_id": "nc_7f3c1a9b8e2d4056",
"type": "user"
}
},
"meta": {
"request_id": "9f1c0a3e-7b2d-4f18-9a55-2c6e0d1b4a77"
}
}