You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
3.3 KiB
YAML
95 lines
3.3 KiB
YAML
8 years ago
|
# Copyright 2016 OpenMarket Ltd
|
||
|
#
|
||
|
# 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.
|
||
9 years ago
|
swagger: '2.0'
|
||
|
info:
|
||
|
title: "Matrix Client-Server Room Kicking API"
|
||
|
version: "1.0.0"
|
||
|
host: localhost:8008
|
||
|
schemes:
|
||
|
- https
|
||
|
- http
|
||
|
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%
|
||
|
consumes:
|
||
|
- application/json
|
||
|
produces:
|
||
|
- application/json
|
||
|
securityDefinitions:
|
||
9 years ago
|
$ref: definitions/security.yaml
|
||
9 years ago
|
paths:
|
||
|
"/rooms/{roomId}/kick":
|
||
|
post:
|
||
|
summary: Kick a user from the room.
|
||
|
description: |-
|
||
|
Kick a user from the room.
|
||
|
|
||
|
The caller must have the required power level in order to perform this operation.
|
||
6 years ago
|
|
||
|
Kicking a user adjusts the target member's membership state to be ``leave`` with an
|
||
|
optional ``reason``. Like with other membership changes, a user can directly adjust
|
||
|
the target member's state by making a request to ``/rooms/<room id>/state/m.room.member/<user id>``.
|
||
7 years ago
|
operationId: kick
|
||
9 years ago
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: roomId
|
||
|
description: The room identifier (not alias) from which the user should be kicked.
|
||
|
required: true
|
||
|
x-example: "!e42d8c:matrix.org"
|
||
|
- in: body
|
||
|
name: body
|
||
|
required: true
|
||
|
schema:
|
||
|
type: object
|
||
7 years ago
|
example: {
|
||
9 years ago
|
"reason": "Telling unfunny jokes",
|
||
|
"user_id": "@cheeky_monkey:matrix.org"
|
||
|
}
|
||
|
properties:
|
||
|
user_id:
|
||
|
type: string
|
||
|
description: The fully qualified user ID of the user being kicked.
|
||
|
reason:
|
||
|
type: string
|
||
6 years ago
|
description: |-
|
||
|
The reason the user has been kicked. This will be supplied as the
|
||
|
``reason`` on the target's updated `m.room.member`_ event.
|
||
9 years ago
|
required: ["user_id"]
|
||
|
responses:
|
||
|
200:
|
||
|
description: The user has been kicked from the room.
|
||
|
examples:
|
||
7 years ago
|
application/json: {
|
||
|
}
|
||
9 years ago
|
schema:
|
||
|
type: object
|
||
|
403:
|
||
|
description: |-
|
||
4 years ago
|
You do not have permission to kick the user from the room. A meaningful ``errcode`` and
|
||
|
description error text will be returned. Example reasons for rejections are:
|
||
9 years ago
|
|
||
|
- The kicker is not currently in the room.
|
||
|
- The kickee is not currently in the room.
|
||
|
- The kicker's power level is insufficient to kick users from the room.
|
||
|
examples:
|
||
7 years ago
|
application/json: {
|
||
9 years ago
|
"errcode": "M_FORBIDDEN",
|
||
|
"error": "You do not have a high enough power level to kick from this room."
|
||
|
}
|
||
6 years ago
|
schema:
|
||
|
"$ref": "definitions/errors/error.yaml"
|
||
9 years ago
|
tags:
|
||
|
- Room membership
|