I’m using the API to bulk add organization relationships, and it seems to be hitting a limit of sorts. But the limit has somewhat odd behavior:
- When adding relationships to an organization, the
POST /v1/organizationRelationshipstransaction seemed to be successful, even adding ~700 of them to the same parent organization (
- In the user interface, said parent has only 100 daughter organizations.
- When queried from the API,
GET /v1/organizationRelationships/?org_id=123gives only 100 organization relationship objects.
- When trying to recreate an organization relationship that was part of the 700, but not part of the 100 returned by the API, I get the error, “A relationship already exists.”
- I inspected the IDs returned in those 100 to try to guess the ID of an organization relationship that probably exists, but wasn’t returned by the API. And it did exist! And it indeed related to the same organization (123).
So it appears that all the organization relationships were created, and they seem to exist in the Pipedrive database. But they’re just not returned beyond the first 100 by the API! And no error is given either—it’s failing silently.
I thought maybe the list was subject to pagination, but the API reference doesn’t list the pagination query parameters for this endpoint. But then I tried querying
GET /v1/organizationRelationships?org_id=123&start=100 and it returned a different 100 relationships! And other results were consistent with pagination:
GET /v1/organizationRelationships?org_id=123&start=800 returned no results, as expected. But one thing still wasn’t consistent with pagination: the response’s
false, even when there were clearly more items in the collection. And using
&limit=500 indeed returned 500 results.
So basically, it appears that organization relationships lists are paginated, but it’s not documented, and it always (misleadingly) returns
A knowledge base article seems to suggest that “Up to 100 related organizations can be added per user account.” But this seems different to what is going on here? Neither a limit nor pagination are documented in the API reference and I couldn’t (easily) find it anywhere else.
Has anyone else hit this? Is this expected behavior?