matrix-spec/api/client-server/account-data.yaml

106 lines
3.2 KiB
YAML
Raw Normal View History

2015-11-16 17:33:57 +01:00
swagger: '2.0'
info:
title: "Matrix Client-Server Client Config API"
version: "1.0.0"
host: localhost:8008
schemes:
- https
- http
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%
2015-11-16 17:33:57 +01:00
consumes:
- application/json
produces:
- application/json
securityDefinitions:
$ref: definitions/security.yaml
2015-11-16 17:33:57 +01:00
paths:
2015-11-19 11:36:27 +01:00
"/user/{userId}/account_data/{type}":
2015-11-16 17:33:57 +01:00
put:
2015-11-19 11:36:27 +01:00
summary: Set some account_data for the user.
2015-11-16 17:33:57 +01:00
description: |-
2015-11-19 11:36:27 +01:00
Set some account_data for the client. This config is only visible to the user
that set the account_data. The config will be synced to clients in the
2015-11-18 16:44:18 +01:00
top-level ``account_data``.
2015-11-16 17:33:57 +01:00
security:
- accessToken: []
parameters:
- in: path
type: string
name: userId
required: true
description: |-
2015-11-19 11:36:27 +01:00
The id of the user to set account_data for. The access token must be
2015-11-16 17:33:57 +01:00
authorized to make requests for this user id.
x-example: "@alice:example.com"
- in: path
type: string
2015-11-19 11:36:27 +01:00
name: type
2015-11-16 17:33:57 +01:00
required: true
description: |-
2015-11-20 19:45:09 +01:00
The event type of the account_data to set. Custom types should be
namespaced to avoid clashes.
2015-11-16 17:33:57 +01:00
x-example: "org.example.custom.config"
- in: body
name: content
required: true
description: |-
2015-11-19 11:36:27 +01:00
The content of the account_data
2015-11-16 17:33:57 +01:00
schema:
type: object
example: |-
2015-11-19 11:36:27 +01:00
{"custom_account_data_key": "custom_config_value"}
2015-11-16 17:33:57 +01:00
responses:
200:
description:
2015-11-19 11:36:27 +01:00
The account_data was successfully added.
tags:
- User data
2015-11-19 11:36:27 +01:00
"/user/{userId}/rooms/{roomId}/account_data/{type}":
2015-11-16 17:33:57 +01:00
put:
2015-11-19 11:36:27 +01:00
summary: Set some account_data for the user.
2015-11-16 17:33:57 +01:00
description: |-
2015-11-19 11:36:27 +01:00
Set some account_data for the client on a given room. This config is only
visible to the user that set the account_data. The config will be synced to
2015-11-18 16:44:18 +01:00
clients in the per-room ``account_data``.
2015-11-16 17:33:57 +01:00
security:
- accessToken: []
parameters:
- in: path
type: string
name: userId
required: true
description: |-
2015-11-19 11:36:27 +01:00
The id of the user to set account_data for. The access token must be
2015-11-16 17:33:57 +01:00
authorized to make requests for this user id.
x-example: "@alice:example.com"
- in: path
type: string
name: roomId
required: true
description: |-
2015-11-19 11:36:27 +01:00
The id of the room to set account_data on.
2015-11-16 17:33:57 +01:00
x-example: "!726s6s6q:example.com"
- in: path
type: string
2015-11-19 11:36:27 +01:00
name: type
2015-11-16 17:33:57 +01:00
required: true
description: |-
2015-11-20 19:45:09 +01:00
The event type of the account_data to set. Custom types should be
2015-11-19 11:36:27 +01:00
namespaced to avoid clashes.
2015-11-16 17:33:57 +01:00
x-example: "org.example.custom.room.config"
- in: body
name: content
required: true
description: |-
2015-11-19 11:36:27 +01:00
The content of the account_data
2015-11-16 17:33:57 +01:00
schema:
type: object
example: |-
2015-11-19 11:36:27 +01:00
{"custom_account_data_key": "custom_account_data_value"}
2015-11-16 17:33:57 +01:00
responses:
200:
description:
2015-11-19 11:36:27 +01:00
The account_data was successfully added.
tags:
- User data