11 $ref: x-primitives.json
17 url: http://www.gnu.org/licenses/gpl.txt
19 name: Koha Development Team
20 url: https://koha-community.org/
24 This API is documented in **OpenAPI format**.
28 The API supports the following authentication mechanisms
30 * HTTP Basic authentication
31 * OAuth2 (client credentials grant)
34 Both _Basic authentication_ and the _OAuth2_ flow, need to be enabled
35 by system preferences.
39 The API uses standard HTTP status codes to indicate the success or failure
40 of the API call. The body of the response will be JSON in the following format:
44 "error": "patron not found"
48 Note: Some routes might offer additional attributes in their error responses but that's
49 subject to change and thus not documented.
51 ## Filtering responses
53 The API allows for some advanced response filtering using a JSON based query syntax. The
54 query can be added to the requests:
56 * as a query parameter `q=`
58 * in a special header `x-koha-query`
60 For simple field equality matches we can use `{ "fieldname": "value" }` where the fieldname
61 matches one of the fields as described in the particular endpoints response object.
63 We can refine that with more complex matching clauses by nesting a the clause into the
64 object; `{ "fieldname": { "clause": "value" } }`.
66 Available matching clauses include ">", "<", ">=", "<=", "-like", and "-not_like".
68 We can filter on multiple fields by adding them to the JSON respresentation. Adding at `HASH`
69 level will result in an 'AND' query, whilst combinding them in an `ARRAY` wilth result in an
70 'OR' query: `{ "field1": 'value2', "field2": "value2" }` will filter the response to only those
71 results with both field1 containing value2 AND field2 containing value2 for example.
75 The following request would return any patron with firstname "Henry" and lastname "Acevedo";
77 `curl -u koha:koha --request GET 'http://127.0.0.1:8081/api/v1/patrons/' --data-raw '{ "surname": "Acevedo", "firstname": "Henry" }'`
79 The following request would return any patron whose lastname begins with "Ace";
81 `curl -u koha:koha --request GET 'http://127.0.0.1:8081/api/v1/patrons/' --data-raw '{ "surname": { "-like": "Ace%" }'`
83 The following request would return any patron whilse lastname is 'Acevedo' OR 'Bernardo'
85 `curl -u koha:koha --request GET 'http://127.0.0.1:8081/api/v1/patrons/' --data-raw '{ "surname": [ "Acevedo", "Bernardo" ] }'`
91 This optional header should be passed to give your api request a library
92 context; If it is not included in the request, then the request context
93 will default to using your api comsumer's assigned home library.
95 - name: "article_requests"
96 x-displayName: Article requests
98 Manage article requests
100 x-displayName: Biblios
102 Manage bibliographic records
104 x-displayName: Cashups
106 Manage cash register cashups
108 x-displayName: Checkouts
111 - name: "circulation_rules"
112 x-displayName: Circulation rules
114 Manage circulation rules
116 x-displayName: Cities
126 Manage funds for the acquisitions module
131 - name: "illbackends"
132 x-displayName: ILL backends
134 Manage ILL module backends
135 - name: "illrequests"
136 x-displayName: ILL requests
144 x-displayName: Libraries
148 x-displayName: Macros
152 x-displayName: Orders
154 Manage acquisition orders
156 x-displayName: "OAuth"
160 x-displayName: Patrons
164 x-displayName: Quotes
167 - name: "return_claims"
168 x-displayName: Return claims
175 - name: "smtp_servers"
176 x-displayName: SMTP servers
178 Manage SMTP servers configurations
180 x-displayName: Transfer limits
182 Manage transfer limits
183 - name: "suggestions"
184 x-displayName: "Purchase suggestions"
186 Manage purchase suggestions
188 x-displayName: "Vendors"
190 Manage vendors for the acquisitions module
191 - name: "batch_import_profiles"
192 x-displayName: Batch import profiles
194 Manage batch import profiles