---
title: "Get the principal document for the active user"
method: GET
path: "/myPrincipal"
tags: ["Authentication"]
---

# Get the principal document for the active user

`GET /myPrincipal`

## Request

- Base URL: `https://example.itential.io`
- URL: `https://example.itential.io/myPrincipal`
- Auth: none declared

Returns the principal for the active user.

## Response `200`

The principal document for the logged in user

- AuthenticationGetMyPrincipalResponse200
  - `id` string: String representation of a MongoDB ObjectId
  - `provenance` string: The name of the AAA adapter from which the user logged in
  - `username` string: The username of the logged in user
  - `firstname` string: The first name of the logged in user
  - `groups` MyPrincipalGetResponsesContentApplicationJsonSchemaGroupsItems[]: An array of groups which contain the logged in user
    - `id` string: String representation of a MongoDB ObjectId
    - `provenance` string: The name of the AAA adapter which contains the group
    - `name` string: The name of the group
  - `roles` IapCommonSchemaObjectId[]: Array of roles user has access to
  - `roleNames` string[]: Array of role names user has access to
  - `allowedMethods` MyPrincipalGetResponsesContentApplicationJsonSchemaAllowedMethodsItems[]: The API methods which a user has access to
    - `provenance` string: The service which contains the method
    - `name` string: The name of the method
  - `allowedViews` MyPrincipalGetResponsesContentApplicationJsonSchemaAllowedViewsItems[]: The URL pages which a user has access to
    - `provenance` string: The service which contains the view
    - `path` string: The URL route to the view
  - `routes` string[]: Array of routes logged in user has access to

## Other responses

- `500`: Error response from API

---

[API](https://skmtc.dev/itential/apis/itential-2.md) - [All operations](https://skmtc.dev/itential/apis/itential-2/llms.txt) - [OpenAPI document](https://skmtc.dev/itential/apis/itential-2/revisions/2095cc90e583?raw)
