Skip to content

Commit 185c564

Browse files
committed
Spec client-server IS unbind API
As per [MSC2140](#2140) Note: this modifies the endpoint in MSC2140 to be more in line with the remainder of the proposal.
1 parent 358c49f commit 185c564

File tree

3 files changed

+67
-1
lines changed

3 files changed

+67
-1
lines changed

api/client-server/administrative_contact.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,70 @@ paths:
234234
- id_server_unbind_result
235235
tags:
236236
- User data
237+
"/account/3pid/unbind":
238+
post:
239+
summary: Removes a user's third party identifier from an identity server.
240+
description: |-
241+
Removes a user's third party identifier from the provided identity server.
242+
This should not cause an unbind from the homeserver (as ``/3pid/delete``
243+
would) and should only affect the identity server.
244+
245+
Unlike other endpoints, this endpoint does not take an ``id_access_token``
246+
parameter because the homeserver is expected to sign the request to the
247+
identity server instead.
248+
operationId: unbind3pidFromAccount
249+
security:
250+
- accessToken: []
251+
parameters:
252+
- in: body
253+
name: body
254+
schema:
255+
type: object
256+
properties:
257+
id_server:
258+
type: string
259+
description: |-
260+
The identity server to unbind from. If not provided, the homeserver
261+
MUST use the ``id_server`` the identifier was added through. If the
262+
homeserver does not know the original ``id_server``, it MUST return
263+
a ``id_server_unbind_result`` of ``no-support``.
264+
example: "example.org"
265+
medium:
266+
type: string
267+
description: The medium of the third party identifier being removed.
268+
enum: ["email", "msisdn"]
269+
example: "email"
270+
address:
271+
type: string
272+
description: The third party address being removed.
273+
example: "example@example.org"
274+
required: ['medium', 'address']
275+
responses:
276+
200:
277+
description: |-
278+
The identity server has disassociated the third party identifier from the
279+
user.
280+
schema:
281+
type: object
282+
properties:
283+
id_server_unbind_result:
284+
type: string
285+
enum:
286+
# XXX: I don't know why, but the order matters here so that "no-support"
287+
# doesn't become "no- support" by the renderer.
288+
- "no-support"
289+
- "success"
290+
description: |-
291+
An indicator as to whether or not the identity server was able to unbind
292+
the 3PID. ``success`` indicates that the identity server has unbound the
293+
identifier whereas ``no-support`` indicates that the identity server
294+
refuses to support the request or the homeserver was not able to determine
295+
an identity server to unbind from.
296+
example: "success"
297+
required:
298+
- id_server_unbind_result
299+
tags:
300+
- User data
237301
"/account/3pid/email/requestToken":
238302
post:
239303
summary: Begins the validation process for an email address for association with the user's account.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add ``POST /account/3pid/unbind`` for removing a 3PID from an identity server.

proposals/2140-terms-of-service-2.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ A client uses this client/server API endpoint to request that the Homeserver
271271
removes the given 3PID from the given Identity Server, or all Identity Servers.
272272
Takes the same parameters as
273273
`POST /_matrix/client/r0/account/3pid/delete`, ie. `id_server`, `medium`,
274-
`address` and the newly added `id_access_token`.
274+
`address`. Similar to the other unbind endpoints, this endpoint does not
275+
require an `id_access_token` because the homeserver can only unbind.
275276

276277
Returns the same as `POST /_matrix/client/r0/account/3pid/delete`.
277278

0 commit comments

Comments
 (0)