---
schema_version: "1"
id: 62e1cbf862f968e5008fe3c3405bf267bdec0be3478081f8212844a4b13afd5f
title: Data Role Search (deprecated)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/b2c-commerce/references/generated-api-specs/ocapi-data-role-search.md
canonical_url: https://developer.salesforce.com/docs/commerce/b2c-commerce/references/ocapi-data-role-search
source_site: developer.salesforce.com
content_type: documentation
content_hash: f3bb0fb349dec414b173035331ff02e80bef4acbecaf18172122c6dfebd51cb4
products:
  - B2C Commerce
  - Salesforce APIs
---
Data Role Search (deprecated)

# Data Role Search (deprecated)

Data API endpoints enable developers to build applications for merchants: Create, update, delete business objects, like products, customers, pricing and promotions or assignments. They typically provide read and write access and are designed for moderate usage.

**Version:** 25.6

## Servers

*   `https://{host}/s/-/dw/data/v25_6`

Protocols: https.

## Security

*   `oauth2_application` (oauth2) Authentication flow with client ID and password with account manager.
    *   OAuth flow application (tokenUrl: https://account.demandware.com:443/dwsso/oauth2/access\_token)
    *   Scope x-info: Scopes are NOT supported. This is just a dummy, because the 'scopes' field is required.
*   `client_id` (apiKey) Add client ID for application identification. Alternative as 'client\_id' query parameter.
    *   API key in header: x-dw-client-id

## Operations

### POST Search public Access Roles

`POST /role_search`

Operation ID: `Search public Access Roles`. Tags: role\_search. Security: oauth2\_application.

Searches for access roles.

The query attribute specifies a complex query that can be used to narrow down the search. These are the list of searchable attributes:

*   id - String
    
*   description - String
    

Optionally, a user ID (the user login) can be specified. When it is supplied, the search for roles is limited to the roles assigned to this user. When expanding the permissions for the roles, all effective permissions for this user can be retrieved.

Optionally, a (single) permission can be specified. When it is supplied, the search for roles is limited to the roles having this permission. When expanding the users for the roles, all users having this permission can be retrieved.

The output of the query can also be sorted. These are the list of sortable attributes:

*   id - String
    
*   description - String
    

This endpoint may return the following faults:

*   400 - InvalidSearchQueryException - Throws when one of the search request restrictions is violated
*   400 - MalformedSearchParameterException - Thrown if the query is ill-formed.

#### Request body (required)

Media type: `application/json, text/xml`. Schema: `role_search_request`.

#### Responses

*   **400** `InvalidSearchQueryException` - Throws when one of the search request restrictions is violated or `MalformedSearchParameterException` - Thrown if the query is ill-formed.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `role_search_result`.
    

## Schemas

### role\_search\_request

Document representing an role search.

Note that only either an user ID or a permission can be provided (or none), but not both. When one of them is provided, the further query elements will filter the respective role set (meaning the user ID / permission is AND-connected to the query definition).

When a permission definition is using a site scope, it can contain only one site.

When optional fields in the permission definitions are not provided, they will be treated as 'don't care' (so its e.g. possible so search for permission to site-specific BM modules without providing a site, and the search will return all roles having that permission for any site).

*   `count` (_integer (int32)_) The number of returned documents  
    Minimum: 1. Maximum: 200.
*   `db_start_record_` (_integer (int32)_) The zero-based index of the record that we want to start with, used to optimize special handling  
    Minimum: 0.
*   `expand` (_array of string_) List of expansions to be applied to each search results. Expands are optional
*   `permissions` (_role\_permissions_) The permission to search for. Note that even though this is a container that can hold multiple permissions definitions, for a search request only one permission can be provided (otherwise an error will be returned).
*   `query` (_query_, required) The query to apply
*   `select` (_string_) The field to be selected.
*   `sorts` (_array of sort_) The list of sort clauses configured for the search request. Sort clauses are optional.
*   `start` (_integer (int32)_) The zero-based index of the first search hit to include in the result.  
    Minimum: 0.
*   `user_id` (_string_) The id of the user whose roles are to be searched.

### fault

Document representing a fault message that is returned whenever the HTTP status code is greater than or equal to 400 (which indicates an error).

*   `arguments` (_object_)
    
    A map that provides fault arguments.
    
    Data can be used to provide error messages on the client side.
    
    Additional properties: `object`.
    
*   `cause` (_cause_)
*   `display_message_pattern` (_string_) The localized display message pattern, if the request parameter display\_locale was given
*   `message` (_string_) The message text of the java exception.
*   `stack_trace` (_string_)
*   `type` (_string_) The name of the java exception.

### role\_search\_result

Document representing an access role search result.

*   `count` (_integer (int32)_) The number of returned documents
*   `data` (_array of object_)
*   `db_start_record_` (_integer (int32)_) The zero-based index of the record that we want to start with, used to optimize special handling  
    Minimum: 0.
*   `expand` (_array of string_) List of expansions to be applied to each search results. Expands are optional
*   `hits` (_array of role_) The sorted array of search hits. Can be empty.
*   `next` (_result\_page_) The data that can be used (as parameters on the search request) to retrieve the next result page.
*   `previous` (_result\_page_) The data that can be used (as parameters on the search request) to retrieve the previous result page.
*   `query` (_query_) The query passed into the search
*   `select` (_string_) The field to be selected.
*   `sorts` (_array of sort_) The list of sort clauses configured for the search request. Sort clauses are optional.
*   `start` (_integer (int32)_) The zero-based index of the first search hit to include in the result.  
    Minimum: 0.
*   `total` (_integer (int32)_) The number of returned documents

_Example_

```
{
  "count": 7,
  "expand": [
    "users"
  ],
  "hits": [
    {
      "description": "Allowed to manage locales",
      "id": "LocaleManager",
      "link": "https://example.com/s/-/dw/data/{version}/roles/LocaleManager",
      "user_count": 1,
      "user_manager": false,
      "users": [
        {
          "disabled": false,
          "email": "ocapi@example.com",
          "first_name": "Ocapi",
          "last_name": "LocaleDude",
          "locked": false,
          "login": "localeDude",
          "preferred_data_locale": "default",
          "preferred_uilocale": "default"
        }
      ]
    },
    {
      "description": "Allowed to manage things global",
      "id": "OrgManager",
      "link": "https://example.com/s/-/dw/data/{version}/roles/OrgManager",
      "user_count": 1,
      "user_manager": false,
      "users": [
        {
          "disabled": false,
          "email": "ocapi@example.com",
          "first_name": "Ocapi",
          "last_name": "OrgDude",
          "locked": false,
          "login": "orgDude",
          "preferred_data_locale": "default",
          "preferred_uilocale": "default"
        }
      ]
    },
    {
      "description": "Allowed to manage roles",
      "id": "RoleManager",
      "link": "https://example.com/s/-/dw/data/{version}/roles/RoleManager",
      "user_count": 2,
      "user_manager": true,
      "users": [
        {
          "disabled": false,
          "email": "ocapi@example.com",
          "first_name": "Ocapi",
          "last_login_date": "2017-01-11",
          "last_name": "RoleDude",
          "locked": false,
          "login": "roleDude",
          "preferred_data_locale": "default",
          "preferred_uilocale": "default"
        },
        {
          "disabled": false,
          "email": "ocapi@example.com",
          "first_name": "Ocapi",
          "last_name": "SecondRoleManager",
          "locked": false,
          "login": "secondRoleManager",
          "preferred_data_locale": "en",
          "preferred_uilocale": "de"
        }
      ]
    },
    {
      "description": "Allowed to manage only site SiteGenesis-DE",
      "id": "SiteGenesisDEManager",
      "link": "https://example.com/s/-/dw/data/{version}/roles/SiteGenesisDEManager",
      "user_count": 1,
      "user_manager": false,
      "users": [
        {
          "disabled": false,
          "email": "ocapi@example.com",
          "first_name": "Ocapi",
          "last_name": "SiteGenesisDEDude",
          "locked": false,
          "login": "SiteGenesisDEDude",
          "preferred_data_locale": "default",
          "preferred_uilocale": "default"
        }
      ]
    },
    {
      "description": "Allowed to manage only site SiteGenesis",
      "id": "SiteGenesisManager",
      "link": "https://example.com/s/-/dw/data/{version}/roles/SiteGenesisManager",
      "user_count": 4,
      "user_manager": false,
      "users": [
        {
          "disabled": false,
          "email": "ocapi_agent@example.com",
          "first_name": "Ocapi",
          "last_name": "SiteGenesisAgentMultiRole",
          "locked": false,
          "login": "SiteGenesisAgentMultiRole",
          "preferred_data_locale": "default",
          "preferred_uilocale": "default"
        },
        {
          "disabled": false,
          "email": "ocapi_oauth2@example.com",
          "first_name": "Ocapi",
          "last_name": "SiteGenesisOAuth2",
          "locked": false,
          "login": "SiteGenesisOAuth2",
          "preferred_data_locale": "default",
          "preferred_uilocale": "default"
        },
        {
          "disabled": false,
          "email": "ocapi@example.com",
          "first_name": "Ocapi",
          "last_login_date": "2017-01-11",
          "last_name": "SiteGenesisDude",
          "locked": false,
          "login": "SiteGenesisDude",
          "preferred_data_locale": "default",
          "preferred_uilocale": "default"
        },
        {
          "disabled": false,
          "email": "ocapi_oauth@example.com",
          "first_name": "Ocapi",
          "last_name": "SiteGenesisOAuth",
          "locked": false,
          "login": "SiteGenesisOAuth",
          "preferred_data_locale": "default",
          "preferred_uilocale": "default"
        }
      ]
    },
    {
      "description": "Allowed to manage users",
      "id": "UserManager",
      "link": "https://example.com/s/-/dw/data/{version}/roles/UserManager",
      "user_count": 1,
      "user_manager": true,
      "users": [
        {
          "disabled": false,
          "email": "ocapi@example.com",
          "first_name": "Ocapi",
          "last_login_date": "2017-01-11",
          "last_name": "UserDude",
          "locked": false,
          "login": "userDude",
          "preferred_data_locale": "default",
          "preferred_uilocale": "default"
        }
      ]
    },
    {
      "description": "Allowed to manage users and roles",
      "id": "UserRoleManager",
      "link": "https://example.com/s/-/dw/data/{version}/roles/UserRoleManager",
      "user_count": 1,
      "user_manager": true,
      "users": [
        {
          "disabled": false,
          "email": "ocapi@example.com",
          "first_name": "Ocapi",
          "last_name": "UserRoleDude",
          "locked": false,
          "login": "userRoleDude",
          "preferred_data_locale": "default",
          "preferred_uilocale": "default"
        }
      ]
    }
  ],
  "query": {
    "text_query": {
      "fields": [
        "id"
      ],
      "search_phrase": "Manager"
    }
  },
  "select": "(**)",
  "sorts": [
    {
      "field": "id",
      "sort_order": "asc"
    }
  ],
  "start": 0,
  "total": 7
}
```

### role\_permissions

Document listing the permissions assigned to a certain role (accessible by type).

*   `functional` (_role\_functional\_permissions_) The functional permissions.
*   `locale` (_role\_locale\_permissions_) The locale permissions.
*   `module` (_role\_module\_permissions_) The module permissions.
*   `webdav` (_role\_webdav\_permissions_) The WebDAV permissions.

_Example_

```
{
  "functional": {
    "organization": [
      {
        "name": "Delete_All_Catalogs",
        "type": "functional",
        "value": "ACCESS"
      },
      {
        "name": "Manage_All_Catalogs",
        "type": "functional",
        "value": "ACCESS"
      },
      {
        "name": "WebDAV_Security_Logs_Access",
        "type": "functional",
        "value": "ACCESS"
      }
    ],
    "site": [
      {
        "name": "Manage_Site_Catalog",
        "type": "functional",
        "values": {
          "SiteGenesis": "ACCESS",
          "SiteGenesisGlobal": "ACCESS"
        }
      },
      {
        "name": "Manage_Site_Library",
        "type": "functional",
        "values": {
          "SiteGenesis": "ACCESS",
          "SiteGenesisGlobal": "ACCESS"
        }
      },
      {
        "name": "Manage_Site_PriceBooks",
        "type": "functional",
        "values": {
          "SiteGenesis": "ACCESS"
        }
      },
      {
        "name": "Manage_Site_Inventory",
        "type": "functional",
        "values": {
          "SiteGenesis": "ACCESS"
        }
      }
    ]
  },
  "locale": {
    "unscoped": [
      {
        "locale_id": "de",
        "type": "locale",
        "value": "ACCESS"
      },
      {
        "locale_id": "default",
        "type": "locale",
        "value": "READONLY"
      },
      {
        "locale_id": "en",
        "type": "locale",
        "value": "READONLY"
      },
      {
        "locale_id": "en_US",
        "type": "locale",
        "value": "ACCESS"
      },
      {
        "locale_id": "fr_FR",
        "type": "locale",
        "value": "ACCESS"
      }
    ]
  },
  "module": {
    "organization": [
      {
        "application": "bm",
        "name": "jobmonitor",
        "type": "module",
        "value": "READONLY"
      },
      {
        "application": "bm",
        "name": "jobschedules",
        "system": true,
        "type": "module",
        "value": "ACCESS"
      }
    ],
    "site": [
      {
        "application": "bm",
        "name": "library_content_libraries",
        "system": true,
        "type": "module",
        "values": {
          "SiteGenesis": "ACCESS",
          "SiteGenesisGlobal": "READONLY"
        }
      },
      {
        "application": "bm",
        "name": "library_folder",
        "system": true,
        "type": "module",
        "values": {
          "SiteGenesis": "ACCESS",
          "SiteGenesisGlobal": "ACCESS"
        }
      },
      {
        "application": "bm",
        "name": "library_content",
        "system": true,
        "type": "module",
        "values": {
          "SiteGenesis": "ACCESS",
          "SiteGenesisGlobal": "READONLY"
        }
      }
    ]
  },
  "webdav": {
    "unscoped": [
      {
        "folder": "/catalogs/apparel-catalog",
        "type": "webdav",
        "value": "ACCESS"
      },
      {
        "folder": "/catalogs/electronics-catalog",
        "type": "webdav",
        "value": "READONLY"
      },
      {
        "folder": "/catalogs/storefront-catalog-en",
        "type": "webdav",
        "value": "READONLY"
      },
      {
        "folder": "/catalogs/storefront-catalog-non-en",
        "type": "webdav",
        "value": "READONLY"
      },
      {
        "folder": "/libraries/SiteGenesis",
        "type": "webdav",
        "value": "ACCESS"
      },
      {
        "folder": "/libraries/SiteGenesisGlobal",
        "type": "webdav",
        "value": "READONLY"
      }
    ]
  }
}
```

### query

Document representing a query. A query contains a set of objects that define criteria used to select records. A query can contain one of the following:

*   match\_all\_query - returns all records.
    
*   term\_query - matches records where a field (or fields) exactly match some simple value (including null).
    
*   text\_query - matches records where a field (or fields) contain a search phrase.
    
*   boolean\_query - formulates a complex boolean expression using query objects as criteria.
    
*   filtered\_query - allows for filtering of records based on both a query and a filter.
    

Type: `any`.

### sort

Document representing a sort request.

*   `field` (_string_, required) The name of the field to sort on.
*   `sort_order` (_string_) The sort order to be applied when sorting. When omitted, the default sort order (ASC) is used.  
    Allowed values: `asc`, `desc`.

_Example_

```
{
  "field": "id",
  "sort_order": "asc"
}
```

### cause

*   `cause` (_cause_)
*   `message` (_string_)
*   `type` (_string_)

### role

Document representing an access role.

*   `creation_date` (_string (date-time)_)
*   `description` (_string_) The role description.
*   `id` (_string_) The role ID.
*   `last_modified` (_string (date-time)_)
*   `link` (_string_) URL that is used to get this instance. This property is computed and cannot be modified.
*   `permissions` (_role\_permissions_) The permissions assigned to the access role. Available through expands.
*   `user_count` (_integer (int32)_) Number of users assigned to the role.
*   `user_manager` (_boolean_) Flag whether this role is allowed to manage users or other access roles.
*   `users` (_array of user_) The users assigned to the access role. Available through expands.

_Example_

```
{
  "description": "Allowed to manage locales",
  "id": "LocaleManager",
  "link": "https://example.com/s/-/dw/data/{version}/roles/LocaleManager",
  "user_count": 1,
  "user_manager": false,
  "users": [
    {
      "disabled": false,
      "email": "ocapi@example.com",
      "first_name": "Ocapi",
      "last_name": "LocaleDude",
      "locked": false,
      "login": "localeDude",
      "preferred_data_locale": "default",
      "preferred_uilocale": "default"
    }
  ]
}
```

### result\_page

Data that can be used to get the next and previous page of a Data API results object.

*   `count` (_integer (int32)_) The number of returned documents.
*   `db_start_record_` (_integer (int32)_) The zero-based index of the record that we want to start with, used to optimize special handling
*   `start` (_integer (int32)_) The zero-based index of the first search hit to include in the result.

### role\_functional\_permissions

Document listing the functional permissions assigned to a certain role.

*   `organization` (_array of role\_functional\_permission_) The list of organization functional permissions.
*   `site` (_array of role\_functional\_permission_) The list of site functional permissions.

_Example_

```
{
  "organization": [
    {
      "name": "Delete_All_Catalogs",
      "type": "functional",
      "value": "ACCESS"
    },
    {
      "name": "Manage_All_Catalogs",
      "type": "functional",
      "value": "ACCESS"
    },
    {
      "name": "WebDAV_Security_Logs_Access",
      "type": "functional",
      "value": "ACCESS"
    }
  ],
  "site": [
    {
      "name": "Manage_Site_Catalog",
      "type": "functional",
      "values": {
        "SiteGenesis": "ACCESS",
        "SiteGenesisGlobal": "ACCESS"
      }
    },
    {
      "name": "Manage_Site_Library",
      "type": "functional",
      "values": {
        "SiteGenesis": "ACCESS",
        "SiteGenesisGlobal": "ACCESS"
      }
    },
    {
      "name": "Manage_Site_PriceBooks",
      "type": "functional",
      "values": {
        "SiteGenesis": "ACCESS"
      }
    },
    {
      "name": "Manage_Site_Inventory",
      "type": "functional",
      "values": {
        "SiteGenesis": "ACCESS"
      }
    }
  ]
}
```

### role\_locale\_permissions

Document listing the locale permissions assigned to a certain role.

*   `unscoped` (_array of role\_locale\_permission_) The list of unscoped locale permissions.

_Example_

```
{
  "unscoped": [
    {
      "locale_id": "de",
      "type": "locale",
      "value": "ACCESS"
    },
    {
      "locale_id": "default",
      "type": "locale",
      "value": "READONLY"
    },
    {
      "locale_id": "en",
      "type": "locale",
      "value": "READONLY"
    },
    {
      "locale_id": "en_US",
      "type": "locale",
      "value": "ACCESS"
    },
    {
      "locale_id": "fr_FR",
      "type": "locale",
      "value": "ACCESS"
    }
  ]
}
```

### role\_module\_permissions

Document listing the module permissions assigned to a certain role.

*   `organization` (_array of role\_module\_permission_) The list of organization module permissions.
*   `site` (_array of role\_module\_permission_) The list of site module permissions.

_Example_

```
{
  "organization": [
    {
      "application": "bm",
      "name": "jobmonitor",
      "type": "module",
      "value": "READONLY"
    },
    {
      "application": "bm",
      "name": "jobschedules",
      "system": true,
      "type": "module",
      "value": "ACCESS"
    }
  ],
  "site": [
    {
      "application": "bm",
      "name": "library_content_libraries",
      "system": true,
      "type": "module",
      "values": {
        "SiteGenesis": "ACCESS",
        "SiteGenesisGlobal": "READONLY"
      }
    },
    {
      "application": "bm",
      "name": "library_folder",
      "system": true,
      "type": "module",
      "values": {
        "SiteGenesis": "ACCESS",
        "SiteGenesisGlobal": "ACCESS"
      }
    },
    {
      "application": "bm",
      "name": "library_content",
      "system": true,
      "type": "module",
      "values": {
        "SiteGenesis": "ACCESS",
        "SiteGenesisGlobal": "READONLY"
      }
    }
  ]
}
```

### role\_webdav\_permissions

Document listing the WebDAV permissions assigned to a certain role.

*   `unscoped` (_array of role\_webdav\_permission_) The list of unscoped WebDAV permissions.

_Example_

```
{
  "unscoped": [
    {
      "folder": "/catalogs/apparel-catalog",
      "type": "webdav",
      "value": "ACCESS"
    },
    {
      "folder": "/catalogs/electronics-catalog",
      "type": "webdav",
      "value": "READONLY"
    },
    {
      "folder": "/catalogs/storefront-catalog-en",
      "type": "webdav",
      "value": "READONLY"
    },
    {
      "folder": "/catalogs/storefront-catalog-non-en",
      "type": "webdav",
      "value": "READONLY"
    },
    {
      "folder": "/libraries/SiteGenesis",
      "type": "webdav",
      "value": "ACCESS"
    },
    {
      "folder": "/libraries/SiteGenesisGlobal",
      "type": "webdav",
      "value": "READONLY"
    }
  ]
}
```

### user

Document representing a user.

*   `creation_date` (_string (date-time)_)
*   `disabled` (_boolean_) Flag whether the user is disabled.
*   `email` (_string_, required) The email address.  
    Maximum length: 256.
*   `external_id` (_string_) The external id. This attribute is only valid when the user uses centralized authentication.  
    Maximum length: 256.
*   `first_name` (_string_) The first name.  
    Maximum length: 256.
*   `last_login_date` (_string (date)_) Last login of the user.
*   `last_modified` (_string (date-time)_)
*   `last_name` (_string_, required) The last name.  
    Maximum length: 256.
*   `link` (_string_) URL that is used to get this instance. This property is computed and cannot be modified.
*   `locked` (_boolean_) Flag whether the user is locked.
*   `login` (_string_) The user login.  
    Maximum length: 256.
*   `password` (_string_) The password. This attribute is only used to set the password upon user creation. This attribute is only valid when the user does not use centralized authentication.
*   `password_expiration_date` (_string (date-time)_) The user password expiration time
*   `password_modification_date` (_string (date-time)_) The time, where the password was last modified
*   `preferred_data_locale` (_string_) The effective preferred data locale of the user. A locale is only considered if the user has at least read permission on the locale.
*   `preferred_ui_locale` (_string_) The preferred UI locale of the user.
*   `roles` (_array of string_) List of role ids the user is assigned to.

_Example_

```
{
  "disabled": false,
  "email": "someUserl@example.com",
  "external_id": "e2b07841-1db0-a5c1-9a1f-f6a02b6fa25c",
  "first_name": "John",
  "last_name": "Doe",
  "locked": false,
  "login": "someUser",
  "password_expiration_date": "2016-01-14T16:48:07Z",
  "password_modification_date": "2016-04-14T16:48:07Z",
  "preferred_data_locale": "default",
  "preferred_ui_locale": "en-US",
  "roles": [
    "FirstRole",
    "SecondRole"
  ]
}
```

### role\_functional\_permission

Document representing a functional permission.

*   `name` (_string_, required) The name of the functional permission.  
    Minimum length: 1.
*   `type` (_string_, required) The permission type ("functional").  
    Minimum length: 1.
*   `value` (_string_) The non domain specific value for the functional permission, e.g. ACCESS or READONLY.
*   `values` (_object_) The map of value per domain for the functional permission, e.g. ACCESS or READONLY per domain name.
    
    Additional properties: `string`.
    

_Example_

```
{
  "name": "Delete_All_Catalogs",
  "type": "functional",
  "value": "ACCESS"
}
```

### role\_locale\_permission

Document representing a locale permission.

*   `locale_id` (_string_, required) The related locale id of the locale permission.  
    Minimum length: 1.
*   `type` (_string_, required) The permission type ("locale").  
    Minimum length: 1.
*   `value` (_string_) The non domain specific value for the locale permission, e.g. ACCESS or READONLY.
*   `values` (_object_) The map of value per domain for the locale permission, e.g. ACCESS or READONLY per domain name.
    
    Additional properties: `string`.
    

_Example_

```
{
  "locale_id": "en",
  "type": "locale",
  "value": "READONLY"
}
```

### role\_module\_permission

Document representing a module permission.

*   `application` (_string_, required) The permission application (e.g. "bm", "csc").  
    Minimum length: 1.
*   `name` (_string_, required) The related menu action name of the module permission.  
    Minimum length: 1.
*   `system` (_boolean_) Flag to indicate a system menu action. This is `false` for custom menu actions.
*   `type` (_string_, required) The permission type ("module").  
    Minimum length: 1.
*   `value` (_string_) The non domain specific value for the module permission, e.g. ACCESS or READONLY.
*   `values` (_object_) The map of value per domain for the module permission, e.g. ACCESS or READONLY per domain name.
    
    Additional properties: `string`.
    

_Example_

```
{
  "application": "bm",
  "name": "jobmonitor",
  "type": "module",
  "value": "READONLY"
}
```

### role\_webdav\_permission

Document representing a WebDAV permission.

*   `folder` (_string_, required) The related folder of the WebDAV permission.  
    Minimum length: 1.
*   `type` (_string_, required) The permission type ("webdav").  
    Minimum length: 1.
*   `value` (_string_) The non domain specific value for the WebDAV permission, e.g. ACCESS or READONLY.
*   `values` (_object_) The map of value per domain for the WebDAV permission, e.g. ACCESS or READONLY per domain name.
    
    Additional properties: `string`.
    

_Example_

```
{
  "folder": "/catalogs/apparel-catalog",
  "type": "webdav",
  "value": "ACCESS"
}
```

### bool\_filter

Document representing a boolean filter.

A boolean filter allows you to combine other filters into (possibly recursive) logical expression trees. A boolean filter is configured with a boolean operator (AND, OR, NOT) and a list of filters the operator relates to. If multiple filters are given to a boolean NOT operator, this is interpreted as a NOT upon a boolean OR of the given filters.

**Example:** (id="myId" AND coupon\_id="couponOne")

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
bool\_filter: {
operator: "and",
filters: \[
{ term\_filter: { field: "id", operator: "is", values: \["myId"\] } },
{ term\_filter: { field: "coupon\_id", operator: "is", values: \["couponOne"\] } }
\]
}
}
}
}

