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

# Atualizar número virtual

> Atualiza informações de um número virtual móvel.

<Warning>Para utilizar nossas APIs e Webhooks de linhas virtuais, é necessário aderir ao nosso [manual de branding](/api-reference/branding)</Warning>

Este endpoint permite a atualização das informações de um número virtual móvel, como nome, centro de custo, colaborador associado e campos customizados.


## OpenAPI

````yaml PATCH /api/v2/virtual-phone-accounts/{id}
openapi: 3.1.0
info:
  version: 1.0.0
  title: Salvy API
  x-logo:
    url: web/logo.png
servers:
  - url: https://api.salvy.com.br
    description: Salvy API URL
security:
  - bearerAuth: []
tags:
  - name: Public API
  - name: Outgoing Webhooks
paths:
  /api/v2/virtual-phone-accounts/{id}:
    patch:
      tags:
        - Public API
      description: Atualiza informações de um número virtual móvel.
      operationId: publicUpdateMobileVirtualPhoneAccount
      parameters:
        - name: id
          in: path
          required: true
          schema:
            $schema: https://json-schema.org/draft/2020-12/schema
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                name:
                  description: >-
                    Nome do número virtual. Utilize para facilitar a gestão dos
                    números virtuais.
                  example: Meu Número Virtual
                  anyOf:
                    - type: string
                    - type: 'null'
                costCenter:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Centro de custo associado ao número virtual.
                  example: marketing
                employeeId:
                  description: >-
                    ID do colaborador associado ao número virtual. Envie null
                    para desassociar.
                  example: 0140a8c6-3815-45b7-9e60-8e137cad845c
                  anyOf:
                    - type: string
                    - type: 'null'
                customFields:
                  description: >-
                    Campos customizados associados ao número virtual. Os campos
                    devem ser criados previamente no [dashboard da
                    Salvy](https://app.salvy.com.br/settings/custom-fields);
                    labels inexistentes serão ignorados.
                  example:
                    - label: Departamento
                      value: Vendas
                  type: array
                  items:
                    type: object
                    properties:
                      label:
                        type: string
                      value:
                        type: string
                    required:
                      - label
                      - value
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  id:
                    example: 0140a8c6-3815-45b7-9e60-8e137cad845c
                    title: UUID
                    type: string
                    description: A valid UUID string, in any version.
                    examples:
                      - 123e4567-e89b-12d3-a456-426614174000
                      - 123e4567-e89b-12d3-a456-426614174001
                  name:
                    description: >-
                      Nome do número virtual. Utilize para facilitar a gestão
                      dos números virtuais.
                    example: Meu Número Virtual
                    anyOf:
                      - type: string
                      - type: 'null'
                  phoneNumber:
                    description: >-
                      Número virtual recém-criado, formatado conforme o padrão
                      internacional E.164.
                    example: '+551151231234'
                    title: PhoneNumberE164
                    type: string
                    examples:
                      - '+5511999999999'
                      - '+551139999999'
                  status:
                    type: string
                    enum:
                      - pending
                      - active
                      - blocked
                      - canceled
                  createdAt:
                    type: string
                    format: date-time
                  canceledAt:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: 'null'
                  cancelReason:
                    anyOf:
                      - type: string
                      - type: 'null'
                  costCenter:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Centro de custo associado ao número virtual.
                    example: marketing
                  employeeId:
                    anyOf:
                      - title: UUID
                        type: string
                        description: A valid UUID string, in any version.
                        examples:
                          - 123e4567-e89b-12d3-a456-426614174000
                          - 123e4567-e89b-12d3-a456-426614174001
                      - type: 'null'
                    description: ID do colaborador associado ao número virtual.
                    example: 0140a8c6-3815-45b7-9e60-8e137cad845c
                  customFields:
                    type: array
                    items:
                      type: object
                      properties:
                        label:
                          type: string
                        type:
                          type: string
                          enum:
                            - text
                            - select
                        value:
                          type: string
                      required:
                        - label
                        - type
                        - value
                      additionalProperties: false
                    description: Campos customizados associados ao número virtual.
                required:
                  - id
                  - name
                  - phoneNumber
                  - status
                  - createdAt
                  - canceledAt
                  - cancelReason
                  - costCenter
                  - employeeId
                  - customFields
                additionalProperties: false
        '401':
          description: ''
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - unauthorized
                  message:
                    type: string
                  publicDetails:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: string
                required:
                  - code
                  - message
                  - publicDetails
                additionalProperties: false
        '403':
          description: ''
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - forbidden
                  message:
                    type: string
                  publicDetails:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: string
                required:
                  - code
                  - message
                  - publicDetails
                additionalProperties: false
        '404':
          description: ''
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - resource-not-found
                  message:
                    type: string
                  publicDetails:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: string
                required:
                  - code
                  - message
                  - publicDetails
                additionalProperties: false
        '413':
          description: ''
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - payload-too-large
                  message:
                    type: string
                  publicDetails:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: string
                required:
                  - code
                  - message
                  - publicDetails
                additionalProperties: false
        '422':
          description: ''
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - input-validation-error
                      - unprocessable-entity
                      - company-not-active
                  message:
                    type: string
                  publicDetails:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: string
                required:
                  - code
                  - message
                  - publicDetails
                additionalProperties: false
        '500':
          description: ''
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - unknown
                  message:
                    type: string
                  publicDetails:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: string
                required:
                  - code
                  - message
                  - publicDetails
                additionalProperties: false
      deprecated: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: key

````