Assemble Developer Portal

Query Builder (3.0)

Download OpenAPI specification:Download

This documentation describes how to retrieve, store and update saved queries.

Saved queries

Saved queries listing

Retrieve a paginated response of saved queries

Note: endpoint is available with "query-builder" feature

Authorizations:
JWT

Responses

Response Schema: application/json
Array of objects (Saved query)
object

Response samples

Content type
application/json
{
  • "data": [
    • {
      • "id": 2432,
      • "name": "string",
      • "description": "Sample saved query",
      • "query": [
        • {
          • "predicate": "andWhere",
          • "field": "first_name, appear_in_directory, t_shirt_size",
          • "relationType": "user",
          • "operator": "=",
          • "value": "Medium"
          }
        ],
      • "type": "users",
      • "global": true,
      • "created_at": "2023-01-05 14:40:25",
      • "created_by": {
        • "id": 46485,
        • "display_name": "John Smith",
        • "title": "Mr",
        • "profile_photo_url": "http://example.com",
        • "can_manage": true,
        • "role_name": "Volunteer",
        • "team_name": "Kent",
        • "about_me": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget.",
        • "facebook": "john.smith",
        • "twitter": "john.smith",
        • "on_hold": "with-contact",
        • "appear_in_directory": true,
        • "appear_in_near_me": true,
        • "is_volunteer": true,
        • "is_non_volunteer": true,
        • "is_system": true,
        • "anonymised": null,
        • "volunteer_for": "2 years",
        • "on_call": true,
        • "on_call_end": "2019-08-24T14:15:22Z",
        • "first_name": "John",
        • "last_name": "Smith",
        • "username": "john.smith",
        • "dob": "1985-01-01",
        • "adult_at_risk": true,
        • "preferred_name": "string",
        • "on_hold_start": "string",
        • "on_hold_end": "string",
        • "status": {
          • "id": "1",
          • "name": "Active",
          • "contactable": true
          },
        • "is_minor": true,
        • "start_date": "2020-01-01",
        • "2fa_enabled": true,
        • "2fa_disabled": true,
        • "internal_email": "string",
        • "flags": { },
        • "accessibility_info": "string",
        • "finance_ref": "string",
        • "int_ref": "string",
        • "personal_risk_assessment": {
          • "id": 5982
          }
        },
      • "updated_at": "2023-01-05 14:40:25",
      • "ephemeral": true
      }
    ],
  • "meta": {
    • "pagination": {
      • "total": "string",
      • "count": "string",
      • "per_page": "string",
      • "current_page": "string",
      • "total_pages": "string",
      • "links": {
        • "next": "string",
        • "previous": "string"
        }
      }
    }
}

Create a new saved query

Create a new saved query

Note: endpoint is available with "query-builder" feature

Authorizations:
JWT
Request Body schema: application/json
name
string
description
string
Array of objects
global
boolean

Specifies whether the query should be made available to the entire organisation

Responses

Response Schema: application/json
object (Saved query)

A model representing a stored query created using the query builder

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "query": [
    • {
      • "predicate": "andWhere",
      • "field": "first_name, appear_in_directory, t_shirt_size",
      • "relationType": "user",
      • "operator": "=",
      • "value": "Medium"
      }
    ],
  • "global": true
}

Response samples

