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

# Atualizar número (privacidade + settings)

> Atualização PARCIAL do número: só o que vier no corpo muda. **Não existe** `POST /v1/numbers/{id}/settings` — configuração de número é este PATCH, e o `syncFullHistory` da Evolution API não tem equivalente aqui (use `settings.historyImportEnabled`).

`piiMode` controla a retenção das conversas e é obrigatório acompanhar `piiRetentionDays` (1–3650) quando for `STORE_X_DAYS`.

O bloco `settings` tem dois grupos. `historyImportEnabled`, `webhookHistoricalMessages` e `ignoreNewsletters` valem para qualquer provider — o último descarta publicação de Canal (`@newsletter`) na entrada, antes da conversa, da mensagem guardada e do webhook. Os outros seis são os `advancedSettings` do Evolution GO e só se aplicam a número não-oficial (conectado por QR) — em número Meta eles são aceitos e guardados, mas nunca aplicados, e a resposta avisa isso em `settings.appliesTo.advanced: "none"`. Mandar `null` num campo do GO **volta ao default do provider**; não é `false`.

Os campos do GO também são empurrados para as instâncias conectadas do número; o resultado vem em `settingsSync`. O push é best-effort: instância fora do ar não faz o PATCH falhar, e o valor persistido é reaplicado no próximo provisionamento.

Corpo sem nenhum campo reconhecido é `400 EMPTY_PATCH` — não é no-op silencioso.



## OpenAPI