**Example:** (id="holidaySale" OR redemption\_count BETWEEN(1, 20)

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
bool\_filter: {
operator: "or",
filters: \[
{ term\_filter: { field: "id", operator: "is", values: \["holidaySale"\] } },
{ range\_filter: { field: "redemption\_count", from: 1, to: 20 } }
\]
}
}
}
}

**Example:** NOT(enabled=false OR coupon\_id="special")

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
bool\_filter: {
operator: "not",
filters: \[
{ term\_filter: { field: "enabled", operator: "is", values: \[false\] } },
{ term\_filter: { field: "coupon\_id", operator: "is", values: \["special"\] } }
\]
}
}
}
}

*   `filters` (_array of filter_) A list of filters, which are logically combined by an operator.
*   `operator` (_string_, required) The logical operator the filters are combined with.  
    Allowed values: `and`, `or`, `not`.

### bool\_query

A boolean query allows construction of full logical expression trees consisting of other queries (usually term and text queries). A boolean query basically has 3 sets of clauses that 'must', 'should' and / or 'must not' match. If 'must', 'must\_not', or 'should' appear in the same boolean query, they are combined logically using the AND operator. The difference between must and should operators is that the must operator requires all subqueries to match whereas the should operator only requires one match

**Example:** (id = 'foo' AND description LIKE 'bar')

