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.
matrix-spec/data/api/server-server/third_party_invite.yaml

270 lines
10 KiB
YAML

# Copyright 2018 New Vector 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.
openapi: 3.1.0
info:
title: Matrix Federation Third-party Invites API
version: 1.0.0
paths:
"/exchange_third_party_invite/{roomId}":
put:
summary: Request a server to auth a third-party invite event
description: |-
The receiving server will verify the partial `m.room.member` event
given in the request body. If valid, the receiving server will issue
an invite as per the [Inviting to a room](/server-server-api/#inviting-to-a-room) section before returning a
response to this request.
operationId: exchangeThirdPartyInvite
security:
- signedRequest: []
parameters:
- in: path
name: roomId
description: The room ID to exchange a third-party invite in
required: true
example: "!abc123:matrix.org"
schema:
type: string
format: mx-room-id
pattern: "^!"
requestBody:
content:
application/json:
schema:
type: object
properties:
type:
type: string
description: The event type. Must be `m.room.member`
example: m.room.member
room_id:
type: string
description: |-
The room ID the event is for. Must match the ID given in
the path.
format: mx-room-id
pattern: "^!"
example: "!abc123:matrix.org"
sender:
type: string
description: |-
The user ID of the user who sent the original `m.room.third_party_invite`
event.
format: mx-user-id
pattern: "^@"
example: "@joe:matrix.org"
state_key:
type: string
description: The user ID of the invited user
format: mx-user-id
pattern: "^@"
example: "@someone:example.org"
content:
type: object
description: The event content
title: Event Content
properties:
membership:
type: string
description: The membership state. Must be `invite`
example: invite
third_party_invite:
type: object
description: The third-party invite
title: Third-party Invite
properties:
display_name:
type: string
description: |-
A name which can be displayed to represent the user instead of their
third-party identifier.
example: alice
signed:
$ref: ../../event-schemas/schema/components/signed_third_party_invite.yaml
required:
- display_name
- signed
example:
display_name: alice
signed:
mxid: "@alice:localhost"
token: abc123
signatures:
magic.forest:
ed25519:3: fQpGIW1Snz+pwLZu6sTy2aHy/DYWWTspTJRPyNp0PKkymfIsNffysMl6ObMMFdIJhk6g6pwlIqZ54rxo8SLmAg
required:
- membership
- third_party_invite
example:
membership: invite
third_party_invite:
display_name: alice
signed:
mxid: "@alice:localhost"
token: abc123
signatures:
magic.forest:
ed25519:3: fQpGIW1Snz+pwLZu6sTy2aHy/DYWWTspTJRPyNp0PKkymfIsNffysMl6ObMMFdIJhk6g6pwlIqZ54rxo8SLmAg
required:
- type
- room_id
- sender
- state_key
- content
example: {
"type": "m.room.member",
"room_id": "!abc123:matrix.org",
"sender": "@joe:matrix.org",
"state_key": "@someone:example.org",
"content": {
"membership": "invite",
"third_party_invite": {
"display_name": "alice",
"signed": {
"mxid": "@alice:localhost",
"token": "abc123",
"signatures": {
"magic.forest": {
"ed25519:3": "fQpGIW1Snz+pwLZu6sTy2aHy/DYWWTspTJRPyNp0PKkymfIsNffysMl6ObMMFdIJhk6g6pwlIqZ54rxo8SLmAg"
}
}
}
}
}
}
description: A partial `m.room.member` event
required: true
responses:
"200":
description: The invite has been issued successfully.
content:
application/json:
schema:
type: object
description: An empty object
example: {}
examples:
response:
value: {}
/3pid/onbind:
put:
summary: |-
Notifies the server that a third-party identifier has been bound to one
of its users.
description: |-
Used by identity servers to notify the homeserver that one of its users
has bound a third-party identifier successfully, including any pending
room invites the identity server has been made aware of.
operationId: onBindThirdPartyIdentifier
requestBody:
content:
application/json:
schema:
type: object
properties:
medium:
type: string
description: |-
The type of third-party identifier. Currently only "email" is
a possible value.
example: email
address:
type: string
description: The third-party identifier itself. For example, an email address.
example: alice@example.com
mxid:
type: string
description: The user that is now bound to the third-party identifier.
format: mx-user-id
pattern: "^@"
example: "@alice:matrix.org"
invites:
type: array
description: A list of pending invites that the third-party identifier has
received.
items:
type: object
title: Third-party Invite
properties:
medium:
type: string
description: |-
The type of third-party invite issues. Currently only
"email" is used.
example: email
address:
type: string
description: The third-party identifier that received the invite.
example: alice@example.com
mxid:
type: string
description: The now-bound user ID that received the invite.
format: mx-user-id
pattern: "^@"
example: "@alice:matrix.org"
room_id:
type: string
description: The room ID the invite is valid for.
format: mx-room-id
pattern: "^!"
example: "!somewhere:example.org"
sender:
type: string
description: The user ID that sent the invite.
format: mx-user-id
pattern: "^@"
example: "@bob:matrix.org"
signed:
$ref: ../../event-schemas/schema/components/signed_third_party_invite.yaml
required:
- medium
- address
- mxid
- room_id
- sender
- signed
required:
- medium
- address
- mxid
- invites
required: true
responses:
"200":
description: The homeserver has processed the notification.
content:
application/json:
schema:
type: object
description: An empty object
example: {}
examples:
response:
value: {}
servers:
- url: "{protocol}://{hostname}{basePath}"
variables:
protocol:
enum:
- http
- https
default: https
hostname:
default: localhost:8448
basePath:
default: /_matrix/federation/v1
components:
securitySchemes:
signedRequest:
$ref: definitions/security.yaml#/signedRequest