Request a verification
Initiates a verification request using the specified destination and channel. Returns a unique identifier that can be used for confirmation.
Request
Body
{
"destination": "+12123464738",
"channel": "sms"
}
Properties
destination string required
Destination of the verification. This is usually a telephone number represented using the E.164 format, but can be other formats depending on the channel used.
Example: +12123464738
channel string required
The delivery mechanism used for delivering verifications.
Possible values: voice
, sms
Examples
curl --request POST \
--url https://api.verifyapi.dev/verify \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"destination": "+12123464738",
"channel": "sms"
}'
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.verifyapi.dev/verify"),
Headers =
{
{ "Authorization", "Bearer YOUR_API_KEY" },
},
Content = new StringContent("{ \"destination\":\"+12123464738\", \"channel\":\"sms\" }")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://api.verifyapi.dev/verify"
payload := strings.NewReader("{ \"destination\":\"+12123464738\", \"channel\":\"sms\" }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.verifyapi.dev/verify"))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer YOUR_API_KEY")
.method("POST", HttpRequest.BodyPublishers.ofString("{ \"destination\":\"+12123464738\", \"channel\":\"sms\" }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
fetch('https://api.verifyapi.dev/verify', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
destination: '+12123464738',
channel: 'sms'
})
})
const axios = require('axios').default;
const options = {
method: 'POST',
url: 'https://api.verifyapi.dev/verify',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer YOUR_API_KEY'
},
data: {
destination: '+12123464738',
channel: 'sms'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
$request = new HttpRequest();
$request->setUrl('https://api.verifyapi.dev/verify');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'Content-Type' => 'application/json',
'Authorization' => 'Bearer YOUR_API_KEY'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destination' => '+12123464738',
'channel' => 'sms'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
import http.client
conn = http.client.HTTPSConnection("api.verifyapi.dev")
payload = "{ \"destination\":\"+12123464738\", \"channel\":\"sms\" }"
headers = {
'Content-Type': "application/json",
'Authorization': "Bearer YOUR_API_KEY"
}
conn.request("POST", "/verify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://api.verifyapi.dev/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Bearer YOUR_API_KEY'
request.body = "{ \"destination\":\"+12123464738\", \"channel\":\"sms\" }"
response = http.request(request)
puts response.read_body
Response
HTTP 200 OK
Verification route has been validated and is now queued up for sending.
{
"id":"6603443f241aa2b2299003b6",
"destination":"+12123464738",
"channel":"sms",
}
id
should be stored for confirmation of verification.
HTTP 400 Bad Request
The payload is invalid or missing required fields. Additional information on which field is invalid will be returned as part of the JSON response.
HTTP 429 Too Many Requests
Too many requests have been sent. To find out more about our rate limiting, please see our rate limiting documentation for more information.