Bug 28020: (follow-up) Add docs about error_code on the API
[koha.git] / api / v1 / swagger / paths / public_patrons.yaml
1 ---
2 "/public/patrons/{patron_id}/password":
3   post:
4     x-mojo-to: Patrons::Password#set_public
5     operationId: setPatronPasswordPublic
6     tags:
7       - patrons
8     summary: Set password for a patron (public)
9     parameters:
10       - $ref: ../parameters.yaml#/patron_id_pp
11       - name: body
12         in: body
13         description: A JSON object containing password information
14         schema:
15           type: object
16           properties:
17             password:
18               description: New password (plain text)
19               type: string
20             password_repeated:
21               description: Repeated new password (plain text)
22               type: string
23             old_password:
24               description: Patron's original password
25               type: string
26           required:
27             - password
28             - password_repeated
29             - old_password
30           additionalProperties: false
31     produces:
32       - application/json
33     responses:
34       "200":
35         description: Password changed
36       "400":
37         description: Bad request
38         schema:
39           $ref: ../definitions.yaml#/error
40       "401":
41         description: Authentication required
42         schema:
43           $ref: ../definitions.yaml#/error
44       "403":
45         description: Access forbidden
46         schema:
47           $ref: ../definitions.yaml#/error
48       "404":
49         description: Patron not found
50         schema:
51           $ref: ../definitions.yaml#/error
52       "500":
53         description: |
54           Internal server error. Possible `error_code` attribute values:
55
56           * `internal_server_error`
57         schema:
58           $ref: ../definitions.yaml#/error
59       "503":
60         description: Under maintenance
61         schema:
62           $ref: ../definitions.yaml#/error
63     x-koha-authorization:
64       allow-owner: true
65 "/public/patrons/{patron_id}/guarantors/can_see_charges":
66   put:
67     x-mojo-to: Patrons#guarantors_can_see_charges
68     operationId: setPatronGuarantorsCanSeeCharges
69     tags:
70       - patrons
71     summary: Set if guarantors can see charges (public)
72     parameters:
73       - $ref: ../parameters.yaml#/patron_id_pp
74       - name: body
75         in: body
76         description: A boolean representing if guarantors should be able to see the
77           patron's charges
78         required: true
79         schema:
80           type: object
81           properties:
82             allowed:
83               type: boolean
84           additionalProperties: false
85     produces:
86       - application/json
87     responses:
88       "200":
89         description: Charges view policy for guarantors changed
90       "400":
91         description: Bad request
92         schema:
93           $ref: ../definitions.yaml#/error
94       "401":
95         description: Authentication required
96         schema:
97           $ref: ../definitions.yaml#/error
98       "403":
99         description: Access forbidden
100         schema:
101           $ref: ../definitions.yaml#/error
102       "404":
103         description: Patron not found
104         schema:
105           $ref: ../definitions.yaml#/error
106       "500":
107         description: |
108           Internal server error. Possible `error_code` attribute values:
109
110           * `internal_server_error`
111         schema:
112           $ref: ../definitions.yaml#/error
113       "503":
114         description: Under maintenance
115         schema:
116           $ref: ../definitions.yaml#/error
117     x-koha-authorization:
118       allow-owner: true
119 "/public/patrons/{patron_id}/guarantors/can_see_checkouts":
120   put:
121     x-mojo-to: Patrons#guarantors_can_see_checkouts
122     operationId: setPatronGuarantorsCanSeeCheckouts
123     tags:
124       - patrons
125     summary: Set if guarantors can see checkouts
126     parameters:
127       - $ref: ../parameters.yaml#/patron_id_pp
128       - name: body
129         in: body
130         description: A boolean representing if guarantors should be able to see the
131           patron's checkouts
132         required: true
133         schema:
134           type: object
135           properties:
136             allowed:
137               type: boolean
138           additionalProperties: false
139     produces:
140       - application/json
141     responses:
142       "200":
143         description: Check-out view policy for guarantors changed
144       "400":
145         description: Bad request
146         schema:
147           $ref: ../definitions.yaml#/error
148       "401":
149         description: Authentication required
150         schema:
151           $ref: ../definitions.yaml#/error
152       "403":
153         description: Access forbidden
154         schema:
155           $ref: ../definitions.yaml#/error
156       "404":
157         description: Patron not found
158         schema:
159           $ref: ../definitions.yaml#/error
160       "500":
161         description: |
162           Internal server error. Possible `error_code` attribute values:
163
164           * `internal_server_error`
165         schema:
166           $ref: ../definitions.yaml#/error
167       "503":
168         description: Under maintenance
169         schema:
170           $ref: ../definitions.yaml#/error
171     x-koha-authorization:
172       allow-owner: true