> ## 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 tax residency

> Update the tax residency information for a user account.



## OpenAPI

````yaml PATCH /users/me/tax-residency
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/tax-residency:
    patch:
      tags:
        - Users
      summary: Update user tax residency
      description: >
        Update the tax residency information for a B2B user. An existing entry
        is overwritten.


        **Headers:**

        - `x-user-id`: MongoDB ObjectId of the user to update.
      operationId: updateUserTaxResidency
      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/UpdateUserTaxResidencyRequest'
            example:
              taxResidency:
                countryCode: GR
                proofType: TIN
                value: '123456789'
      responses:
        '204':
          description: Tax residency updated successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
components:
  schemas:
    UpdateUserTaxResidencyRequest:
      type: object
      required:
        - taxResidency
      properties:
        taxResidency:
          type: object
          description: Tax residency information. Overwrites any existing entry.
          required:
            - countryCode
            - proofType
            - value
          properties:
            countryCode:
              type: string
              description: Two-letter ISO country code for tax residency
              pattern: ^[A-Z]{2}$
              example: GR
            proofType:
              type: string
              description: >-
                Type of tax identification. Valid values are "NINO" (for UK) or
                "TIN" (for all other countries).
              enum:
                - NINO
                - TIN
              example: TIN
            value:
              type: string
              description: Tax identification number
              example: '123456789'
      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.

````