Check a contact before sending
POST /v1/deliveries/contact_check
Whether the last message from this organisation (in this mode) to the e-mail address or phone number failed — an e-mail that bounced, an SMS that never reported delivery to the phone (after 15 minutes) or failed, or a contact on the block list. Null warning for a contact never tried, or whose last attempt succeeded. A POST so the contact stays out of URLs and logs; the answer names no delivery or recipient.
Body Optional
Returns 200 application/json . One answer per contact given; null for a contact not given (or a phone not in E.164).
Errors have one shape; see Errors for every code.
Example Try it
Code language cURL Node.js Python C# Java PHP
Request
curl -X POST "https://api.parasend.com/v1/deliveries/contact_check" \
-H "Authorization: Bearer $PARASEND_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"email" : "anna.bjork@example.com"
}'const res = await fetch('https://api.parasend.com/v1/deliveries/contact_check' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${process.env.PARASEND_KEY}` ,
'Idempotency-Key' : crypto.randomUUID(),
'Content-Type' : 'application/json' ,
},
body: JSON.stringify({
email: 'anna.bjork@example.com' ,
}),
});
const data = await res.json();import os, requests, uuid
res = requests.post(
"https://api.parasend.com/v1/deliveries/contact_check" ,
headers={
"Authorization" : f"Bearer {os.environ['PARASEND_KEY']}" ,
"Idempotency-Key" : str(uuid.uuid4()),
},
json={
"email" : "anna.bjork@example.com" ,
},
)
data = res.json()using var http = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.parasend.com/v1/deliveries/contact_check" );
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer" , Environment.GetEnvironmentVariable("PARASEND_KEY" ));
request.Headers.Add("Idempotency-Key" , Guid.NewGuid().ToString());
request.Content = new StringContent("" "
{
"email" : "anna.bjork@example.com"
}
"" ", Encoding.UTF8, " application/json");
var response = await http.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();var json = "" "
{
"email" : "anna.bjork@example.com"
}
"" ";
var request = HttpRequest.newBuilder(URI.create("https://api.parasend.com/v1/deliveries/contact_check" ))
.header("Authorization" , "Bearer " + System.getenv("PARASEND_KEY" ))
.header("Idempotency-Key" , UUID.randomUUID().toString())
.header("Content-Type" , "application/json" )
.method("POST" , HttpRequest.BodyPublishers.ofString(json))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());$client = new GuzzleHttp\Client();
$response = $client->request('POST' , 'https://api.parasend.com/v1/deliveries/contact_check' , [
'headers' => [
'Authorization' => 'Bearer ' . getenv('PARASEND_KEY' ),
'Idempotency-Key' => bin2hex(random_bytes(16 )),
],
'json' => [
'email' => 'anna.bjork@example.com' ,
],
]);
$data = json_decode($response->getBody(), true );
Response · 200
{
"object" : "contact_check" ,
"email" : {
"warning" : null
},
"phone" : null
}