> For the complete documentation index, see [llms.txt](https://docs.truedat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.truedat.io/v8.12/api-integrations/data-catalog-data-lineage-and-grants-apis/user-search-filters.md).

# User Search Filters

## List current user's search filters

> Returns only the search filters owned by the authenticated user.\
> \
> No pagination is applied.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.12.2"},"paths":{"/api/user_search_filters/me":{"get":{"description":"Returns only the search filters owned by the authenticated user.\n\nNo pagination is applied.\n","operationId":"TdDdWeb.UserSearchFilterController.index_by_user","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSearchFilterListResponse"}}},"description":"User search filter list"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List current user's search filters","tags":["User Search Filters"]}}},"components":{"schemas":{"UserSearchFilterListResponse":{"additionalProperties":false,"properties":{"data":{"description":"List of user search filters","items":{"$ref":"#/components/schemas/UserSearchFilterResource"},"type":"array"}},"required":["data"],"title":"UserSearchFilterListResponse","type":"object"},"UserSearchFilterResource":{"additionalProperties":false,"properties":{"filters":{"additionalProperties":true,"nullable":true,"type":"object"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","nullable":true,"type":"string"},"is_global":{"default":false,"nullable":true,"type":"boolean"},"name":{"type":"string"},"scope":{"type":"string"},"updated_at":{"format":"date-time","nullable":true,"type":"string"},"user_id":{"type":"integer"}},"required":["id","name","user_id","scope","is_global"],"title":"UserSearchFilterResource","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```

## Get a user search filter

> Retrieves a specific user search filter by its ID.\
> \
> Requires access to the filter (ownership or admin account).<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.12.2"},"paths":{"/api/user_search_filters/{id}":{"get":{"description":"Retrieves a specific user search filter by its ID.\n\nRequires access to the filter (ownership or admin account).\n","operationId":"TdDdWeb.UserSearchFilterController.show","parameters":[{"description":"User search filter ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSearchFilterResponse"}}},"description":"User search filter details"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdNotFoundErrorResponse"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Get a user search filter","tags":["User Search Filters"]}}},"components":{"schemas":{"UserSearchFilterResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/UserSearchFilterResource"}},"required":["data"],"title":"UserSearchFilterResponse","type":"object"},"UserSearchFilterResource":{"additionalProperties":false,"properties":{"filters":{"additionalProperties":true,"nullable":true,"type":"object"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","nullable":true,"type":"string"},"is_global":{"default":false,"nullable":true,"type":"boolean"},"name":{"type":"string"},"scope":{"type":"string"},"updated_at":{"format":"date-time","nullable":true,"type":"string"},"user_id":{"type":"integer"}},"required":["id","name","user_id","scope","is_global"],"title":"UserSearchFilterResource","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdNotFoundErrorResponse":{"additionalProperties":false,"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdNotFoundErrorResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```

## Delete a user search filter

> Permanently deletes a user search filter by its ID.\
> \
> The user must be the owner of the filter (same \`user\_id\`) or be an administrator.\
> \
> Deleting a filter does not affect any other data; only the filter record is removed.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.12.2"},"paths":{"/api/user_search_filters/{id}":{"delete":{"description":"Permanently deletes a user search filter by its ID.\n\nThe user must be the owner of the filter (same `user_id`) or be an administrator.\n\nDeleting a filter does not affect any other data; only the filter record is removed.\n","operationId":"TdDdWeb.UserSearchFilterController.delete","parameters":[{"description":"User search filter ID","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"User search filter deleted"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdForbiddenResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdNotFoundErrorResponse"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Delete a user search filter","tags":["User Search Filters"]}}},"components":{"schemas":{"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdForbiddenResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdForbiddenResponse","type":"object"},"TdDdNotFoundErrorResponse":{"additionalProperties":false,"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdNotFoundErrorResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```

## List user search filters

> Returns a list of all user search filters visible to the current user.\
> \
> Requires the \*\*'View user search filters'\*\* permission.\
> \
> By default, returns filters for all users (admin only) or filters scoped to the current user depending on the implementation. Use \`index\_by\_user\` to explicitly list only the current user's filters.\
> \
> No pagination is applied; the full list is returned in a single response.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.12.2"},"paths":{"/api/user_search_filters":{"get":{"description":"Returns a list of all user search filters visible to the current user.\n\nRequires the **'View user search filters'** permission.\n\nBy default, returns filters for all users (admin only) or filters scoped to the current user depending on the implementation. Use `index_by_user` to explicitly list only the current user's filters.\n\nNo pagination is applied; the full list is returned in a single response.\n","operationId":"TdDdWeb.UserSearchFilterController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSearchFilterListResponse"}}},"description":"User search filter list"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdForbiddenResponse"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List user search filters","tags":["User Search Filters"]}}},"components":{"schemas":{"UserSearchFilterListResponse":{"additionalProperties":false,"properties":{"data":{"description":"List of user search filters","items":{"$ref":"#/components/schemas/UserSearchFilterResource"},"type":"array"}},"required":["data"],"title":"UserSearchFilterListResponse","type":"object"},"UserSearchFilterResource":{"additionalProperties":false,"properties":{"filters":{"additionalProperties":true,"nullable":true,"type":"object"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","nullable":true,"type":"string"},"is_global":{"default":false,"nullable":true,"type":"boolean"},"name":{"type":"string"},"scope":{"type":"string"},"updated_at":{"format":"date-time","nullable":true,"type":"string"},"user_id":{"type":"integer"}},"required":["id","name","user_id","scope","is_global"],"title":"UserSearchFilterResource","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdForbiddenResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdForbiddenResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```

## Create a user search filter

> Creates a new search filter for the authenticated user.\
> \
> Requires the \*\*'Create user search filters'\*\* permission. Any authenticated user can create a filter for themselves but the \`is\_global\` flag can only be set by administrators.\
> \
> \*\*Request body:\*\*\
> \- \`name\` (required, string) – The filter name.\
> \- \`scope\` (required, string) – The context where the filter applies (e.g., \`rule\`, \`rule\_implementation\`, \`data\_structure\`).\
> \- \`filters\` (optional, object) – The filter criteria (key‑value pairs).\
> \- \`is\_global\` (optional, boolean) – Whether the filter is global. Default: \`false\`. Only admins can set this to \`true\`.<br>

```json
{"openapi":"3.0.0","info":{"title":"td-dd","version":"Truedat 8.12.2"},"paths":{"/api/user_search_filters":{"post":{"description":"Creates a new search filter for the authenticated user.\n\nRequires the **'Create user search filters'** permission. Any authenticated user can create a filter for themselves but the `is_global` flag can only be set by administrators.\n\n**Request body:**\n- `name` (required, string) – The filter name.\n- `scope` (required, string) – The context where the filter applies (e.g., `rule`, `rule_implementation`, `data_structure`).\n- `filters` (optional, object) – The filter criteria (key‑value pairs).\n- `is_global` (optional, boolean) – Whether the filter is global. Default: `false`. Only admins can set this to `true`.\n","operationId":"TdDdWeb.UserSearchFilterController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSearchFilterCreateRequest"}}},"description":"User search filter payload","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSearchFilterResponse"}}},"description":"User search filter created"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnauthorizedResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdForbiddenResponse"}}},"description":"Forbidden"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdUnprocessableEntityObjectResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdDdInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create a user search filter","tags":["User Search Filters"]}}},"components":{"schemas":{"UserSearchFilterCreateRequest":{"additionalProperties":false,"properties":{"user_search_filter":{"additionalProperties":false,"properties":{"filters":{"additionalProperties":true,"description":"Filter criteria","nullable":true,"type":"object"},"is_global":{"default":false,"description":"Whether the filter is global (admin only)","nullable":true,"type":"boolean"},"name":{"description":"Filter name","type":"string"},"scope":{"description":"Scope (e.g., 'rule', 'rule_implementation', 'data_structure')","type":"string"}},"required":["name","scope"],"type":"object"}},"required":["user_search_filter"],"title":"UserSearchFilterCreateRequest","type":"object"},"UserSearchFilterResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/UserSearchFilterResource"}},"required":["data"],"title":"UserSearchFilterResponse","type":"object"},"UserSearchFilterResource":{"additionalProperties":false,"properties":{"filters":{"additionalProperties":true,"nullable":true,"type":"object"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","nullable":true,"type":"string"},"is_global":{"default":false,"nullable":true,"type":"boolean"},"name":{"type":"string"},"scope":{"type":"string"},"updated_at":{"format":"date-time","nullable":true,"type":"string"},"user_id":{"type":"integer"}},"required":["id","name","user_id","scope","is_global"],"title":"UserSearchFilterResource","type":"object"},"TdDdUnauthorizedResponse":{"anyOf":[{"$ref":"#/components/schemas/TdDdUnauthorizedMessageResponse"},{"$ref":"#/components/schemas/TdDdUnauthorizedErrorResponse"}],"description":"Unauthorized response from auth plug or error view","title":"TdDdUnauthorizedResponse"},"TdDdUnauthorizedMessageResponse":{"additionalProperties":false,"properties":{"message":{"type":"string"}},"required":["message"],"title":"TdDdUnauthorizedMessageResponse","type":"object"},"TdDdUnauthorizedErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnauthorizedErrorResponse","type":"object"},"TdDdForbiddenResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdForbiddenResponse","type":"object"},"TdDdUnprocessableEntityObjectResponse":{"additionalProperties":false,"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"required":["errors"],"title":"TdDdUnprocessableEntityObjectResponse","type":"object"},"TdDdInternalServerErrorResponse":{"additionalProperties":false,"properties":{"errors":{"additionalProperties":false,"properties":{"detail":{"type":"string"}},"required":["detail"],"type":"object"}},"required":["errors"],"title":"TdDdInternalServerErrorResponse","type":"object"}}}}
```
