11 $ref: x-primitives.yaml
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": "Current settings prevent the passed due date to be applied",
45 "error_code": "invalid_due_date"
49 Note: Some routes might offer additional attributes in their error responses but that's
50 subject to change and thus not documented.
52 ## Filtering responses
54 The API allows for some advanced response filtering using a JSON based query syntax. The
55 query can be added to the requests:
57 * as a query parameter `q=`
59 * in a special header `x-koha-query`
61 For simple field equality matches we can use `{ "fieldname": "value" }` where the fieldname
62 matches one of the fields as described in the particular endpoints response object.
64 We can refine that with more complex matching clauses by nesting a the clause into the
65 object; `{ "fieldname": { "clause": "value" } }`.
67 Available matching clauses include ">", "<", ">=", "<=", "-like", and "-not_like".
69 We can filter on multiple fields by adding them to the JSON respresentation. Adding at `HASH`
70 level will result in an 'AND' query, whilst combinding them in an `ARRAY` wilth result in an
71 'OR' query: `{ "field1": 'value2', "field2": "value2" }` will filter the response to only those
72 results with both field1 containing value2 AND field2 containing value2 for example.
76 The following request would return any patron with firstname "Henry" and lastname "Acevedo";
78 `curl -u koha:koha --request GET 'http://127.0.0.1:8081/api/v1/patrons/' --data-raw '{ "surname": "Acevedo", "firstname": "Henry" }'`
80 The following request would return any patron whose lastname begins with "Ace";
82 `curl -u koha:koha --request GET 'http://127.0.0.1:8081/api/v1/patrons/' --data-raw '{ "surname": { "-like": "Ace%" }'`
84 The following request would return any patron whilse lastname is 'Acevedo' OR 'Bernardo'
86 `curl -u koha:koha --request GET 'http://127.0.0.1:8081/api/v1/patrons/' --data-raw '{ "surname": [ "Acevedo", "Bernardo" ] }'`
92 This optional header should be passed to give your api request a library
93 context; If it is not included in the request, then the request context
94 will default to using your api comsumer's assigned home library.
96 - name: "article_requests"
97 x-displayName: Article requests
99 Manage article requests
101 x-displayName: Biblios
103 Manage bibliographic records
105 x-displayName: Cashups
107 Manage cash register cashups
109 x-displayName: Checkouts
112 - name: "circulation_rules"
113 x-displayName: Circulation rules
115 Manage circulation rules
117 x-displayName: Cities
127 Manage funds for the acquisitions module
132 - name: "illbackends"
133 x-displayName: ILL backends
135 Manage ILL module backends
136 - name: "illrequests"
137 x-displayName: ILL requests
145 x-displayName: Libraries
149 x-displayName: Macros
153 x-displayName: Orders
155 Manage acquisition orders
157 x-displayName: "OAuth"
161 x-displayName: Patrons
165 x-displayName: Quotes
168 - name: "return_claims"
169 x-displayName: Return claims
176 - name: "smtp_servers"
177 x-displayName: SMTP servers
179 Manage SMTP servers configurations
181 x-displayName: Transfer limits
183 Manage transfer limits
184 - name: "suggestions"
185 x-displayName: "Purchase suggestions"
187 Manage purchase suggestions
189 x-displayName: "Vendors"
191 Manage vendors for the acquisitions module
192 - name: "batch_import_profiles"
193 x-displayName: Batch import profiles
195 Manage batch import profiles