# How offset works \[API-DB Sync\]

**URL:** <https://community.hubspot.com/t/how-offset-works-api-db-sync/16428>\
**Category:** APIs & Integrations\
**Tags:** object\
**Created:** [September 25, 2019, 7:13pm UTC](https://community.hubspot.com/t/how-offset-works-api-db-sync/16428 "2019-09-25T19:13:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![caiorochap](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/caiorochap/32/43872_2.png) [@caiorochap](https://community.hubspot.com/u/caiorochap)\
**Post date:** [September 25, 2019, 7:13pm UTC](https://community.hubspot.com/t/how-offset-works-api-db-sync/16428/1 "2019-09-25T19:13:31Z")

</div>

Hi, I’m currently developing some jobs that synchronizes our Hub API to an internal Database. I’m only writing this because I’ve created two jobs for the deals specific API: one for a big batch load(the get all deals endpoint) and one to keep it updated. I wanted to know how **offset** works in the following scenario: is it possible for me to save the

**offset** parameter into my DB so I don’t need to request it all back again, whenever I call the job? I know there’s the parameter **since** , in the recently modified/created endpoints, but I’d like to know if I could use the **offset** as a checkpoint, as well as using the **since** parameter.

Thanks!

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [September 27, 2019, 3:06am UTC](https://community.hubspot.com/t/how-offset-works-api-db-sync/16428/2 "2019-09-27T03:06:47Z")

</div>

Hi @caiorochap,

I hope all is well with you 😄

Currently it is not possible to use the `since`parameter and using offset as a checkpoint on the [Get all deals API.](https://developers.hubspot.com/docs/methods/deals/get-all-deals) The offset value is the last deal ID that was given back. Offset cannot be use as a checkpoint as deals will constantly be created/deleted and so it is possible that the offset value will change.

I hope this helps to clarify things!

---

<div class="post-metadata">

**Author:** ![caiorochap](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/caiorochap/32/43872_2.png) [@caiorochap](https://community.hubspot.com/u/caiorochap)\
**Post date:** [September 27, 2019, 2:34pm UTC](https://community.hubspot.com/t/how-offset-works-api-db-sync/16428/3 "2019-09-27T14:34:11Z")

</div>

Hi, Wendy! Yes, this clarifies a lot. Thanks! I’d like to know if that works for all other endpoints, such as tickets, contacts and companies.

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [September 30, 2019, 1:16am UTC](https://community.hubspot.com/t/how-offset-works-api-db-sync/16428/4 "2019-09-30T01:16:11Z")

</div>

Hi @caiorochap,

That works for all the other endpoints. Such as [Get all contacts](https://developers.hubspot.com/docs/methods/contacts/get_contacts), [Get all companies](https://developers.hubspot.com/docs/methods/companies/get-all-companies) and [Get all tickets](https://developers.hubspot.com/docs/methods/tickets/get-all-tickets).

Hope this helps!

---

<div class="post-metadata">

**Author:** ![caiorochap](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/caiorochap/32/43872_2.png) [@caiorochap](https://community.hubspot.com/u/caiorochap)\
**Post date:** [September 30, 2019, 7:31pm UTC](https://community.hubspot.com/t/how-offset-works-api-db-sync/16428/5 "2019-09-30T19:31:43Z")

</div>

Thanks a lot, Wendy. I’d also like to know if there is any other parameter recommended to make this API synchronization incrementally, so I don’t have to always request the whole collection.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [October 1, 2019, 2:17am UTC](https://community.hubspot.com/t/how-offset-works-api-db-sync/16428/6 "2019-10-01T02:17:58Z")

</div>

Hi @caiorochap,

Currently the object API doesn’t have parameter such as date to retrieve object based on a specific date or specific property.

That said, if you have access to the [list tool](https://knowledge.hubspot.com/articles/kcs_article/lists/create-active-or-static-lists), you can use this endpoint: [Get contacts in a list | Contact Lists API](https://developers.hubspot.com/docs/methods/lists/get_list_contacts) to retrieve contacts in a particular list. The list can be easily created in your HubSpot portal with criteria set. The list tool is applicable to contact records only.

For both deals and companies, the best way to go about doing this is to use the get recently created/modified endpoint if you’re not looking to request the whole collection.