query: {
bool\_query: {
must: \[
{ term\_query: { fields: \["id"\], operator: "is", values: \["foo"\] } },
{ text\_query: { fields: \["description"\], search\_phrase: "bar" } }
\]
}
}

**Example:** (id = 'foo' OR description LIKE 'bar')

query: {
bool\_query: {
should: \[
{ term\_query: { fields: \["id"\], operator: "is", values: \["foo"\] } },
{ text\_query: { fields: \["description"\], search\_phrase: "bar" } }
\]
}
}

**Example:** (NOT (id = 'foo' AND description LIKE 'bar'))

query: {
bool\_query: {
must\_not: \[
{ term\_query: { fields: \["id"\], operator: "is", values: \["foo"\] } },
{ text\_query: { fields: \["description"\], search\_phrase: "bar" } }
\]
}
}

**Example:** ((coupon\_id LIKE "limit" AND description LIKE "limit per customer") AND NOT (enabled=false))

query: {
bool\_query: {
must: \[
{ text\_query: { fields: \[ "coupon\_id" \], search\_phrase: "limit" } },
{ text\_query: { fields: \[ "description" \], search\_phrase: "limit per customer" } }
\],
must\_not: \[
{ term\_query: { fields: \[ "enabled" \], operator: "is", values: \[false\] } }
\]
}
}

