Imports

Imports are used to populate a HubSpot account with object (including contacts, companies, deals, and tickets) data that can be used with the sales, marketing, and service tools. Imports need a structured source file, such as an Excel or CSV (comma-separated value) document. A single structured file gives users the power to import tens of thousands of objects into their accounts at once.

Example use case: The import endpoints can be used to create objects in HubSpot from an Excel or CSV (comma-separated value) source file.

Example POST URL:
https://api.hubapi.com/crm-data/v1/imports?

Example importRequest JSON data:
This example contains 3 columns:
 - First name, mapped to the firstname contact property
 - Email, mapped to the email contact property
 - Company ID, which contains a list of company record IDs
   that the contact will be assocated with.
{
  "name": "test_import",
  "files": [
    {
      "fileName": "final_emails.csv",
      "fileImportPage": {
        "hasHeader": true,
        "columnMappings": [
          {
            "ignored": false,
            "columnName": "First Name",
            "idColumnType": null,
            "propertyName": "firstname",
            "foreignKeyType": null,
            "columnObjectType": "CONTACT",
            "associationIdentifierColumn": false
          },
          {
            "ignored": false,
            "columnName": "Email",
            "idColumnType": "HUBSPOT_ALTERNATE_ID",
            "propertyName": "email",
            "foreignKeyType": null,
            "columnObjectType": "CONTACT",
            "associationIdentifierColumn": false
          },
          {
            "ignored": false,
            "columnName": "Company ID",
            "idColumnType": "HUBSPOT_OBJECT_ID",
            "propertyName": null,
            "foreignKeyType": {
              "associationCategory": "HUBSPOT_DEFINED",
              "associationTypeId": 1
            },
            "columnObjectType": "CONTACT",
            "associationIdentifierColumn": false
          }
        ]
      }
    }
  ]
}

Example JSON response:
{
  "createdAt": 1562562830192,
  "metadata": {
    "objectLists": [
	],
    "counters": {
    },
    "fileIds": [
      9976411500
    ]
  },
  "updatedAt": 1562562830192,
  "state": "STARTED",
  "optOutImport": false,
  "id": "5796141"
}