Bug 28020: (follow-up) Add docs about error_code on the API
[koha.git] / api / v1 / swagger / paths / patrons_holds.yaml
1 ---
2 "/patrons/{patron_id}/holds":
3   get:
4     x-mojo-to: Patrons::Holds#list
5     operationId: getPatronHolds
6     tags:
7       - holds
8     summary: List holds for a patron
9     parameters:
10       - $ref: ../parameters.yaml#/patron_id_pp
11       - $ref: ../parameters.yaml#/match
12       - $ref: ../parameters.yaml#/order_by
13       - $ref: ../parameters.yaml#/page
14       - $ref: ../parameters.yaml#/per_page
15       - $ref: ../parameters.yaml#/q_param
16       - $ref: ../parameters.yaml#/q_body
17       - $ref: ../parameters.yaml#/q_header
18     produces:
19       - application/json
20     responses:
21       "200":
22         description: The patron holds
23         schema:
24           type: array
25           items:
26             $ref: ../definitions.yaml#/hold
27       "401":
28         description: Authentication required
29         schema:
30           $ref: ../definitions.yaml#/error
31       "403":
32         description: Access forbidden
33         schema:
34           $ref: ../definitions.yaml#/error
35       "404":
36         description: Patron not found
37         schema:
38           $ref: ../definitions.yaml#/error
39       "500":
40         description: |
41           Internal server error. Possible `error_code` attribute values:
42
43           * `internal_server_error`
44         schema:
45           $ref: ../definitions.yaml#/error
46       "503":
47         description: Under maintenance
48         schema:
49           $ref: ../definitions.yaml#/error
50     x-koha-authorization:
51       permissions:
52         borrowers: edit_borrowers