Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Saved Searches

Retrieving all saved searches

get
Preview

Retrieves the saved searches for every searchable type on the tenant: custom schema types, customer, and legal-entity. Each item includes type.

Required scopes
This endpoint requires the following scopes:
  • : Needed to search documents, to read saved searches, and to read search indexes and index jobs.
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name. Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
pageNumberinteger · min: 1Optional

Page number to be retrieved. The number of the first page is 1.

Default: 1
pageSizeinteger · min: 1 · max: 2000Optional

Number of items to be retrieved per page.

Default: 60
sortstringOptional

Comma-separated list of properties used to sort the results. The order of properties indicates their priority.

Possible values:

  • {fieldName}
  • {fieldName}:ASC
  • {fieldName}:DESC

When the direction is omitted, the field is sorted in ascending order. When sort is omitted, results are ordered by metadata.createdAt descending.

Example: name:ASC
qstringOptional

A standard query parameter is used to search for specific values.

See: Standard practises - Query parameter

fieldsstringOptional

Comma-separated list of saved search properties to return. When the parameter is omitted, the saved search is returned in full.

Example: id,name,indexId
Header parameters
Accept-LanguagestringOptional

List of language codes acceptable for the response.

  • If the header is set to a language or a list of languages, the service returns the first requested language that has a translation. Localized fields are maps with that language code as the key.
  • If the header is set to *, localized fields are retrieved as maps of translations, where the keys are language codes and values are the fields in their respective languages.
  • If the header is empty, localized fields are retrieved as maps containing a single translation, where the key is a language code and the value is the field in the specified language. The endpoint assumes that localized fields are to be retrieved in the tenant's default language defined in the Configuration Service.
  • If none of the requested languages has a translation, the localized fields are omitted from the response.
X-Total-CountbooleanOptional

Flag indicating whether the total count of retrieved items should be returned.

Default: false
Responses
200

The request succeeded. The body is the current page of saved searches.

application/json
get/search/{tenant}/search/queries
GET /search/{tenant}/search/queries HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "id": "red-cars",
    "type": "VEHICLE",
    "name": {
      "en": "Red cars"
    },
    "description": {
      "en": "Vehicles whose name contains red"
    },
    "indexId": "vehicles",
    "queries": {
      "type": "TEXT",
      "query": "red",
      "field": "name.en"
    },
    "metadata": {
      "version": 1,
      "createdAt": "2026-03-12T10:00:00.000Z",
      "modifiedAt": "2026-03-12T10:00:00.000Z"
    }
  },
  {
    "id": "city-bikes",
    "type": "BIKE",
    "name": {
      "en": "City bikes"
    },
    "description": {
      "en": "Bikes whose name contains city"
    },
    "indexId": "bikes",
    "queries": {
      "type": "TEXT",
      "query": "city",
      "field": "name.en"
    },
    "metadata": {
      "version": 1,
      "createdAt": "2026-03-13T10:00:00.000Z",
      "modifiedAt": "2026-03-13T10:00:00.000Z"
    }
  }
]

Retrieving saved searches

get
Preview

Retrieves the saved searches for one type.

When sort is omitted, saved searches are ordered by metadata.createdAt descending. When the X-Total-Count request header is true, the response includes the X-Total-Count header with the number of saved searches. The response body stays an array.

Required scopes
This endpoint requires the following scopes:
  • : Needed to search documents, to read saved searches, and to read search indexes and index jobs.
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name. Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
typestringRequired

Type of documents to search. Use a custom schema type, customer, or legal-entity.

Example: VEHICLE
Query parameters
pageNumberinteger · min: 1Optional

Page number to be retrieved. The number of the first page is 1.

Default: 1
pageSizeinteger · min: 1 · max: 2000Optional

Number of items to be retrieved per page.

Default: 60
sortstringOptional

Comma-separated list of properties used to sort the results. The order of properties indicates their priority.

Possible values:

  • {fieldName}
  • {fieldName}:ASC
  • {fieldName}:DESC

When the direction is omitted, the field is sorted in ascending order. When sort is omitted, results are ordered by metadata.createdAt descending.

Example: name:ASC
qstringOptional

A standard query parameter is used to search for specific values.

See: Standard practises - Query parameter

fieldsstringOptional

Comma-separated list of saved search properties to return. When the parameter is omitted, the saved search is returned in full.

Example: id,name,indexId
Header parameters
Accept-LanguagestringOptional

List of language codes acceptable for the response.

  • If the header is set to a language or a list of languages, the service returns the first requested language that has a translation. Localized fields are maps with that language code as the key.
  • If the header is set to *, localized fields are retrieved as maps of translations, where the keys are language codes and values are the fields in their respective languages.
  • If the header is empty, localized fields are retrieved as maps containing a single translation, where the key is a language code and the value is the field in the specified language. The endpoint assumes that localized fields are to be retrieved in the tenant's default language defined in the Configuration Service.
  • If none of the requested languages has a translation, the localized fields are omitted from the response.
X-Total-CountbooleanOptional

Flag indicating whether the total count of retrieved items should be returned.

Default: false
Responses
200

The request succeeded. The body is the current page of saved searches.