Content type
application/json
{
  • "data": {
    • "id": 2432,
    • "name": "string",
    • "description": "Sample saved query",
    • "query": [
      • {
        • "predicate": "andWhere",
        • "field": "first_name, appear_in_directory, t_shirt_size",
        • "relationType": "user",
        • "operator": "=",
        • "value": "Medium"
        }
      ],
    • "type": "users",
    • "global": true,
    • "created_at": "2023-01-05 14:40:25",
    • "created_by": {
      • "id": 46485,
      • "display_name": "John Smith",
      • "title": "Mr",
      • "profile_photo_url": "http://example.com",
      • "can_manage": true,
      • "role_name": "Volunteer",
      • "team_name": "Kent",
      • "about_me": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget.",
      • "facebook": "john.smith",
      • "twitter": "john.smith",
      • "on_hold": "with-contact",
      • "appear_in_directory": true,
      • "appear_in_near_me": true,
      • "is_volunteer": true,
      • "is_non_volunteer": true,
      • "is_system": true,
      • "anonymised": null,
      • "volunteer_for": "2 years",
      • "on_call": true,
      • "on_call_end": "2019-08-24T14:15:22Z",
      • "first_name": "John",
      • "last_name": "Smith",
      • "username": "john.smith",
      • "dob": "1985-01-01",
      • "adult_at_risk": true,
      • "preferred_name": "string",
      • "on_hold_start": "string",
      • "on_hold_end": "string",
      • "status": {
        • "id": "1",
        • "name": "Active",
        • "contactable": true
        },
      • "is_minor": true,
      • "start_date": "2020-01-01",
      • "2fa_enabled": true,
      • "2fa_disabled": true,
      • "internal_email": "string",
      • "flags": { },
      • "accessibility_info": "string",
      • "finance_ref": "string",
      • "int_ref": "string",
      • "personal_risk_assessment": {
        • "id": 5982
        }
      },
    • "updated_at": "2023-01-05 14:40:25",
    • "ephemeral": true
    }
}

Show a saved query

Retrieve a specific saved query

Note: endpoint is available with "query-builder" feature

Authorizations:
JWT
path Parameters
id
required
string

Responses

Response Schema: application/json
object (Saved query)

A model representing a stored query created using the query builder

Response samples

Content type
application/json
{
  • "data": {
    • "id": 2432,
    • "name": "string",
    • "description": "Sample saved query",
    • "query": [
      • {
        • "predicate": "andWhere",
        • "field": "first_name, appear_in_directory, t_shirt_size",
        • "relationType": "user",
        • "operator": "=",
        • "value": "Medium"
        }
      ],
    • "type": "users",
    • "global": true,
    • "created_at": "2023-01-05 14:40:25",
    • "created_by": {
      • "id": 46485,
      • "display_name": "John Smith",
      • "title": "Mr",
      • "profile_photo_url": "http://example.com",
      • "can_manage": true,
      • "role_name": "Volunteer",
      • "team_name": "Kent",
      • "about_me": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget.",
      • "facebook": "john.smith",
      • "twitter": "john.smith",
      • "on_hold": "with-contact",
      • "appear_in_directory": true,
      • "appear_in_near_me": true,
      • "is_volunteer": true,
      • "is_non_volunteer": true,
      • "is_system": true,
      • "anonymised": null,
      • "volunteer_for": "2 years",
      • "on_call": true,
      • "on_call_end": "2019-08-24T14:15:22Z",
      • "first_name": "John",
      • "last_name": "Smith",
      • "username": "john.smith",
      • "dob": "1985-01-01",
      • "adult_at_risk": true,
      • "preferred_name": "string",
      • "on_hold_start": "string",
      • "on_hold_end": "string",
      • "status": {
        • "id": "1",
        • "name": "Active",
        • "contactable": true
        },
      • "is_minor": true,
      • "start_date": "2020-01-01",
      • "2fa_enabled": true,
      • "2fa_disabled": true,
      • "internal_email": "string",
      • "flags": { },
      • "accessibility_info": "string",
      • "finance_ref": "string",
      • "int_ref": "string",
      • "personal_risk_assessment": {
        • "id": 5982
        }
      },
    • "updated_at": "2023-01-05 14:40:25",
    • "ephemeral": true
    }
}

Update a saved query

Update an existing saved query

Note: endpoint is available with "query-builder" feature

Authorizations:
JWT
path Parameters
id
required
string
Request Body schema: application/json
id
integer

The unique ID of the saved query record

name
string <= 255 characters

Name of the saved query

description
string <= 255 characters

The description of a saved query

Array of objects

An array of Query Builder Fragments to filter results by

global
boolean

Specifies whether the saved query can be accessible by other users in the organisation

created_at
string <date-time>

Creation time of the saved query

object
ephemeral
boolean

When true, indicates this is a temporary query that will be deleted after execution

Responses

Response Schema: application/json
object (Saved query)

A model representing a stored query created using the query builder

Request samples

