> ## 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.

# Update user profile

> Update the authenticated shopper's name, phone, or avatar.

## Request

```http theme={null}
PATCH /user
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
Content-Type: application/json

{
    "name": "Jane Smith",
    "phone": "08099887766"
}
```

## Body parameters

| Field    | Type   | Description                                |
| -------- | ------ | ------------------------------------------ |
| `name`   | string | Optional. Display name (1–120 characters). |
| `phone`  | string | Optional. 6–20 characters.                 |
| `avatar` | string | Optional. Absolute URL to an avatar image. |

<Note>
  At least one field must be supplied. An empty body returns `400`.
</Note>

## Successful response

```json theme={null}
{
    "status": 200,
    "success": true,
    "message": "User profile updated",
    "data": {
        "user": {
            "_id": "651f8a1b2c3d4e5f60718293",
            "name": "Jane Smith",
            "email": "jane@example.com",
            "phone": "08099887766",
            "role": "user",
            "avatar": "https://cdn.salesive.com/avatars/jane.webp",
            "updatedAt": "2026-06-18T03:21:00.000Z"
        }
    }
}
```

## Error response

```json theme={null}
{
    "status": 400,
    "success": false,
    "message": "\"value\" must have at least 1 key",
    "data": {}
}
```


## OpenAPI

````yaml PATCH /user
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:
  /user:
    patch:
      summary: Update current user profile
      description: >-
        Update the authenticated shopper's `name`, `phone`, and/or `avatar`. At
        least one field is required.
      parameters:
        - $ref: '#/components/parameters/XShopIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              minProperties: 1
              properties:
                name:
                  type: string
                  example: Jane Smith
                phone:
                  type: string
                  example: '08099887766'
                avatar:
                  type: string
                  format: uri
      responses:
        '200':
          description: Profile updated.
          content:
            application/json:
              schema:
                type: object
        '400':
          description: No valid fields provided.
        '401':
          description: Authentication required.
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.

````