{
  "openapi": "3.1.0",
  "info": {
    "title": "Notes",
    "version": "4.7.1",
    "description": "Distraction-free notes and writing",
    "license": {
      "name": "agpl",
      "identifier": "AGPL-3.0"
    }
  },
  "servers": [
    {
      "url": "https://{hostname}:{port}",
      "variables": {
        "hostname": {
          "default": "localhost"
        },
        "port": {
          "default": "8080"
        }
      }
    }
  ],
  "security": [
    {
      "basic_auth": []
    }
  ],
  "tags": [],
  "components": {
    "schemas": {
      "OCSMeta": {
        "type": "object",
        "required": [
          "status",
          "statuscode"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "statuscode": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "totalitems": {
            "type": "string"
          },
          "itemsperpage": {
            "type": "string"
          }
        }
      },
      "EmptyOCS": {
        "type": "object",
        "required": [
          "ocs"
        ],
        "properties": {
          "ocs": {
            "type": "object",
            "required": [
              "meta",
              "data"
            ],
            "properties": {
              "meta": {
                "$ref": "#/components/schemas/OCSMeta"
              },
              "data": {
                "type": "array"
              }
            }
          }
        }
      },
      "Note": {
        "type": "object",
        "required": [
          "id",
          "etag",
          "readonly",
          "content",
          "title",
          "category",
          "favorite",
          "modified",
          "error",
          "errorType"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "etag": {
            "type": "string"
          },
          "readonly": {
            "type": "boolean"
          },
          "content": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "favorite": {
            "type": "boolean"
          },
          "modified": {
            "type": "integer"
          },
          "error": {
            "type": "boolean"
          },
          "errorType": {
            "type": "string"
          }
        }
      },
      "Settings": {
        "type": "object",
        "required": [
          "notesPath",
          "fileSuffix",
          "noteMode"
        ],
        "properties": {
          "notesPath": {
            "type": "string"
          },
          "fileSuffix": {
            "type": "string"
          },
          "noteMode": {
            "type": "string",
            "enum": [
              "edit",
              "preview",
              "rich"
            ]
          }
        }
      }
    },
    "securitySchemes": {
      "basic_auth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "paths": {
    "/index.php/apps/notes/api/v1/notes": {
      "get": {
        "operationId": "get-notes",
        "tags": [
          "notes"
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "exclude",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": ""
            }
          },
          {
            "name": "pruneBefore",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "chunkSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "chunkCursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Note"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create-note",
        "tags": [
          "notes"
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": ""
            }
          },
          {
            "name": "title",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": ""
            }
          },
          {
            "name": "content",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": ""
            }
          },
          {
            "name": "modified",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "favorite",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          }
        }
      }
    },
    "/index.php/apps/notes/api/v1/notes/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer"
          }
        }
      ],
      "get": {
        "operationId": "get-note",
        "tags": [
          "notes"
        ],
        "parameters": [
          {
            "name": "exclude",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": ""
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "update-note",
        "tags": [
          "notes"
        ],
        "parameters": [
          {
            "name": "content",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "modified",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "title",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "favorite",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete-note",
        "tags": [
          "notes"
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/index.php/apps/notes/api/v1/settings": {
      "get": {
        "operationId": "get-settings",
        "tags": [
          "notes"
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Settings"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "update-settings",
        "tags": [
          "notes"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Settings"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Settings"
                }
              }
            }
          }
        }
      }
    }
  }
}