Search folders

When searching folders you have the ability to search for all folders (country,state,region,area,location) or just leaf_nodes (locations).

Examples

Search first 100 folder items

curl -X POST "https://api.safetyculture.io/directory/v1/folders/search" \
-H "Authorization: Bearer {api_token}" \
-d '{
    "query": "221 Sturt St",
    "limit": 100
}'

Search next 100 folder items

curl -X POST "https://api.safetyculture.io/directory/v1/folders/search" \
-H "Authorization: Bearer {api_token}" \
-d '{
    "query": "221 Sturt St",
    "limit": 100,
    "page_token": "57kljdlzvvvsdfgg"
}'

Search for only location folders

curl -X POST "https://api.safetyculture.io/directory/v1/folders/search" \
-H "Authorization: Bearer {api_token}" \
-d '{
    "query": "221 Sturt St",
    "only_leaf_nodes": true
}'

Search folders in desc order

curl -X POST "https://api.safetyculture.io/directory/v1/folders/search" \
-H "Authorization: Bearer {api_token}" \
-d '{
    "query": "221 Sturt St",
    "order_by": { sort_order: 2 }
}'

Search for specific folders

curl -X POST "https://api.safetyculture.io/directory/v1/folders/search" \
-H "Authorization: Bearer {api_token}" \
-d '{
    "query": "221 Sturt St",
    "filters": [
        { "not": false, "folder_id": "4fb56fa8-fa23-4a9c-907e-8367abc75a2d" },
        { "not": false, "folder_id": "3fb56fa8-fa23-4a9c-907e-8367abc75a2f" },
        { "not": false, "folder_id": "2fb56fa8-fa23-4a9c-907e-8367abc75a2c" }
    ]
}'

Search for specific meta_labels and folders

curl -X POST "https://api.safetyculture.io/directory/v1/folders/search" \
-H "Authorization: Bearer {api_token}" \
-d '{
    "query": "221 Sturt St",
    "filters": [
        { "not": false, "meta_label": "location" },
        { "not": false, "folder_id": "3fb56fa8-fa23-4a9c-907e-8367abc75a2f" },
        { "not": false, "folder_id": "2fb56fa8-fa23-4a9c-907e-8367abc75a2c" }
    ]
}'
Body Params

The parameters for SearchFoldersRequest

The parameters for SearchFoldersRequest

string

Optional. The search value to query folders with when provided. When not
provided, either all of the organisations folders or users folders will be
returned in a paginated way

order_by
object

FoldersOrderBy represents the sort order folders will be returned in

filters
array of objects

Optional. Filters to apply when getting folders. Used for only returning
folders that match the filter setting. i.e. only returning meta_label
'location'. Maximum of 1000 filters allowed.

filters
boolean

When true, SearchFolders will only return folders that are assigned to
the user making the request. Defaults to false

boolean

When true, SearchFolders will only search location folders. Defaults to false.

boolean

Whether to return the directly associated members
count with the folders. Defaults to false.

boolean

Whether to return the total number of folders discovered
in the query. Defaults to false

boolean

Whether to return both deleted and non-deleted folders. Defaults to false

int32

The number of results to be returned. maximum 1500, default 500

string

The offset used for pagination. The starting number for the next query

boolean

Optional. When true, folders will still be returned when disabled for the
organisation

string

domain represents the type/domain/hierarchy for the folder. This is used
for getting folders of a certain domain, i.e. getting all template
folders or site folders

Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json