User directory

Searches the user directory.

Performs a search for users. The homeserver may determine which subset of users are searched. However, the homeserver MUST at a minimum consider users who are visible to the requester based on their membership in rooms known to the homeserver. This means:

  • users that share a room with the requesting user
  • users who are joined to rooms known to the homeserver that have a public join rule
  • users who are joined to rooms known to the homeserver that have a world_readable history visibility

The search MUST consider local users to the homeserver, and SHOULD query remote users as part of the search.

The search is performed case-insensitively on user IDs and display names preferably using a collation determined based upon the Accept-Language header provided in the request, if present.

post/_matrix/client/v3/user_directory/search

Request

Request body

limitinteger

The maximum number of results to return. Defaults to 10.

search_termstring required

The term to search for

Example request

{
  "limit": 10,
  "search_term": "foo"
}

Response

The results of the search.

limitedboolean required

Indicates if the result list has been truncated by the limit.

Example response

{
  "results": [
    {
      "avatar_url": "mxc://bar.com/foo",
      "display_name": "Foo",
      "user_id": "@foo:bar.com"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.