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

# Set Phone Number

> Sets the user's phone number. Creates a cardholder if the user does not have one yet.

If you require users to verify their phone, include `code` from POST /phone/verification; `phone` is optional. Otherwise send `phone` and omit `code`.



## OpenAPI

````yaml https://core.prod.gnosispay.com/user-api/openapi.json post /phone
openapi: 3.1.0
info:
  title: User Service
  version: 0.0.0
servers:
  - url: https://core.prod.gnosispay.com/user-api
    description: Production
    variables: {}
  - url: https://core.sandbox.gnosispay.in/user-api
    description: Sandbox
    variables: {}
security: []
tags:
  - name: Auth
  - name: User
  - name: Terms
  - name: Source of Funds
  - name: Phone
  - name: User Account
  - name: Cards
  - name: User Movements
  - name: KYC
  - name: PCI
  - name: Health
paths:
  /phone:
    post:
      tags:
        - Phone
      summary: Set Phone Number
      description: >-
        Sets the user's phone number. Creates a cardholder if the user does not
        have one yet.


        If you require users to verify their phone, include `code` from POST
        /phone/verification; `phone` is optional. Otherwise send `phone` and
        omit `code`.
      operationId: Phone_createPhone
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePhoneRequest'
      responses:
        '200':
          description: Phone number updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatePhoneSuccess'
        '400':
          description: Bad Request - validation or invalid phone number
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatePhoneBadRequestBody'
        '401':
          description: Unauthorized - Invalid JWT
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: User not found or no cardholder record
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: The request conflicts with the current state of the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatePhoneConflict'
        '422':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneVerificationUnprocessable'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneVerificationBadGateway'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    UpdatePhoneRequest:
      type: object
      properties:
        phone:
          type: string
          minLength: 6
          maxLength: 20
          description: Required unless you require phone verification and send `code`.
        code:
          type: string
          minLength: 6
          maxLength: 6
          pattern: ^[0-9]{6}$
          description: >-
            One-time SMS code from POST /phone/verification. Required if you
            require phone verification for your users; omit otherwise.
    UpdatePhoneSuccess:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
          enum:
            - true
      description: Phone number updated successfully
    UpdatePhoneBadRequestBody:
      type: object
      oneOf:
        - $ref: '#/components/schemas/UpdatePhoneValidationError'
        - $ref: '#/components/schemas/UpdatePhoneBusinessError'
      discriminator:
        propertyName: kind
        mapping:
          validation:
            $ref: '#/components/schemas/UpdatePhoneValidationError'
          business:
            $ref: '#/components/schemas/UpdatePhoneBusinessError'
      description: >-
        Discriminated 400 body for PATCH/POST /phone. The `kind` field is
        additive

        and not a breaking change. Clients can keep reading `success` and
        `error`.
    Error:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
    UpdatePhoneConflict:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
    PhoneVerificationUnprocessable:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
    PhoneVerificationBadGateway:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
    UpdatePhoneValidationError:
      type: object
      required:
        - kind
        - success
        - error
      properties:
        kind:
          type: string
          enum:
            - validation
        success:
          type: boolean
          enum:
            - false
        error:
          $ref: '#/components/schemas/ValidationErrorDetail'
      description: Validation failure on update phone (decoder / request constraints).
    UpdatePhoneBusinessError:
      type: object
      required:
        - kind
        - success
        - error
      properties:
        kind:
          type: string
          enum:
            - business
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
      description: Domain/business failure on update phone (INVALID_PHONE).
    ValidationErrorDetail:
      type: object
      required:
        - name
        - message
      properties:
        name:
          type: string
          enum:
            - ValidationError
        message:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: Bearer

````