---
agentTools:
  projectIndex: https://bouncify.readme.io/llms.txt
---

# Upload a bulk email list

This endpoint allows you to upload a bulk email validation list. It accepts the email data in multiple ways. You can upload email addresses in the CSV file format or an array of objects.

If `auto_verify` is enabled, this API will create a job and automatically process each email in the uploaded list. If the `auto_verify` is disabled, the email list is prepared and ‘ready’ for verification, you can start verification using start endpoint. The API response does not contain the verification results. Instead it returns the `job_id` in the success response. Once the verification is completed, you can download the result using this `job_id`.

### Option 1: CSV file

This endpoint accepts the file in .csv (comma separated values) format. The supported size of the file is 10Mb. The number of emails in a file must be within 5 lakhs. The additional columns in the csv file will be retained.

### Option 2: Array of emails

Instead of having to write to a file, you can dynamically create email lists on the fly when you provide the data directly. The array of objects contains the ‘email’ field as well as any additional data you want to include with the email. If the data is provided as an object, the key names will be used for the column headers. Here is an example of an email object in JSON format.

```json Emails Object
{
    "auto_verify": "true",
    "emails": [
        {
            "email": "test1@example.com",
            "firstname": "John",
            "lastname": "Doe"
        },
        {
            "email": "test2@example.com",
          	"firstname": "Daniel",
            "lastname": "Jay"
        }
    ]
}
```

> 🚧 Limits
>
> Our API supports having up to 500 unverified lists in an account, with a maximum of 100 lists allowed for active verification concurrently.

## Successful Response

```json
HTTP/1.1 200 OK
{
   "job_id": "r374aki32rnatv868nntpxloc7dkilszc3eu",
   "success": true,   
   "message": "Bulk email verification list has been created"
}
```

## Response Parameters

| Parameter | Type           | Description                                                 |
| :-------- | :------------- | :---------------------------------------------------------- |
| job\_id   | \[string]      | The job\_id corresponding to the list you have been created |
| success   | \[true, false] | Whether the API request call was successful or not.         |
| message   | \[string]      | Describes API result                                        |

## Other responses

The response you get when the API key is invalid:

```json
HTTP/1.1 401 Unauthorized
{   
   "result":"Invalid API Key",
   "success": false
}
```

The response you get when the `auto_verify` is enabled:

```json
HTTP/1.1 200 OK
{
   "job_id": "r374aki32rnatv868nntpxloc7dkilszc3eu",
   "success": true,   
   "message": "Bulk email verification list has been created and starts verification shortly"
}
```

The response you get when you provide the incorrect file format:

```json
HTTP/1.1 400 BadRequest
{
   "result": "Invalid file data",
   "success": false
}
```

The response you get when you reach the limit of maximum list uploads.

```json
HTTP/1.1 400 BadRequest
{
    "success": false,
    "message": "The maximum number of lists has been reached."
}
```

The response you get when you reach the limit of concurrent list verifications.

```json
HTTP/1.1 400 BadRequest
{
    "success": false,
    "message": "The maximum number of active verification lists has been reached."
}
```

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Bulk Validation",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.bouncify.io/v1/"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "query",
        "name": "apikey"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/bulk": {
      "post": {
        "summary": "Upload a bulk email list",
        "description": "",
        "operationId": "upload-a-bulk-email-list",
        "parameters": [
          {
            "name": "apikey",
            "in": "query",
            "description": "Your API key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "local_file",
                  "RAW_BODY"
                ],
                "properties": {
                  "local_file": {
                    "type": "string",
                    "description": "The file to be upload in .csv format",
                    "format": "binary"
                  },
                  "auto_verify": {
                    "type": "boolean",
                    "description": "Auto verify allows to start verification instantly"
                  },
                  "RAW_BODY": {
                    "type": "string",
                    "description": "The emails to be verified",
                    "format": "json"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n   \"job_id\": \"r374aki32rnatv868nntpxloc7dkilszc3eu\",\n   \"success\": true,   \n   \"message\": \"Bulk email verification list has been created\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "example": "r374aki32rnatv868nntpxloc7dkilszc3eu"
                    },
                    "success": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Bulk email verification list has been created"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "python",
              "code": "import requests\n\nurl = \"https://api.bouncify.io/v1/bulk\"\n\n# Replace API_KEY with your API Key\nquery={\"apikey\":'API_KEY'}\n\nfile = open('/home/doc/new.csv', 'rb')\n\nheaders = {\n    \"Accept\": \"*/*\",\n}\nresponse = requests.request(\"POST\", url, files={'local_file': file}, params=query, data={'auto_verify': 'true'}, headers=headers)\n\nprint(response.text)",
              "name": "python"
            },
            {
              "language": "php",
              "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => 'https://api.bouncify.io/v1/bulk?apikey=API_KEY',\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => '',\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 0,\n  CURLOPT_FOLLOWLOCATION => true,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => 'POST',\n  CURLOPT_POSTFIELDS => array('local_file'=> new CURLFILE('/home/doc/new.csv')),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n\n?>"
            },
            {
              "language": "node",
              "code": "var request = require('request');\nvar fs = require('fs');\nvar options = {\n  'method': 'POST',\n  // Replace API_KEY with your API Key\n  'url': 'https://api.bouncify.io/v1/bulk/apikey=API_KEY',\n  'headers': {},\n  formData: {\n    'local_file': {\n      'value': fs.createReadStream('path/to/file'),\n      'options': {\n        'filename': 'path/to/file',\n        'contentType': null\n      }\n    }\n  }\n};\nrequest(options, function (error, response) {\n  if (error) throw new Error(error);\n  console.log(response.body);\n});"
            },
            {
              "language": "ruby",
              "code": "require \"uri\"\nrequire \"net/http\"\n\n# Replace API_KEY with your API Key\nurl = URI(\"https://api.bouncify.io/v1/bulk/apikey=API_KEY\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\n\nform_data = [['file_contents', File.open('path/to/file')]]\nrequest.set_form form_data, 'multipart/form-data'\nresponse = https.request(request)\nputs response.read_body"
            },
            {
              "language": "go",
              "code": "package main\n\nimport (\n  \"fmt\"\n  \"bytes\"\n  \"mime/multipart\"\n  \"os\"\n  \"path/filepath\"\n  \"io\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n\n  // Replace API_KEY with your API Key\n  url := \"https://api.bouncify.io/v1/bulk/apikey=API_KEY\"\n  method := \"POST\"\n\n  payload := &bytes.Buffer{}\n  writer := multipart.NewWriter(payload)\n  file, errFile1 := os.Open(\"path/to/file\")\n  defer file.Close()\n  part1,\n        errFile1 := writer.CreateFormFile(\"file_contents\",filepath.Base(\"path/to/file\"))\n  _, errFile1 = io.Copy(part1, file)\n  if errFile1 != nil {\n    fmt.Println(errFile1)\n    return\n  }\n  err := writer.Close()\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n\n  client := &http.Client {\n  }\n  req, err := http.NewRequest(method, url, payload)\n\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n\n  req.Header.Set(\"Content-Type\", writer.FormDataContentType())\n  res, err := client.Do(req)\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  defer res.Body.Close()\n\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  fmt.Println(string(body))\n}"
            }
          ],
          "samples-languages": [
            "python",
            "php",
            "node",
            "ruby",
            "go"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "615c4578d429bb01b74fdae5:615c4578d429bb01b74fdae8"
}
```