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 that
54 can be added as a query parameter, `q=` or in the request body.
56 For simple field equality matches we can use `{ "fieldname": "value" }` where the fieldname
57 matches one of the fields as described in the particular endpoints response object.
59 We can refine that with more complex matching clauses by nesting a the clause into the
60 object; `{ "fieldname": { "clause": "value" } }`.
62 Available matching clauses include ">", "<", ">=", "<=", "-like", and "-not_like".
64 We can filter on multiple fields by adding them to the JSON respresentation. Adding at `HASH`
65 level will result in an 'AND' query, whilst combinding them in an `ARRAY` wilth result in an
66 'OR' query: `{ "field1": 'value2', "field2": "value2" }` will filter the response to only those
67 results with both field1 containing value2 AND field2 containing value2 for example.
71 The following request would return any patron with firstname "Henry" and lastname "Acevedo";
73 `curl -u koha:koha --request GET 'http://127.0.0.1:8081/api/v1/patrons/' --data-raw '{ "surname": "Acevedo", "firstname": "Henry" }'`
75 The following request would return any patron whose lastname begins with "Ace";
77 `curl -u koha:koha --request GET 'http://127.0.0.1:8081/api/v1/patrons/' --data-raw '{ "surname": { "-like": "Ace%" }'`
79 The following request would return any patron whilse lastname is 'Acevedo' OR 'Bernardo'
81 `curl -u koha:koha --request GET 'http://127.0.0.1:8081/api/v1/patrons/' --data-raw '{ "surname": [ "Acevedo", "Bernardo" ] }'`
87 This optional header should be passed to give your api request a library
88 context; If it is not included in the request, then the request context
89 will default to using your api comsumer's assigned home library.
91 - name: "article_requests"
92 x-displayName: Article requests
94 Manage article requests
96 x-displayName: Biblios
98 Manage bibliographic records
100 x-displayName: Cashups
102 Manage cash register cashups
104 x-displayName: Checkouts
107 - name: "circulation_rules"
108 x-displayName: Circulation rules
110 Manage circulation rules
112 x-displayName: Cities
122 Manage funds for the acquisitions module
127 - name: "illbackends"
128 x-displayName: ILL backends
130 Manage ILL module backends
131 - name: "illrequests"
132 x-displayName: ILL requests
140 x-displayName: Libraries
144 x-displayName: Macros
148 x-displayName: Orders
150 Manage acquisition orders
152 x-displayName: "OAuth"
156 x-displayName: Patrons
160 x-displayName: Quotes
163 - name: "return_claims"
164 x-displayName: Return claims
171 - name: "smtp_servers"
172 x-displayName: SMTP servers
174 Manage SMTP servers configurations
176 x-displayName: Transfer limits
178 Manage transfer limits
179 - name: "suggestions"
180 x-displayName: "Purchase suggestions"
182 Manage purchase suggestions
184 x-displayName: "Vendors"
186 Manage vendors for the acquisitions module
187 - name: "batch_import_profiles"
188 x-displayName: Batch import profiles
190 Manage batch import profiles