*   `must` (_array of query_) List of queries that must match.
*   `must_not` (_array of query_) List of queries that must not match.
*   `should` (_array of query_) List of queries that should match (i.e., at least one query must match).

### filter

Document representing a filter.

A filter contains a set of objects that define criteria used to select records. A filter can contain one of the following:

*   term\_filter - matches records where a field (or fields) exactly match some simple value (including null).
    
*   range\_filter - matches records where a field value lies in a specified range.
    
*   query\_filter - provides filtering based on a query.
    
*   bool\_filter - provides filtering of records using a set of filters combined with a specified operator.
    

Type: `any`.

### filtered\_query

A filtered query allows to filter the result of a (possibly complex) query using a (possibly complex) filter.

**Example:**

query : {
filtered\_query: {
query: {
text\_query: { fields: \["coupon\_id"\], search\_phrase: "disabled" }
},
filter: {
term\_filter: {
field: "enabled", operator: "is", values: \[ false \]
}
}
}
}

*   `filter` (_filter_, required) The (possibly complex) filter object.
*   `query` (_query_, required) The query object.

### match\_all\_query

A match all query simply matches all documents (namespace and document type). This query comes in handy if you just want to filter a search result or really do not have any constraints.

**Example:**

query: {
match\_all\_query: {}
}

