Skip to content

Commit 5e60ff8

Browse files
committed
Add 404 error responses to push rule endpoints
MSC: #2663
1 parent 5610436 commit 5e60ff8

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

api/client-server/pushrules.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,16 @@ paths:
300300
allOf: [
301301
"$ref": "definitions/push_rule.yaml"
302302
]
303+
404:
304+
description: |-
305+
The push rule does not exist.
306+
examples:
307+
application/json: {
308+
"errcode": "M_NOT_FOUND",
309+
"error": "The push rule was not found."
310+
}
311+
schema:
312+
"$ref": "definitions/errors/error.yaml"
303313
tags:
304314
- Push notifications
305315
delete:
@@ -340,6 +350,16 @@ paths:
340350
}
341351
schema:
342352
type: object # empty json object
353+
404:
354+
description: |-
355+
The push rule does not exist.
356+
examples:
357+
application/json: {
358+
"errcode": "M_NOT_FOUND",
359+
"error": "The push rule was not found."
360+
}
361+
schema:
362+
"$ref": "definitions/errors/error.yaml"
343363
tags:
344364
- Push notifications
345365
put:
@@ -446,6 +466,16 @@ paths:
446466
}
447467
schema:
448468
"$ref": "definitions/errors/error.yaml"
469+
404:
470+
description: |-
471+
The push rule does not exist (when updating a push rule).
472+
examples:
473+
application/json: {
474+
"errcode": "M_NOT_FOUND",
475+
"error": "The push rule was not found."
476+
}
477+
schema:
478+
"$ref": "definitions/errors/error.yaml"
449479
429:
450480
description: This request was rate-limited.
451481
schema:
@@ -498,6 +528,16 @@ paths:
498528
type: boolean
499529
description: Whether the push rule is enabled or not.
500530
required: ["enabled"]
531+
404:
532+
description: |-
533+
The push rule does not exist.
534+
examples:
535+
application/json: {
536+
"errcode": "M_NOT_FOUND",
537+
"error": "The push rule was not found."
538+
}
539+
schema:
540+
"$ref": "definitions/errors/error.yaml"
501541
tags:
502542
- Push notifications
503543
put:
@@ -553,6 +593,16 @@ paths:
553593
}
554594
schema:
555595
type: object
596+
404:
597+
description: |-
598+
The push rule does not exist.
599+
examples:
600+
application/json: {
601+
"errcode": "M_NOT_FOUND",
602+
"error": "The push rule was not found."
603+
}
604+
schema:
605+
"$ref": "definitions/errors/error.yaml"
556606
tags:
557607
- Push notifications
558608
"/pushrules/{scope}/{kind}/{ruleId}/actions":
@@ -608,6 +658,16 @@ paths:
608658
- string
609659
- object
610660
required: ["actions"]
661+
404:
662+
description: |-
663+
The push rule does not exist.
664+
examples:
665+
application/json: {
666+
"errcode": "M_NOT_FOUND",
667+
"error": "The push rule was not found."
668+
}
669+
schema:
670+
"$ref": "definitions/errors/error.yaml"
611671
tags:
612672
- Push notifications
613673
put:
@@ -671,5 +731,15 @@ paths:
671731
}
672732
schema:
673733
type: object
734+
404:
735+
description: |-
736+
The push rule does not exist.
737+
examples:
738+
application/json: {
739+
"errcode": "M_NOT_FOUND",
740+
"error": "The push rule was not found."
741+
}
742+
schema:
743+
"$ref": "definitions/errors/error.yaml"
674744
tags:
675745
- Push notifications
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add a 404 ``M_NOT_FOUND`` error to push rule endpoints as per `MSC2663 <https://github.com/matrix-org/matrix-doc/pull/2663>`_.

0 commit comments

Comments
 (0)