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

# Update user address

> Update the physical address for a user account.



## OpenAPI

````yaml PATCH /users/me/address
openapi: 3.0.3
info:
  title: Wealthyhood Users API
  version: 1.0.0
  description: >
    User management endpoints for creating and managing user accounts in the
    Wealthyhood platform.


    All requests require a bearer access token with the advertised scopes, and
    must include 

    appropriate authentication headers.
servers:
  - url: https://{host}
    variables:
      host:
        default: api.wealthyhood.com
        description: Wealthyhood API host name.
security:
  - bearerAuth: []
tags:
  - name: Users
    description: Create and manage user accounts.
paths:
  /users/me/address:
    patch:
      tags:
        - Users
      summary: Update user address
      description: >
        Update the physical address for a B2B user. An existing address is
        overwritten.


        **Headers:**

        - `x-user-id`: MongoDB ObjectId of the user to update.
      operationId: updateUserAddress
      parameters:
        - name: x-user-id
          in: header
          required: true
          description: MongoDB ObjectId of the authenticated user
          schema:
            type: string
            pattern: ^[a-f0-9]{24}$
          example: 64f0c51e7fb3fc001234a001
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateUserAddressRequest'
            example:
              address:
                line1: 15 Ermou Street
                line2: Apartment 4B
                city: Athens
                postalCode: 10563
                countryCode: GR
      responses:
        '204':
          description: Address updated successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
components:
  schemas:
    UpdateUserAddressRequest:
      type: object
      required:
        - address
      properties:
        address:
          type: object
          description: Physical address. Overwrites any existing address.
          required:
            - line1
            - city
            - postalCode
            - countryCode
          properties:
            line1:
              type: string
              description: First line of address
              minLength: 1
              example: 15 Ermou Street
            line2:
              type: string
              description: Second line of address (optional)
              example: Apartment 4B
            city:
              type: string
              description: City or town
              minLength: 1
              example: Athens
            postalCode:
              type: string
              description: Postal or ZIP code
              minLength: 1
              example: 10563
            countryCode:
              type: string
              description: Two-letter ISO country code
              pattern: ^[A-Z]{2}$
              example: GR
      additionalProperties: false
    ApiErrorResponse:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        error:
          type: object
          properties:
            message:
              type: string
              description: Error message
            description:
              type: string
              description: Additional error details
              nullable: true
        responseId:
          type: string
          format: uuid
          description: Unique identifier for this error response
      additionalProperties: false
  responses:
    BadRequestError:
      description: Validation failure or business rule violation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          examples:
            invalidEmail:
              summary: Invalid email format
              value:
                status: 400
                error:
                  message: Invalid email address format
                responseId: 3f0fd3bf-a2ff-4c0e-9b1d-5d7055dbf6cd
            missingFields:
              summary: Missing required fields
              value:
                status: 400
                error:
                  message: 'Missing required fields: firstName, lastName'
                responseId: 3f0fd3bf-a2ff-4c0e-9b1d-5d7055dbf6cd
            addressCountryMismatch:
              summary: Address country code mismatch
              value:
                status: 400
                error:
                  message: Address countryCode must match residencyCountry
                responseId: 3f0fd3bf-a2ff-4c0e-9b1d-5d7055dbf6cd
    UnauthorizedError:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: 401
            error:
              message: Unauthorized - Invalid or missing authentication token
            responseId: 145f2b0d-1d5b-4e91-8d0d-7af0ae9ad13a
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Auth0-issued access token that includes the scopes listed for the
        endpoint.

````