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

# Update an Alias Account

> Use this endpoint to update the details of an Alias Account.



## OpenAPI

````yaml /en/openapi/v3-current/CRM.yaml patch /v1/holders/{holder_id}/aliases/{alias_id}
openapi: 3.1.0
info:
  title: CRM
  description: >-
    The CRM Integration API is a non-transactional component that provides a set
    of endpoints for managing holders of ledger accounts and their associated
    data. CRM is designed to organize and expose customer data for use by other
    components within the system, facilitating efficient integration and data
    management.
  version: 3.7.1
servers:
  - url: https://crm.sandbox.lerian.net
security: []
tags:
  - name: Holders
paths:
  /v1/holders/{holder_id}/aliases/{alias_id}:
    patch:
      tags:
        - Alias Accounts API
      summary: Update an Alias Account
      description: Use this endpoint to update the details of an Alias Account.
      parameters:
        - name: holder_id
          in: path
          description: The unique identifier of the Holder.
          required: true
          example: ''
          schema:
            type: string
        - name: alias_id
          in: path
          description: The unique identifier of the Alias account.
          required: true
          example: ''
          schema:
            type: string
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/XOrganizationId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAliasRequest'
            example:
              bankingDetails:
                branch: '0001'
                account: '123450'
                type: CACC
                openingDate: '2024-01-01'
                iban: US12345678901234567890
                countryCode: US
                bankId: '12345'
              relatedParties:
                - document: '91315026015'
                  name: John Doe
                  role: PRIMARY_HOLDER
                  startDate: '2024-01-01'
              metadata:
                ad_4a: true
      responses:
        '200':
          description: >-
            Indicates that the resource was successfully created and the
            operation was completed as expected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AliasResponse'
              example:
                id: 01951ad1-9f62-793a-9095-fe7701f94434
                holderId: 0194f0ea-2cb2-78c9-b9be-704ba20a9cd8
                type: LEGAL_PERSON
                document: '91315026015'
                ledgerId: 7b0fb8b-1bd9-4810-9c6d-7e80064fab0c
                accountId: 019c96a0-0c0c-7221-8cf3-13313fb60081
                bankingDetails:
                  branch: '0001'
                  account: '123450'
                  type: CACC
                  openingDate: '2024-01-01'
                  iban: US12345678901234567890
                  countryCode: US
                  bankId: '12345'
                relatedParties:
                  - id: 01951ad2-1234-5678-9abc-def012345678
                    document: '91315026015'
                    name: John Doe
                    role: PRIMARY_HOLDER
                    startDate: '2024-01-01'
                regulatoryFields:
                  participantDocument: '00000000000191'
                metadata:
                  ad_4a: true
                createdAt: '2025-01-01T00:00:00Z'
                updatedAt: '2025-01-01T00:00:00Z'
                deletedAt: null
          headers: {}
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error0001:
                  $ref: '#/components/examples/Error0001'
                Error0002:
                  $ref: '#/components/examples/Error0002'
                Error0004:
                  $ref: '#/components/examples/Error0004'
                Error0005:
                  $ref: '#/components/examples/Error0005'
                Error0007:
                  $ref: '#/components/examples/Error0007'
                Error0012:
                  $ref: '#/components/examples/Error0012'
                Error0022:
                  $ref: '#/components/examples/Error0022'
          headers: {}
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error0006:
                  $ref: '#/components/examples/Error0006'
                Error0008:
                  $ref: '#/components/examples/Error0008'
          headers: {}
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error0014:
                  $ref: '#/components/examples/Error0014'
          headers: {}
      security: []
