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

# Import contacts

It returns the background process ID which on completion calls the notify URL that you have set in the input. **Note**: - Any contact attribute that doesn't exist in your account will be ignored at import end.

Sample for **fileBody**:

| EMAIL                 | LASTNAME | FIRSTNAME | SMS        |
| :-------------------- | :------- | :-------- | :--------- |
| <john6@example.com>   | Smith    | John      | 3123456793 |
| harry6#@example.com   | Edmund   | Harry     | 3111222226 |
| how#ard6#@example.com | Stern    | Howard    | 3777888902 |
| <credits@davy.ie>     | Jane     | Doe       | 2344556681 |

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "contact": {
      "email": "contact@brevo.com",
      "name": "Brevo Support",
      "url": "https://account.brevo.com/support"
    },
    "description": "Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to :\n  - Manage your campaigns and get the statistics\n  - Manage your contacts\n  - Send transactional Emails and SMS\n  - and much more...\n\nYou can download our wrappers at https://github.com/orgs/brevo\n**Possible responses**\n  | Code | Message |\n  | :-------------: | ------------- |\n  | 200  | OK. Successful Request  |\n  | 201  | OK. Successful Creation |\n  | 202  | OK. Request accepted |\n  | 204  | OK. Successful Update/Deletion  |\n  | 400  | Error. Bad Request  |\n  | 401  | Error. Authentication Needed  |\n  | 402  | Error. Not enough credit, plan upgrade needed  |\n  | 403  | Error. Permission denied  |\n  | 404  | Error. Object does not exist |\n  | 405  | Error. Method not allowed  |\n  | 406  | Error. Not Acceptable  |\n  | 422  | Error. Unprocessable Entity |\n",
    "license": {
      "name": "MIT",
      "url": "http://opensource.org/licenses/MIT"
    },
    "title": "Brevo API",
    "version": "3.0.0"
  },
  "servers": [
    {
      "url": "https://api.brevo.com/v3"
    }
  ],
  "security": [
    {
      "api-key": []
    },
    {
      "partner-key": []
    }
  ],
  "paths": {
    "/contacts/import": {
      "post": {
        "description": "It returns the background process ID which on completion calls the notify URL that you have set in the input. **Note**: - Any contact attribute that doesn't exist in your account will be ignored at import end.\n",
        "operationId": "importContacts",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "disableNotification": {
                    "default": false,
                    "description": "To disable email notification",
                    "example": false,
                    "type": "boolean"
                  },
                  "emailBlacklist": {
                    "default": false,
                    "description": "To blacklist all the contacts for email",
                    "example": false,
                    "type": "boolean"
                  },
                  "emptyContactsAttributes": {
                    "default": false,
                    "description": "To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in Brevo, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( **only available if `updateExistingContacts` set to true **)\n",
                    "example": true,
                    "type": "boolean"
                  },
                  "fileBody": {
                    "description": "**Mandatory if fileUrl and jsonBody is not defined.** CSV content to be imported. Use semicolon to separate multiple attributes. **Maximum allowed file body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files.\n",
                    "example": "NAME;SURNAME;EMAIL\nSmith;John;john.smith@example.com\nRoger;Ellie;ellie36@example.com",
                    "type": "string"
                  },
                  "fileUrl": {
                    "description": "**Mandatory if fileBody and jsonBody is not defined.** URL of the file to be imported (**no local file**). Possible file formats: #### .txt, .csv, .json\n",
                    "example": "https://importfile.domain.com",
                    "format": "url",
                    "type": "string"
                  },
                  "jsonBody": {
                    "description": "**Mandatory if fileUrl and fileBody is not defined.** JSON content to be imported. **Maximum allowed json body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of json body size while parsing. Please use fileUrl instead to import bigger files.\n",
                    "items": {
                      "example": {
                        "attributes": {
                          "BIRTHDAY": "11/02/1989",
                          "COUNTRY": "DE",
                          "FNAME": "Dicky",
                          "LANDLINE_NUMBER": "33689965433",
                          "LNAME": "Noemi",
                          "PREFERED_COLOR": "BLACK",
                          "SMS": "33689965433",
                          "WHATSAPP": "33689965433"
                        },
                        "email": "ndicky0@ocn.ne.jp"
                      },
                      "properties": {
                        "attributes": {
                          "additionalProperties": true,
                          "description": "List of attributes to be imported",
                          "type": "object"
                        },
                        "email": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "listIds": {
                    "description": "**Mandatory if newList is not defined.** Ids of the lists in which the contacts shall be imported. For example, **[2, 4, 7]**.\n",
                    "items": {
                      "description": "List Id in which the contacts shall be imported",
                      "example": 76,
                      "format": "int64",
                      "type": "integer"
                    },
                    "type": "array"
                  },
                  "newList": {
                    "description": "To create a new list and import the contacts into it, pass the listName and an optional folderId.",
                    "properties": {
                      "folderId": {
                        "description": "Id of the folder where this new list shall be created. **Mandatory if listName is not empty**\n",
                        "example": 2,
                        "format": "int64",
                        "type": "integer"
                      },
                      "listName": {
                        "description": "List with listName will be created first and users will be imported in it. **Mandatory if listIds is empty**.\n",
                        "example": "ContactImport - 2017-05",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "notifyUrl": {
                    "description": "URL that will be called once the import process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479",
                    "example": "http://requestb.in/173lyyx1",
                    "format": "url",
                    "type": "string"
                  },
                  "smsBlacklist": {
                    "default": false,
                    "description": "To blacklist all the contacts for sms",
                    "example": false,
                    "type": "boolean"
                  },
                  "updateExistingContacts": {
                    "default": true,
                    "description": "To facilitate the choice to update the existing contacts",
                    "example": true,
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          },
          "description": "Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns``",
          "required": true
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/createdProcessId"
          },
          "400": {
            "$ref": "#/components/responses/errorModel"
          }
        },
        "summary": "Import contacts",
        "tags": [
          "Contacts"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "api-key": {
        "description": "The API key should be passed in the request headers as `api-key` for authentication.",
        "in": "header",
        "name": "api-key",
        "type": "apiKey"
      },
      "partner-key": {
        "description": "The partner key should be passed in the request headers as `partner-key` along with `api-key` pair for successful authentication of partner (Optional).",
        "in": "header",
        "name": "partner-key",
        "type": "apiKey"
      }
    },
    "responses": {
      "errorModel": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "code": {
                  "description": "Error code displayed in case of a failure",
                  "enum": [
                    "invalid_parameter",
                    "missing_parameter",
                    "out_of_range",
                    "campaign_processing",
                    "campaign_sent",
                    "document_not_found",
                    "not_enough_credits",
                    "permission_denied",
                    "duplicate_parameter",
                    "duplicate_request",
                    "method_not_allowed",
                    "unauthorized",
                    "account_under_validation",
                    "not_acceptable",
                    "bad_request",
                    "unprocessable_entity",
                    "Domain does not exist",
                    "Contact email not found",
                    "Attribute not found",
                    "Category id not found",
                    "Invalid parameters passed",
                    "Record(s) for identifier not found",
                    "Returned when query params are invalid",
                    "Returned when invalid data posted",
                    "Feed not found",
                    "Campaign ID not found",
                    "api-key not found",
                    "DMARC policy requires domain authentication",
                    "DNS records not properly configured",
                    "Invalid OTP code provided",
                    "OTP code has expired",
                    "Domain already exists in your account",
                    "The sum of all IP weights must equal 100",
                    "Authentication failed",
                    "Insufficient credits",
                    "Request already processed"
                  ],
                  "example": "method_not_allowed",
                  "type": "string"
                },
                "message": {
                  "description": "Readable message associated to the failure",
                  "example": "POST Method is not allowed on this path",
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ],
              "type": "object"
            }
          }
        },
        "description": "bad request"
      },
      "createdProcessId": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "processId": {
                  "description": "Id of the process created",
                  "example": 78,
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "processId"
              ],
              "type": "object"
            }
          }
        },
        "description": "process id created"
      }
    }
  },
  "x-samples-languages": [
    "curl"
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 91,
      "1": 104,
      "2": 180,
      "3": 205,
      "4": 240,
      "5": 82,
      "6": 207,
      "7": 0,
      "8": 3,
      "9": 36,
      "10": 63,
      "11": 142
    }
  }
}
```