---
title: "Search roles"
method: GET
path: "/roles/search"
tags: ["product:chat"]
---

# Search roles

`GET /roles/search`

Searches mentionable roles (user-assignable + channel-assignable, built-in and custom) by name prefix for autocomplete

## Query parameters

- `query` string, required — Case-insensitive name prefix to match against role names
- `limit` integer — Maximum number of roles to return (1-25, default 10)
- `name_gt` string — Return roles with names strictly greater than this cursor (for pagination)
- `role_type` 'user' | 'channel' — Optional filter: 'user' for user-assignable roles, 'channel' for channel-assignable roles. Omit to return both.
- `include_global_roles` boolean — When true, include cross-team operator roles whose name starts with 'global_'. Defaults to false.

## Response `200`

Successful response

- SearchRolesResponse, nullable
  - `duration` string, required
  - `roles` Role[], required — Matching roles, sorted ascending by name
    - `created_at` string, date-time, required — Date/time of creation
    - `custom` boolean, required — Whether this is a custom role or built-in
    - `name` string, required — Unique role name
    - `scopes` string[], required — List of scopes where this role is currently present. `.app` means that role is present in app-level grants
    - `updated_at` string, date-time, required — Date/time of the last update

## Other responses

- `400` — Bad request
- `429` — Too many requests

---

[API](https://skmtc.net/getstream/apis/stream-api.md) · [All operations](https://skmtc.net/getstream/apis/stream-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getstream/stream-api/versions/3dba86aaa0d8/schema)