````yaml openapi.pt.json PATCH /v1/numbers/{id}
openapi: 3.1.0
info:
  title: API Pilot Status
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    API REST pública do Pilot Status. Autentique com o header `x-api-key:
    ps_...` (ou `x-api-key-id`). Base URL: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/numbers/{id}:
    patch:
      tags:
        - Numbers
      summary: Atualizar número (privacidade + settings)
      description: >-
        Atualização PARCIAL do número: só o que vier no corpo muda. **Não
        existe** `POST /v1/numbers/{id}/settings` — configuração de número é
        este PATCH, e o `syncFullHistory` da Evolution API não tem equivalente
        aqui (use `settings.historyImportEnabled`).


        `piiMode` controla a retenção das conversas e é obrigatório acompanhar
        `piiRetentionDays` (1–3650) quando for `STORE_X_DAYS`.


        O bloco `settings` tem dois grupos. `historyImportEnabled`,
        `webhookHistoricalMessages` e `ignoreNewsletters` valem para qualquer
        provider — o último descarta publicação de Canal (`@newsletter`) na
        entrada, antes da conversa, da mensagem guardada e do webhook. Os outros
        seis são os `advancedSettings` do Evolution GO e só se aplicam a número
        não-oficial (conectado por QR) — em número Meta eles são aceitos e
        guardados, mas nunca aplicados, e a resposta avisa isso em
        `settings.appliesTo.advanced: "none"`. Mandar `null` num campo do GO
        **volta ao default do provider**; não é `false`.


        Os campos do GO também são empurrados para as instâncias conectadas do
        número; o resultado vem em `settingsSync`. O push é best-effort:
        instância fora do ar não faz o PATCH falhar, e o valor persistido é
        reaplicado no próximo provisionamento.


        Corpo sem nenhum campo reconhecido é `400 EMPTY_PATCH` — não é no-op
        silencioso.
      operationId: patch_numbers_id
      parameters:
        - name: id
          in: path
          required: true
          description: WhatsApp number id.
          schema:
            type: string
          example: num_01HZX...
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                piiMode:
                  type: string
                  enum:
                    - STORE_INDEFINITE
                    - STORE_X_DAYS
                    - RELAY_ONLY
                  description: >-
                    Conversation retention policy. Optional — omit it to change
                    only `settings`.
                  example: STORE_X_DAYS
                piiRetentionDays:
                  type:
                    - integer
                    - 'null'
                  minimum: 1
                  maximum: 3650
                  description: >-
                    Required (1–3650) when `piiMode` is `STORE_X_DAYS`; forced
                    to null otherwise.
                  example: 30
                settings:
                  type: object
                  description: 'Per-number settings. Partial: only the keys you send change.'
                  properties:
                    historyImportEnabled:
                      type: boolean
                      description: >-
                        Import the history the provider dumps on connect.
                        Default **false**: the number starts existing at the
                        moment it connected. Ask for it HERE, on creation — the
                        provider hands the history over in a single burst right
                        after the connection and it cannot be requested again,
                        so a PATCH after creating races that burst. Numbers
                        created before 2026-08-26 keep whatever they had.
                      example: false
                    webhookHistoricalMessages:
                      type: boolean
                      description: >-
                        Deliver those historical messages to your webhooks.
                        Default `false`: every reconnect replays the history and
                        your integration cannot tell it apart from new traffic
                        (on the FREE plan it would also consume inbound quota).
                        To READ history use `GET /v1/messages/history`.
                      example: false
                    ignoreNewsletters:
                      type: boolean
                      description: >-
                        Drop WhatsApp Channel (`@newsletter`) posts on arrival:
                        no conversation, no stored message, no webhook. Default
                        `false`, so a number that receives channels today keeps
                        receiving them. This is NOT an Evolution GO field: the
                        provider has no `@newsletter` gate to push it to (unlike
                        `ignoreGroups`, which it applies itself), so a channel
                        post always reaches the platform and can only be refused
                        here. An official Meta number never receives channels at
                        all.
                      example: false
                    alwaysOnline:
                      type:
                        - boolean
                        - 'null'
                      description: >-
                        Keep the WhatsApp presence permanently online.
                        Unofficial (Evolution GO) numbers only. `null` resets to
                        the provider default.
                      example: false
                    rejectCall:
                      type:
                        - boolean
                        - 'null'
                      description: >-
                        Auto-reject incoming calls. Unofficial numbers only.
                        `null` resets to the provider default.
                      example: true
                    msgRejectCall:
                      type:
                        - string
                        - 'null'
                      maxLength: 1000
                      description: >-
                        Text replied when a call is rejected (empty string = no
                        reply). Unofficial numbers only. `null` resets to the
                        provider default.
                      example: I don't take calls here
                    readMessages:
                      type:
                        - boolean
                        - 'null'
                      description: >-
                        Mark every received message as read. Unofficial numbers
                        only. `null` resets to the provider default.
                      example: false
                    ignoreGroups:
                      type:
                        - boolean
                        - 'null'
                      description: >-
                        Drop group messages inside the provider. Note the field
                        name: this is the Evolution GO dialect (`ignoreGroups`),
                        NOT the v2 `groupsIgnore`. Setting it explicitly beats
                        the value derived from your group webhook subscriptions.
                        Unofficial numbers only.
                      example: false
                    ignoreStatus:
                      type:
                        - boolean
                        - 'null'
                      description: >-
                        Drop status/stories updates. Unofficial numbers only.
                        `null` resets to the provider default.
                      example: false
      responses:
        '200':
          description: Updated number
          content:
            application/json:
              example:
                id: num_01HZX...
                number: '+5511999999999'
                name: Atendimento
                provider: WEB
                state: OPEN
                isFullyConnected: true
                piiMode: STORE_X_DAYS
                piiRetentionDays: 30
                settings:
                  historyImportEnabled: false
                  webhookHistoricalMessages: false
                  ignoreNewsletters: false
                  alwaysOnline: null
                  rejectCall: true
                  msgRejectCall: I don't take calls here
                  readMessages: null
                  ignoreGroups: null
                  ignoreStatus: null
                  appliesTo:
                    history: all
                    advanced: evolution-go
                settingsSync:
                  applied: 1
                  failed: 0
                  skipped: 0
                health:
                  qualityRating: null
                  messagingLimitTier: null
                  metaStatus: null
                  code: null
                  reason: null
                  sendable: true
                meta: null
        '400':
          description: Invalid settings, or nothing to update
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              examples:
                invalidSettings:
                  summary: INVALID_SETTINGS
                  value:
                    error: settings.rejectCall must be a boolean or null
                    code: INVALID_SETTINGS
                emptyPatch:
                  summary: EMPTY_PATCH
                  value:
                    error: Nothing to update — send `piiMode` and/or `settings`
                    code: EMPTY_PATCH
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: Unauthorized
        '404':
          description: Number not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: Number not found
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Sua chave de API ps_
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: Id da chave de API (alternativa ao x-api-key)

````