{
    "openapi": "3.1.0",
    "info": {
        "title": "Vectorify",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://api.vectorify.ai/v1",
            "description": "Production"
        }
    ],
    "tags": [
        {
            "name": "Query"
        },
        {
            "name": "Chats"
        },
        {
            "name": "Upserts"
        },
        {
            "name": "Items"
        },
        {
            "name": "Collections"
        }
    ],
    "security": [
        {
            "apiKey": []
        }
    ],
    "paths": {
        "/query": {
            "post": {
                "operationId": "query.store",
                "description": "Ask questions about your data.\nUse the `chats` endpoint to start a conversation with follow-up questions.",
                "summary": "Query data",
                "tags": [
                    "Query"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/App.Http.Requests.Api.Chat"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`ChatMessage`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ChatMessage"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/chats": {
            "get": {
                "operationId": "chats.index",
                "description": "Retrieve a list of chats and their messages.",
                "summary": "Retrieve a list of chats",
                "tags": [
                    "Chats"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `Chat`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Chat"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer"
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "last_page": {
                                                    "type": "integer"
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page."
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice."
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated."
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "chats.store",
                "description": "Start a conversation with follow-up questions.\nThe results are returned as a message in the chat.",
                "summary": "Create a chat",
                "tags": [
                    "Chats"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/App.Http.Requests.Api.Chat"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`Chat`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Chat"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/chats/{chat}": {
            "get": {
                "operationId": "chats.show",
                "description": "Retrieve a specific chat and its messages.",
                "summary": "Retrieve a chat",
                "tags": [
                    "Chats"
                ],
                "parameters": [
                    {
                        "name": "chat",
                        "in": "path",
                        "required": true,
                        "description": "The chat ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`Chat`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Chat"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    }
                }
            }
        },
        "/chats/{chat}/messages": {
            "post": {
                "operationId": "messages.store",
                "description": "Create a new message in a chat.\nThe response includes the latest message in the chat.",
                "summary": "Create a chat message",
                "tags": [
                    "Chats"
                ],
                "parameters": [
                    {
                        "name": "chat",
                        "in": "path",
                        "required": true,
                        "description": "The chat ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/App.Http.Requests.Api.ChatMessage"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`ChatMessage`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ChatMessage"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/chats/{chat}/messages/{message}": {
            "get": {
                "operationId": "messages.show",
                "description": "Retrieve a specific message in a chat.",
                "summary": "Retrieve a chat message",
                "tags": [
                    "Chats"
                ],
                "parameters": [
                    {
                        "name": "chat",
                        "in": "path",
                        "required": true,
                        "description": "The chat ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "message",
                        "in": "path",
                        "required": true,
                        "description": "The message ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ChatMessage`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ChatMessage"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    }
                }
            }
        },
        "/chats/{chat}/feedback": {
            "post": {
                "operationId": "chats.feedback.store",
                "description": "Send feedback on a specific chat.",
                "summary": "Send feedback on a chat",
                "tags": [
                    "Chats"
                ],
                "parameters": [
                    {
                        "name": "chat",
                        "in": "path",
                        "required": true,
                        "description": "The chat ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ChatMessageFeedback"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`Chat`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Chat"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/chats/{chat}/messages/{message}/feedback": {
            "post": {
                "operationId": "chats.messages.feedback.store",
                "description": "Send feedback on a specific message.",
                "summary": "Send feedback on a message",
                "tags": [
                    "Chats"
                ],
                "parameters": [
                    {
                        "name": "chat",
                        "in": "path",
                        "required": true,
                        "description": "The chat ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "message",
                        "in": "path",
                        "required": true,
                        "description": "The message ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ChatMessageFeedback"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`ChatMessage`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ChatMessage"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/upserts": {
            "get": {
                "operationId": "upserts.index",
                "description": "Retrieve a list of upserts. An upsert is an operation that allows you to create or update items in a single operation.",
                "summary": "Retrieve a list of upserts",
                "tags": [
                    "Upserts"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `Upsert`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Upsert"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer"
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "last_page": {
                                                    "type": "integer"
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page."
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice."
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated."
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "upserts.store",
                "description": "An upsert is an operation that allows you to create or update items in a single operation. You don't have to worry about whether the item already exists or not.\n\nThe `metadata` field stores additional context about your items that won't be used for search but enable filtering capabilities.\n\nThe `tenant` field is used to identify the organisation to which the items belong. It is required if you've selected `multi` from the project settings.",
                "summary": "Create an upsert",
                "tags": [
                    "Upserts"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/App.Http.Requests.Api.Upsert"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`UpsertStore`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/UpsertStore"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/upserts/{upsert}": {
            "get": {
                "operationId": "upserts.show",
                "description": "Retrieve a specific upsert. An upsert is an operation that allows you to create or update items in a single operation.",
                "summary": "Retrieve an upsert",
                "tags": [
                    "Upserts"
                ],
                "parameters": [
                    {
                        "name": "upsert",
                        "in": "path",
                        "required": true,
                        "description": "The upsert ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`Upsert`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Upsert"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    }
                }
            }
        },
        "/items": {
            "get": {
                "operationId": "items.index",
                "description": "Retrieve a list of upserted items.",
                "summary": "Retrieve a list of items",
                "tags": [
                    "Items"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `Item`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Item"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer"
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "last_page": {
                                                    "type": "integer"
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page."
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice."
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated."
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/items/{item}": {
            "get": {
                "operationId": "items.show",
                "description": "Retrieve a specific item.",
                "summary": "Retrieve an item",
                "tags": [
                    "Items"
                ],
                "parameters": [
                    {
                        "name": "item",
                        "in": "path",
                        "required": true,
                        "description": "The item ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`Item`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Item"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    }
                }
            }
        },
        "/collections": {
            "get": {
                "operationId": "collections.index",
                "description": "A list of collections and their items.\n\nA collection is a group of items that can be used to answer questions.\nThink of it like a folder that contains files or a database table that contains rows.\nCollections are used to group items together for better retrieval.\nYou can use collections to filter items by their metadata.",
                "summary": "Retrieve a list of collections",
                "tags": [
                    "Collections"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `Collection`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Collection"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer"
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "last_page": {
                                                    "type": "integer"
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page."
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice."
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated."
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/collections/{collection}": {
            "get": {
                "operationId": "collections.show",
                "description": "Retrieve a specific collection.",
                "summary": "Retrieve a collection",
                "tags": [
                    "Collections"
                ],
                "parameters": [
                    {
                        "name": "collection",
                        "in": "path",
                        "required": true,
                        "description": "The collection ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`Collection`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Collection"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "apiKey": {
                "type": "apiKey",
                "in": "header",
                "name": "Api-Key"
            }
        },
        "schemas": {
            "App.Http.Requests.Api.Chat": {
                "type": "object",
                "properties": {
                    "text": {
                        "type": "string",
                        "example": "how many invoices are in draft status?"
                    },
                    "collections": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "description": "Array of collection slugs to filter the query.",
                        "example": [
                            "invoices"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "tenant": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Required if the project is multi-tenant.",
                        "example": 235611
                    },
                    "identifier": {
                        "type": "object",
                        "description": "Optional user identifier data.",
                        "example": {
                            "id": "123",
                            "name": "John Doe",
                            "email": "john@example.com"
                        },
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string",
                                "maxLength": 100
                            },
                            "email": {
                                "type": "string",
                                "format": "email",
                                "maxLength": 100
                            }
                        }
                    }
                },
                "required": [
                    "text"
                ],
                "title": "App.Http.Requests.Api.Chat"
            },
            "App.Http.Requests.Api.ChatMessage": {
                "type": "object",
                "properties": {
                    "text": {
                        "type": "string"
                    }
                },
                "required": [
                    "text"
                ],
                "title": "App.Http.Requests.Api.ChatMessage"
            },
            "App.Http.Requests.Api.Upsert": {
                "type": "object",
                "properties": {
                    "collection": {
                        "type": "object",
                        "properties": {
                            "slug": {
                                "type": "string",
                                "example": "invoices"
                            },
                            "metadata": {
                                "type": [
                                    "array",
                                    "null"
                                ],
                                "example": {
                                    "customer_name": {
                                        "type": "string"
                                    },
                                    "status": {
                                        "type": "enum",
                                        "options": [
                                            "draft",
                                            "sent",
                                            "paid"
                                        ]
                                    }
                                },
                                "items": {
                                    "type": "string"
                                },
                                "maxItems": 10
                            }
                        },
                        "required": [
                            "slug"
                        ]
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "example": "123",
                                    "maxLength": 50
                                },
                                "data": {
                                    "type": "array",
                                    "example": {
                                        "customer_name": "John Doe",
                                        "status": "draft",
                                        "amount": "100",
                                        "currency": "USD",
                                        "due_date": "2023-10-01"
                                    },
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                "metadata": {
                                    "type": [
                                        "array",
                                        "null"
                                    ],
                                    "example": {
                                        "customer_name": "John Doe",
                                        "status": "draft"
                                    },
                                    "items": {
                                        "type": "string"
                                    },
                                    "maxItems": 10
                                },
                                "tenant": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "example": 987
                                },
                                "url": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            },
                            "required": [
                                "id",
                                "data"
                            ]
                        },
                        "maxItems": 90
                    }
                },
                "required": [
                    "items"
                ],
                "title": "App.Http.Requests.Api.Upsert"
            },
            "Chat": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "tenant": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "user": {
                        "$ref": "#/components/schemas/User"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "messages": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ChatMessage"
                        }
                    }
                },
                "required": [
                    "id",
                    "name",
                    "tenant",
                    "created_at"
                ],
                "title": "Chat"
            },
            "ChatMessage": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "chat_id": {
                        "type": "string"
                    },
                    "role": {
                        "type": "string"
                    },
                    "user": {
                        "$ref": "#/components/schemas/User"
                    },
                    "text": {
                        "type": "string"
                    },
                    "text_html": {
                        "type": "string"
                    },
                    "identifier": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "feedback": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "chat_id",
                    "role",
                    "text",
                    "text_html",
                    "identifier",
                    "feedback",
                    "created_at"
                ],
                "title": "ChatMessage"
            },
            "ChatMessageFeedback": {
                "type": "object",
                "properties": {
                    "feedback": {
                        "type": "string"
                    }
                },
                "required": [
                    "feedback"
                ],
                "title": "ChatMessageFeedback"
            },
            "Collection": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "source": {
                        "type": "string"
                    },
                    "metadata": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "items_count": {
                        "type": "integer"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "slug",
                    "source",
                    "metadata",
                    "created_at"
                ],
                "title": "Collection"
            },
            "Item": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "item_id": {
                        "type": "string"
                    },
                    "tenant": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "collection": {
                        "$ref": "#/components/schemas/Collection"
                    },
                    "upserts": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Upsert"
                        }
                    }
                },
                "required": [
                    "id",
                    "item_id",
                    "tenant",
                    "url",
                    "created_at"
                ],
                "title": "Item"
            },
            "Upsert": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "chunk_size": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string"
                    },
                    "started_at": {
                        "type": "string"
                    },
                    "completed_at": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "chunk_size",
                    "status",
                    "started_at",
                    "completed_at",
                    "created_at"
                ],
                "title": "Upsert"
            },
            "UpsertStore": {
                "type": "object",
                "properties": {
                    "result": {
                        "type": "string",
                        "enum": [
                            "Queued"
                        ]
                    },
                    "created_at": {
                        "type": "string"
                    }
                },
                "required": [
                    "result",
                    "created_at"
                ],
                "title": "UpsertStore"
            },
            "User": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string"
                    },
                    "avatar": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "email",
                    "avatar",
                    "created_at"
                ],
                "title": "User"
            }
        },
        "responses": {
            "ValidationException": {
                "description": "Validation error",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Errors overview."
                                },
                                "errors": {
                                    "type": "object",
                                    "description": "A detailed description of each field that failed validation.",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "message",
                                "errors"
                            ]
                        }
                    }
                }
            },
            "ModelNotFoundException": {
                "description": "Not found",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            }
        }
    }
}
