Get Authenticated User

Get Authenticated User

GET

/api/portal/v1/auth/whoami

Description

Return the user record associated with the bearer token used for the request. This is typically used by client applications to load the current user’s profile after authenticating.

Authentication

This endpoint requires a Bearer token in the Authorization header.

  • Authorization: Bearer <token>. A valid Portal API session token or API token.

Response Schema

The endpoint returns the authenticated user record.

  • userId: The user’s unique identifier.
  • username: The user’s login username.
  • isAdmin: true if the user has administrator privileges on this OEM instance, otherwise false. Administrators have elevated privileges and have access to management endpoints under Users & Team.
  • isAccountOwner: true if the user is the owner of the account, otherwise false.
  • account.id: The ID of the account the user belongs to.
  • account.name: The display name of the account.

Error Responses

  • 401 Unauthorized: The Authorization header is missing or the token is not valid.
Example Request
GET https://<your-host>:9909/api/portal/v1/auth/whoami
Authorization: Bearer <token>

Example Response
Status Code: 200 OK
Response Body:
{
    "userId": 1,
    "username": "admin",
    "isAdmin": true,
    "isAccountOwner": false,
    "account": {
        "id": 1,
        "name": "Default"
    }
}
VectorCharts.com © 2024, Zydro Marine Technologies, Inc. · vectorcharts.com