# User Profile & Roles

Retrieve information about the authenticated user to determine their context and permissions. The response structure varies slightly depending on the user's **Role**.

Brand Group User

role: "brandGroup"

Manages a holding or franchise group. Has a `brandGroupId`. Can access multiple brands.

Brand User

role: "brand"

Manages a specific brand. Has a `brandId`. Full access to the brand and all its restaurants.

Restaurant User

role: "restaurant"

Restricted to specific locations. Has access to one or more restaurants listed in the `restaurants` array.

### `GET /oauth/me` - Get Current User

Retrieve detailed information about the currently authenticated user.

#### Response

```json
{
  "status": 200,
  "code": "user_succeed",
  "data": {
    "userId": 100500,
    "firstName": "Admin User",
    "email": "admin@innovorder.com",
    "role": "brand",
    "brandId": 100,
    "brandGroupId": null,
    "accessFlags": {
      "CAN_EDIT_AREAS": true,
      "MENU_EDIT": true
    },
    "brands": [
      {
        "brandId": 100,
        "name": "Innovorder Burgers"
      }
    ],
    "restaurants": [
      {
        "restaurantId": 200,
        "name": "Innovorder Burgers Paris"
      }
    ]
  }
}
```

##### Response Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| status | integer | 200 | HTTP status code returned by the API. |
| code | string | "user\_succeed" | Machine-readable application code for the result. |
| data | object | {…} | Endpoint-specific response payload. |
| data.userId | integer | 100500 | Identifier of the user. |
| data.firstName | string | "Admin User" | The first name value. |
| data.email | string | "admin@innovorder.com" | Email address. |
| data.role | string | "brand" | The role value. |
| data.brandId | integer | 100 | Identifier of the brand. |
| data.brandGroupId | null | null | Identifier of the associated brand group. |
| data.accessFlags | object | {…} | Object containing access flags fields. |
| data.accessFlags.CAN\_EDIT\_AREAS | boolean | true | The can edit areas value. |
| data.accessFlags.MENU\_EDIT | boolean | true | The menu edit value. |
| data.brands | array | \[…\] | List of brands entries. |
| data.brands\[\] | object | {…} | Object containing brands fields. |
| data.brands\[\].brandId | integer | 100 | Identifier of the brand. |
| data.brands\[\].name | string | "Innovorder Burgers" | The name value. |
| data.restaurants | array | \[…\] | List of restaurants entries. |
| data.restaurants\[\] | object | {…} | Object containing restaurants fields. |
| data.restaurants\[\].restaurantId | integer | 200 | Identifier of the restaurant. |
| data.restaurants\[\].name | string | "Innovorder Burgers Paris" | The name value. |

#### Key Context Fields

role

Determines the user's scope.

-   `brandGroup`: Root level access. Use the **Brand Groups** section to navigate.
-   `brand`: Brand level access. Use `brandId` for API calls.
-   `restaurant`: Location level access. Use `restaurants` list to find accessible `restaurantId`s.

accessFlags

A map of boolean flags representing specific granular permissions (e.g., `MENU_EDIT`).
