Many objects allow you to request additional information as an expanded response by using the expand
request parameter. This parameter is available on all API requests, and applies to the response of that request only.
The expandable label in this documentation indicates ID fields that you can expand into objects. When an object contains the ID of a related object in its response properties, you can expand these objects in line with the expand
request parameter.
For example, when querying Sources, without expanding any fields:
curl --request GET \
--url https://api.nekt.ai/api/v1/sources/ \
--header "x-api-key: <api-key>"
The API will return:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "78f91ad6-fb65-470e-b193-4f34fe2ba024",
"slug": "json-content-9pVL",
"active": true,
...
"connector_version": "dc371ad6-388f-48df-89d6-d64898ba9835",
"last_run": "0dce33ce-59a8-4adb-a92c-1366798ab96d",
"created_by": 14
}
]
}
Note that connector_version
field returned the ID of the Connector Version model related to this Source.
We can then expand this field, using the expand[]
query parameter:
curl --request GET \
--url https://api.nekt.ai/api/v1/sources/ \
--header "x-api-key: <api-key>" \
--data "expand[]"=connector_version \
--get
The API will return:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "78f91ad6-fb65-470e-b193-4f34fe2ba024",
"slug": "json-content-9pVL",
"active": true,
...
"connector_version": {
"id": "dc371ad6-388f-48df-89d6-d64898ba9835",
"version": "0.1",
"editable": true,
"connector": "97323c4a-7bd0-420a-a243-0feaee555a55"
},
"last_run": "0dce33ce-59a8-4adb-a92c-1366798ab96d",
"created_by": 14
}
]
}
Note that connector
field, inside the connector_version
field returned the ID of the Connector model related to the Connector Version.
Expanding recursively
You can expand recursively by specifying nested fields after a dot (.
). For example, requesting connector.customer
on a transaction expands the payment property into a full Payment object, then expands the customer property on that payment into a full Customer object.
Performing deep expansions might result in slower processing times.
This is an example expanding the connector
field of the connector_version
of a Source, using the expand[]
query parameter:
curl --request GET \
--url https://api.nekt.ai/api/v1/sources/ \
--header "x-api-key: <api-key>" \
--data "expand[]"=connector_version.connector \
--get
The API will return:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "78f91ad6-fb65-470e-b193-4f34fe2ba024",
"slug": "json-content-9pVL",
"active": true,
...
"connector_version": {
"id": "dc371ad6-388f-48df-89d6-d64898ba9835",
"version": "0.1",
"editable": true,
"connector": {
"id": "97323c4a-7bd0-420a-a243-0feaee555a55",
"created_at": "2025-04-14T23:40:01.572568-03:00",
"updated_at": "2025-04-14T23:50:08.062632-03:00",
"type": "source",
"name": "JSON Content",
"slug": "json-content",
"description": "The Json Content connector enables the seamless capture and unification of JSON data available as a payload in a public single-page endpoint.",
"logo": "https://statics.nekt.ai/connector/logos/97323c4a-7bd0-420a-a243-0feaee555a55-2025-04-15T024001.5726250000.jpg",
"docs_available": true,
"external_docs_url": null,
"current_version": "dc371ad6-388f-48df-89d6-d64898ba9835"
}
},
"last_run": "0dce33ce-59a8-4adb-a92c-1366798ab96d",
"created_by": 14
}
]
}
Maximum expansion depth
Expansions have a maximum depth of four levels.
Methods that support expanding
You can use the expand
parameter on any endpoint that returns expandable fields, including list, details, create, and update endpoints.
Performing deep expansions on numerous list requests might result in slower processing times.
You can expand multiple objects at the same time by identifying multiple items in the expand
array.