> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salesive.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get authenticated user

> Validate a shopper token and retrieve the current session profile.

## Request

```http theme={null}
GET /auth/me
Authorization: Bearer {token}
x-shop-id: {shopId}
```

## Headers

| Header          | Type   | Description                                             |
| --------------- | ------ | ------------------------------------------------------- |
| `Authorization` | string | Provide the shopper token in the format `Bearer <jwt>`. |
| `x-shop-id`     | string | Shop identifier to associate the user with your store.  |

## Successful response

```json theme={null}
{
    "status": 200,
    "success": true,
    "message": "Authenticated user retrieved successfully",
    "data": {
        "user": {
            "_id": "669d5dcf3cc9c8596ec0f302",
            "name": "Jane Smith",
            "email": "jane@example.com",
            "phone": "08099887766",
            "role": "user",
            "shopRole": null,
            "stores": [],
            "avatar": "https://cdn.salesive.com/u/avatar.png",
            "authMethod": "google",
            "balance": 0,
            "deleted": false,
            "disabled": false,
            "createdAt": "2025-02-11T09:15:22.293Z",
            "updatedAt": "2025-11-12T18:04:55.121Z"
        },
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
        "tokenExpiresAt": "2026-07-09T08:43:17.000Z"
    }
}
```

<Check>
  You confirm the token is still valid when you receive the shopper profile
  and the `tokenExpiresAt` timestamp.
</Check>

## Error response

```json theme={null}
{
    "status": 401,
    "success": false,
    "message": "Authentication required",
    "data": {}
}
```

<Warning>
  A 401 response means the token is missing, expired, or revoked. Prompt the
  shopper to re-authenticate before retrying.
</Warning>


## OpenAPI

````yaml GET /auth/me
openapi: 3.1.0
info:
  title: Salesive Store API
  description: >-
    REST interface for querying products, categories, and merchandising banners
    exposed by Salesive storefronts.
  version: 1.0.0
servers:
  - description: Production
    url: https://store.salesive.com/api/v1
security:
  - BearerAuth: []
    ShopIdHeader: []
paths:
  /auth/me:
    get:
      summary: Get authenticated user
      description: Retrieve the profile information of the currently authenticated user.
      parameters:
        - $ref: '#/components/parameters/XShopIdHeader'
      responses:
        '200':
          description: User profile retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - success
                  - message
                  - data
                properties:
                  status:
                    type: integer
                    example: 200
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Authenticated user retrieved successfully
                  data:
                    type: object
                    required:
                      - user
                      - token
                    properties:
                      user:
                        type: object
                        properties:
                          _id:
                            type: string
                          name:
                            type: string
                          email:
                            type: string
                          role:
                            type: string
                      token:
                        type: string
                      tokenExpiresAt:
                        type: string
                        format: date-time
        '401':
          description: Not authenticated.
      security: []
components:
  parameters:
    XShopIdHeader:
      name: x-shop-id
      in: header
      description: >-
        Optional identifier that scopes responses to a specific storefront when
        the referer cannot be inferred.
      required: false
      schema:
        type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT issued by the Salesive Store API for authenticated shoppers.
    ShopIdHeader:
      type: apiKey
      in: header
      name: x-shop-id
      description: >-
        Optional storefront identifier sent as a header to scope responses to a
        specific shop. Try It requests remember this value once provided.

````