# Batch Updates - Python

**URL:** <https://community.hubspot.com/t/batch-updates-python/103773>\
**Category:** APIs & Integrations\
**Tags:** python, companies\
**Created:** [March 29, 2024, 10:31pm UTC](https://community.hubspot.com/t/batch-updates-python/103773 "2024-03-29T22:31:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![APopp3](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@APopp3](https://community.hubspot.com/u/APopp3)\
**Post date:** [March 29, 2024, 10:31pm UTC](https://community.hubspot.com/t/batch-updates-python/103773/1 "2024-03-29T22:31:20Z")

</div>

I am trying to perform a simple batch update using the recommened python package hubspot-api-client.

My expectation is that I could create a list of dictionaries with the id and properties and use them as below:

from hubspot.crm.companies import SimplePublicObjectInput

from hubspot.crm.companies import BatchInputSimplePublicObjectBatchInput

companies\_to\_update = []

for company in companies:

companies\_to\_update.append(SimplePublicObjectInput(properties={

“id”: “12345”,

“level”: “good”

}))

objects\_input = [CompanyObjectInput(\*\*obj) for obj in companies\_to\_update]

batch\_input = BatchInputSimplePublicObjectBatchInput(inputs=objects\_input)

response = api\_client.crm.companies.batch\_api.update(batch\_input)

However, when I try this, the api responds that id is a required field. If I instead move [id] out of properties and into kwargs, then python barks at me that id is not an expected kwarg.

This would seem to me a very common use case which I can’t seem to get to work? Can anyone spot what I’m doing wrong?

---

<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:** [April 1, 2024, 7:04pm UTC](https://community.hubspot.com/t/batch-updates-python/103773/2 "2024-04-01T19:04:36Z")

</div>

Hi, @APopp3 👋 Welcome to our community. Were you able to get this worked out?

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![APopp3](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@APopp3](https://community.hubspot.com/u/APopp3)\
**Post date:** [April 1, 2024, 7:25pm UTC](https://community.hubspot.com/t/batch-updates-python/103773/3 "2024-04-01T19:25:25Z")

</div>

Hi Jaycee,

Thanks - no such luck trying to get this to work using the recommended python library. I think it might be more straightforward to just use the api without the library, although if someone were able to point out a solution with the library, that would be best, as I’m sure I would be losing out on many side benefits by not using the library.
