> ## 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.

# Create contact

> Adds and stores a new contact in the user's address book; prevents duplicate phones.



## OpenAPI

````yaml /raas/swagger-partner.json post /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}:
    post:
      tags:
        - Contacts
      summary: Create contact
      description: >-
        Adds and stores a new contact in the user's address book; prevents
        duplicate phones.
      operationId: createContact
      parameters:
        - description: Owner user token.
          in: path
          name: userToken
          required: true
          schema:
            type: string
      requestBody:
        description: Contact data to register.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createContactRequestParamsPartner'
            example:
              firstName: Hugo
              lastName: Tru
              phone: '+19166014999'
              email: javier+1@leapfinancial.com
              countryCode: US
      responses:
        '200':
          description: >-
            **200 — OK.** Contact persisted.


            **Scenarios for this response**:


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

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

            | Contact created | Valid token + body + unique phone. | `{
            "reason": "Contact created", "code": "OK" }` |


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


            **Scenarios for this response**:


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

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

            | Missing names | Empty `firstName` or `lastName`. |
            `ERROR_NAME_NOT_PROVIDED` / `ERROR_INVALID_NAME` |

            | Missing / bad phone | Missing `phone` or normalization fails. |
            `INVALID_PHONE_NUMBER` / `ERROR_COUNTRY_NOT_SUPPORTED` |

            | Missing country | No `countryCode`. | `ERROR_COUNTRY_NOT_PROVIDED`
            |

            | Duplicate phone | Same phone for same owner. |
            `ERROR_DUPLICATED_PHONE` |


            See also [Full scenario
            matrix](/raas/guides/testing-sandbox#create-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 send an invalid key. |
            Same as `listContacts` — OpenAPI `401` via
            `@Response<ErrorResponse>`. |


            See also [Full scenario
            matrix](/raas/guides/testing-sandbox#create-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#create-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.** Unexpected after validation.


            **Scenarios for this response**:


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

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

            | Unknown failure | Non-`NumiBadRequestError` / non-`NumiError`. |
            `ERROR_INTERNAL_SERVER_ERROR` |


            See also [Full scenario
            matrix](/raas/guides/testing-sandbox#create-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:
    createContactRequestParamsPartner:
      properties:
        alias:
          type: string
          description: Optional label shown in the address book.
        countryCode:
          type: string
          description: |-
            Country code for phone normalization and display.
            **ISO 3166-1 alpha-2**. Example: `US`.
        phone:
          type: string
          description: |-
            Phone number with country code (**E.164**).
            Example: `+19166020018`.
        lastName:
          type: string
          description: |-
            Contact family name.
            Example: `Tru`.
        firstName:
          type: string
          description: |-
            Contact given name(s).
            Example: `Hugo`.
        email:
          type: string
          description: |-
            Email address.
            Example: `name@domain.com`.
      required:
        - countryCode
        - phone
        - lastName
        - firstName
      type: object
      description: >-
        `POST /user/contacts/{userToken}` body for partner **create contact**
        (owner resolved from path).
    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

````