# CRM Imports Endpoint

**URL:** <https://community.hubspot.com/t/crm-imports-endpoint/18329>\
**Category:** APIs & Integrations\
**Tags:** companies, developer-tools, contacts\
**Created:** [January 24, 2020, 11:43am UTC](https://community.hubspot.com/t/crm-imports-endpoint/18329 "2020-01-24T11:43:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![etezisci](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/etezisci/32/68653_2.png) [@etezisci](https://community.hubspot.com/u/etezisci)\
**Post date:** [January 24, 2020, 11:43am UTC](https://community.hubspot.com/t/crm-imports-endpoint/18329/1 "2020-01-24T11:43:52Z")

</div>

Hi, can someone help me with the sample payload/body/data part for this POST request? ([Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs-beta/crm/imports))  
Apparently we can use Excel or CSV source file but i couldn’t manage to define it

```auto
import requests

url = "https://api.hubapi.com/crm/v3/imports/"

querystring = {"hapikey":"xxxx-xxxx"}

payload = "{\"importRequest\":\"datetime\"}"
headers = {
 'accept': "application/json",
 'content-type': "multipart/form-data"
 }

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

print(response.text) 

```

Thanks

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [January 27, 2020, 6:37pm UTC](https://community.hubspot.com/t/crm-imports-endpoint/18329/2 "2020-01-27T18:37:56Z")

</div>

Hi, @etezisci.

Our documentation is still a work in progress, but the following worked for me:

`var request = require('request');var fs = require('fs');var options = {'method': 'POST','url': 'https://api.hubapi.com/crm/v3/imports/?hapikey=xxxx-xxxx','headers': {'Content-Type': 'application/x-www-form-urlencoded'},formData: {'files': {'value': fs.createReadStream('/Users/itakushi/Documents/API_Import_1.csv'),'options': {'filename': 'API_Import_1.csv','contentType': null}},'importRequest': '{"name":"API_Import_1","files":[{"fileName":"API_Import_1.csv","fileImportPage":{"hasHeader":true,"columnMappings":[{"ignored":false,"columnName":"email","idColumnType":"HUBSPOT_ALTERNATE_ID","propertyName":"email","foreignKeyType":null,"columnObjectType":"CONTACT","associationIdentifierColumn":false},{"ignored":false,"columnName":"firstname","idColumnType":null,"propertyName":"firstname","foreignKeyType":null,"columnObjectType":"CONTACT","associationIdentifierColumn":false},{"ignored":false,"columnName":"lastname","idColumnType":null,"propertyName":"lastname","foreignKeyType":null,"columnObjectType":"CONTACT","associationIdentifierColumn":false}]}}]}'}};request(options, function (error, response) { if (error) throw new Error(error);console.log(response.body);});`

Here’s a better look at the `importRequest` object:

```auto
{
 "name": "API_Import_1",
 "files": [
 {
 "fileName": "API_Import_1.csv",
 "fileImportPage": {
 "hasHeader": true,
 "columnMappings": [
 {
 "ignored": false,
 "columnName": "email",
 "idColumnType": "HUBSPOT_ALTERNATE_ID",
 "propertyName": "email",
 "foreignKeyType": null,
 "columnObjectType": "CONTACT",
 "associationIdentifierColumn": false
 },
 {
 "ignored": false,
 "columnName": "firstname",
 "idColumnType": null,
 "propertyName": "firstname",
 "foreignKeyType": null,
 "columnObjectType": "CONTACT",
 "associationIdentifierColumn": false
 },
 {
 "ignored": false,
 "columnName": "lastname",
 "idColumnType": null,
 "propertyName": "lastname",
 "foreignKeyType": null,
 "columnObjectType": "CONTACT",
 "associationIdentifierColumn": false
 }
 ]
 }
 }
 ]
}

```

My CSV file, `API_Import_1.csv`, had three columns. In order: “email” mapping to `email`, “firstname” mapping to `firstname`, and “lastname” mapping to `lastname`.

Here are screenshots of the draft documentation for the other fields:

 ![Screen Shot 2020-01-27 at 1.36.16 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/5/e5f4ead9a8dc59031abca8d5092e8d7def0e5361.png)  
Required Parameters  
 ![Screen Shot 2020-01-27 at 1.36.26 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/6/86dd6f48c1565e7df73f42745cae6c0db716d898.png)  
Optional Parameters

I hope this helps others while we work to publish formal documentation on this endpoint.

---

<div class="post-metadata">

**Author:** ![etezisci](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/etezisci/32/68653_2.png) [@etezisci](https://community.hubspot.com/u/etezisci)\
**Post date:** [January 28, 2020, 10:22am UTC](https://community.hubspot.com/t/crm-imports-endpoint/18329/3 "2020-01-28T10:22:50Z")

</div>

Thank you Isaac! It worked for me too.
