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. Restoring a number that had already connected puts it back into the number count: when that takes the workspace past the capacity it has paid for, one extra number is charged at the restore (prorated), and when that cannot be paid it answers 422 INSUFFICIENT_FUNDS (or PLAN_NUMBER_LIMIT_REACHED) with proratedTotal and walletBalance, charging nothing and leaving the number deleted. A number that never connected costs nothing to restore: it is charged at its first connection, like any other.
curl --request POST \
--url https://pilotstatus.com.br/v1/numbers/{id}/restore \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/numbers/{id}/restore"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/numbers/{id}/restore', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pilotstatus.com.br/v1/numbers/{id}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/numbers/{id}/restore"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pilotstatus.com.br/v1/numbers/{id}/restore")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/numbers/{id}/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ok": true,
"requiresReconnect": true
}{
"error": "Unauthorized"
}{
"error": "Your workspace role does not allow this action (numbers:restore).",
"code": "PERMISSION_DENIED"
}{
"error": "A janela de 30 dias para restaurar este número expirou.",
"code": "RESTORE_WINDOW_EXPIRED"
}{
"error": "Este número já foi reconectado em outro lugar e não pode ser restaurado.",
"code": "NUMBER_ALREADY_ACTIVE"
}{
"error": "Saldo insuficiente na carteira e cartão indisponível para cobrar o número extra. Adicione créditos ou um cartão.",
"code": "INSUFFICIENT_FUNDS",
"proratedTotal": 33.23,
"walletBalance": 0
}{
"error": "Too many requests"
}Was this page helpful?
curl --request POST \
--url https://pilotstatus.com.br/v1/numbers/{id}/restore \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/numbers/{id}/restore"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/numbers/{id}/restore', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pilotstatus.com.br/v1/numbers/{id}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/numbers/{id}/restore"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pilotstatus.com.br/v1/numbers/{id}/restore")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/numbers/{id}/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ok": true,
"requiresReconnect": true
}{
"error": "Unauthorized"
}{
"error": "Your workspace role does not allow this action (numbers:restore).",
"code": "PERMISSION_DENIED"
}{
"error": "A janela de 30 dias para restaurar este número expirou.",
"code": "RESTORE_WINDOW_EXPIRED"
}{
"error": "Este número já foi reconectado em outro lugar e não pode ser restaurado.",
"code": "NUMBER_ALREADY_ACTIVE"
}{
"error": "Saldo insuficiente na carteira e cartão indisponível para cobrar o número extra. Adicione créditos ou um cartão.",
"code": "INSUFFICIENT_FUNDS",
"proratedTotal": 33.23,
"walletBalance": 0
}{
"error": "Too many requests"
}