API Reference
Create team explorer preset
Saves a reusable (optionally parameterized) Data Explorer query. Parameters are allowed for visual-mode presets (placeholders in filter values) and for raw-mode presets whose ra…
POST /api/explorer-presets
Saves a reusable (optionally parameterized) Data Explorer query. Parameters are allowed for visual-mode presets (placeholders in filter values) and for raw-mode presets whose rawQuery is valid JSON (placeholders inside JSON string literals, e.g. Mongo). Every parameter must be referenced by a {{name}} placeholder, and every placeholder must reference a declared parameter.
Operation ID: createExplorerPreset
Authentication
Option 1
- BearerAuth (
http bearer) API key token. Create via POST /api/api-keys. Format:envoy_<hex>
Option 2
- CookieAuth (
apiKey) Session cookie set after login + TOTP verification
Request body
The request body is required.
application/json
- Type:
object - Properties:
name(string,required)connector_id(integer | null)- Nullable: yes
resource(string | null)- Nullable: yes
definition(ExplorerPresetDefinition,required)- Reference:
ExplorerPresetDefinition- Properties:
mode(string,required) — Parameters are allowed invisualmode (placeholders in filter values) and inrawmode whenrawQueryis valid JSON (placeholders inside JSON string literals). SQL/OData raw queries cannot be parameterized.- Description: Parameters are allowed in
visualmode (placeholders in filter values) and inrawmode whenrawQueryis valid JSON (placeholders inside JSON string literals). SQL/OData raw queries cannot be parameterized. - Allowed values:
visual,raw
- Description: Parameters are allowed in
filters(array<ExplorerFilter>)- Items:
- Reference:
ExplorerFilter- Type:
object - Properties:
field(string,required)operator(string,required)value(string,required) — A literal value, or a{{param}}placeholder referencing a name in the preset'sparameters.valueType(string) — Optional type hint. UseobjectIdfor MongoDB ObjectId fields so the value is coerced to Extended JSON on apply.- Description: Optional type hint. Use
objectIdfor MongoDB ObjectId fields so the value is coerced to Extended JSON on apply. - Allowed values:
auto,string,number,boolean,null,objectId,date
- Description: Optional type hint. Use
- Type:
- Reference:
- Items:
action(string) — Visual builder action. Defaults to find when omitted.- Description: Visual builder action. Defaults to find when omitted.
- Allowed values:
find,count,insert,update,delete
rawQuery(string) — Raw query string formode: raw(SQL, Mongo Extended JSON, or OData). Ignored by parameterization.columns(array<string>)- Items:
- Type:
string
- Type:
- Items:
limit(string)sort(string) — Visual-mode sort columnorder(string) — Visual-mode sort direction (omit or asc when unsorted / ascending)- Description: Visual-mode sort direction (omit or asc when unsorted / ascending)
- Allowed values:
asc,desc
resultView(string)- Allowed values:
table,json
- Allowed values:
jsonata(string)csvDelimiter(string)parameters(array<PresetParameter>) — Visual-mode only. Every parameter must be referenced by a{{name}}placeholder in a filter value, and every placeholder must reference a declared parameter.- Description: Visual-mode only. Every parameter must be referenced by a
{{name}}placeholder in a filter value, and every placeholder must reference a declared parameter. - Items:
- Reference:
PresetParameter- Type:
object - Properties:
name(string,required) — Referenced as{{name}}in a filter value. Letters, numbers, and underscores only; unique within the preset.label(string,required) — Shown in the apply dialog.required(boolean)- Default:
true
- Default:
type(string,required) —string— free text.objectId— free text validated as a 24-char hex ObjectId.mongoRecord— searchable record picker over a Mongo collection on the preset's connector.- Description:
string— free text.objectId— free text validated as a 24-char hex ObjectId.mongoRecord— searchable record picker over a Mongo collection on the preset's connector. - Allowed values:
string,objectId,mongoRecord
- Description:
collection(string) — Required formongoRecord. The Mongo collection to query (e.g.migration_jobs).valueField(string) — mongoRecord. Field substituted into the filter. Defaults to_id(coerced to ObjectId hex).labelField(string) — mongoRecord. Primary display label (e.g.name).descriptionFields(array<string>) — mongoRecord. Muted metadata fields shown under the label.- Description: mongoRecord. Muted metadata fields shown under the label.
- Items:
- Type:
string
- Type:
searchFields(array<string>) — mongoRecord. Fields searched server-side for the picker query.- Description: mongoRecord. Fields searched server-side for the picker query.
- Items:
- Type:
string
- Type:
filter(object) — mongoRecord. Base filter merged into every picker query.sort(object) — mongoRecord. Mongo sort object.- Description: mongoRecord. Mongo sort object.
- Additional properties:
- Type:
integer - Allowed values:
1,-1
- Type:
- Type:
- Reference:
- Description: Visual-mode only. Every parameter must be referenced by a
- Properties:
- Reference:
Success responses
201
Created preset
Content type: application/json
- Reference:
ExplorerPreset- Type:
object - Properties:
id(integer)name(string)connector_id(integer | null)- Nullable: yes
resource(string | null)- Nullable: yes
definition(ExplorerPresetDefinition)- Reference:
ExplorerPresetDefinition- Properties:
mode(string,required) — Parameters are allowed invisualmode (placeholders in filter values) and inrawmode whenrawQueryis valid JSON (placeholders inside JSON string literals). SQL/OData raw queries cannot be parameterized.- Description: Parameters are allowed in
visualmode (placeholders in filter values) and inrawmode whenrawQueryis valid JSON (placeholders inside JSON string literals). SQL/OData raw queries cannot be parameterized. - Allowed values:
visual,raw
- Description: Parameters are allowed in
filters(array<ExplorerFilter>)- Items:
- Reference:
ExplorerFilter- Type:
object - Properties:
field(string,required)operator(string,required)value(string,required) — A literal value, or a{{param}}placeholder referencing a name in the preset'sparameters.valueType(string) — Optional type hint. UseobjectIdfor MongoDB ObjectId fields so the value is coerced to Extended JSON on apply.- Description: Optional type hint. Use
objectIdfor MongoDB ObjectId fields so the value is coerced to Extended JSON on apply. - Allowed values:
auto,string,number,boolean,null,objectId,date
- Description: Optional type hint. Use
- Type:
- Reference:
- Items:
action(string) — Visual builder action. Defaults to find when omitted.- Description: Visual builder action. Defaults to find when omitted.
- Allowed values:
find,count,insert,update,delete
rawQuery(string) — Raw query string formode: raw(SQL, Mongo Extended JSON, or OData). Ignored by parameterization.columns(array<string>)- Items:
- Type:
string
- Type:
- Items:
limit(string)sort(string) — Visual-mode sort columnorder(string) — Visual-mode sort direction (omit or asc when unsorted / ascending)- Description: Visual-mode sort direction (omit or asc when unsorted / ascending)
- Allowed values:
asc,desc
resultView(string)- Allowed values:
table,json
- Allowed values:
jsonata(string)csvDelimiter(string)parameters(array<PresetParameter>) — Visual-mode only. Every parameter must be referenced by a{{name}}placeholder in a filter value, and every placeholder must reference a declared parameter.- Description: Visual-mode only. Every parameter must be referenced by a
{{name}}placeholder in a filter value, and every placeholder must reference a declared parameter. - Items:
- Reference:
PresetParameter- Type:
object - Properties:
name(string,required) — Referenced as{{name}}in a filter value. Letters, numbers, and underscores only; unique within the preset.label(string,required) — Shown in the apply dialog.required(boolean)- Default:
true
- Default:
type(string,required) —string— free text.objectId— free text validated as a 24-char hex ObjectId.mongoRecord— searchable record picker over a Mongo collection on the preset's connector.- Description:
string— free text.objectId— free text validated as a 24-char hex ObjectId.mongoRecord— searchable record picker over a Mongo collection on the preset's connector. - Allowed values:
string,objectId,mongoRecord
- Description:
collection(string) — Required formongoRecord. The Mongo collection to query (e.g.migration_jobs).valueField(string) — mongoRecord. Field substituted into the filter. Defaults to_id(coerced to ObjectId hex).labelField(string) — mongoRecord. Primary display label (e.g.name).descriptionFields(array<string>) — mongoRecord. Muted metadata fields shown under the label.- Description: mongoRecord. Muted metadata fields shown under the label.
- Items:
- Type:
string
- Type:
searchFields(array<string>) — mongoRecord. Fields searched server-side for the picker query.- Description: mongoRecord. Fields searched server-side for the picker query.
- Items:
- Type:
string
- Type:
filter(object) — mongoRecord. Base filter merged into every picker query.sort(object) — mongoRecord. Mongo sort object.- Description: mongoRecord. Mongo sort object.
- Additional properties:
- Type:
integer - Allowed values:
1,-1
- Type:
- Type:
- Reference:
- Description: Visual-mode only. Every parameter must be referenced by a
- Properties:
- Reference:
created_by(integer)created_at(string)- Format:
date-time
- Format:
updated_at(string | null)- Format:
date-time - Nullable: yes
- Format:
- Type:
Error responses
400
Validation error (invalid definition)
Content type: application/json
- Reference:
Error- Type:
object - Properties:
error(string)- Example:
NOT_FOUND
- Example:
message(string)- Example:
Resource not found
- Example:
- Type:
Examples
cURL
curl --request POST \
--url 'https://your-envoy.example.com/api/explorer-presets' \
--header 'Authorization: Bearer $API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"name": "string",
"definition": {
"mode": "visual"
}
}'JavaScript (fetch)
const response = await fetch('https://your-envoy.example.com/api/explorer-presets', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"definition": {
"mode": "visual"
}
}),
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = response.status === 204 ? null : await response.json();
console.log(data);