Type: `any`.

### nested\_query

A nested query queries nested documents that are part of a larger document. The classical example is a product master with variants (in one big document) where you want to constrain a search to masters that have variants that match multiple constraints (like color = blue AND size = M). This query is not compatible with some search types. **Example:** finds all the documents that has firstname = "John" and lastname = "Doe"

{
"query": {
"bool\_query": {
"must": \[
{
"nested\_query": {
"path": "order.shipping\_addresses",
"query": {
"bool\_query": {
"must": \[
{
"bool\_query": {
"must": \[
{
"term\_query": {
"fields": \[ "order.shipping\_addresses.first\_name" \],
"operator": "is",
"values": \[ "John" \]
}
}
\]
}
},
{
"bool\_query": {
"must": \[
{
"term\_query": {
"fields": \[ "order.shipping\_addresses.last\_name" \],
"operator": "is",
"values": \[ "Doe" \]
}
}
\]
}
}
\]
}
},
"score\_mode": "avg"
}
}
\]
}
}
}

*   `path` (_string_, required)
*   `query` (_query_, required)
*   `score_mode` (_string_)  
    Allowed values: `avg`, `total`, `max`, `none`.

### query\_filter

Document representing a query filter. A query filter wraps any query and allows it to be used as a filter.

**Example:** (coupon\_id contains "disabled" AND (enabled=false OR active=false))

