API reference

Profile

The user the credential acts on behalf of.

Retrieve the profile

GETapi.niucore.com/api/v1/me

Scope: 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

idinteger

Owning user's id.

namestring

Name.

emailstring

Email.

company_idinteger

Company.

rolestring

Platform role.

permissionsstring[]

The user's effective permissions right now.

scopesstring[]

Effective scopes = token scopes ∩ what the permissions allow.

tokenobject

The 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"
Response
{
  "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

PATCHapi.niucore.com/api/v1/me

Scope: 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

namestring

Up to 100 characters.

phonestring

Up to 32 characters.

documentstring

Document.

document_typestring

Document 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_idinteger

Country. Valid ids come from `GET /catalog/countries`.

job_titlestring

Job title.

timezonestring

IANA time zone.

Errors

  • 422api_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"
  }'
Response
{
  "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"
  }
}