components:
  parameters:
    Authorization:
      name: Authorization
      in: header
      description: >-
        The authorization token in the 'Bearer <token>' format.  


        **Important:** This header is required if your environment has Access
        Manager enabled. For more information, refer to the [Access
        Manager](/en/access-manager) documentation.
      required: false
      schema:
        type: string
    XOrganizationId:
      name: X-Organization-id
      in: header
      description: The unique identifier of the Organization associated with the request.
      required: true
      schema:
        type: string
        example: 019c96a0-0a98-7287-9a31-786e0809c769
  schemas:
    UpdateAliasRequest:
      description: Details of the updated Alias Account.
      type: object
      properties:
        bankingDetails:
          $ref: '#/components/schemas/BankingDetails'
          description: Details of the Holder's banking account.
        relatedParties:
          description: List of related parties associated with this Alias Account.
          type: array
          items:
            $ref: '#/components/schemas/RelatedPartyRequest'
        regulatoryFields:
          $ref: '#/components/schemas/RegulatoryFields'
          description: Regulatory compliance fields required for specific jurisdictions.
        metadata:
          $ref: '#/components/schemas/Metadata'
    AliasResponse:
      description: Information about the Alias Account.
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the Alias Account.
        holderId:
          type: string
          description: Unique identifier of the Holder.
        type:
          type: string
          description: Type of Holder.
          enum:
            - LEGAL_PERSON
            - NATURAL_PERSON
        document:
          type: string
          description: Holder's identification document.
        ledgerId:
          type: string
          description: Unique identifier of the Midaz Ledger of the related Account.
        accountId:
          type: string
          description: Unique identifier of the related Account.
        bankingDetails:
          $ref: '#/components/schemas/BankingDetails'
          description: Details of the Holder's banking account.
        relatedParties:
          description: List of related parties associated with this Alias Account.
          type: array
          items:
            $ref: '#/components/schemas/RelatedPartyResponse'
        regulatoryFields:
          $ref: '#/components/schemas/RegulatoryFields'
          description: Regulatory compliance fields required for specific jurisdictions.
        metadata:
          $ref: '#/components/schemas/Metadata'
        createdAt:
          type: string
          description: The date when the Alias Account was created.
        updatedAt:
          type: string
          description: The date when the Alias Account was last updated.
        deletedAt:
          type: string
          description: The date when the Alias Account was deleted.
    ErrorMessage:
      description: The response message error.
      type: object
      properties:
        code:
          type: string
          description: A unique, stable identifier for the error.
        title:
          type: string
          description: A brief summary of the issue.
        message:
          type: string
          description: Detailed guidance for resolving the error.
    BankingDetails:
      description: Banking details linked to the user's account.
      type: object
      properties:
        branch:
          description: Branch number or code where the account is held.
          type: string
        account:
          description: Account number or code used to identify the user's account.
          type: string
        type:
          description: Account type (e.g., CACC for checking account).
          type: string
        openingDate:
          description: 'Date when the account was opened (format: YYYY-MM-DD).'
          type: string
          format: date
        closingDate:
          description: 'Date when the account was closed (format: YYYY-MM-DD).'
          type: string
          format: date
        iban:
          description: International Bank Account Number (IBAN) tied to the account.
          type: string
        countryCode:
          description: ISO 3166-1 alpha-2 country code where the bank is based.
          type: string
        bankId:
          description: Bank identifier used to link the account to its institution.
          type: string
    RelatedPartyRequest:
      description: >-
        Information about a related party to be associated with an Alias
        Account.
      type: object
      required:
        - document
        - name
        - role
        - startDate
      properties:
        document:
          description: Identification document of the related party (e.g., CPF or CNPJ).
          type: string
        name:
          description: Full legal name of the related party.
          type: string
        role:
          description: >-
            The type of relationship between the related party and the Alias
            Account.

            * `PRIMARY_HOLDER` – The main account holder.

            * `LEGAL_REPRESENTATIVE` – A person legally authorized to represent
            the holder.

            * `RESPONSIBLE_PARTY` – A person responsible for the account on
            behalf of the holder.
          type: string
          enum:
            - PRIMARY_HOLDER
            - LEGAL_REPRESENTATIVE
            - RESPONSIBLE_PARTY
        startDate:
          description: >-
            Start date of the relationship with the Alias Account (format
            YYYY-MM-DD).
          type: string
          format: date
        endDate:
          description: >-
            End date of the relationship with the Alias Account (format
            YYYY-MM-DD). If not provided, the relationship is considered
            ongoing.
          type: string
          format: date
    RegulatoryFields:
      description: >-
        Regulatory compliance fields required for specific jurisdictions or
        regulatory frameworks.
      type: object
      properties:
        participantDocument:
          description: >-
            The document number of the participant institution (e.g., CNPJ for
            Brazilian financial institutions).
          type: string
    Metadata:
      type: object
      additionalProperties:
        type: string
      description: >-
        An object containing key-value pairs to add as metadata, where the field
        `name` is the key and the field `value` is the value. For example, to
        add a Cost Center, use 'costCenter': 'BR_11101997'.
    RelatedPartyResponse:
      description: Information about a related party associated with an Alias Account.
      type: object
      properties:
        id:
          description: Unique identifier of the related party record.
          type: string
        document:
          description: Identification document of the related party (e.g., CPF or CNPJ).
          type: string
        name:
          description: Full legal name of the related party.
          type: string
        role:
          description: >-
            The type of relationship between the related party and the Alias
            Account.

            * `PRIMARY_HOLDER` – The main account holder.

            * `LEGAL_REPRESENTATIVE` – A person legally authorized to represent
            the holder.

            * `RESPONSIBLE_PARTY` – A person responsible for the account on
            behalf of the holder.
          type: string
          enum:
            - PRIMARY_HOLDER
            - LEGAL_REPRESENTATIVE
            - RESPONSIBLE_PARTY
        startDate:
          description: >-
            Start date of the relationship with the Alias Account (format
            YYYY-MM-DD).
          type: string
          format: date
        endDate:
          description: >-
            End date of the relationship with the Alias Account (format
            YYYY-MM-DD).
          type: string
          format: date
  examples:
    Error0001:
      value:
        code: CRM-0001
        title: Invalid Metadata Nesting
        message: >-
          The metadata object cannot contain nested values. Please ensure that
          the value %v is not nested and try again.
      summary: Invalid Metadata Nesting
    Error0002:
      value:
        code: CRM-0002
        title: Metadata Key Length Exceeded
        message: >-
          The metadata key %v exceeds the maximum allowed length of %v
          characters. Please use a shorter key.
      summary: Metadata Key Length Exceeded
    Error0004:
      value:
        code: CRM-0004
        title: Invalid Field Type
        message: >-
          Your request contains one or more fields with an invalid data type.
          Please refer to the documentation to verify that all fields have the
          correct type.
      summary: Invalid Field Type
    Error0005:
      value:
        code: CRM-0005
        title: Invalid Path Parameter
        message: >-
          One or more path parameters are in an incorrect format. Please check
          the following parameters %v and ensure they meet the required format
          before trying again.
      summary: Invalid Path Parameter
    Error0007:
      value:
        code: CRM-0007
        title: Unexpected Fields in the Request
        message: >-
          The request body contains more fields than expected. Please send only
          the allowed fields as per the documentation. The unexpected fields are
          listed in the fields object.
        fields: '{{field}}: {{field.value}}'
      summary: Unexpected Fields in the Request
    Error0012:
      value:
        code: CRM-0012
        title: Metadata Value Length Exceeded
        message: >-
          The metadata value %v exceeds the maximum allowed length of %v
          characters. Please use a shorter value.
      summary: Metadata Value Length Exceeded
    Error0022:
      value:
        code: CRM-0022
        title: Invalid Header Value
        message: >-
          One or more headers have invalid values. Please check the following
          headers %v and ensure they contain valid UUIDs before trying again.
      summary: Invalid Header Value
    Error0006:
      value:
        code: CRM-0006
        title: Holder ID Not Found
        message: >-
          The provided holder ID does not exist in our records. Please verify
          the holder ID and try again.
      summary: Holder ID Not Found
    Error0008:
      value:
        code: CRM-0008
        title: Alias ID Not Found
        message: >-
          The provided alias ID does not exist in our records. Please verify the
          account ID and try again.
      summary: Alias ID Not Found
    Error0014:
      value:
        code: CRM-0014
        title: Internal Server Error
        message: >-
          The server encountered an unexpected error. Please try again later or
          contact support.
      summary: Internal Server Error

````