Batch reading by unique properties (not id)

Hello all,
I’m trying to do a batch read where i don’t have access to the internal hubspot id of the records i want to read, but i do have access to their `domain` value. It looks like it should be possible to do this (i.e. do a batch read based on a unique property other than the id, such as domain). Accounts Dashboard | HubSpot
But whenever i try to call the interface without the id, like so:
api_client.crm.companies.batch_api.read(batch_read_input_simple_public_object_id=BatchReadInputSimplePublicObjectId(id_property=“domain”, inputs=[{“domain”:<domain_value>}]))
I get the error:

HTTP response body: {“status”:“error”,“message”:“Invalid input JSON on line 1, column 61. Some required fields were not set: [id]”,“correlationId”:“13311a7b-2829-4f88-a587-452d8560ee28”,“category”:“VALIDATION_ERROR”}
Can anyone help me understand how to do a batch read without the internal id (using another unique property) If this is possible?

Hi @PDenning :waving_hand:

I don’t think this is possible using the Company property “domain”, as per this related HubSpot Community post: https://community.hubspot.com/t5/APIs-Integrations/Retrieve-company-by-domain/td-p/752039

What you might consider doing is (as suggested in the post linked above):

  1. Use the CRM Search API (search for Company where domain equals insert.relevant.domain), or
  2. Considering using a workflow (or similar automated process) to copy Company domain name to a custom property where “hasUniqueValue” has been set to “true”.

I hope this proves useful. Please let me know if you have any follow-up questions.