# Bulk Email Verification

{% tabs %}
{% tab title="Curl" %}

```
curl --location 'https://api.trueinbox.io/v1/api/bulk-email-verify' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "keys":[
        "username1@domain",
        "username2@domain",
        ...
    ],
    "name": "demo"
}'
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "keys":[
        "username1@domain",
        "username2@domain",
        ...
    ],
  "name": "demo"
});

let config = {
  method: 'post',
  url: 'https://api.trueinbox.io/v1/api/bulk-email-verify',
  headers: { 
    'Authorization': 'Bearer <token>', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://api.trueinbox.io/v1/api/bulk-email-verify"

payload = json.dumps({
  "keys":[
        "username1@domain",
        "username2@domain",
        ...
    ],
  "name": "demo"
})
headers = {
  'Authorization': 'Bearer <token>',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"keys\":[\n  \"username1@domain\",\n  \"username2@domain\"\n    ],\n    \"name\": \"demo\"\n}");
Request request = new Request.Builder()
  .url("https://api.trueinbox.io/v1/api/bulk-email-verify")
  .method("POST", body)
  .addHeader("Authorization", "Bearer <token>")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://api.trueinbox.io/v1/api/bulk-email-verify")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
   "keys":[
        "username1@domain",
        "username2@domain",
        ...
    ],
  "name": "demo"
})

response = https.request(request)
puts response.read_body

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.trueinbox.io/v1/api/bulk-email-verify',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
   "keys":[
        "username1@domain",
        "username2@domain",
        ...
    ],
    "name": "demo"
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer <token>',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}
{% endtabs %}

### Response

```json
{
    "message": "Bulk email verification started. We've locked 200 credits for processing. We will release credits for failed verification on completion",
    "uid": "018a2e10-97ae-4072-8d4d-49554687c85d",
    "total_credits": 25000,
    "credits_used": 517,
    "credits_remaining": 24483
}
```

## Bulk verification result

{% tabs %}
{% tab title="Curl" %}

```
curl --location 'https://api.trueinbox.io/v1/api/bulk-result?uid=018a2e10-97ae-4072-8d4d-49554687c85d&currentPage=1&limit=500'
--header 'Authorization: Bearer <token>'
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const axios = require('axios');
axios.get('https://api.trueinbox.io/v1/api/bulk-result?uid=018a2e10-97ae-4072-8d4d-49554687c85d&currentPage=1&limit=500', {
    headers: {accept: 'application/json', Authorization: 'Bearer <token>'}
})
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.log(error);
  });

```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = 'https://api.trueinbox.io/v1/api/bulk-result'
payload = {
    'uid': '018a2e10-97ae-4072-8d4d-49554687c85d',
    'currentPage': 1,
    'limit': 500
}

headers = {
    'Authorization': 'Bearer <token>'
}

resp = requests.get(url, params=params, headers=headers)

if response.status_code == 200:
    data = response.json()
    # Process the data as needed
else:
    print(f"Error: {response.status_code} - {response.text}")

```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.trueinbox.io/v1/api/bulk-result?uid=018a2e10-97ae-4072-8d4d-49554687c85d&currentPage=1&limit=500")
  .get()
  .addHeader("accept", "application/json")
  .addHeader("authorization", "Bearer <token>")
  .build();

Response response = client.newCall(request).execute();
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.trueinbox.io/v1/api/bulk-result?uid=018a2e10-97ae-4072-8d4d-49554687c85d&currentPage=1&limit=500")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.trueinbox.io/v1/api/bulk-result?uid=018a2e10-97ae-4072-8d4d-49554687c85d&currentPage=1&limit=500",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "accept: application/json",
    "authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}
{% endtabs %}

### Response

```json
{
    "result": [
        {
            "uid": "08c0fe4e-e550-4d61-929e-b970e559f211",
            "key": "username1@domain",
            "meta": null,
            "result": {
                "status": "completed",
                "result": "valid",
                "confidenceScore": 99,
                "smtpProvider": "Google",
                "mailDisposable": false,
                "mailAcceptAll": false,
                "free": true
            },
            "success": true,
            "status": "completed",
            "reason": ""
        },
        {
            "uid": "6e2e6460-cf6a-411f-88a0-414f14eb2ddb",
            "key": "username2@domain",
            "meta": null,
            "result": {
                "status": "completed",
                "result": "valid",
                "confidenceScore": 99,
                "smtpProvider": "Google",
                "mailDisposable": false,
                "mailAcceptAll": false,
                "free": false
            },
            "success": true,
            "status": "completed",
            "reason": ""
        },
        ...
    ],
    "totalCount": 200,
    "totalValid": 190,
    "totalRisky": 5,
    "totalInvalid": 5,
    "successCount": 200,
    "currentPage": "1",
    "limit": 500,
    "numPages": 1
}
```

## Bulk verification result csv

{% tabs %}
{% tab title="Curl" %}

```
curl --location 'https://api.trueinbox.io/v1/api/bulk-result-csv?uid=018a2e10-97ae-4072-8d4d-49554687c85d&currentPage=1&limit=500' \
--header 'Authorization: Bearer <token>'
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const axios = require('axios');
axios.get('https://api.trueinbox.io/v1/api/bulk-result-csv?uid=018a2e10-97ae-4072-8d4d-49554687c85d&currentPage=1&limit=500', {
    headers: {accept: 'application/json', Authorization: 'Bearer <token>'}
})
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.log(error);
  });

```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = 'https://api.trueinbox.io/v1/api/bulk-result-csv'
payload = {
    'uid': '018a2e10-97ae-4072-8d4d-49554687c85d',
    'currentPage': 1,
    'limit': 500
}

headers = {
    'Authorization': 'Bearer <token>'
}

resp = requests.get(url, params=params, headers=headers)

if response.status_code == 200:
    data = response.json()
    # Process the data as needed
else:
    print(f"Error: {response.status_code} - {response.text}")

```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.trueinbox.io/v1/api/bulk-result-csv?uid=018a2e10-97ae-4072-8d4d-49554687c85d&currentPage=1&limit=500")
  .get()
  .addHeader("accept", "application/json")
  .addHeader("authorization", "Bearer <token>")
  .build();

Response response = client.newCall(request).execute();
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.trueinbox.io/v1/api/bulk-result-csv?uid=018a2e10-97ae-4072-8d4d-49554687c85d&currentPage=1&limit=500")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.trueinbox.io/v1/api/bulk-result-csv?uid=018a2e10-97ae-4072-8d4d-49554687c85d&currentPage=1&limit=500",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "accept: application/json",
    "authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

{% endtab %}
{% endtabs %}

## Response

<figure><img src="/files/KPmoU0w56yg6VUnnIR8m" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trueinbox.io/reference/bulk-email-verification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
