audiobookshelf/docs/openapi.json
Nicholas Wallace 9af5b8d96d Update json
2024-05-14 05:23:01 +00:00

1108 lines
42 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"openapi": "3.0.0",
"info": {
"title": "Audiobookshelf API",
"version": "0.1.0",
"description": "Audiobookshelf API with autogenerated OpenAPI doc"
},
"servers": [
{
"url": "http://localhost:3000",
"description": "Development server"
}
],
"components": {
"securitySchemes": {
"BearerAuth": {
"description": "Bearer authentication",
"type": "http",
"scheme": "bearer"
}
}
},
"security": [
{
"BearerAuth": []
}
],
"paths": {
"/api/libraries": {
"get": {
"operationId": "getLibraries",
"summary": "Get all libraries on server",
"description": "Get all libraries on server.",
"tags": [
"Libraries"
],
"responses": {
"200": {
"description": "getLibraries OK",
"content": {
"application/json": {
"schema": {
"type": "array"
}
}
}
}
}
},
"post": {
"operationId": "createLibrary",
"summary": "Create a new library on server",
"description": "Create a new library on server.",
"tags": [
"Libraries"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"description": "The name of the library."
},
"folders": {
"description": "The folders of the library. Only specify the fullPath."
},
"displayOrder": {
"description": "The display order of the library. Must be >= 1."
},
"icon": {
"description": "The icon of the library. See Library Icons for a list of possible icons."
},
"mediaType": {
"description": "The type of media that the library contains. Must be `book` or `podcast`."
},
"provider": {
"description": "Preferred metadata provider for the library. See Metadata Providers for a list of possible providers."
},
"settings": {
"description": "The settings for the library."
}
}
}
}
}
},
"responses": {
"200": {
"description": "Library found.",
"content": {
"application/json": {
"schema": {
"description": "A library object which includes either books or podcasts.",
"type": "object",
"properties": {
"id": {
"$ref": "#/components/schemas/libraryId"
},
"name": {
"$ref": "#/components/schemas/libraryName"
},
"folders": {
"description": "The folders that belong to the library.",
"type": "array",
"items": {
"$ref": "./Folder.yaml#/components/schemas/folder"
}
},
"displayOrder": {
"description": "Display position of the library in the list of libraries. Must be >= 1.",
"type": "integer",
"example": 1
},
"icon": {
"description": "The selected icon for the library. See Library Icons for a list of possible icons.",
"type": "string",
"example": "audiobookshelf"
},
"mediaType": {
"description": "The type of media that the library contains. Will be `book` or `podcast`. (Read Only)",
"type": "string",
"example": "book"
},
"provider": {
"description": "Preferred metadata provider for the library. See Metadata Providers for a list of possible providers.",
"type": "string",
"example": "audible"
},
"settings": {
"$ref": "#/components/schemas/librarySettings"
},
"createdAt": {
"$ref": "../schemas.yaml#/components/schemas/createdAt"
},
"lastUpdate": {
"$ref": "../schemas.yaml#/components/schemas/updatedAt"
}
}
}
}
}
},
"404": {
"description": "Library not found.",
"content": {
"text/html": {
"schema": {
"type": "string",
"example": "Library not found."
}
}
}
}
}
}
},
"/api/libraries/{id}": {
"parameters": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{
"type": "string",
"description": "The ID of the library.",
"format": "uuid",
"example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b"
}
],
"get": {
"operationId": "getLibraryById",
"summary": "Get a single library by ID on server",
"description": "Get a single library by ID on server.",
"tags": [
"Libraries"
],
"responses": {
"200": {
"description": "Library found.",
"content": {
"application/json": {
"schema": {
"description": "A library object which includes either books or podcasts.",
"type": "object",
"properties": {
"id": {
"$ref": "#/components/schemas/libraryId"
},
"name": {
"$ref": "#/components/schemas/libraryName"
},
"folders": {
"description": "The folders that belong to the library.",
"type": "array",
"items": {
"$ref": "./Folder.yaml#/components/schemas/folder"
}
},
"displayOrder": {
"description": "Display position of the library in the list of libraries. Must be >= 1.",
"type": "integer",
"example": 1
},
"icon": {
"description": "The selected icon for the library. See Library Icons for a list of possible icons.",
"type": "string",
"example": "audiobookshelf"
},
"mediaType": {
"description": "The type of media that the library contains. Will be `book` or `podcast`. (Read Only)",
"type": "string",
"example": "book"
},
"provider": {
"description": "Preferred metadata provider for the library. See Metadata Providers for a list of possible providers.",
"type": "string",
"example": "audible"
},
"settings": {
"$ref": "#/components/schemas/librarySettings"
},
"createdAt": {
"$ref": "../schemas.yaml#/components/schemas/createdAt"
},
"lastUpdate": {
"$ref": "../schemas.yaml#/components/schemas/updatedAt"
}
}
}
}
}
},
"404": {
"description": "Library not found.",
"content": {
"text/html": {
"schema": {
"type": "string",
"example": "Library not found."
}
}
}
}
}
},
"patch": {
"operationId": "updateLibraryById",
"summary": "Update a single library by ID on server",
"description": "Update a single library by ID on server.",
"tags": [
"Libraries"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"description": "The name of the library."
},
"folders": {
"description": "The folders of the library. Only specify the fullPath."
},
"displayOrder": {
"description": "The display order of the library. Must be >= 1."
},
"icon": {
"description": "The icon of the library. See Library Icons for a list of possible icons."
},
"mediaType": {
"description": "The type of media that the library contains. Must be `book` or `podcast`."
},
"provider": {
"description": "Preferred metadata provider for the library. See Metadata Providers for a list of possible providers."
},
"settings": {
"description": "The settings for the library."
}
}
}
}
}
},
"responses": {
"200": {
"description": "Library found.",
"content": {
"application/json": {
"schema": {
"description": "A library object which includes either books or podcasts.",
"type": "object",
"properties": {
"id": {
"$ref": "#/components/schemas/libraryId"
},
"name": {
"$ref": "#/components/schemas/libraryName"
},
"folders": {
"description": "The folders that belong to the library.",
"type": "array",
"items": {
"$ref": "./Folder.yaml#/components/schemas/folder"
}
},
"displayOrder": {
"description": "Display position of the library in the list of libraries. Must be >= 1.",
"type": "integer",
"example": 1
},
"icon": {
"description": "The selected icon for the library. See Library Icons for a list of possible icons.",
"type": "string",
"example": "audiobookshelf"
},
"mediaType": {
"description": "The type of media that the library contains. Will be `book` or `podcast`. (Read Only)",
"type": "string",
"example": "book"
},
"provider": {
"description": "Preferred metadata provider for the library. See Metadata Providers for a list of possible providers.",
"type": "string",
"example": "audible"
},
"settings": {
"$ref": "#/components/schemas/librarySettings"
},
"createdAt": {
"$ref": "../schemas.yaml#/components/schemas/createdAt"
},
"lastUpdate": {
"$ref": "../schemas.yaml#/components/schemas/updatedAt"
}
}
}
}
}
},
"404": {
"description": "Library not found.",
"content": {
"text/html": {
"schema": {
"type": "string",
"example": "Library not found."
}
}
}
}
}
},
"delete": {
"operationId": "deleteLibraryById",
"summary": "Delete a single library by ID on server",
"description": "Delete a single library by ID on server and return the deleted object.",
"tags": [
"Libraries"
],
"responses": {
"200": {
"description": "Library found.",
"content": {
"application/json": {
"schema": {
"description": "A library object which includes either books or podcasts.",
"type": "object",
"properties": {
"id": {
"$ref": "#/components/schemas/libraryId"
},
"name": {
"$ref": "#/components/schemas/libraryName"
},
"folders": {
"description": "The folders that belong to the library.",
"type": "array",
"items": {
"$ref": "./Folder.yaml#/components/schemas/folder"
}
},
"displayOrder": {
"description": "Display position of the library in the list of libraries. Must be >= 1.",
"type": "integer",
"example": 1
},
"icon": {
"description": "The selected icon for the library. See Library Icons for a list of possible icons.",
"type": "string",
"example": "audiobookshelf"
},
"mediaType": {
"description": "The type of media that the library contains. Will be `book` or `podcast`. (Read Only)",
"type": "string",
"example": "book"
},
"provider": {
"description": "Preferred metadata provider for the library. See Metadata Providers for a list of possible providers.",
"type": "string",
"example": "audible"
},
"settings": {
"$ref": "#/components/schemas/librarySettings"
},
"createdAt": {
"$ref": "../schemas.yaml#/components/schemas/createdAt"
},
"lastUpdate": {
"$ref": "../schemas.yaml#/components/schemas/updatedAt"
}
}
}
}
}
},
"404": {
"description": "Library not found.",
"content": {
"text/html": {
"schema": {
"type": "string",
"example": "Library not found."
}
}
}
}
}
}
},
"/api/authors/{id}": {
"get": {
"parameters": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{
"type": "string",
"description": "The ID of the author.",
"format": "uuid",
"example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b"
}
],
"operationId": "getAuthorById",
"summary": "Get an author by ID",
"description": "Get an author by ID. The author's books and series can be included in the response.",
"tags": [
"Authors"
],
"requestBody": {
"name": "library",
"in": "requestBody",
"description": "The ID of the library to to include filter included items from.",
"schema": {
"type": "string",
"description": "The ID of the library.",
"format": "uuid",
"example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b"
}
},
"responses": {
"200": {
"description": "getAuthorById OK",
"content": {
"application/json": {
"schema": {
"summary": "An author object which includes a description and image path.",
"description": "An author object which includes a description and image path. The library items and series associated with the author are optionally included.",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The ID of the author.",
"format": "uuid",
"example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b"
},
"asin": {
"type": "string",
"description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.",
"nullable": true,
"example": "B000APZOQA"
},
"name": {
"description": "The name of the author.",
"type": "string",
"example": "Terry Goodkind"
},
"description": {
"description": "A description of the author. Will be null if there is none.",
"type": "string",
"nullable": true,
"example": "Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork,\nThe Sword of Truth. He has written 30+ major, bestselling novels, has been published in more than 20\nlanguages world-wide, and has sold more than 26 Million books. The Sword of Truth is a revered literary\ntour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing. Terry Goodkind's\nbrilliant books are character-driven stories, with a focus on the complexity of the human psyche. Goodkind\nhas an uncanny grasp for crafting compelling stories about people like you and me, trapped in terrifying\nsituations.\n"
},
"imagePath": {
"description": "The absolute path for the author image located in the `metadata/` directory. Will be null if there is no image.",
"type": "string",
"nullable": true,
"example": "/metadata/authors/aut_bxxbyjiptmgb56yzoz.jpg"
},
"addedAt": {
"type": "integer",
"description": "The time (in ms since POSIX epoch) when added to the server.",
"example": 1633522963509
},
"updatedAt": {
"type": "integer",
"description": "The time (in ms since POSIX epoch) when last updated.",
"example": 1633522963509
},
"libraryItems": {
"description": "The items associated with the author",
"type": "array",
"items": {
"type": "object",
"description": "A single item on the server, like a book or podcast. Minified media format.",
"allOf": [
{
"$ref": "#/components/schemas/libraryItemBase"
},
{
"type": "object",
"properties": {
"media": {
"$ref": "./mediaTypes/media.yaml#/components/schemas/mediaMinified"
}
}
}
]
}
},
"series": {
"description": "The series associated with the author",
"type": "array",
"items": {
"type": "object",
"description": "Series and the included library items that an author has written.",
"properties": {
"id": {
"type": "string",
"description": "The ID of the series.",
"format": "uuid",
"example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b"
},
"name": {
"description": "The name of the series.",
"type": "string",
"example": "Sword of Truth"
},
"items": {
"description": "The items in the series. Each library item's media's metadata will have a `series` attribute, a `Series Sequence`, which is the matching series.",
"type": "array",
"items": {
"ref": "../LibraryItem.yaml#/components/schemas/libraryItemMinified"
}
}
}
}
}
}
}
}
}
},
"404": {
"description": "Author not found.",
"content": {
"text/html": {
"schema": {
"type": "string",
"example": "Author not found."
}
}
}
}
}
},
"patch": {
"operationId": "updateAuthorById",
"summary": "Update an author by ID",
"description": "Update an author by ID. The author's name and description can be updated. This endpoint will merge two authors if the new author name matches another author name in the database.",
"tags": [
"Authors"
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"name": "asin",
"in": "requestBody",
"description": "The Audible Identifier (ASIN).",
"schema": {
"type": "string",
"description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.",
"nullable": true,
"example": "B000APZOQA"
}
}
}
}
},
"responses": {
"200": {
"description": "updateAuthorById OK",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"description": "An author object which includes a description and image path. The library items and series associated with the author are optionally included.",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The ID of the author.",
"format": "uuid",
"example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b"
},
"asin": {
"type": "string",
"description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.",
"nullable": true,
"example": "B000APZOQA"
},
"name": {
"description": "The name of the author.",
"type": "string",
"example": "Terry Goodkind"
},
"description": {
"description": "A description of the author. Will be null if there is none.",
"type": "string",
"nullable": true,
"example": "Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork,\nThe Sword of Truth. He has written 30+ major, bestselling novels, has been published in more than 20\nlanguages world-wide, and has sold more than 26 Million books. The Sword of Truth is a revered literary\ntour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing. Terry Goodkind's\nbrilliant books are character-driven stories, with a focus on the complexity of the human psyche. Goodkind\nhas an uncanny grasp for crafting compelling stories about people like you and me, trapped in terrifying\nsituations.\n"
},
"imagePath": {
"description": "The absolute path for the author image located in the `metadata/` directory. Will be null if there is no image.",
"type": "string",
"nullable": true,
"example": "/metadata/authors/aut_bxxbyjiptmgb56yzoz.jpg"
},
"addedAt": {
"type": "integer",
"description": "The time (in ms since POSIX epoch) when added to the server.",
"example": 1633522963509
},
"updatedAt": {
"type": "integer",
"description": "The time (in ms since POSIX epoch) when last updated.",
"example": 1633522963509
},
"libraryItems": {
"description": "The items associated with the author",
"type": "array"
},
"series": {
"description": "The series associated with the author",
"type": "array",
"items": {
"type": "object",
"description": "Series and the included library items that an author has written.",
"properties": {
"id": {
"type": "string",
"description": "The ID of the series.",
"format": "uuid",
"example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b"
},
"name": {
"description": "The name of the series.",
"type": "string",
"example": "Sword of Truth"
},
"items": {
"description": "The items in the series. Each library item's media's metadata will have a `series` attribute, a `Series Sequence`, which is the matching series.",
"type": "array",
"items": {}
}
}
}
}
}
},
{
"description": "Whether the author was updated without errors. Will not exist if author was merged.",
"type": "boolean",
"nullable": true
},
{
"description": "Whether the author was merged with another author. Will not exist if author was updated.",
"type": "boolean",
"nullable": true
}
]
}
}
}
},
"404": {
"description": "Author not found.",
"content": {
"text/html": {
"schema": {
"type": "string",
"example": "Author not found."
}
}
}
}
}
},
"delete": {
"operationId": "deleteAuthorById",
"summary": "Delete an author by ID",
"description": "Delete an author by ID. This will remove the author from all books.",
"tags": [
"Authors"
],
"responses": {
"200": {
"description": "deleteAuthorById OK",
"content": {
"text/plain": {
"schema": {
"type": "string",
"example": "Author deleted."
}
}
}
},
"404": {
"description": "Author not found.",
"content": {
"text/html": {
"schema": {
"type": "string",
"example": "Author not found."
}
}
}
}
}
}
},
"/api/authors/{id}/image": {
"get": {
"parameters": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{
"type": "string",
"description": "The ID of the author.",
"format": "uuid",
"example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b"
}
],
"operationId": "getAuthorImageById",
"summary": "Get an author image by author ID",
"description": "Get an author image by author ID. The image will be returned in the requested format and size.",
"tags": [
"Authors"
],
"requestBody": {
"name": "raw",
"in": "requestBody",
"description": "Return the raw image without scaling if true.",
"schema": {
"type": "boolean",
"default": false
}
},
"responses": {
"200": {
"description": "getAuthorImageById OK",
"content": {
"image/webp": {
"schema": {
"type": "string",
"format": "binary"
}
},
"image/jpeg": {
"schema": {
"type": "string",
"format": "binary"
}
},
"image/*": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},
"404": {
"description": "Author not found.",
"content": {
"text/html": {
"schema": {
"type": "string",
"example": "Author not found."
}
}
}
}
}
},
"post": {
"operationId": "addAuthorImageById",
"summary": "Add an author image to the server",
"description": "Add an author image to the server. The image will be downloaded from the provided URL and stored on the server.",
"tags": [
"Authors"
],
"requestBody": {
"name": "url",
"in": "requestBody",
"description": "The URL of the image to add to the server",
"required": true,
"schema": {
"type": "string",
"format": "uri",
"example": "https://images-na.ssl-images-amazon.com/images/I/51NoQTm33OL.__01_SX120_CR0,0,120,120__.jpg"
}
},
"responses": {
"200": {
"description": "addAuthorImageById OK",
"content": {
"image/*": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},
"404": {
"description": "Author not found.",
"content": {
"text/html": {
"schema": {
"type": "string",
"example": "Author not found."
}
}
}
}
}
},
"patch": {
"operationId": "updateAuthorImageById",
"summary": "Update an author image by author ID",
"description": "Update an author image by author ID. The image will be resized if the width, height, or format is provided.",
"tags": [
"Authors"
],
"requestBody": {
"name": "raw",
"in": "requestBody",
"description": "Return the raw image without scaling if true.",
"schema": {
"type": "boolean",
"default": false
}
},
"responses": {
"200": {
"description": "updateAuthorImageById OK",
"content": {
"image/*": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},
"404": {
"description": "Author not found.",
"content": {
"text/html": {
"schema": {
"type": "string",
"example": "Author not found."
}
}
}
}
}
},
"delete": {
"parameters": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{
"type": "string",
"description": "The ID of the author.",
"format": "uuid",
"example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b"
}
],
"operationId": "deleteAuthorImageById",
"summary": "Delete an author image by author ID",
"description": "Delete an author image by author ID. This will remove the image from the server and the database.",
"tags": [
"Authors"
],
"responses": {
"200": {
"description": "deleteAuthorImageById OK"
},
"404": {
"description": "Author not found.",
"content": {
"text/html": {
"schema": {
"type": "string",
"example": "Author not found."
}
}
}
}
}
}
},
"/api/authors/{id}/match": {
"post": {
"parameters": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{
"type": "string",
"description": "The ID of the author.",
"format": "uuid",
"example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b"
}
],
"operationId": "matchAuthorById",
"summary": "Match the author against Audible using quick match",
"description": "Match the author against Audible using quick match. Quick match updates the author's description and image (if no image already existed) with information from audible. Either `asin` or `q` must be provided, with `asin` taking priority if both are provided.",
"tags": [
"Authors"
],
"requestBody": {
"name": "q",
"in": "requestBody",
"description": "The name of the author to use for searching.",
"schema": {
"type": "string",
"example": "Terry Goodkind"
}
},
"responses": {
"200": {
"description": "matchAuthorById OK",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"description": "An author object which includes a description and image path. The library items and series associated with the author are optionally included.",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The ID of the author.",
"format": "uuid",
"example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b"
},
"asin": {
"type": "string",
"description": "The Audible identifier (ASIN) of the author. Will be null if unknown. Not the Amazon identifier.",
"nullable": true,
"example": "B000APZOQA"
},
"name": {
"description": "The name of the author.",
"type": "string",
"example": "Terry Goodkind"
},
"description": {
"description": "A description of the author. Will be null if there is none.",
"type": "string",
"nullable": true,
"example": "Terry Goodkind is a #1 New York Times Bestselling Author and creator of the critically acclaimed masterwork,\nThe Sword of Truth. He has written 30+ major, bestselling novels, has been published in more than 20\nlanguages world-wide, and has sold more than 26 Million books. The Sword of Truth is a revered literary\ntour de force, comprised of 17 volumes, borne from over 25 years of dedicated writing. Terry Goodkind's\nbrilliant books are character-driven stories, with a focus on the complexity of the human psyche. Goodkind\nhas an uncanny grasp for crafting compelling stories about people like you and me, trapped in terrifying\nsituations.\n"
},
"imagePath": {
"description": "The absolute path for the author image located in the `metadata/` directory. Will be null if there is no image.",
"type": "string",
"nullable": true,
"example": "/metadata/authors/aut_bxxbyjiptmgb56yzoz.jpg"
},
"addedAt": {
"type": "integer",
"description": "The time (in ms since POSIX epoch) when added to the server.",
"example": 1633522963509
},
"updatedAt": {
"type": "integer",
"description": "The time (in ms since POSIX epoch) when last updated.",
"example": 1633522963509
},
"libraryItems": {
"description": "The items associated with the author",
"type": "array"
},
"series": {
"description": "The series associated with the author",
"type": "array",
"items": {
"type": "object",
"description": "Series and the included library items that an author has written.",
"properties": {
"id": {
"type": "string",
"description": "The ID of the series.",
"format": "uuid",
"example": "e4bb1afb-4a4f-4dd6-8be0-e615d233185b"
},
"name": {
"description": "The name of the series.",
"type": "string",
"example": "Sword of Truth"
},
"items": {
"description": "The items in the series. Each library item's media's metadata will have a `series` attribute, a `Series Sequence`, which is the matching series.",
"type": "array",
"items": {}
}
}
}
}
}
},
{
"description": "Whether the author was updated without errors. Will not exist if author was merged.",
"type": "boolean",
"nullable": true
}
]
}
}
}
},
"404": {
"description": "Author not found.",
"content": {
"text/html": {
"schema": {
"type": "string",
"example": "Author not found."
}
}
}
}
}
}
}
},
"tags": [
{
"name": "Authors",
"description": "Author endpoints"
},
{
"name": "Libraries",
"description": "Library endpoints"
}
]
}