query : {
filtered\_query: {
query: { text\_query: { fields: \["coupon\_id"\], search\_phrase: "disabled" } },
filter: {
query\_filter: {
query: {
term\_query: { fields: \["enabled","active"\], operator: "is", values: \[ false \] }
}
}
}
}
}

*   `query` (_query_, required) The query to use as a filter.

### range2\_filter

Document representing a range comparison with a range filter, named Range2Filter.

A Range2Filter allows you to restrict a search result to hits where a range defined by specified attributes has a certain relationship to a specified range.

The first range (R1) is defined by a pair of attributes ("from\_field" and "to\_field") that specify the extent of a range, such as the attributes "valid\_from" and "valid\_to".

The second range (R2) is defined by "from\_value" and "to\_value".

The filter mode specifies the method used to compare the two ranges:

*   overlap: R1 overlaps fully or partially with R2
    
*   containing: R1 contains R2
    
*   contained: R1 is contained in R2
    

The range filter supports several value types, and relies on the natural sorting of the value type for range interpretation. Value ranges can be open-ended (at one end only). You can configure whether the lower and upper bounds are inclusive or exclusive.

A range 2 filter is useful for general restrictions that can be shared between searches (like a static date range) because the filter result is cached in memory. Range filters are not appropriate if the range is expected to be different for every query (for example, if the user controls the date range down to the hour via a UI control). Range filters are inclusive by default.

