Expanding objects
Learn how to expand related objects in API responses using the expand
query parameter.
Overview
The API supports expanding related objects in responses using the expand
query parameter. This allows you to retrieve complete objects instead of just their IDs. For example, when fetching an event, you can expand the associated user object to get the full user details instead of just the userId
.
Basic Usage
Single Object Expansion
For one-to-one relationships, use the expand
parameter to include the full object. For example, adding ?expand=user
to a request will include the complete user object in the response.
List Expansion
For one-to-many relationships, the API will return an array of expanded objects. By default, these fields are null
(not expanded). For example, adding ?expand=memberships
will include an array of all the user’s memberships.
Advanced Usage
Nested Expansion
You can expand nested relationships by using dot notation (.
). For example, ?expand=memberships.company
will expand both the memberships and their associated companies.
Multiple Expansions
To expand multiple objects simultaneously, use the array syntax with multiple paths:
Supported Endpoints
The expand
parameter can be used on any endpoint that returns expandable fields, including:
- List endpoints
- Create endpoints
- Update endpoints