Skip to navigation

Includes and sparse fieldsets

Fetch related resources and choose the attributes you receive
View as MarkdownOpen in Claude

include adds related resources to the response, so you do not need a second request for them. Pass a comma-separated list of relationships:

curl "https://api.modulards.com/api/public/v1/sites?include=team,tags" \
-H "Authorization: Bearer $MODULAR_DS_TOKEN"

Each resource in data then lists the related ids under relationships, and the related resources themselves appear once each in the top-level included array. Each endpoint documents the includes it accepts; any other answers 400 (see Filtering and sorting).

Sparse fieldsets

fields[type] limits the attributes returned for resources of that type. The key is the resource type, and the value a comma-separated list of attributes:

fields[sites]=name,host

Computed attributes

Some attributes cost more to produce, so a plain listing leaves them out and you ask for them through fields. On websites, for example, note (the private note, decrypted on demand) and is_favorite are only returned when you request them:

fields[sites]=name,note,is_favorite

Each endpoint documents which of its attributes are computed this way. Sorting by a computed attribute, where the endpoint allows it, computes it too.