**Example:** (valid dates overlap with the range January 1, 2007 through January 1, 2017)

"query" : {
"filtered\_query": {
"filter": {
"range2\_filter": {
"from\_field": "valid\_from",
"to\_field": "valid\_to",
"filter\_mode":"overlap",
"from\_value": "2007-01-01T00:00:00.000Z",
"to\_value": "2017-01-01T00:00:00.000Z"
}
},
"query": { "match\_all\_query": {} }
}
}

*   `filter_mode` (_string_) Compare mode: overlap, containing, or contained. If not specified, the default is overlap.  
    Allowed values: `overlap`, `containing`, `contained`.
*   `from_field` (_string_, required) The field name of the field that starts the first range.
*   `from_inclusive` (_boolean_) Indicates whether the lower bound of the second range is inclusive. If not specified, the default is true. Set to false to make the lower bound exclusive.
*   `from_value` (_object_) The lower bound of the second range. If not specified, the range is open-ended with respect to the lower bound. You can't leave both the lower and upper bounds open-ended.
*   `to_field` (_string_, required) The field name of the field that ends the first range.
*   `to_inclusive` (_boolean_) Indicates whether the upper bound of the second range is inclusive. If not specified, the default is true. Set to false to make the lower bound exclusive.
*   `to_value` (_object_) The upper bound of the second range. If not specified, the range is open-ended with respect to the upper bound. You can't leave both the upper and lower bounds open-ended.

### range\_filter

Document representing a range filter.

A range filter allows you to restrict a search result to hits that have values for a given attribute that fall into a given value range. The range filter supports several value types, and relies on the natural sorting of the value type for range interpretation. Value ranges can be open-ended (at one end only). You can configure whether the lower and upper bounds are inclusive or exclusive.

