Overview
LabelType API is an API for managing label types in Fess. Label types allow you to classify search results based on crawled paths or virtual hosts, and can be used for label-based filtering on the search screen.
For common specifications regarding authentication, responses (status codes, version field, error format, HTTP status codes, etc.), refer to Admin API Overview. To access this API, you must provide an access token with admin API permission (admin-api) in the Authorization: Bearer <access_token> header.
Base URL
Endpoint List
| Method | Path | Description |
|---|---|---|
| GET | /settings | List label types |
| GET | /setting/{id} | Get label type |
| POST | /setting | Create label type |
| PUT | /setting | Update label type |
| DELETE | /setting/{id} | Delete label type |
List Label Types
Request
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
size | Integer | No | Number of items per page. Default is the paging.page.size setting value (25 by default). |
page | Integer | No | Page number (starts from 1). Default is 1. |
name | String | No | Filter by display name (wildcard search). |
value | String | No | Filter by label value (wildcard search). |
Response
Note
Each settings object also includes createdBy / createdTime / updatedBy / updatedTime for auditing, and versionNo for optimistic locking (fields with a null value are omitted). The response object always includes version indicating the product version, but it may be omitted in subsequent examples for brevity.
Get Label Type
Request
Response
Create Label Type
Request
Request Body
Field Descriptions
| Field | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Label display name (max 100 characters). |
value | String | Yes | Label value (used with the label parameter in searches). Only alphanumeric characters and underscores (_) are allowed; must match the regex ^[a-zA-Z0-9_]+$ (max 100 characters). |
includedPaths | String | No | Regular expressions for paths to be labelled. Separate multiple entries with a newline (\n). |
excludedPaths | String | No | Regular expressions for paths to exclude from labelling. Separate multiple entries with a newline (\n). |
permissions | String | No | Roles/groups/users permitted to access (e.g. {role}admin). Separate multiple entries with a newline (\n). |
sortOrder | Integer | No | Display order (non-negative integer). Defaults to 0 if not specified. |
virtualHost | String | No | Virtual host (max 1000 characters). |
Note
Audit fields such as createdBy / createdTime are set automatically on the server side and do not need to be specified in the request.
Response
On successful creation, created is true.
Update Label Type
Request
Request Body
When updating, the following fields are required in addition to the fields used at creation time.
| Field | Type | Required | Description |
|---|---|---|---|
id | String | Yes | The ID of the label type to update. |
versionNo | Integer | Yes | Version number for optimistic locking. Specify the versionNo included in the response when the setting was retrieved. If the specified version does not match the current one, the update will fail. |
Response
On update, created is false.
Delete Label Type
Request
Response
Usage Examples
Create Documentation Label
List Label Types
Search with Label
See Also
Admin API Overview - Admin API Overview
Search API - Search API
Label - Label Type Management Guide