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

# Update contact

> Updates and persists attributes of an existing contact for the user.



## OpenAPI

````yaml /raas/swagger-partner.json put /user/contacts/{userToken}
openapi: 3.0.0
info:
  title: ''
  version: 0.0.1
servers:
  - url: https://raas-partner-cv.nomas.cash/v1
security: []
paths:
  /user/contacts/{userToken}:
    put:
      tags:
        - Contacts
      summary: Update contact
      description: Updates and persists attributes of an existing contact for the user.
      operationId: updateContact
      parameters:
        - description: User token (contact owner).
          in: path
          name: userToken
          required: true
          schema:
            type: string
      requestBody:
        description: Updated contact attributes.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateContactRequestParams'
            example:
              firstName: Hugo
              lastName: Tru
              phone: '+19166014999'
              email: javier+1@leapfinancial.com
              countryCode: US
      responses:
        '200':
          description: >-
            **200 — OK.** Contact updated.


            **Scenarios for this response**:


            | Scenario | How to reproduce | Typical `code` / body |

            |------------|------------------|------------------------|

            | Update applied | Valid token + existing contact + body. | `{
            "reason": "Contact updated", "code": "OK" }` |


            See also [Full scenario
            matrix](/raas/guides/testing-sandbox#update-contact-scenario-matrix).
          content:
            application/json:
              schema:
                properties:
                  code:
                    type: string
                  reason:
                    type: string
                required:
                  - code
                  - reason
                type: object
              example:
                reason: Contact updated
        '400':
          description: >-
            **400 — Bad request.**


            **Scenarios for this response**:


            | Scenario | How to reproduce | Typical `code` / body |

            |------------|------------------|------------------------|

            | Payload / business rules | Invalid body or contact rules (as
            returned by handler). | `ERROR_*` from `ErrorCodes` |


            See also [Full scenario
            matrix](/raas/guides/testing-sandbox#update-contact-scenario-matrix).
          content:
            application/json:
              schema:
                properties:
                  code:
                    type: string
                  reason:
                    type: string
                required:
                  - code
                  - reason
                type: object
              example:
                reason: Name not provided
        '401':
          description: >-
            **401 — Unauthorized.**


            **Scenarios for this response**:


            | Scenario | How to reproduce | Typical `code` / body |

            |------------|------------------|------------------------|

            | Missing / bad API key | Omit `api_key` or invalid key / wrong
            scope for `partner` + `partner_send`. | OpenAPI `401` via
            `@Response<ErrorResponse>`. |


            See also [Full scenario
            matrix](/raas/guides/testing-sandbox#update-contact-scenario-matrix).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                reason: Missing or invalid API key
        '404':
          description: >-
            **404 — Not found.**


            **Scenarios for this response**:


            | Scenario | How to reproduce | Typical `code` / body |

            |------------|------------------|------------------------|

            | Unknown path user | `userToken` does not resolve to a stored user.
            | `ERROR_USER_NOT_FOUND` |


            See also [Full scenario
            matrix](/raas/guides/testing-sandbox#update-contact-scenario-matrix).
          content:
            application/json:
              schema:
                properties:
                  code:
                    type: string
                  reason:
                    type: string
                required:
                  - code
                  - reason
                type: object
              example:
                reason: User not found
        '500':
          description: >-
            **500 — Internal server error.**


            **Scenarios for this response**:


            | Scenario | How to reproduce | Typical `code` / body |

            |------------|------------------|------------------------|

            | Update failed | Storage / unexpected errors. |
            `ERROR_INTERNAL_SERVER_ERROR` |


            See also [Full scenario
            matrix](/raas/guides/testing-sandbox#update-contact-scenario-matrix).
          content:
            application/json:
              schema:
                properties:
                  code:
                    type: string
                  reason:
                    type: string
                required:
                  - code
                  - reason
                type: object
              example:
                reason: An unhandled error has occurred
      security:
        - api_key:
            - partner
            - partner_send
components:
  schemas:
    updateContactRequestParams:
      properties:
        alias:
          type: string
        countryCode:
          type: string
          description: |-
            Country code.
            ISO 3166-1 alpha-2.
        lastName:
          type: string
        firstName:
          type: string
        email:
          type: string
          description: Email address.
        phone:
          type: string
          description: |-
            Phone number with country code.
            Example: `+19166020018`.
      required:
        - phone
      type: object
      description: >-
        `PUT /user/contacts/{userToken}` body for partner **update contact**
        (match existing contact by `phone`).
    ErrorResponse:
      properties:
        detail:
          type: string
        code:
          type: string
        reason:
          type: string
      required:
        - code
        - reason
      type: object
  securitySchemes:
    api_key:
      type: apiKey
      name: api_key
      in: header

````