A range filter is useful for general restrictions that can be shared between searches (like a static date range) because the filter result is cached in memory. Range filters are not appropriate if the range is expected to be different for every query (for example, if the user controls the date range down to the hour via a UI control). Range filters are inclusive by default.

**Example:** ( redemption\_count BETWEEN (0,10\] )

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
range\_filter: {
field: "redemption\_count",
from: 0,
to: 10,
from\_inclusive: false
}
}
}
}

*   `field` (_string_, required) The search field.
*   `from` (_object_) The lower bound of the filter range. If not specified, the range is open-ended with respect to the lower bound. You can't leave both the lower and upper bounds open-ended.
*   `from_inclusive` (_boolean_) Indicates whether the lower bound of the range is inclusive. If not specified, the default is true. Set to false to make the lower bound exclusive.
*   `to` (_object_) The upper bound of the filter range. If not specified, the range is open-ended with respect to the upper bound. You can't leave both the upper and lower bounds open-ended.
*   `to_inclusive` (_boolean_) Indicates whether the upper bound of the range is inclusive. If not specified, the default is true. Set to false to made the upper bound exclusive.

### term\_filter

Document representing a term filter.

A term filter allows you to restrict a search result to hits that match (exactly) one of the values configured for the filter. A term filter is useful for general restrictions that can be shared between searches. Use term filters whenever the criterion you filter on is a shared property of multiple searches (for example, like filtering by an order status). Use term filters for fields that have a discrete and small set of values only.

**Example:** (id="my\_id")

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
term\_filter: {
field: "id",
operator: "is",
values: \["my\_id"\]
}
}
}
}

**Example:** (id IN ("my\_id","other\_id"))

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
term\_filter: {
field: "id",
operator: "one\_of",
values: \["my\_id","other\_id"\]
}
}
}
}

**Example:** (description=NULL)

query: {
filtered\_query: {
query: { match\_all\_query: {} },
filter: {
term\_filter: {
field: "description",
operator: "is\_null"
}
}
}
}

*   `field` (_string_, required) The filter field.
*   `operator` (_string_, required) The operator to compare the field's values with the given ones.  
    Allowed values: `is`, `one_of`, `is_null`, `is_not_null`, `less`, `greater`, `not_in`, `neq`.
*   `values` (_array of object_) The filter values.

### term\_query

A term query matches one (or more) value(s) against one (or more) document field(s). A document is considered a hit if one of the values matches (exactly) with at least one of the given fields. The operator "is" can only take one value, while "one\_of" can take multiple values. If multiple fields are specified, they are combined using the OR operator. The `less` and `greater` operators are not compatible with some search types. To query based on numeric bounds in those cases, you can use a range filter on a filtered query .

**Elastic only** : If used with multiple fields, the query is internally handled as a boolean OR of DisjointMaxQueries (with the dismax matching a value against all fields). The dismax makes sure that a document carrying a single term in multiple fields does not get higher scores than a document matching multiple terms in multiple fields.

**Example:** (id="my\_id")

query: {
term\_query: {
fields: \["id"\],
operator: "is",
values: \["my\_id"\]
}
}

**Example:** (id IN ("my\_id","other\_id"))

query: {
term\_query: {
fields: \["id"\],
operator: "one\_of",
values: \["my\_id","other\_id"\]
}
}

**Example:** (id=null)

query: {
term\_query: {
fields: \["description"\],
operator: "is\_null"
}
}

**Example:** ((id IN ('generic', 'keyword')) OR (description IN ('generic', 'keyword'))

query: {
term\_query: {
fields: \["id", "description"\],
operator: "one\_of",
values: \["generic","keyword"\]
}
}

*   `fields` (_array of string_, required) The document field(s) the value(s) are matched against, combined with the operator.  
    Minimum items: 1.
*   `operator` (_string_, required) Returns the operator to use for the term query.  
    Allowed values: `is`, `one_of`, `is_null`, `is_not_null`, `less`, `greater`, `not_in`, `neq`.
*   `values` (_array of object_) The values the field(s) are compared against, combined with the operator.

### text\_query

A text query is used to match some text (i.e. a search phrase possibly consisting of multiple terms) against one or multiple fields. In case multiple fields are provided, the phrase conceptually forms a logical OR over the fields. In this case, the terms of the phrase basically have to match the text that would result from concatenating all given fields.

**Example:** (coupon\_id contains "xmas" )

query: {
text\_query: {
fields: \["coupon\_id"\],
search\_phrase: "xmas"
}
}

**Example:** (coupon\_id contains "xmas" OR description contains "xmas")

query: {
text\_query: {
fields: \["description", "coupon\_id"\],
search\_phrase: "xmas"
}
}

**Example:** (description contains "holiday" AND description contains "bojo")

query: {
text\_query: {
fields: \["description"\],
search\_phrase: "holiday bogo"
}
}

*   `fields` (_array of string_, required) The document fields the search phrase has to match.  
    Minimum items: 1.
*   `search_phrase` (_string_, required) A search phrase which may consist of multiple terms.