curl --request POST \
--url https://api.salvy.com.br/api/v1/virtual-phone-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"areaCode": 11,
"redirectPhoneNumber": "11912341234",
"employeeId": "0140a8c6-3815-45b7-9e60-8e137cad845c",
"identifier": "meu-número-virtual",
"costCenter": "marketing",
"redirectExpiresAt": "2024-01-03T00:00:00Z"
}
'import requests
url = "https://api.salvy.com.br/api/v1/virtual-phone-accounts"
payload = {
"areaCode": 11,
"redirectPhoneNumber": "11912341234",
"employeeId": "0140a8c6-3815-45b7-9e60-8e137cad845c",
"identifier": "meu-número-virtual",
"costCenter": "marketing",
"redirectExpiresAt": "2024-01-03T00:00:00Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
areaCode: 11,
redirectPhoneNumber: '11912341234',
employeeId: '0140a8c6-3815-45b7-9e60-8e137cad845c',
identifier: 'meu-número-virtual',
costCenter: 'marketing',
redirectExpiresAt: '2024-01-03T00:00:00Z'
})
};
fetch('https://api.salvy.com.br/api/v1/virtual-phone-accounts', 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://api.salvy.com.br/api/v1/virtual-phone-accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'areaCode' => 11,
'redirectPhoneNumber' => '11912341234',
'employeeId' => '0140a8c6-3815-45b7-9e60-8e137cad845c',
'identifier' => 'meu-número-virtual',
'costCenter' => 'marketing',
'redirectExpiresAt' => '2024-01-03T00:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.salvy.com.br/api/v1/virtual-phone-accounts"
payload := strings.NewReader("{\n \"areaCode\": 11,\n \"redirectPhoneNumber\": \"11912341234\",\n \"employeeId\": \"0140a8c6-3815-45b7-9e60-8e137cad845c\",\n \"identifier\": \"meu-número-virtual\",\n \"costCenter\": \"marketing\",\n \"redirectExpiresAt\": \"2024-01-03T00:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.salvy.com.br/api/v1/virtual-phone-accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"areaCode\": 11,\n \"redirectPhoneNumber\": \"11912341234\",\n \"employeeId\": \"0140a8c6-3815-45b7-9e60-8e137cad845c\",\n \"identifier\": \"meu-número-virtual\",\n \"costCenter\": \"marketing\",\n \"redirectExpiresAt\": \"2024-01-03T00:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salvy.com.br/api/v1/virtual-phone-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"areaCode\": 11,\n \"redirectPhoneNumber\": \"11912341234\",\n \"employeeId\": \"0140a8c6-3815-45b7-9e60-8e137cad845c\",\n \"identifier\": \"meu-número-virtual\",\n \"costCenter\": \"marketing\",\n \"redirectExpiresAt\": \"2024-01-03T00:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "0140a8c6-3815-45b7-9e60-8e137cad845c",
"identifier": "meu-número-virtual",
"phoneNumber": "+551151231234",
"status": "pending",
"createdAt": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"cancelReason": "<string>",
"redirectPhoneNumber": "+5511999999999",
"redirectExpiresAt": "2024-01-03T00:00:00Z",
"costCenter": "marketing"
}{
"code": "unauthorized",
"message": "<string>",
"publicDetails": {}
}{
"code": "forbidden",
"message": "<string>",
"publicDetails": {}
}{
"code": "resource-not-found",
"message": "<string>",
"publicDetails": {}
}{
"code": "did-area-code-out-of-stock",
"message": "<string>",
"publicDetails": {}
}{
"code": "payload-too-large",
"message": "<string>",
"publicDetails": {}
}{
"code": "input-validation-error",
"message": "<string>",
"publicDetails": {}
}{
"code": "unknown",
"message": "<string>",
"publicDetails": {}
}Criar número virtual
[DEPRECADO] Descontinuado em 2026-08-11; deixa de ser atendido em 2027-02-01. Utilize https://api.salvy.com.br/api/v2/virtual-phone-accounts em substituição. Detalhes e instruções de migração: https://docs.salvy.com.br/api-reference/deprecation
Cria um novo número virtual.
curl --request POST \
--url https://api.salvy.com.br/api/v1/virtual-phone-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"areaCode": 11,
"redirectPhoneNumber": "11912341234",
"employeeId": "0140a8c6-3815-45b7-9e60-8e137cad845c",
"identifier": "meu-número-virtual",
"costCenter": "marketing",
"redirectExpiresAt": "2024-01-03T00:00:00Z"
}
'import requests
url = "https://api.salvy.com.br/api/v1/virtual-phone-accounts"
payload = {
"areaCode": 11,
"redirectPhoneNumber": "11912341234",
"employeeId": "0140a8c6-3815-45b7-9e60-8e137cad845c",
"identifier": "meu-número-virtual",
"costCenter": "marketing",
"redirectExpiresAt": "2024-01-03T00:00:00Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
areaCode: 11,
redirectPhoneNumber: '11912341234',
employeeId: '0140a8c6-3815-45b7-9e60-8e137cad845c',
identifier: 'meu-número-virtual',
costCenter: 'marketing',
redirectExpiresAt: '2024-01-03T00:00:00Z'
})
};
fetch('https://api.salvy.com.br/api/v1/virtual-phone-accounts', 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://api.salvy.com.br/api/v1/virtual-phone-accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'areaCode' => 11,
'redirectPhoneNumber' => '11912341234',
'employeeId' => '0140a8c6-3815-45b7-9e60-8e137cad845c',
'identifier' => 'meu-número-virtual',
'costCenter' => 'marketing',
'redirectExpiresAt' => '2024-01-03T00:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.salvy.com.br/api/v1/virtual-phone-accounts"
payload := strings.NewReader("{\n \"areaCode\": 11,\n \"redirectPhoneNumber\": \"11912341234\",\n \"employeeId\": \"0140a8c6-3815-45b7-9e60-8e137cad845c\",\n \"identifier\": \"meu-número-virtual\",\n \"costCenter\": \"marketing\",\n \"redirectExpiresAt\": \"2024-01-03T00:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.salvy.com.br/api/v1/virtual-phone-accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"areaCode\": 11,\n \"redirectPhoneNumber\": \"11912341234\",\n \"employeeId\": \"0140a8c6-3815-45b7-9e60-8e137cad845c\",\n \"identifier\": \"meu-número-virtual\",\n \"costCenter\": \"marketing\",\n \"redirectExpiresAt\": \"2024-01-03T00:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salvy.com.br/api/v1/virtual-phone-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"areaCode\": 11,\n \"redirectPhoneNumber\": \"11912341234\",\n \"employeeId\": \"0140a8c6-3815-45b7-9e60-8e137cad845c\",\n \"identifier\": \"meu-número-virtual\",\n \"costCenter\": \"marketing\",\n \"redirectExpiresAt\": \"2024-01-03T00:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "0140a8c6-3815-45b7-9e60-8e137cad845c",
"identifier": "meu-número-virtual",
"phoneNumber": "+551151231234",
"status": "pending",
"createdAt": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"cancelReason": "<string>",
"redirectPhoneNumber": "+5511999999999",
"redirectExpiresAt": "2024-01-03T00:00:00Z",
"costCenter": "marketing"
}{
"code": "unauthorized",
"message": "<string>",
"publicDetails": {}
}{
"code": "forbidden",
"message": "<string>",
"publicDetails": {}
}{
"code": "resource-not-found",
"message": "<string>",
"publicDetails": {}
}{
"code": "did-area-code-out-of-stock",
"message": "<string>",
"publicDetails": {}
}{
"code": "payload-too-large",
"message": "<string>",
"publicDetails": {}
}{
"code": "input-validation-error",
"message": "<string>",
"publicDetails": {}
}{
"code": "unknown",
"message": "<string>",
"publicDetails": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Código de área (DDD) associado ao número virtual.
11 <= x <= 9911
Número (incluindo DDD) para o qual serão encaminhadas as chamadas recebidas.
"11912341234"
ID do colaborador associado ao número virtual.
"0140a8c6-3815-45b7-9e60-8e137cad845c"
Identificador do número virtual. Utilize para facilitar a gestão dos números virtuais.
"meu-número-virtual"
Centro de custo associado ao número virtual.
"marketing"
Data de expiração do redirecionamento de chamadas. Caso não seja informada, o redirecionamento terá validade de 72 horas.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$"2024-01-03T00:00:00Z"
Response
A valid UUID string, in any version.
"123e4567-e89b-12d3-a456-426614174000"
"123e4567-e89b-12d3-a456-426614174001"
Identificador do número virtual. Utilize para facilitar a gestão dos números virtuais.
"meu-número-virtual"
Número virtual recém-criado, formatado conforme o padrão internacional E.164.
"+5511999999999"
"+551139999999"
pending, active, blocked, canceled Número designado para receber chamadas direcionadas ao número virtual recém-criado, formatado conforme o padrão internacional E.164.
"+5511999999999"
Data de expiração do redirecionamento de chamadas.
"2024-01-03T00:00:00Z"
Centro de custo associado ao número virtual.
"marketing"