# upload contacts using python client

**URL:** <https://community.hubspot.com/t/upload-contacts-using-python-client/64500>\
**Category:** APIs & Integrations\
**Tags:** starter\
**Created:** [September 6, 2022, 9:32am UTC](https://community.hubspot.com/t/upload-contacts-using-python-client/64500 "2022-09-06T09:32:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mali05](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mali05](https://community.hubspot.com/u/mali05)\
**Post date:** [September 6, 2022, 9:32am UTC](https://community.hubspot.com/t/upload-contacts-using-python-client/64500/1 "2022-09-06T09:32:00Z")

</div>

so i am am trying to upload a list of contacts into our CRM account

the contacts have different fields but for now i am just trying to upload only 2 fields which are :

1. ParentID

2. Email

i can’t find any decent documentation for the python client in order to use it. can you please either show me how to do it or point out where in the documentation is that avaliable (maybe as a code snippet) ???

i already created a private app with an API token so access the account.

here is my code sofar

from fileinput import filename

import hubspot

from pprint import pprint

from hubspot.crm.imports import ApiException

client = hubspot.Client.create(access\_token=‘my\_access\_token’)

import hubspot

from pprint import pprint

from hubspot.crm.imports import ApiException

try:

api\_response = client.crm.imports.core\_api.create(files=[‘hubspot.csv’])

pprint(api\_response)

except ApiException as e:

print(“Exception when calling core\_api-\>get\_by\_id: %s\n” % e)

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [September 6, 2022, 8:37pm UTC](https://community.hubspot.com/t/upload-contacts-using-python-client/64500/2 "2022-09-06T20:37:23Z")

</div>

Hi, @mali05 👋 Hey, @taran42 @BJacobson @JBeatty, do you happen to have a quick Import example using Python that @mali05 can use as a starting off point? As the [documentation](https://developers.hubspot.com/docs/api/crm/imports) doesn’t provide one (I’ll inquire about that on my end)

Thank you very much! — Jaycee

---

<div class="post-metadata">

**Author:** ![mali05](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mali05](https://community.hubspot.com/u/mali05)\
**Post date:** [September 7, 2022, 9:08am UTC](https://community.hubspot.com/t/upload-contacts-using-python-client/64500/3 "2022-09-07T09:08:40Z")

</div>

thank you

---

<div class="post-metadata">

**Author:** ![mali05](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mali05](https://community.hubspot.com/u/mali05)\
**Post date:** [September 12, 2022, 9:13am UTC](https://community.hubspot.com/t/upload-contacts-using-python-client/64500/4 "2022-09-12T09:13:30Z")

</div>

Hey [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) @taran42 @BJacobson @JBeatty,

i still didn’t get any help regarding uploading the upload of contacts. can you please post a snippet code here, i would be glad.

---

<div class="post-metadata">

**Author:** ![taran42](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/taran42/32/105524_2.png) [@taran42](https://community.hubspot.com/u/taran42)\
**Post date:** [September 6, 2022, 9:25pm UTC](https://community.hubspot.com/t/upload-contacts-using-python-client/64500/5 "2022-09-06T21:25:20Z")

</div>

I think these two links should get you the info you need.

[API Imports](https://developers.hubspot.com/docs/api/crm/imports)

[API Contacts](https://developers.hubspot.com/docs/api/crm/contacts)

You can also check out the v1 way of doing it, which may be useful.

[Update Contacts](https://legacydocs.hubspot.com/docs/methods/contacts/update_contact)

---

<div class="post-metadata">

**Author:** ![mali05](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mali05](https://community.hubspot.com/u/mali05)\
**Post date:** [September 7, 2022, 9:09am UTC](https://community.hubspot.com/t/upload-contacts-using-python-client/64500/6 "2022-09-07T09:09:19Z")

</div>

i already checked these documentation but they are incomplete. there is no python example on how to do a bulk contact list uplaod.

---

<div class="post-metadata">

**Author:** ![mali05](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mali05](https://community.hubspot.com/u/mali05)\
**Post date:** [September 7, 2022, 9:09am UTC](https://community.hubspot.com/t/upload-contacts-using-python-client/64500/7 "2022-09-07T09:09:54Z")

</div>

and when i tried with the API with the example, it just returened a 400 Error code
