{
  "openapi": "3.1.0",
  "info": {
    "title": "Hippocampus API",
    "version": "0.1.0-beta",
    "description": "Beta, 5 Oct 2026: endpoints and fields can still change.\n\nThe public endpoints of the Hippocampus API (beta: fields can still change). Two services take the same token: the core (https://hippocampuscore.thalius.ai) imports, searches and answers; the vault (https://hippocampusvault.thalius.ai) holds folders and documents. Your tenant's addresses are in the Hippocampus app under Manage tenant → API and MCP; the servers below are the defaults. Every request carries `Authorization: Bearer <token>`, the ID token of a signed-in Hippocampus user (about one hour). There are no API keys yet. Ids in the examples are shortened.",
    "contact": {
      "name": "Thalius",
      "url": "https://www.thalius.ai/developers"
    }
  },
  "externalDocs": {
    "description": "API reference",
    "url": "https://www.thalius.ai/developers/api"
  },
  "servers": [
    {
      "url": "https://hippocampuscore.thalius.ai",
      "description": "Core: import, search, answers (default address)"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Import",
      "description": "Upload files; a job tracks the work (core)."
    },
    {
      "name": "Search and answers",
      "description": "Passages that answer a question, and short answers (core)."
    },
    {
      "name": "Browse",
      "description": "Folder summaries (core), folders and document lists (vault)."
    },
    {
      "name": "Read",
      "description": "A document's text, tags and original file (vault)."
    }
  ],
  "paths": {
    "/ingest": {
      "post": {
        "tags": [
          "Import"
        ],
        "operationId": "ingest",
        "summary": "Import files",
        "description": "Upload one or more files for import into a folder. `.pdf`, `.docx`, `.md`, `.markdown`, `.txt`, `.text`.",
        "parameters": [
          {
            "name": "stream",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "`true` streams progress as server-sent events; `false` returns a job at once."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "files"
                ],
                "properties": {
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    }
                  },
                  "file_metadata": {
                    "type": "string",
                    "description": "JSON array, one object per file in the same order: `{\"folder_name\": \"contracts\", \"tags\": []}`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJob"
                },
                "example": {
                  "job_id": "c0a9f6d2-…",
                  "status": "processing",
                  "message": "Queued 1 file",
                  "total_files": 1,
                  "done": false
                }
              }
            }
          },
          "202": {
            "description": "Accepted (queued)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJob"
                }
              }
            }
          },
          "401": {
            "description": "Token missing, expired or not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreError"
                },
                "example": {
                  "detail": "Not authenticated"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or has the wrong type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreError"
                }
              }
            }
          }
        }
      }
    },
    "/jobs/{job_id}": {
      "get": {
        "tags": [
          "Import"
        ],
        "operationId": "getJob",
        "summary": "Check an import",
        "description": "Poll until `done` is `true`.",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJob"
                },
                "example": {
                  "job_id": "c0a9f6d2-…",
                  "status": "complete",
                  "successful": 1,
                  "failed": 0,
                  "results": [
                    {
                      "filename": "MSA-2025.pdf",
                      "success": true,
                      "document_id": "8c1f0e4a-…",
                      "folder_name": "contracts/master-agreements",
                      "duplicate": false
                    }
                  ],
                  "done": true,
                  "message": "Processed 1 file"
                }
              }
            }
          },
          "401": {
            "description": "Token missing, expired or not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreError"
                },
                "example": {
                  "detail": "Not authenticated"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or has the wrong type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreError"
                }
              }
            }
          }
        }
      }
    },
    "/search": {
      "post": {
        "tags": [
          "Search and answers"
        ],
        "operationId": "search",
        "summary": "Find the passages that answer a question",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              },
              "example": {
                "query": "What is the notice period for termination?",
                "folder_name": "contracts/master-agreements"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                },
                "example": {
                  "sources": [
                    {
                      "doc_id": "8c1f0e4a-…",
                      "document_title": "Master Services Agreement 2025",
                      "leaf_title": "12. Term and Termination",
                      "start_page": 14,
                      "end_page": 15,
                      "score": 0.91,
                      "text": "Either party may terminate this Agreement on ninety (90) days' written notice…",
                      "deep_link": "/documents/5b7d2c90-….pdf#page=14"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Token missing, expired or not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreError"
                },
                "example": {
                  "detail": "Not authenticated"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or has the wrong type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreError"
                }
              }
            }
          }
        }
      }
    },
    "/ask": {
      "post": {
        "tags": [
          "Search and answers"
        ],
        "operationId": "ask",
        "summary": "Get a short answer",
        "description": "Returns `answer`, `reasoning` and `confidence`; the passages are not returned.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AskRequest"
              },
              "example": {
                "query": "What is the notice period for termination?",
                "folder_name": "contracts/master-agreements"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskResponse"
                },
                "example": {
                  "answer": "Either party may terminate on 90 days' written notice (section 12.2).",
                  "reasoning": "Section 12.2 of the Master Services Agreement states…",
                  "confidence": 0.86
                }
              }
            }
          },
          "401": {
            "description": "Token missing, expired or not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreError"
                },
                "example": {
                  "detail": "Not authenticated"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or has the wrong type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreError"
                }
              }
            }
          }
        }
      }
    },
    "/folders/summary": {
      "get": {
        "tags": [
          "Browse"
        ],
        "operationId": "getFolderSummary",
        "summary": "What a folder holds",
        "parameters": [
          {
            "name": "folder_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderSummaryResponse"
                },
                "example": {
                  "status": "ok",
                  "folder_summary": {
                    "folder": "contracts/master-agreements",
                    "title": "Master agreements",
                    "description": "Signed MSAs with customers and suppliers, 2019–2025.",
                    "content": "- Master Services Agreement 2025: term, termination, liability caps…",
                    "truncated": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Token missing, expired or not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreError"
                },
                "example": {
                  "detail": "Not authenticated"
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or has the wrong type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreError"
                }
              }
            }
          }
        }
      }
    },
    "/folders": {
      "servers": [
        {
          "url": "https://hippocampusvault.thalius.ai",
          "description": "Vault: folders and documents (default address)"
        }
      ],
      "get": {
        "tags": [
          "Browse"
        ],
        "operationId": "listFolders",
        "summary": "List folders",
        "parameters": [
          {
            "name": "parentFolderId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Leave it out for the top level."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Folder"
                  }
                },
                "example": [
                  {
                    "id": "0144f7ed-…",
                    "name": "Onboarding notes",
                    "parentFolderId": "0c25a285-…",
                    "createdAt": "2026-09-08T09:15:16.000Z",
                    "updatedAt": "2026-09-08T09:15:16.000Z"
                  }
                ]
              }
            }
          },
          "401": {
            "description": "Token missing or not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "error": "unauthenticated"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not readable by this user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "statusCode": 404,
                  "message": "not_found"
                }
              }
            }
          }
        }
      }
    },
    "/folders/{id}": {
      "servers": [
        {
          "url": "https://hippocampusvault.thalius.ai",
          "description": "Vault: folders and documents (default address)"
        }
      ],
      "get": {
        "tags": [
          "Browse"
        ],
        "operationId": "getFolder",
        "summary": "One folder, with its documents and subfolders",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Folder id"
          },
          {
            "name": "include",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "`true` adds ancestors, documents and subfolders."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderDetail"
                },
                "example": {
                  "id": "0144f7ed-…",
                  "name": "Onboarding notes",
                  "parentFolderId": "0c25a285-…",
                  "ancestors": [
                    {
                      "id": "0c25a285-…",
                      "name": "HR"
                    }
                  ],
                  "documents": [
                    {
                      "id": "3c76ff09-…",
                      "name": "comments.md",
                      "contentType": "text/markdown",
                      "folderId": "0144f7ed-…",
                      "version": 1
                    }
                  ],
                  "subfolders": [
                    {
                      "id": "9e2a…",
                      "name": "_hippocampus"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Token missing or not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "error": "unauthenticated"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not readable by this user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "statusCode": 404,
                  "message": "not_found"
                }
              }
            }
          }
        }
      }
    },
    "/documents": {
      "servers": [
        {
          "url": "https://hippocampusvault.thalius.ai",
          "description": "Vault: folders and documents (default address)"
        }
      ],
      "get": {
        "tags": [
          "Browse"
        ],
        "operationId": "listDocuments",
        "summary": "List the documents in a folder",
        "parameters": [
          {
            "name": "folderId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Leave it out for the top level."
          },
          {
            "name": "tag",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only documents with this tag."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DocumentListItem"
                  }
                },
                "example": [
                  {
                    "id": "0001b85f-…",
                    "name": "Onboarding notes.md",
                    "contentType": "text/markdown",
                    "folderId": "0144f7ed-…",
                    "version": 1,
                    "createdAt": "2026-09-08T09:15:17.000Z"
                  }
                ]
              }
            }
          },
          "401": {
            "description": "Token missing or not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "error": "unauthenticated"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not readable by this user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "statusCode": 404,
                  "message": "not_found"
                }
              }
            }
          }
        }
      }
    },
    "/documents/{id}": {
      "servers": [
        {
          "url": "https://hippocampusvault.thalius.ai",
          "description": "Vault: folders and documents (default address)"
        }
      ],
      "get": {
        "tags": [
          "Read"
        ],
        "operationId": "getDocument",
        "summary": "One document; text documents carry their content",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Document id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                },
                "example": {
                  "id": "0001b85f-…",
                  "name": "Onboarding notes.md",
                  "contentType": "text/markdown",
                  "size": 510,
                  "version": 1,
                  "folderId": "d3f3ed56-…",
                  "createdAt": "2026-09-08T09:15:17.000Z",
                  "content": "---\ntype: document\ntitle: Onboarding notes\n---\n…"
                }
              }
            }
          },
          "401": {
            "description": "Token missing or not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "error": "unauthenticated"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not readable by this user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "statusCode": 404,
                  "message": "not_found"
                }
              }
            }
          }
        }
      }
    },
    "/documents/batch": {
      "servers": [
        {
          "url": "https://hippocampusvault.thalius.ai",
          "description": "Vault: folders and documents (default address)"
        }
      ],
      "post": {
        "tags": [
          "Read"
        ],
        "operationId": "getDocuments",
        "summary": "Up to 100 documents in one call",
        "description": "Ids that do not exist or that you may not read are left out.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ids"
                ],
                "properties": {
                  "ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              },
              "example": {
                "ids": [
                  "0001b85f-…",
                  "3c76ff09-…"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Document"
                  }
                },
                "example": [
                  {
                    "id": "0001b85f-…",
                    "name": "Onboarding notes.md",
                    "contentType": "text/markdown",
                    "content": "---\ntype: document\n…"
                  },
                  {
                    "id": "3c76ff09-…",
                    "name": "comments.md",
                    "contentType": "text/markdown",
                    "content": "…"
                  }
                ]
              }
            }
          },
          "401": {
            "description": "Token missing or not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "error": "unauthenticated"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not readable by this user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "statusCode": 404,
                  "message": "not_found"
                }
              }
            }
          }
        }
      }
    },
    "/documents/{id}/content": {
      "servers": [
        {
          "url": "https://hippocampusvault.thalius.ai",
          "description": "Vault: folders and documents (default address)"
        }
      ],
      "get": {
        "tags": [
          "Read"
        ],
        "operationId": "getDocumentContent",
        "summary": "The stored file itself",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Document id, e.g. the one in a search result's deep_link"
          }
        ],
        "responses": {
          "200": {
            "description": "The file, with its own content type",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Token missing or not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "error": "unauthenticated"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not readable by this user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "statusCode": 404,
                  "message": "not_found"
                }
              }
            }
          }
        }
      }
    },
    "/documents/{id}/tags": {
      "servers": [
        {
          "url": "https://hippocampusvault.thalius.ai",
          "description": "Vault: folders and documents (default address)"
        }
      ],
      "get": {
        "tags": [
          "Read"
        ],
        "operationId": "getDocumentTags",
        "summary": "A document's tags",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Document id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tags"
                },
                "example": {
                  "tags": [
                    "onboarding",
                    "hr"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Token missing or not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "error": "unauthenticated"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not readable by this user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultError"
                },
                "example": {
                  "statusCode": 404,
                  "message": "not_found"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "ID token of a signed-in Hippocampus user. Lasts about an hour."
      }
    },
    "schemas": {
      "IngestJob": {
        "type": "object",
        "required": [
          "job_id",
          "status",
          "message"
        ],
        "properties": {
          "job_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "processing",
              "complete",
              "error"
            ],
            "description": "`complete`, not `completed`. Poll while `processing`."
          },
          "message": {
            "type": "string"
          },
          "progress_percent": {
            "type": [
              "number",
              "null"
            ]
          },
          "total_files": {
            "type": [
              "integer",
              "null"
            ]
          },
          "successful": {
            "type": [
              "integer",
              "null"
            ]
          },
          "failed": {
            "type": [
              "integer",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "done": {
            "type": "boolean",
            "description": "True once the job has finished, whatever the status."
          },
          "results": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/IngestResult"
            }
          }
        }
      },
      "IngestResult": {
        "type": "object",
        "required": [
          "filename",
          "success",
          "folder_name"
        ],
        "properties": {
          "filename": {
            "type": "string"
          },
          "document_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "folder_name": {
            "type": "string"
          },
          "duplicate": {
            "type": "boolean",
            "description": "The file was imported before."
          }
        }
      },
      "SearchRequest": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string",
            "description": "The question."
          },
          "folder_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Limit the search to one folder path, e.g. `contracts/master-agreements`."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Limit it to documents with these tags."
          },
          "tag_mode": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ],
            "default": "all"
          }
        }
      },
      "Source": {
        "type": "object",
        "properties": {
          "doc_id": {
            "type": "string"
          },
          "document_title": {
            "type": "string"
          },
          "leaf_title": {
            "type": "string",
            "description": "The section the passage is in."
          },
          "start_page": {
            "type": [
              "integer",
              "null"
            ]
          },
          "end_page": {
            "type": [
              "integer",
              "null"
            ]
          },
          "text": {
            "type": "string",
            "description": "The passage."
          },
          "score": {
            "type": "number"
          },
          "deep_link": {
            "type": "string",
            "description": "The original file at that page."
          }
        }
      },
      "SearchResponse": {
        "type": "object",
        "properties": {
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source"
            }
          }
        }
      },
      "AskRequest": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "folder_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AskResponse": {
        "type": "object",
        "properties": {
          "answer": {
            "type": "string"
          },
          "reasoning": {
            "type": "string"
          },
          "confidence": {
            "type": "number"
          }
        },
        "description": "No passages: call /search for them."
      },
      "FolderSummaryResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "none",
              "unavailable"
            ]
          },
          "folder_summary": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "folder": {
                "type": "string"
              },
              "document_id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "content": {
                "type": "string"
              },
              "truncated": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "Folder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "parentFolderId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "docFolder": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FolderDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Folder"
          },
          {
            "type": "object",
            "properties": {
              "ancestors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                }
              },
              "documents": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/DocumentListItem"
                }
              },
              "subfolders": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "docFolder": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "parentDocuments": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/DocumentListItem"
                }
              }
            }
          }
        ]
      },
      "DocumentListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "contentType": {
            "type": [
              "string",
              "null"
            ]
          },
          "size": {
            "type": "integer",
            "description": "Always 0 in listings."
          },
          "folderId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Document": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DocumentListItem"
          },
          {
            "type": "object",
            "properties": {
              "content": {
                "type": "string",
                "description": "Text documents only."
              }
            }
          }
        ]
      },
      "Tags": {
        "type": "object",
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CoreError": {
        "type": "object",
        "properties": {
          "detail": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "loc": {
                      "type": "array",
                      "items": {}
                    },
                    "msg": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  }
                }
              }
            ]
          }
        }
      },
      "VaultError": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer"
          },
          "message": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "error": {
            "type": "string"
          }
        },
        "description": "A missing or invalid token answers `{\"error\": \"unauthenticated\"}`."
      }
    }
  }
}
