Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Wikedhart18/nextjs-ai-chatbot/llms.txt
Use this file to discover all available pages before exploring further.
All endpoints require an active session cookie. You can only access and modify
documents that belong to your user account.
The Document type
Documents are versioned artifacts created by the AI during a conversation. Multiple versions of the same logical document share the sameid; each version is distinguished by its createdAt timestamp.
UUID shared by all versions of this document.
ISO 8601 timestamp of when this version was created. Together with
id this
forms the primary key.Human-readable title of the document.
Full text or code content of this document version.
Artifact type. One of
"text", "code", "image", "sheet".UUID of the user who owns the document.
GET /api/document
Fetch all versions of a document in ascending creation order. Authentication: required (session cookie)Query parameters
UUID of the document to retrieve.
Response
Returns a JSON array ofDocument objects ordered by createdAt ascending. Each element represents one saved version.
Example response
Error codes
| Status | Meaning |
|---|---|
400 | id query parameter is missing. |
401 | Missing or invalid session, or the document belongs to a different user. |
404 | No document found with the given ID. |
Example
curl
TypeScript
POST /api/document
Save a new version of a document. Each call appends a new version record; prior versions are preserved. Authentication: required (session cookie)Query parameters
UUID of the document. Use an existing document UUID to add a new version, or
generate a new UUID to create a fresh document.
Request body
Human-readable title for this version.
Full content of the document version.
Artifact type. One of
"text", "code", "image", "sheet".Response
Returns the newly createdDocument object as JSON with status 200.
Error codes
| Status | Meaning |
|---|---|
400 | id query parameter is missing. |
401 | Missing or invalid session. |
Example
curl
TypeScript
PATCH /api/document
Delete all document versions created after a given timestamp. Use this to revert a document to an earlier version. Authentication: required (session cookie). You can only modify documents you own.Query parameters
UUID of the document to truncate.
Request body
ISO 8601 datetime string. All document versions (and associated suggestions)
with a
createdAt strictly after this value are deleted.Response
Returns200 Deleted as plain text on success.
Error codes
| Status | Meaning |
|---|---|
400 | id query parameter is missing. |
401 | Missing or invalid session, or the document belongs to a different user. |
Example
curl
TypeScript