matrix-doc/api/client-server/users.yaml

101 lines
3.4 KiB
YAML
Raw Normal View History

2017-12-18 16:54:11 +00:00
# Copyright 2017 New Vector Ltd
2017-12-17 23:42:44 +00:00
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
swagger: '2.0'
info:
2017-12-18 16:54:11 +00:00
title: "Matrix Client-Server User Directory API"
2017-12-17 23:42:44 +00:00
version: "1.0.0"
host: localhost:8008
schemes:
- https
- http
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%
consumes:
- application/json
produces:
- application/json
securityDefinitions:
$ref: definitions/security.yaml
paths:
"/user_directory/search":
post:
summary: Searches the user directory.
description: |-
2017-12-18 16:54:11 +00:00
This API performs a server-side search over all users registered on the server.
2017-12-21 17:45:26 +00:00
It searches user ID and displayname case-insensitively for users that you share a room with or that are in public rooms.
operationId: searchUserDirectory
2017-12-17 23:42:44 +00:00
security:
- accessToken: []
parameters:
- in: body
name: body
schema:
type: object
properties:
search_term:
type: string
description: The term to search for
example: "foo"
limit:
type: number
2017-12-21 17:45:26 +00:00
description: The maximum number of results to return (Defaults to 10).
2017-12-17 23:42:44 +00:00
example: 10
required: ["search_term"]
responses:
200:
2017-12-18 16:54:11 +00:00
description: The results of the search.
2017-12-17 23:42:44 +00:00
examples:
application/json: {
"results": [
{
"user_id": "@foo:bar.com",
"display_name": "Foo",
"avatar_url": "mxc://bar.com/foo"
}
],
"limited": false
}
schema:
type: object
required: ["results", "limited"]
properties:
results:
type: array
2017-12-18 16:54:11 +00:00
description: Ordered by rank and then whether or not profile info is available.
2017-12-17 23:42:44 +00:00
items:
title: User
type: object
required: ["user_id"]
2017-12-17 23:42:44 +00:00
properties:
user_id:
type: string
example: "@foo:bar.com"
2017-12-21 17:45:26 +00:00
description: The user's matrix user ID.
2017-12-17 23:42:44 +00:00
display_name:
type: string
example: "Foo"
description: The display name of the user, if one exists.
2017-12-17 23:42:44 +00:00
avatar_url:
type: string
example: "mxc://bar.com/foo"
description: The avatar url, as an MXC, if one exists.
2017-12-17 23:42:44 +00:00
limited:
type: boolean
description: Indicates if the result list has been truncated by the limit.
429:
description: This request was rate-limited.
schema:
"$ref": "definitions/error.yaml"
tags:
- User data