This topic describes how to pre-load additional objects with an API request. These additional objects are referred to as embedded resources.
Use the ?expand query parameter to expand and include embedded objects within the _embedded property of the response. The _embedded property contains objects keyed by the values of the expand parameter. To expand multiple objects, pass them as a comma-separated list of resource names.
Expand may be used on GET, PATCH, POST, PUT requests.
Important warning
It is highly recommended to use expand for single resources only. This operation will negatively affect performance on collections.
Example request containing multiple objects:
?expand=recentInvoice,customerExample response:
{
"_embedded": {
"recentInvoice": {
"id": "invoice-1"
},
"customer": {
"id": "customer-1"
}
}
}