organization includes a location_ids array of loc_… ids rather than the
full location objects. To avoid a second round trip, you can ask the API to
expand those references and return the related objects inline.
How it works
Pass one or moreexpand[] query parameters naming the fields you want to
inline. Each expandable field has a documented expansion target — for an
organization, the expandable field is locations.
Without expansion
By default, the organization returns only ids. You would need a follow-up request per location to hydrate them.Default response
With expansion
When you expandlocations, the response adds a locations field containing the
full location objects inline. The original id fields are preserved.
Expanded response
Expansion is additive. The
location_ids array still appears alongside the
expanded locations field, so existing integrations that read ids keep
working.ids vs. expandable fields
Fields that hold a reference are named with the_id or _ids suffix and return
opaque, prefixed identifiers. Each one maps to an expandable field you can
request via expand[].
| Resource | id field | Holds | Expandable field | Expands to |
|---|---|---|---|---|
organization | location_ids | loc_… ids | locations | array of location |
location | organization_id | org_… id | — | not expandable |
Only fields documented as expandable can be passed to
expand[]. The
organization_id on a location is a reference id but is not currently
expandable.List expansions are conservative
Expansion is also available on list endpoints, but it is applied conservatively: theexpand[] parameter resolves references on each item in
the data array, and only documented expandable fields are honored. Combine it
with pagination to keep responses bounded.
List response (truncated)
Parameters
Repeatable. Each value names a documented expandable field on the resource (or
on each item, for lists). Unrecognized field names are ignored rather than
expanded.
Response fields
Always present on an
organization. The loc_… ids of its locations,
returned whether or not locations is expanded.Present only when
expand[]=locations is requested. Contains the full
location objects referenced by location_ids.Related
Pagination
Page through list endpoints with cursor-based
limit, starting_after, and
ending_before — pair it with conservative list expansions.