application/json
get/search/{tenant}/search/{type}/queries
GET /search/{tenant}/search/{type}/queries HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "id": "red-cars",
    "type": "VEHICLE",
    "name": {
      "en": "Red cars"
    },
    "description": {
      "en": "Vehicles whose name contains red"
    },
    "indexId": "vehicles",
    "queries": {
      "type": "TEXT",
      "query": "red",
      "field": "name.en"
    },
    "metadata": {
      "version": 1,
      "createdAt": "2026-03-12T10:00:00.000Z",
      "modifiedAt": "2026-03-12T10:00:00.000Z"
    }
  }
]

Retrieving a saved search

get
Preview

Retrieves one saved search.

Required scopes
This endpoint requires the following scopes:
  • : Needed to search documents, to read saved searches, and to read search indexes and index jobs.
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name. Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
typestringRequired

Type of documents to search. Use a custom schema type, customer, or legal-entity.

Example: VEHICLE
idstringRequired

Saved search id. Use 1 to 66 characters. Allowed characters are letters, digits, underscore, and hyphen.

Example: red-carsPattern: ^[\w-]{1,66}$
Query parameters
fieldsstringOptional

Comma-separated list of saved search properties to return. When the parameter is omitted, the saved search is returned in full.

Example: id,name,indexId
Header parameters
Accept-LanguagestringOptional

List of language codes acceptable for the response.

  • If the header is set to a language or a list of languages, the service returns the first requested language that has a translation. Localized fields are maps with that language code as the key.
  • If the header is set to *, localized fields are retrieved as maps of translations, where the keys are language codes and values are the fields in their respective languages.
  • If the header is empty, localized fields are retrieved as maps containing a single translation, where the key is a language code and the value is the field in the specified language. The endpoint assumes that localized fields are to be retrieved in the tenant's default language defined in the Configuration Service.
  • If none of the requested languages has a translation, the localized fields are omitted from the response.
Responses
200

The request succeeded. The body is the saved search.

application/json

One stored saved search. The request field index is returned as indexId. queries is one query node. A list sent on save is returned as one or group.

idstringOptional

Saved search id.

Example: red-cars
typestringOptional

Type this saved search belongs to. A custom schema type, customer, or legal-entity.

Example: VEHICLE
indexIdstringOptional

Id of the search index this saved search uses.

Example: vehicles
get/search/{tenant}/search/{type}/queries/{id}
GET /search/{tenant}/search/{type}/queries/{id} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "id": "red-cars",
  "type": "VEHICLE",
  "name": {
    "en": "Red cars"
  },
  "description": {
    "en": "Vehicles whose name contains red"
  },
  "indexId": "vehicles",
  "queries": {
    "type": "TEXT",
    "query": "red",
    "field": "name.en",
    "boost": 2
  },
  "metadata": {
    "version": 1,
    "createdAt": "2026-03-12T10:00:00.000Z",
    "modifiedAt": "2026-03-12T10:00:00.000Z"
  }
}

Upserting a saved search

put
Preview

Creates or replaces the saved search identified by {id} for one type. Unknown properties in the body are ignored. Saving does not start an index build.

A new saved search returns 201 Created and the saved search id. Replacing an existing saved search returns 204 No Content. index must already exist for this type. The body must include queries, filters, or both.

metadata can be omitted when the saved search is created. An update requires metadata.version.

Required scopes
This endpoint requires the following scopes:
  • : Needed to create, update, and delete saved searches and search indexes.
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name. Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
typestringRequired

Type of documents to search. Use a custom schema type, customer, or legal-entity.

Example: VEHICLE
idstringRequired

Saved search id. Use 1 to 66 characters. Allowed characters are letters, digits, underscore, and hyphen.

Example: red-carsPattern: ^[\w-]{1,66}$
Header parameters
Content-LanguagestringOptional

Language of the localized name and description in the request body. Each language key in those maps must be configured for the tenant.

Example: en
Body

Definition of a saved search. Unknown properties are ignored. The body must include queries, filters, or both. index must already exist for the type.

anyOptional
or
anyOptional
Responses
201

The saved search was created. The body is the saved search id.

application/json

Identifier of a created saved search.

idstringRequired

Saved search id.

Example: red-cars
put/search/{tenant}/search/{type}/queries/{id}
PUT /search/{tenant}/search/{type}/queries/{id} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 169

{
  "name": {
    "en": "Red cars"
  },
  "description": {
    "en": "Vehicles whose name contains red"
  },
  "index": "vehicles",
  "queries": {
    "type": "TEXT",
    "query": "red",
    "field": "name.en",
    "boost": 2
  }
}
{
  "id": "red-cars"
}

Deleting a saved search

delete
Preview

Deletes one saved search. Deleting does not start an index build.

Required scopes
This endpoint requires the following scopes:
  • : Needed to create, update, and delete saved searches and search indexes.
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name. Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
typestringRequired

Type of documents to search. Use a custom schema type, customer, or legal-entity.

Example: VEHICLE
idstringRequired

Saved search id. Use 1 to 66 characters. Allowed characters are letters, digits, underscore, and hyphen.

Example: red-carsPattern: ^[\w-]{1,66}$
Responses
204

The saved search was deleted. The response has no body.

No content

delete/search/{tenant}/search/{type}/queries/{id}
DELETE /search/{tenant}/search/{type}/queries/{id} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Last updated

Was this helpful?