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

# Restore number

> Undoes `DELETE /v1/numbers/{id}` within its 30-day window (the `restorableUntil` the delete returned). It restores the number's RECORD — id, API keys, webhooks, history — but NOT its connection: the device was logged out on delete, so reconnect it afterwards (`GET /v1/numbers/{id}/connect`, or re-provisioning at Meta). `404` with `code: RESTORE_WINDOW_EXPIRED` once the 30 days are over; `409 NUMBER_ALREADY_ACTIVE` when the same phone was reconnected meanwhile — use the active number instead.



## OpenAPI

````yaml openapi.json POST /v1/numbers/{id}/restore
openapi: 3.1.0
info:
  title: Pilot Status API
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    Public REST API for Pilot Status. Authenticate with the `x-api-key: ps_...`
    header (or `x-api-key-id`). Base URL: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/numbers/{id}/restore:
    post:
      tags:
        - Numbers
      summary: Restore number
      description: >-
        Undoes `DELETE /v1/numbers/{id}` within its 30-day window (the
        `restorableUntil` the delete returned). It restores the number's RECORD
        — id, API keys, webhooks, history — but NOT its connection: the device
        was logged out on delete, so reconnect it afterwards (`GET
        /v1/numbers/{id}/connect`, or re-provisioning at Meta). `404` with
        `code: RESTORE_WINDOW_EXPIRED` once the 30 days are over; `409
        NUMBER_ALREADY_ACTIVE` when the same phone was reconnected meanwhile —
        use the active number instead.
      operationId: post_numbers_id_restore
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: num_01HZX...
          description: Id of the deleted number (the WhatsApp number id).
      responses:
        '200':
          description: Number restored — reconnection required
          content:
            application/json:
              example:
                ok: true
                requiresReconnect: true
        '401':
          description: Missing or invalid `x-api-key` / `x-api-key-id` header
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unauthorized
        '404':
          description: >-
            Unknown id, never deleted, or window expired
            (`RESTORE_WINDOW_EXPIRED`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: A janela de 30 dias para restaurar este número expirou.
                code: RESTORE_WINDOW_EXPIRED
        '409':
          description: The same phone is active again (`NUMBER_ALREADY_ACTIVE`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  Este número já foi reconectado em outro lugar e não pode ser
                  restaurado.
                code: NUMBER_ALREADY_ACTIVE
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Too many requests
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your ps_ API key
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: API key id (alternative to x-api-key)

````