Endpoints

Saved queries

GET/api/v1/me/saved-queries

Every saved query in the active org this user may see: org-visible ones plus their own private ones.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://example.com/api/v1/me/saved-queries"
[  {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",    "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",    "name": "string",    "query_text": "string",    "visibility": "private",    "time_from": "string",    "time_to": "string",    "source_default": "logs",    "presentation": {      "columns": [        "string"      ],      "column_widths": {        "property1": 0,        "property2": 0      },      "sort": {        "field": "string",        "direction": "asc"      },      "result_mode": "table"    },    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z"  }]
POST/api/v1/me/saved-queries

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/me/saved-queries" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "query_text": "string"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "name": "string",  "query_text": "string",  "visibility": "private",  "time_from": "string",  "time_to": "string",  "source_default": "logs",  "presentation": {    "columns": [      "string"    ],    "column_widths": {      "property1": 0,      "property2": 0    },    "sort": {      "field": "string",      "direction": "asc"    },    "result_mode": "table"  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
GET/api/v1/me/saved-queries/{saved_query_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

saved_query_id*Saved Query Id
Formatuuid

Response Body

application/json

application/json

curl -X GET "https://example.com/api/v1/me/saved-queries/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "name": "string",  "query_text": "string",  "visibility": "private",  "time_from": "string",  "time_to": "string",  "source_default": "logs",  "presentation": {    "columns": [      "string"    ],    "column_widths": {      "property1": 0,      "property2": 0    },    "sort": {      "field": "string",      "direction": "asc"    },    "result_mode": "table"  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
PATCH/api/v1/me/saved-queries/{saved_query_id}

Creator only. An org-visible query is readable by the whole org; it is not writable by it.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

saved_query_id*Saved Query Id
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/api/v1/me/saved-queries/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "name": "string",  "query_text": "string",  "visibility": "private",  "time_from": "string",  "time_to": "string",  "source_default": "logs",  "presentation": {    "columns": [      "string"    ],    "column_widths": {      "property1": 0,      "property2": 0    },    "sort": {      "field": "string",      "direction": "asc"    },    "result_mode": "table"  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
DELETE/api/v1/me/saved-queries/{saved_query_id}

Creator always; Owner/Admin additionally, but only for org-visible queries — an elevated role governs shared org content, not a member's personal content that happens to live in the org.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

saved_query_id*Saved Query Id
Formatuuid

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/me/saved-queries/497f6eca-6276-4993-bfeb-53cbbbba6f08"
Empty