openapi: 3.0.3 info: contact: name: Koha Development Team url: https://koha-community.org/ description: "## Background\n\nThe API supports two sets of endpoints, one targetted at library staff and the other at at library users.\n\nThose endpoints under the `/public` path are aimed at delivering functionality tailored to library users and offer\na more restricted set of functions, overrides and data in thier responses for data privacy and library policy\nreasons. Many of these endpoints do not require authentication for fetching public data, though an authenticated\nsession will expose additional options and allow users to see more data where it is part of their own record.\n\nAll other endpoints are targetted at the staff interface level and allow for additional functionality and a more\nunrestricted view of data. These endpoints, however, have a level of redaction built in for resources that the\napi consumer should not have access to. For example, user data for users who do not belong to the same library\nor library group of your api user will be reduced to just minimum neccesary for a valid response. Object keys will\nbe consistent for all responses, but their values may be removed depending on access.\n\n## Authentication\n\nThe API supports the following authentication mechanisms\n\n* HTTP Basic authentication\n* OAuth2 (client credentials grant)\n* Cookie-based\n\nBoth _Basic authentication_ and the _OAuth2_ flow, need to be enabled\nby system preferences.\n\n## Authorization\n\nThe API uses existing user profiles to restrict access to resources based on user permissions and the library the\nAPI user is assigned to. This may result, at times, in resources being returned in a redacted form with all keys\npresent but sensative values nulled.\n\nWe do not yet support OAuth Scopes or the Authorization Code grant flow.\n\n## Errors\n\nThe API uses standard HTTP status codes to indicate the success or failure\nof the API call. The body of the response will be JSON in the following format:\n\n```\n{\n \"error\": \"Current settings prevent the passed due date to be applied\",\n \"error_code\": \"invalid_due_date\"\n}\n```\n\nNote: Some routes might offer additional attributes in their error responses but that\"s\nsubject to change and thus not documented.\n\n## Filtering responses\n\nThe API allows for some advanced response filtering using a JSON based query syntax. The\nquery can be added to the requests:\n\n* as a query parameter `q=`\n* in the request body\n\nFor simple field equality matches we can use `{ \"fieldname\": \"value\" }` where the fieldname\nmatches one of the fields as described in the particular endpoints response object.\n\nWe can refine that with more complex matching clauses by nesting a the clause into the\nobject; `{ \"fieldname\": { \"clause\": \"value\" } }`.\n\nAvailable matching clauses include `=`, `!=`, `<`, `>`, `<=`, `>=` and `-not`. We also support `-like`\nand `-not_like` string comparisons with `%` used to denote wildcards, thus you can pass\n`{ \"fieldname\": { \"-like\": \"value%\" } }` to do a 'starts with' string match for example.\n\nWe can filter on multiple fields by adding them to the JSON respresentation. Adding at `HASH`\nlevel will result in an \"AND\" query, whilst combinding them in an `ARRAY` will result in an\n\"OR\" query: `{ \"field1\": \"value2\", \"field2\": \"value2\" }` will filter the response to only those\nresults with both field1 containing value2 AND field2 containing value2 for example.\n\nThere is a collection of special operators also available to you, including:\n\n* `-in` - Expects an array of values to perform an OR match against\n* `-not_in` - Expects an array of values to perform a NOR match against\n* `-between` - Expects two values which the value of the field is expected to fall between\n* `-not_between` - Expects two values which the value of the field is expected to fall outside of\n* `-ident` - Expects a second field name to match the two field values against\n* `-regexp` - Expects a perl compatible regular expression for which the value should match\n\nLogic and nesting is also supported and you may use `-and` and `-or` to change the logic of an ARRAY\nor HASH as described above.\n\nAdditionally, if you are requesting related data be embedded into the response one can query\non the related data using dot notation in the field names.\n\n### Examples\n\nThe following request would return any patron with firstname \"Henry\" and lastname \"Acevedo\";\n\n`curl -u koha:koha --request GET \"http://127.0.0.1:8081/api/v1/patrons/\" --data-raw '{ \"surname\": \"Acevedo\", \"firstname\": \"Henry\" }'`\n\nThe following request would return any patron whose lastname begins with \"Ace\";\n\n`curl -u koha:koha --request GET \"http://127.0.0.1:8081/api/v1/patrons/\" --data-raw '{ \"surname\": { \"-like\": \"Ace%\" }'`\n\nThe following request would return any patron whose lastname is \"Acevedo\" OR \"Bernardo\"\n\n`curl -u koha:koha --request GET \"http://127.0.0.1:8081/api/v1/patrons/\" --data-raw '{ \"surname\": [ \"Acevedo\", \"Bernardo\" ] }'`\n\nThe following request embeds the related patron extended attributes data and filters on it.\n\n`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\" }'`\n\n## Special headers\n\n### x-koha-embed\n\nThis optional header allows the api consumer to request additional related data\nto be returned in the api response. It also allows for cross referencing in the\nqueries as described above. It accepts a comma delimited list of relation names.\n\nRelations may on occasion also support dot delimited nesting to allow traversal.\n\n### x-koha-library\n\nThis optional header should be passed to give your api request a library\ncontext; If it is not included in the request, then the request context\nwill default to using your api comsumer\"s assigned home library.\n" license: name: GPL v3, url: http://www.gnu.org/licenses/gpl.txt title: Koha REST 2fa erm_eholdings_titles API version: '1' servers: - url: https://libserv.iitk.ac.in/api/v1 description: PKK Library Koha REST API (production) tags: - description: 'Manage ERM eHoldings titles ' name: erm_eholdings_titles x-displayName: ERM eHoldings titles paths: /erm/eholdings/local/titles/import: post: tags: - erm_eholdings_titles summary: Import local titles operationId: importErmEHoldingsTitles requestBody: required: true content: application/json: schema: additionalProperties: false properties: list_id: type: string package_id: type: string type: object description: The list_id of the list to import responses: '201': description: Successfully enqueued the import job content: application/json: schema: additionalProperties: false properties: job_id: type: string type: object '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/error_yaml' '401': description: Authentication required content: application/json: schema: $ref: '#/components/schemas/error_yaml' '403': description: Access forbidden content: application/json: schema: $ref: '#/components/schemas/error_yaml' '404': description: Ressource not found content: application/json: schema: $ref: '#/components/schemas/error_yaml' '409': description: Conflict in creating resource content: application/json: schema: $ref: '#/components/schemas/error_yaml' '500': description: 'Internal server error. Possible `error_code` attribute values: * `internal_server_error`' content: application/json: schema: $ref: '#/components/schemas/error_yaml' '501': description: Default response. content: application/json: schema: $ref: '#/components/schemas/DefaultResponse' '503': description: Under maintenance content: application/json: schema: $ref: '#/components/schemas/error_yaml' /erm/eholdings/{provider}/titles: get: tags: - erm_eholdings_titles summary: List eholdings titles operationId: listErmEHoldingsTitles parameters: - name: provider in: path required: true description: Provider name schema: type: string - name: title_id in: query required: false description: Case insensitive search on title title_id schema: type: integer - name: publication_title in: query required: false description: Case insensitive search on title publication_title schema: type: string - name: external_id in: query required: false description: Case insensitive search on title external_id schema: type: string - name: print_identifier in: query required: false description: Case insensitive search on title print_identifier schema: type: string - name: online_identifier in: query required: false description: Case insensitive search on title online_identifier schema: type: string - name: date_first_issue_online in: query required: false description: Case insensitive search on title date_first_issue_online schema: type: string - name: num_first_vol_online in: query required: false description: Case insensitive search on title num_first_vol_online schema: type: string - name: num_first_issue_online in: query required: false description: Case insensitive search on title num_first_issue_online schema: type: string - name: date_last_issue_online in: query required: false description: Case insensitive search on title date_last_issue_online schema: type: string - name: num_last_vol_online in: query required: false description: Case insensitive search on title num_last_vol_online schema: type: string - name: num_last_issue_online in: query required: false description: Case insensitive search on title num_last_issue_online schema: type: string - name: title_url in: query required: false description: Case insensitive search on title title_url schema: type: string - name: first_author in: query required: false description: Case insensitive search on title first_author schema: type: string - name: embargo_info in: query required: false description: Case insensitive search on title embargo_info schema: type: string - name: coverage_depth in: query required: false description: Case insensitive search on title coverage_depth schema: type: string - name: notes in: query required: false description: Case insensitive search on title notes schema: type: string - name: publisher_name in: query required: false description: Case insensitive search on title publisher_name schema: type: string - name: publication_type in: query required: false description: Case insensitive search on title publication_type schema: type: string - name: date_monograph_published_print in: query required: false description: Case insensitive search on title date_monograph_published_print schema: type: string - name: date_monograph_published_online in: query required: false description: Case insensitive search on title date_monograph_published_online schema: type: string - name: monograph_volume in: query required: false description: Case insensitive search on title monograph_volume schema: type: string - name: monograph_edition in: query required: false description: Case insensitive search on title monograph_edition schema: type: string - name: first_editor in: query required: false description: Case insensitive search on title first_editor schema: type: string - name: parent_publication_title_id in: query required: false description: Case insensitive search on title parent_publication_title_id schema: type: string - name: preceding_publication_title_id in: query required: false description: Case insensitive search on title preceding_publication_title_id schema: type: string - name: access_type in: query required: false description: Case insensitive search on title access_type schema: type: string - name: x-koha-embed in: header required: false description: Embed list sent as a request header schema: type: array items: enum: - resources.package type: string - name: _match in: query required: false description: Matching criteria schema: type: string enum: - contains - exact - starts_with - ends_with - name: _order_by in: query required: false description: Sorting criteria schema: type: array items: type: string - name: _page in: query required: false description: Page number, for paginated object listing schema: type: integer - name: _per_page in: query required: false description: Page size, for paginated object listing schema: type: integer - name: q in: query required: false description: Query filter sent as a request parameter style: form explode: true schema: type: array items: type: string requestBody: required: false content: application/json: schema: type: object description: Query filter sent through request"s body responses: '200': description: A list of eHoldings titles content: application/json: schema: items: $ref: '#/components/schemas/erm_eholdings_title_yaml' type: array '400': description: "Bad request. Possible `error_code` attribute values:\n\n * `invalid_query`\n" content: application/json: schema: $ref: '#/components/schemas/error_yaml' '401': description: Default response. content: application/json: schema: $ref: '#/components/schemas/DefaultResponse' '403': description: Access forbidden content: application/json: schema: $ref: '#/components/schemas/error_yaml' '404': description: Default response. content: application/json: schema: $ref: '#/components/schemas/DefaultResponse' '500': description: 'Internal server error. Possible `error_code` attribute values: * `internal_server_error`' content: application/json: schema: $ref: '#/components/schemas/error_yaml' '501': description: Default response. content: application/json: schema: $ref: '#/components/schemas/DefaultResponse' '503': description: Under maintenance content: application/json: schema: $ref: '#/components/schemas/error_yaml' post: tags: - erm_eholdings_titles summary: Add eholding operationId: addErmEHoldingsTitles parameters: - name: provider in: path required: true description: Provider name schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/erm_eholdings_title_yaml' description: A JSON object containing information about the new title responses: '201': description: A successfully created title content: application/json: schema: items: $ref: '#/components/schemas/erm_eholdings_title_yaml' '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/error_yaml' '401': description: Authentication required content: application/json: schema: $ref: '#/components/schemas/error_yaml' '403': description: Access forbidden content: application/json: schema: $ref: '#/components/schemas/error_yaml' '404': description: Ressource not found content: application/json: schema: $ref: '#/components/schemas/error_yaml' '409': description: Conflict in creating resource content: application/json: schema: $ref: '#/components/schemas/error_yaml' '500': description: 'Internal server error. Possible `error_code` attribute values: * `internal_server_error`' content: application/json: schema: $ref: '#/components/schemas/error_yaml' '501': description: Default response. content: application/json: schema: $ref: '#/components/schemas/DefaultResponse' '503': description: Under maintenance content: application/json: schema: $ref: '#/components/schemas/error_yaml' /erm/eholdings/{provider}/titles/{title_id}: delete: tags: - erm_eholdings_titles summary: Delete eHolding title operationId: deleteErmEHoldingsTitles parameters: - name: provider in: path required: true description: Provider name schema: type: string - name: title_id in: path required: true description: Title internal identifier schema: type: integer responses: '204': description: title deleted '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/error_yaml' '401': description: Authentication required content: application/json: schema: $ref: '#/components/schemas/error_yaml' '403': description: Access forbidden content: application/json: schema: $ref: '#/components/schemas/error_yaml' '404': description: Ressource not found content: application/json: schema: $ref: '#/components/schemas/error_yaml' '409': description: Conflict in deleting resource content: application/json: schema: $ref: '#/components/schemas/error_yaml' '500': description: 'Internal server error. Possible `error_code` attribute values: * `internal_server_error`' content: application/json: schema: $ref: '#/components/schemas/error_yaml' '501': description: Default response. content: application/json: schema: $ref: '#/components/schemas/DefaultResponse' '503': description: Under maintenance content: application/json: schema: $ref: '#/components/schemas/error_yaml' get: tags: - erm_eholdings_titles summary: Get titles operationId: getErmEHoldingsTitles parameters: - name: provider in: path required: true description: Provider name schema: type: string - name: title_id in: path required: true description: Title internal identifier schema: type: integer - name: x-koha-embed in: header required: false description: Embed list sent as a request header schema: type: array items: enum: - resources - resources.package type: string responses: '200': description: An eHolding title content: application/json: schema: items: $ref: '#/components/schemas/erm_eholdings_title_yaml' '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/error_yaml' '401': description: Authentication required content: application/json: schema: $ref: '#/components/schemas/error_yaml' '403': description: Access forbidden content: application/json: schema: $ref: '#/components/schemas/error_yaml' '404': description: Ressource not found content: application/json: schema: $ref: '#/components/schemas/error_yaml' '500': description: 'Internal server error. Possible `error_code` attribute values: * `internal_server_error`' content: application/json: schema: $ref: '#/components/schemas/error_yaml' '501': description: Default response. content: application/json: schema: $ref: '#/components/schemas/DefaultResponse' '503': description: Under maintenance content: application/json: schema: $ref: '#/components/schemas/error_yaml' put: tags: - erm_eholdings_titles summary: Update titles operationId: updateErmEHoldingsTitles parameters: - name: provider in: path required: true description: Provider name schema: type: string - name: title_id in: path required: true description: Title internal identifier schema: type: integer - name: x-koha-embed in: header required: false description: Embed list sent as a request header schema: type: array items: enum: - resources - resources.package type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/erm_eholdings_title_yaml' description: A JSON object containing new information about existing title responses: '200': description: A successfully updated title content: application/json: schema: items: $ref: '#/components/schemas/erm_eholdings_title_yaml' '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/error_yaml' '401': description: Default response. content: application/json: schema: $ref: '#/components/schemas/DefaultResponse' '403': description: Access forbidden content: application/json: schema: $ref: '#/components/schemas/error_yaml' '404': description: Ressource not found content: application/json: schema: $ref: '#/components/schemas/error_yaml' '409': description: Conflict in updating resource content: application/json: schema: $ref: '#/components/schemas/error_yaml' '500': description: 'Internal server error. Possible `error_code` attribute values: * `internal_server_error`' content: application/json: schema: $ref: '#/components/schemas/error_yaml' '501': description: Default response. content: application/json: schema: $ref: '#/components/schemas/DefaultResponse' '503': description: Under maintenance content: application/json: schema: $ref: '#/components/schemas/error_yaml' /erm/eholdings/{provider}/titles/{title_id}/resources: get: tags: - erm_eholdings_titles summary: List eholdings resources operationId: listErmEHoldingsTitlesResources parameters: - name: provider in: path required: true description: Provider name schema: type: string - name: resource_id in: query required: false description: Case insensitive search on resource_id schema: type: string - name: started_on in: query required: false description: Case insensitive search on started_on schema: type: string - name: ended_on in: query required: false description: Case insensitive search on ended_on schema: type: string - name: proxy in: query required: false description: Case insensitive search on proxy schema: type: string - name: title_id in: path required: true description: Title internal identifier schema: type: integer - name: _match in: query required: false description: Matching criteria schema: type: string enum: - contains - exact - starts_with - ends_with - name: _order_by in: query required: false description: Sorting criteria schema: type: array items: type: string - name: _page in: query required: false description: Page number, for paginated object listing schema: type: integer - name: _per_page in: query required: false description: Page size, for paginated object listing schema: type: integer - name: q in: query required: false description: Query filter sent as a request parameter style: form explode: true schema: type: array items: type: string - name: x-koha-embed in: header required: false description: Embed list sent as a request header schema: type: array items: enum: - title.publication_title type: string requestBody: required: false content: application/json: schema: type: object description: Query filter sent through request"s body responses: '200': description: A list of eHoldings resources content: application/json: schema: items: $ref: '#/components/schemas/erm_eholdings_resource_yaml' type: array '400': description: "Bad request. Possible `error_code` attribute values:\n\n * `invalid_query`\n" content: application/json: schema: $ref: '#/components/schemas/error_yaml' '401': description: Default response. content: application/json: schema: $ref: '#/components/schemas/DefaultResponse' '403': description: Access forbidden content: application/json: schema: $ref: '#/components/schemas/error_yaml' '404': description: Default response. content: application/json: schema: $ref: '#/components/schemas/DefaultResponse' '500': description: 'Internal server error. Possible `error_code` attribute values: * `internal_server_error`' content: application/json: schema: $ref: '#/components/schemas/error_yaml' '501': description: Default response. content: application/json: schema: $ref: '#/components/schemas/DefaultResponse' '503': description: Under maintenance content: application/json: schema: $ref: '#/components/schemas/error_yaml' components: schemas: error_yaml: additionalProperties: true properties: error: description: Error message type: string error_code: description: Error code type: string type: object erm_eholdings_resource_yaml: additionalProperties: false properties: ended_on: description: End date type: - string - 'null' is_selected: type: - boolean - 'null' package: description: Information about the package type: - object - 'null' package_id: description: foreign key to the package type: - string - 'null' proxy: description: Proxy to access this resource type: - string - 'null' resource_id: description: internally assigned identifier readOnly: true type: string started_on: description: Start date type: - string - 'null' title: description: Information about the title type: - object - 'null' title_id: description: foreign key to the title type: - integer - 'null' vendor: description: Information about the vendor type: - object - 'null' vendor_id: description: foreign key to aqbooksellers type: - integer - 'null' required: - package_id type: object DefaultResponse: properties: errors: items: properties: message: type: string path: type: string required: - message type: object type: array required: - errors type: object erm_eholdings_title_yaml: additionalProperties: false properties: access_type: description: access_type of the title type: - string - 'null' biblio_id: description: internally assigned identifier for the linked biblio readOnly: true type: - integer - 'null' coverage_depth: description: coverage_depth of the title type: - string - 'null' date_first_issue_online: description: date_first_issue_online of the title type: - string - 'null' date_last_issue_online: description: date_last_issue_online of the title type: - string - 'null' date_monograph_published_online: description: date_monograph_published_online of the title type: - string - 'null' date_monograph_published_print: description: date_monograph_published_print of the title type: - string - 'null' embargo_info: description: embargo_info of the title type: - string - 'null' external_id: description: External id of the title type: - string - 'null' first_author: description: first_author of the title type: - string - 'null' first_editor: description: first_editor of the title type: - string - 'null' is_selected: description: if the title is selected in the KB type: - boolean - 'null' monograph_edition: description: monograph_edition of the title type: - string - 'null' monograph_volume: description: monograph_volume of the title type: - string - 'null' notes: description: notes of the title type: - string - 'null' num_first_issue_online: description: num_first_issue_online of the title type: - string - 'null' num_first_vol_online: description: num_first_vol_online of the title type: - string - 'null' num_last_issue_online: description: num_last_issue_online of the title type: - string - 'null' num_last_vol_online: description: num_last_vol_online of the title type: - string - 'null' online_identifier: description: online_identifier of the title type: - string - 'null' parent_publication_title_id: description: parent_publication_title_id of the title type: - string - 'null' preceding_publication_title_id: description: preceding_publication_title_id of the title type: - string - 'null' print_identifier: description: print_identifier of the title type: - string - 'null' publication_title: description: publication_title of the title type: string publication_type: description: publication_type of the title type: - string - 'null' publisher_name: description: publisher_name of the title type: - string - 'null' resources: description: Resource containing this title items: $ref: '#/components/schemas/erm_eholdings_resource_yaml' type: array title_id: description: internally assigned identifier readOnly: true type: integer title_url: description: title_url of the title type: - string - 'null' required: - publication_title type: object