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