SR
Click to open github profile
Endpoints

customQuery

Learn how to use the customQuery API endpoint.


The customQuery endpoint allows you to query addresses, assets, entries, and users directly via URL parameters. It returns a JSON response for easy consumption.

To use it, simply send a GET request to: ${PRIMARY_SITE_URL}/v1/api/queryApi/customQuery with some query params. This could look like that /v1/api/queryApi/customQuery?elementType=entries&section=home&one=1.

A full example with an access token might look like this:

curl --request GET \
  --url 'https://your-site.ddev.site/v1/api/queryApi/customQuery?elementType=entries&section=home&one=1' \
  --header 'authorization: Bearer your-access-token'

GET Params

Each element type has its own set of available GET parameters. This ensures precise control over the query and enhances security. Internally, these parameters are filtered to prevent potential exploits.

Special Parameters

Below is a list of special GET parameters that are available in all element types.

ParamsDescriptionPossible Values
allFetch all elements1
elementTypeSpecify the element type to queryaddresses, assets, entries, users
includeAllEntryWhether to include the full data of entries or just the minimal fields (title, URI, ID, and slug).1 for true and 0 for false
fieldsQuery specific field data by handlestring or array of field handles, use dot notation to filter out nested data, use * as a wildcard
oneFetch a single element1
Note

The following parameters are required: elementType and either one or all.

fields

The fields param is a simple filter, to minify the response returned to the client. You can use a * in combination with fieldhandle.nestedFieldHandle, to filter out stuff that is not important.

includeAllEntry

The includeAllEntry defines how entry relations from an Entries field are returned. If enabled, the customQuery endpoint will include full entry objects, otherwise only minimal data (title, URI, ID, slug) is returned. To enable this setting globally you can use the includeAllEntry setting

Warning

If you use the includeAllEntry param, be sure that you don't have circular entry relations. This would end up in an endless loop.

Addresses

Below is a list of all available GET parameters for the addresses element type:

ParamsElement type
addressLine1addresses
addressLine2addresses
addressLine3addresses
fullNameaddresses
idall
limitall
localityaddresses
offsetall
orderByall
organizationaddresses
searchall

Assets

Below is a list of all available GET parameters for the assets element type:

ParamsElement type
filenameassets
idall
kindassets
limitall
offsetall
orderByall
searchall
siteassets
siteIdassets
volumeassets

Entries

Below is a list of all available GET parameters for the entries element type:

ParamsElement type
idall
levelentries
limitall
offsetall
orderByall
postDateentries
searchall
sectionentries
sectionIdentries
siteentries
siteIdentries
slugentries
statusall
typeentries
urientries

Users

Below is a list of all available GET parameters for the users element type:

ParamsElement type
adminusers
authorOfusers
emailusers
fullNameusers
groupusers
groupIdusers
hasPhotousers
idall
limitall
offsetall
orderByall
searchall
statusall

Copyright © 2025 Samuel Reichör