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

# Rename or complete a contact

> Renames a contact and fills in details it is still missing (address, relationship, BIC, bank address). Values already stored are kept as they are, and whatever the payout providers keep about the recipient is updated on their side too. Use this instead of deleting and re-creating a contact to add a field — a re-created contact is a new row, and the provider beneficiary registered for the original stays behind on it.



## OpenAPI

````yaml /openapi.json patch /api/v1/user/contacts/{contact_id}
openapi: 3.1.0
info:
  title: HEVN API
  description: Backend API for HEVN mobile neobank
  version: 0.1.2
servers: []
security: []
paths:
  /api/v1/user/contacts/{contact_id}:
    patch:
      tags:
        - User
      summary: Rename or complete a contact
      description: >-
        Renames a contact and fills in details it is still missing (address,
        relationship, BIC, bank address). Values already stored are kept as they
        are, and whatever the payout providers keep about the recipient is
        updated on their side too. Use this instead of deleting and re-creating
        a contact to add a field — a re-created contact is a new row, and the
        provider beneficiary registered for the original stays behind on it.
      operationId: update_contact_api_v1_user_contacts__contact_id__patch
      parameters:
        - name: contact_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Contact Id
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ContactUpdateRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
            - type: 'null'
          title: Name
        address:
          anyOf:
            - $ref: '#/components/schemas/UserAddress'
            - type: 'null'
        relationship:
          anyOf:
            - $ref: '#/components/schemas/ContactRelationship'
            - type: 'null'
        bic:
          anyOf:
            - type: string
            - type: 'null'
          title: Bic
          description: >-
            BIC for an IBAN contact saved without one — Align requires it on
            IBAN beneficiaries. Ignored when the contact already has a BIC.
        bankAddress:
          anyOf:
            - $ref: '#/components/schemas/BankAddressDetails'
            - type: 'null'
          description: >-
            The beneficiary bank's own address (street + city), required by the
            banking provider payouts. Parts the contact already carries are
            kept; missing ones are filled, so a legacy free-text address can
            gain its city.
      type: object
      title: ContactUpdateRequest
      description: >-
        Request to update a contact.


        The display name is freely mutable. Requisites, address and relationship

        are *fill-only*: a field that is already set on the contact keeps its

        value, and only the still-empty ones are filled in. Recreating the
        contact

        to add a missing field is what produced duplicate rows — the requisites

        identity changes with the added field, so the upsert misses the original

        and its provider account ids are stranded on the deleted row.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UserAddress:
      properties:
        streetAddress:
          anyOf:
            - type: string
            - type: 'null'
          title: Streetaddress
        addressLine2:
          anyOf:
            - type: string
            - type: 'null'
          title: Addressline2
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        country:
          anyOf:
            - $ref: '#/components/schemas/CountryCode'
            - type: 'null'
        zip:
          anyOf:
            - type: string
            - type: 'null'
          title: Zip
      type: object
      title: UserAddress
      description: >-
        Address schema for user.


        Canonical field names: street_address, address_line_2, city, state,
        country, zip.

        Accepts legacy Align/IBAN field names (street_line_1, street_line_2,
        postal_code)

        for backward compatibility with existing JSONB data.
    ContactRelationship:
      type: string
      enum:
        - employee
        - contractor
        - vendor
        - subsidiary
        - merchant
        - customer
        - landlord
        - family
        - other
        - self
      title: ContactRelationship
      description: >-
        How a payout contact relates to the user.


        The vocabulary mirrors Swipelux's recipient relationships so the common

        values project onto their API unchanged, but this is our own domain
        type:

        ``SELF`` marks a first-party payout to the user's own account at another

        bank and has no Swipelux counterpart. Providers own that projection —
        see

        ``SwipeluxRecipients._recipient_relationship`` — so nothing here depends
        on

        a provider, and no provider enum has to carry a value it cannot accept.
    BankAddressDetails:
      properties:
        addressLine1:
          type: string
          title: Addressline1
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        postalCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Postalcode
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
      type: object
      required:
        - addressLine1
      title: BankAddressDetails
      description: >-
        The beneficiary bank's own address, kept apart from the holder's.


        Read/storage shape: only the street is guaranteed, because rows saved
        before

        this was structured hold a single free-text line that validates into

        ``address_line1`` alone. New input goes through BankAddressInput, which

        requires everything the banking provider does.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CountryCode:
      type: string
      enum:
        - AF
        - AX
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BQ
        - BA
        - BW
        - BV
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - CV
        - KH
        - CM
        - CA
        - KY
        - CF
        - TD
        - CL
        - CN
        - CX
        - CC
        - CO
        - KM
        - CG
        - CD
        - CK
        - CR
        - CI
        - HR
        - CU
        - CW
        - CY
        - CZ
        - DK
        - DJ
        - DM
        - DO
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - SZ
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - GF
        - PF
        - TF
        - GA
        - GM
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GU
        - GT
        - GG
        - GN
        - GW
        - GY
        - HT
        - HM
        - VA
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IR
        - IQ
        - IE
        - IM
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KI
        - KP
        - KR
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MH
        - MQ
        - MR
        - MU
        - YT
        - MX
        - FM
        - MD
        - MC
        - MN
        - ME
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - MK
        - MP
        - 'NO'
        - OM
        - PK
        - PW
        - PS
        - PA
        - PG
        - PY
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - RE
        - RO
        - RU
        - RW
        - BL
        - SH
        - KN
        - LC
        - MF
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SX
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - SS
        - ES
        - LK
        - SD
        - SR
        - SJ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TZ
        - TH
        - TL
        - TG
        - TK
        - TO
        - TT
        - TN
        - TR
        - TM
        - TC
        - TV
        - UG
        - UA
        - AE
        - GB
        - US
        - UM
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
      title: CountryCode
      description: ISO 3166-1 alpha-2 country codes.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````