Content type
application/json
{
  • "id": 2432,
  • "name": "string",
  • "description": "Sample saved query",
  • "query": [
    • {
      • "predicate": "andWhere",
      • "field": "first_name, appear_in_directory, t_shirt_size",
      • "relationType": "user",
      • "operator": "=",
      • "value": "Medium"
      }
    ],
  • "global": true,
  • "created_at": "2023-01-05 14:40:25",
  • "created_by": {
    • "id": 46485,
    • "title": "Mr",
    • "can_manage": true,
    • "about_me": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget.",
    • "facebook": "john.smith",
    • "twitter": "john.smith",
    • "appear_in_directory": true,
    • "appear_in_near_me": true,
    • "on_call": true,
    • "on_call_end": "2019-08-24T14:15:22Z",
    • "first_name": "John",
    • "last_name": "Smith",
    • "dob": "1985-01-01",
    • "adult_at_risk": true,
    • "preferred_name": "string",
    • "on_hold_start": "string",
    • "on_hold_end": "string",
    • "status": { },
    • "start_date": "2020-01-01",
    • "2fa_disabled": true,
    • "accessibility_info": "string",
    • "finance_ref": "string",
    • "int_ref": "string",
    • "personal_risk_assessment": {
      • "id": 5982
      }
    },
  • "ephemeral": true
}

Response samples

Content type
application/json
{
  • "data": {
    • "id": 2432,
    • "name": "string",
    • "description": "Sample saved query",
    • "query": [
      • {
        • "predicate": "andWhere",
        • "field": "first_name, appear_in_directory, t_shirt_size",
        • "relationType": "user",
        • "operator": "=",
        • "value": "Medium"
        }
      ],
    • "type": "users",
    • "global": true,
    • "created_at": "2023-01-05 14:40:25",
    • "created_by": {
      • "id": 46485,
      • "display_name": "John Smith",
      • "title": "Mr",
      • "profile_photo_url": "http://example.com",
      • "can_manage": true,
      • "role_name": "Volunteer",
      • "team_name": "Kent",
      • "about_me": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Laoreet suspendisse interdum consectetur libero id faucibus nisl tincidunt eget.",
      • "facebook": "john.smith",
      • "twitter": "john.smith",
      • "on_hold": "with-contact",
      • "appear_in_directory": true,
      • "appear_in_near_me": true,
      • "is_volunteer": true,
      • "is_non_volunteer": true,
      • "is_system": true,
      • "anonymised": null,
      • "volunteer_for": "2 years",
      • "on_call": true,
      • "on_call_end": "2019-08-24T14:15:22Z",
      • "first_name": "John",
      • "last_name": "Smith",
      • "username": "john.smith",
      • "dob": "1985-01-01",
      • "adult_at_risk": true,
      • "preferred_name": "string",
      • "on_hold_start": "string",
      • "on_hold_end": "string",
      • "status": {
        • "id": "1",
        • "name": "Active",
        • "contactable": true
        },
      • "is_minor": true,
      • "start_date": "2020-01-01",
      • "2fa_enabled": true,
      • "2fa_disabled": true,
      • "internal_email": "string",
      • "flags": { },
      • "accessibility_info": "string",
      • "finance_ref": "string",
      • "int_ref": "string",
      • "personal_risk_assessment": {
        • "id": 5982
        }
      },
    • "updated_at": "2023-01-05 14:40:25",
    • "ephemeral": true
    }
}

Delete a saved query

Delete an existing saved query

Note: endpoint is available with "query-builder" feature

Authorizations:
JWT
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "Unauthorized action",
  • "status_code": "403"
}

Validate a query

Check if a query is valid and can be executed by the current user

Note: endpoint is available with "query-builder" feature

Authorizations:
JWT
Request Body schema: application/json
Array of objects
name
string
description
string

Responses

Response Schema: application/json
can_save
boolean

Whether the query structure is valid

can_view
boolean

Whether the user has permission to access all fields used in the query

Request samples

Content type
application/json
{
  • "query": [
    • {
      • "predicate": "andWhere",
      • "field": "first_name, appear_in_directory, t_shirt_size",
      • "relationType": "user",
      • "operator": "=",
      • "value": "Medium"
      }
    ],
  • "name": "string",
  • "description": "string"
}

Response samples

Content type
application/json
{
  • "can_save": true,
  • "can_view": true
}