# Update mailbox

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/mailboxes:
    put:
      summary: Update mailbox
      deprecated: false
      description: "This endpoint allows updating mailbox details, including:\n\n- First Name  \n- Last Name  \n- Username  \n- Profile Picture  \n\nUse this endpoint to make modifications to mailbox information as needed.\n\n### mailboxData\n- **Type**: `array`\n- **Description**: An array of mailboxes to be updated. Each mailbox object should include:\n\n  - **mailboxId** (string): The unique ID of the mailbox.\n  - **firstName** (string): The updated first name.\n  - **lastName** (string): The updated last name.\n  - **username** (string): The updated username.\n  - **profilePicture** (string): The URL or path to the new profile picture. Leave empty to keep the current picture.\n  - **removeProfilePicture** (boolean): Set to `true` if you want to remove the current profile picture; otherwise, set to `false`.\n\n### Validation Rules\n1.\tPayload Structure\n    -\t**mailboxData** must be a non-empty array.\n    -\tEach mailbox object must include all required fields.\n2.\t**username**\n    -\tMust follow valid email username rules:\n    -\tCannot start or end with ., _, or -\n    -\tCannot contain consecutive ., _, or -\n    -\tMust be alphanumeric or include valid symbols ., _, -\n3.\t**profilePicture**\n    -\tIf profilePicture is provided, it must be a valid URL or path string.\n    -\tIf **removeProfilePicture** is true, profilePicture can be ignored.\n4.\t**mailboxId** (Optional)\n    -\tIf provided, must match one of the mailboxIds in mailboxData.\n\n> **NOTE**: At least one of these **mailboxId, domainId, userId** is required\n"
      tags:
        - mailbox
      parameters:
        - name: x-auth-zapmail
          in: header
          description: ''
          required: true
          example: ''
          schema:
            type: string
        - name: x-workspace-key
          in: header
          description: ''
          required: false
          example: ''
          schema:
            type: string
        - name: ' x-service-provider'
          in: header
          description: ''
          required: false
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                mailboxData:
                  type: array
                  items:
                    type: object
                    properties:
                      userId:
                        type: string
                      firstName:
                        type: string
                      lastName:
                        type: string
                      username:
                        type: string
                      removeProfilePicture:
                        type: boolean
                      mailboxId:
                        type: string
                      domainId:
                        type: string
                      profilePicture:
                        type: string
                    x-apidog-orders:
                      - userId
                      - firstName
                      - lastName
                      - username
                      - removeProfilePicture
                      - mailboxId
                      - domainId
                      - profilePicture
              required:
                - mailboxData
              x-apidog-orders:
                - mailboxData
            example:
              mailboxData:
                - userId: f47ac10b-58cc-4372-a567-0e02b2c3d479
                  firstName: Alice
                  lastName: Johnson
                  username: alice.johnson
                  removeProfilePicture: true
                - mailboxId: 6ba7b810-9dad-11d1-80b4-00c04fd430c8
                  firstName: Bob
                  lastName: Wilson
                - domainId: 6ba7b811-9dad-11d1-80b4-00c04fd430c8
                  firstName: Charlie
                  lastName: Brown
                  profilePicture: https://cdn.example.com/charlie.jpg
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                status: 200
                message: User details changes are in progress
                data:
                  - mailboxId: a9a0feda-ca3a-435c-a357-385d36e92f5a
                    profileUrl: ''
                    failureDetails: []
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: mailbox
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/797058/apis/api-13490429-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.zapmail.ai/api
    description: Prod Env
security: []

```
