Bug 30982: [22.05.x] Use the REST API for background job list view
[koha.git] / api / v1 / swagger / swagger.yaml
1 ---
2 swagger: "2.0"
3 basePath: /api/v1
4 definitions:
5   account_line:
6     $ref: ./definitions/account_line.yaml
7   advancededitormacro:
8     $ref: ./definitions/advancededitormacro.yaml
9   allows_renewal:
10     $ref: ./definitions/allows_renewal.yaml
11   basket:
12     $ref: ./definitions/basket.yaml
13   cashup:
14     $ref: ./definitions/cashup.yaml
15   checkout:
16     $ref: ./definitions/checkout.yaml
17   checkouts:
18     $ref: ./definitions/checkouts.yaml
19   circ-rule-kind:
20     $ref: ./definitions/circ-rule-kind.yaml
21   city:
22     $ref: ./definitions/city.yaml
23   error:
24     $ref: ./definitions/error.yaml
25   fund:
26     $ref: ./definitions/fund.yaml
27   hold:
28     $ref: ./definitions/hold.yaml
29   holds:
30     $ref: ./definitions/holds.yaml
31   ill_backend:
32     $ref: ./definitions/ill_backend.yaml
33   ill_backends:
34     $ref: ./definitions/ill_backends.yaml
35   import_batch_profile:
36     $ref: ./definitions/import_batch_profile.yaml
37   import_batch_profiles:
38     $ref: ./definitions/import_batch_profiles.yaml
39   import_record_match:
40     $ref: ./definitions/import_record_match.yaml
41   invoice:
42     $ref: ./definitions/invoice.yaml
43   item:
44     $ref: ./definitions/item.yaml
45   job:
46     $ref: ./definitions/job.yaml
47   library:
48     $ref: ./definitions/library.yaml
49   order:
50     $ref: ./definitions/order.yaml
51   patron:
52     $ref: ./definitions/patron.yaml
53   patron_account_credit:
54     $ref: ./definitions/patron_account_credit.yaml
55   patron_balance:
56     $ref: ./definitions/patron_balance.yaml
57   patron_extended_attribute:
58     $ref: ./definitions/patron_extended_attribute.yaml
59   quote:
60     $ref: ./definitions/quote.yaml
61   return_claim:
62     $ref: ./definitions/return_claim.yaml
63   smtp_server:
64     $ref: ./definitions/smtp_server.yaml
65   suggestion:
66     $ref: ./definitions/suggestion.yaml
67   transfer_limit:
68     $ref: ./definitions/transfer_limit.yaml
69   vendor:
70     $ref: ./definitions/vendor.yaml
71 paths:
72   /acquisitions/baskets/managers:
73     $ref: paths/acquisitions_baskets.yaml#/~1acquisitions~1baskets~1managers
74   /acquisitions/funds:
75     $ref: ./paths/acquisitions_funds.yaml#/~1acquisitions~1funds
76   /acquisitions/funds/owners:
77     $ref: paths/acquisitions_funds.yaml#/~1acquisitions~1funds~1owners
78   /acquisitions/funds/users:
79     $ref: paths/acquisitions_funds.yaml#/~1acquisitions~1funds~1users
80   /acquisitions/orders:
81     $ref: ./paths/acquisitions_orders.yaml#/~1acquisitions~1orders
82   "/acquisitions/orders/{order_id}":
83     $ref: "./paths/acquisitions_orders.yaml#/~1acquisitions~1orders~1{order_id}"
84   /acquisitions/vendors:
85     $ref: ./paths/acquisitions_vendors.yaml#/~1acquisitions~1vendors
86   "/acquisitions/vendors/{vendor_id}":
87     $ref: "./paths/acquisitions_vendors.yaml#/~1acquisitions~1vendors~1{vendor_id}"
88   /advanced_editor/macros:
89     $ref: ./paths/advancededitormacros.yaml#/~1advanced_editor~1macros
90   /advanced_editor/macros/shared:
91     $ref: ./paths/advancededitormacros.yaml#/~1advanced_editor~1macros~1shared
92   "/advanced_editor/macros/shared/{advancededitormacro_id}":
93     $ref: "./paths/advancededitormacros.yaml#/~1advanced_editor~1macros~1shared~1{advancededitormacro_id}"
94   "/advanced_editor/macros/{advancededitormacro_id}":
95     $ref: "./paths/advancededitormacros.yaml#/~1advanced_editor~1macros~1{advancededitormacro_id}"
96   "/article_requests/{article_request_id}":
97     $ref: "./paths/article_requests.yaml#/~1article_requests~1{article_request_id}"
98   "/biblios/{biblio_id}":
99     $ref: "./paths/biblios.yaml#/~1biblios~1{biblio_id}"
100   "/biblios/{biblio_id}/checkouts":
101     $ref: "./paths/biblios.yaml#/~1biblios~1{biblio_id}~1checkouts"
102   "/biblios/{biblio_id}/items":
103     $ref: "./paths/biblios.yaml#/~1biblios~1{biblio_id}~1items"
104   "/biblios/{biblio_id}/pickup_locations":
105     $ref: "./paths/biblios.yaml#/~1biblios~1{biblio_id}~1pickup_locations"
106   "/cash_registers/{cash_register_id}/cashups":
107     $ref: "./paths/cash_registers.yaml#/~1cash_registers~1{cash_register_id}~1cashups"
108   "/cashups/{cashup_id}":
109     $ref: "./paths/cash_registers.yaml#/~1cashups~1{cashup_id}"
110   /checkouts:
111     $ref: ./paths/checkouts.yaml#/~1checkouts
112   "/checkouts/{checkout_id}":
113     $ref: "./paths/checkouts.yaml#/~1checkouts~1{checkout_id}"
114   "/checkouts/{checkout_id}/allows_renewal":
115     $ref: "./paths/checkouts.yaml#/~1checkouts~1{checkout_id}~1allows_renewal"
116   "/checkouts/{checkout_id}/renewal":
117     $ref: "./paths/checkouts.yaml#/~1checkouts~1{checkout_id}~1renewal"
118   /circulation-rules/kinds:
119     $ref: ./paths/circulation-rules.yaml#/~1circulation-rules~1kinds
120   /cities:
121     $ref: ./paths/cities.yaml#/~1cities
122   "/cities/{city_id}":
123     $ref: "./paths/cities.yaml#/~1cities~1{city_id}"
124   "/clubs/{club_id}/holds":
125     $ref: "./paths/clubs.yaml#/~1clubs~1{club_id}~1holds"
126   /config/smtp_servers:
127     $ref: ./paths/config_smtp_servers.yaml#/~1config~1smtp_servers
128   "/config/smtp_servers/{smtp_server_id}":
129     $ref: "./paths/config_smtp_servers.yaml#/~1config~1smtp_servers~1{smtp_server_id}"
130   /holds:
131     $ref: ./paths/holds.yaml#/~1holds
132   "/holds/{hold_id}":
133     $ref: "./paths/holds.yaml#/~1holds~1{hold_id}"
134   "/holds/{hold_id}/pickup_location":
135     $ref: "./paths/holds.yaml#/~1holds~1{hold_id}~1pickup_location"
136   "/holds/{hold_id}/pickup_locations":
137     $ref: "./paths/holds.yaml#/~1holds~1{hold_id}~1pickup_locations"
138   "/holds/{hold_id}/priority":
139     $ref: "./paths/holds.yaml#/~1holds~1{hold_id}~1priority"
140   "/holds/{hold_id}/suspension":
141     $ref: "./paths/holds.yaml#/~1holds~1{hold_id}~1suspension"
142   /ill_backends:
143     $ref: ./paths/ill_backends.yaml#/~1ill_backends
144   "/ill_backends/{ill_backend_id}":
145     $ref: "./paths/ill_backends.yaml#/~1ill_backends~1{ill_backend_id}"
146   /illrequests:
147     $ref: ./paths/illrequests.yaml#/~1illrequests
148   "/import_batches/{import_batch_id}/records/{import_record_id}/matches/chosen":
149     $ref: "./paths/import_batches.yaml#/~1import_batches~1{import_batch_id}~1records~1{import_record_id}~1matches~1chosen"
150   /import_batch_profiles:
151     $ref: ./paths/import_batch_profiles.yaml#/~1import_batch_profiles
152   "/import_batch_profiles/{import_batch_profile_id}":
153     $ref: "./paths/import_batch_profiles.yaml#/~1import_batch_profiles~1{import_batch_profile_id}"
154   /items:
155     $ref: ./paths/items.yaml#/~1items
156   "/items/{item_id}":
157     $ref: "./paths/items.yaml#/~1items~1{item_id}"
158   "/items/{item_id}/pickup_locations":
159     $ref: "./paths/items.yaml#/~1items~1{item_id}~1pickup_locations"
160   /jobs:
161     $ref: ./paths/jobs.yaml#/~1jobs
162   "/jobs/{job_id}":
163     $ref: "./paths/jobs.yaml#/~1jobs~1{job_id}"
164   /libraries:
165     $ref: ./paths/libraries.yaml#/~1libraries
166   "/libraries/{library_id}":
167     $ref: "./paths/libraries.yaml#/~1libraries~1{library_id}"
168   /oauth/token:
169     $ref: ./paths/oauth.yaml#/~1oauth~1token
170   /patrons:
171     $ref: ./paths/patrons.yaml#/~1patrons
172   "/patrons/{patron_id}":
173     $ref: "./paths/patrons.yaml#/~1patrons~1{patron_id}"
174   "/patrons/{patron_id}/account":
175     $ref: "./paths/patrons_account.yaml#/~1patrons~1{patron_id}~1account"
176   "/patrons/{patron_id}/account/credits":
177     $ref: "./paths/patrons_account.yaml#/~1patrons~1{patron_id}~1account~1credits"
178   "/patrons/{patron_id}/extended_attributes":
179     $ref: "./paths/patrons_extended_attributes.yaml#/~1patrons~1{patron_id}~1extended_attributes"
180   "/patrons/{patron_id}/extended_attributes/{extended_attribute_id}":
181     $ref: "./paths/patrons_extended_attributes.yaml#/~1patrons~1{patron_id}~1extended_attributes~1{extended_attribute_id}"
182   "/patrons/{patron_id}/holds":
183     $ref: "./paths/patrons_holds.yaml#/~1patrons~1{patron_id}~1holds"
184   "/patrons/{patron_id}/password":
185     $ref: "./paths/patrons_password.yaml#/~1patrons~1{patron_id}~1password"
186   "/patrons/{patron_id}/password/expiration_date":
187     $ref: "./paths/patrons_password.yaml#/~1patrons~1{patron_id}~1password~1expiration_date"
188   "/public/biblios/{biblio_id}":
189     $ref: "./paths/biblios.yaml#/~1public~1biblios~1{biblio_id}"
190   "/public/biblios/{biblio_id}/items":
191     $ref: "./paths/biblios.yaml#/~1public~1biblios~1{biblio_id}~1items"
192   /public/libraries:
193     $ref: ./paths/libraries.yaml#/~1public~1libraries
194   "/public/libraries/{library_id}":
195     $ref: "./paths/libraries.yaml#/~1public~1libraries~1{library_id}"
196   "/public/patrons/{patron_id}/article_requests/{article_request_id}":
197     $ref: "./paths/article_requests.yaml#/~1public~1patrons~1{patron_id}~1article_requests~1{article_request_id}"
198   "/public/patrons/{patron_id}/guarantors/can_see_charges":
199     $ref: "./paths/public_patrons.yaml#/~1public~1patrons~1{patron_id}~1guarantors~1can_see_charges"
200   "/public/patrons/{patron_id}/guarantors/can_see_checkouts":
201     $ref: "./paths/public_patrons.yaml#/~1public~1patrons~1{patron_id}~1guarantors~1can_see_checkouts"
202   "/public/patrons/{patron_id}/password":
203     $ref: "./paths/public_patrons.yaml#/~1public~1patrons~1{patron_id}~1password"
204   /quotes:
205     $ref: ./paths/quotes.yaml#/~1quotes
206   "/quotes/{quote_id}":
207     $ref: "./paths/quotes.yaml#/~1quotes~1{quote_id}"
208   /return_claims:
209     $ref: ./paths/return_claims.yaml#/~1return_claims
210   "/return_claims/{claim_id}":
211     $ref: "./paths/return_claims.yaml#/~1return_claims~1{claim_id}"
212   "/return_claims/{claim_id}/notes":
213     $ref: "./paths/return_claims.yaml#/~1return_claims~1{claim_id}~1notes"
214   "/return_claims/{claim_id}/resolve":
215     $ref: "./paths/return_claims.yaml#/~1return_claims~1{claim_id}~1resolve"
216   "/rotas/{rota_id}/stages/{stage_id}/position":
217     $ref: "./paths/rotas.yaml#/~1rotas~1{rota_id}~1stages~1{stage_id}~1position"
218   /suggestions:
219     $ref: ./paths/suggestions.yaml#/~1suggestions
220   "/suggestions/{suggestion_id}":
221     $ref: "./paths/suggestions.yaml#/~1suggestions~1{suggestion_id}"
222   /suggestions/managers:
223     $ref: paths/suggestions.yaml#/~1suggestions~1managers
224   /transfer_limits:
225     $ref: ./paths/transfer_limits.yaml#/~1transfer_limits
226   /transfer_limits/batch:
227     $ref: ./paths/transfer_limits.yaml#/~1transfer_limits~1batch
228   "/transfer_limits/{limit_id}":
229     $ref: "./paths/transfer_limits.yaml#/~1transfer_limits~1{limit_id}"
230 parameters:
231   advancededitormacro_id_pp:
232     description: Advanced editor macro internal identifier
233     in: path
234     name: advancededitormacro_id
235     required: true
236     type: integer
237   biblio_id_pp:
238     description: Record internal identifier
239     in: path
240     name: biblio_id
241     required: true
242     type: integer
243   candidate_match_id_pp:
244     description: Internal import record match identifier
245     in: path
246     name: candidate_match_id
247     required: true
248     type: integer
249   cash_register_id_pp:
250     description: Cash register internal identifier
251     in: path
252     name: cash_register_id
253     required: true
254     type: integer
255   cashup_id_pp:
256     description: Cashup internal identifier
257     in: path
258     name: cashup_id
259     required: true
260     type: integer
261   checkout_id_pp:
262     description: Internal checkout identifier
263     in: path
264     name: checkout_id
265     required: true
266     type: integer
267   city_id_pp:
268     description: City internal identifier
269     in: path
270     name: city_id
271     required: true
272     type: integer
273   club_id_pp:
274     description: Internal club identifier
275     in: path
276     name: club_id
277     required: true
278     type: integer
279   fund_id_pp:
280     description: Fund id
281     in: path
282     name: fund_id
283     required: true
284     type: integer
285   hold_id_pp:
286     description: Internal hold identifier
287     in: path
288     name: hold_id
289     required: true
290     type: integer
291   import_batch_profile_id_pp:
292     description: Internal profile identifier
293     in: path
294     name: import_batch_profile_id
295     required: true
296     type: integer
297   import_record_id_pp:
298     description: Internal import record identifier
299     in: path
300     name: import_record_id
301     required: true
302     type: integer
303   item_id_pp:
304     description: Internal item identifier
305     in: path
306     name: item_id
307     required: true
308     type: integer
309   job_id_pp:
310     description: Job internal identifier
311     in: path
312     name: job_id
313     required: true
314     type: integer
315   library_id_pp:
316     description: Internal library identifier
317     in: path
318     name: library_id
319     required: true
320     type: string
321   match:
322     description: Matching criteria
323     enum:
324       - contains
325       - exact
326       - starts_with
327       - ends_with
328     in: query
329     name: _match
330     required: false
331     type: string
332   order_by:
333     collectionFormat: csv
334     description: Sorting criteria
335     in: query
336     items:
337       type: string
338     name: _order_by
339     required: false
340     type: array
341   order_id_pp:
342     description: Internal order identifier
343     in: path
344     name: order_id
345     required: true
346     type: integer
347   page:
348     description: "Page number, for paginated object listing"
349     in: query
350     name: _page
351     required: false
352     type: integer
353   patron_id_pp:
354     description: Internal patron identifier
355     in: path
356     name: patron_id
357     required: true
358     type: integer
359   patron_id_qp:
360     description: Internal patron identifier
361     in: query
362     name: patron_id
363     type: integer
364   per_page:
365     description: "Page size, for paginated object listing"
366     in: query
367     name: _per_page
368     required: false
369     type: integer
370   q_body:
371     description: Query filter sent through request"s body
372     in: body
373     name: query
374     required: false
375     schema:
376       type: object
377   q_header:
378     description: Query filter sent as a request header
379     in: header
380     name: x-koha-query
381     required: false
382     type: string
383   q_param:
384     description: Query filter sent as a request parameter
385     in: query
386     name: q
387     required: false
388     type: array
389     items:
390       type: string
391     collectionFormat: multi
392   quote_id_pp:
393     description: Quote internal identifier
394     in: path
395     name: quote_id
396     required: true
397     type: integer
398   request_id_header:
399     description: Request id header
400     in: header
401     name: x-koha-request-id
402     required: false
403     type: integer
404   seen_pp:
405     description: Item was seen flag
406     in: query
407     name: seen
408     required: false
409     type: integer
410   smtp_server_id_pp:
411     description: SMTP server internal identifier
412     in: path
413     name: smtp_server_id
414     required: true
415     type: integer
416   suggestion_id_pp:
417     description: Internal suggestion identifier
418     in: path
419     name: suggestion_id
420     required: true
421     type: integer
422   transfer_limit_id_pp:
423     description: Internal transfer limit identifier
424     in: path
425     name: limit_id
426     required: true
427     type: string
428   vendor_id_pp:
429     description: Vendor id
430     in: path
431     name: vendor_id
432     required: true
433     type: integer
434 info:
435   title: Koha REST API
436   version: "1"
437   license:
438     name: "GPL v3,"
439     url: http://www.gnu.org/licenses/gpl.txt
440   contact:
441     name: Koha Development Team
442     url: https://koha-community.org/
443   description: |
444     ## Introduction
445
446     This API is documented in **OpenAPI format**.
447
448     ## Authentication
449
450     The API supports the following authentication mechanisms
451
452     * HTTP Basic authentication
453     * OAuth2 (client credentials grant)
454     * Cookie-based
455
456     Both _Basic authentication_ and the _OAuth2_ flow, need to be enabled
457     by system preferences.
458
459     ## Errors
460
461     The API uses standard HTTP status codes to indicate the success or failure
462     of the API call. The body of the response will be JSON in the following format:
463
464     ```
465     {
466       "error": "Current settings prevent the passed due date to be applied",
467       "error_code": "invalid_due_date"
468     }
469     ```
470
471     Note: Some routes might offer additional attributes in their error responses but that"s
472     subject to change and thus not documented.
473
474     ## Filtering responses
475
476     The API allows for some advanced response filtering using a JSON based query syntax. The
477     query can be added to the requests:
478
479     * as a query parameter `q=`
480     * in the request body
481     * in a special header `x-koha-query`
482
483     For simple field equality matches we can use `{ "fieldname": "value" }` where the fieldname
484     matches one of the fields as described in the particular endpoints response object.
485
486     We can refine that with more complex matching clauses by nesting a the clause into the
487     object; `{ "fieldname": { "clause": "value" } }`.
488
489     Available matching clauses include ">", "<", ">=", "<=", "-like", and "-not_like".
490
491     We can filter on multiple fields by adding them to the JSON respresentation. Adding at `HASH`
492     level will result in an "AND" query, whilst combinding them in an `ARRAY` wilth result in an
493     "OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those
494     results with both field1 containing value2 AND field2 containing value2 for example.
495
496     Additionally, if you are requesting related data be embedded into the response one can query
497     on the related data using dot notation in the field names.
498
499     ### Examples
500
501     The following request would return any patron with firstname "Henry" and lastname "Acevedo";
502
503     `curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": "Acevedo", "firstname": "Henry" }"`
504
505     The following request would return any patron whose lastname begins with "Ace";
506
507     `curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": { "-like": "Ace%" }"`
508
509     The following request would return any patron whose lastname is "Acevedo" OR "Bernardo"
510
511     `curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": [ "Acevedo", "Bernardo" ] }"`
512
513     The following request embeds the related patron extended attributes data and filters on it.
514
515     `curl -u koha:koha =--request GET 'http://127.0.0.1:8081/api/v1/patrons/' --header 'x-koha-embed: extended_attributes' --data-raw '{ "extended_attributes.code": "internet", "extended_attributes.attribute": "1" }'`
516
517     ## Special headers
518
519     ### x-koha-embed
520
521     This optional header allows the api consumer to request additional related data
522     to be returned in the api response.  It also allows for cross referencing in the
523     queries as described above. It accepts a comma delimited list of relation names.
524
525     Relations may on occasion also support dot delimited nesting to allow traversal.
526
527     ### x-koha-library
528
529     This optional header should be passed to give your api request a library
530     context; If it is not included in the request, then the request context
531     will default to using your api comsumer"s assigned home library.
532 tags:
533   - description: "Manage article requests\n"
534     name: article_requests
535     x-displayName: Article requests
536   - description: "Manage baskets for the acquisitions module\n"
537     name: baskets
538     x-displayName: Baskets
539   - description: "Manage bibliographic records\n"
540     name: biblios
541     x-displayName: Biblios
542   - description: "Manage cash register cashups\n"
543     name: cashups
544     x-displayName: Cashups
545   - description: "Manage checkouts\n"
546     name: checkouts
547     x-displayName: Checkouts
548   - description: "Manage circulation rules\n"
549     name: circulation_rules
550     x-displayName: Circulation rules
551   - description: "Manage cities\n"
552     name: cities
553     x-displayName: Cities
554   - description: "Manage patron clubs\n"
555     name: clubs
556     x-displayName: Clubs
557   - description: "Manage funds for the acquisitions module\n"
558     name: funds
559     x-displayName: Funds
560   - description: "Manage holds\n"
561     name: holds
562     x-displayName: Holds
563   - description: "Manage ILL module backends\n"
564     name: illbackends
565     x-displayName: ILL backends
566   - description: "Manage ILL requests\n"
567     name: illrequests
568     x-displayName: ILL requests
569   - description: "Manage import batches\n"
570     name: import_batches
571     x-display-name: Import batches
572   - description: "Manage items\n"
573     name: items
574     x-displayName: Items
575   - description: "Manage jobs\n"
576     name: jobs
577     x-displayName: Jobs
578   - description: "Manage libraries\n"
579     name: libraries
580     x-displayName: Libraries
581   - description: "Manage macros\n"
582     name: macros
583     x-displayName: Macros
584   - description: "Manage acquisition orders\n"
585     name: orders
586     x-displayName: Orders
587   - description: "Handle OAuth flows\n"
588     name: oauth
589     x-displayName: OAuth
590   - description: "Manage patrons\n"
591     name: patrons
592     x-displayName: Patrons
593   - description: "Manage quotes\n"
594     name: quotes
595     x-displayName: Quotes
596   - description: "Manage return claims\n"
597     name: return_claims
598     x-displayName: Return claims
599   - description: "Manage rotas\n"
600     name: rotas
601     x-displayName: Rotas
602   - description: "Manage SMTP servers configurations\n"
603     name: smtp_servers
604     x-displayName: SMTP servers
605   - description: "Manage transfer limits\n"
606     name: transfer
607     x-displayName: Transfer limits
608   - description: "Manage purchase suggestions\n"
609     name: suggestions
610     x-displayName: Purchase suggestions
611   - description: "Manage vendors for the acquisitions module\n"
612     name: vendors
613     x-displayName: Vendors
614   - description: "Manage batch import profiles\n"
615     name: batch_import_profiles
616     x-displayName: Batch import profiles