{ "openapi": "3.1.0", "info": { "title": "Honcho API", "summary": "An API for adding personalization to AI Apps", "description": "This API is used to store data and get insights about users for AI\n applications", "contact": { "name": "Plastic Labs", "url": "https://plasticlabs.ai/", "email": "hello@plasticlabs.ai" }, "version": "0.0.15" }, "servers": [ { "url": "http://127.0.0.1:8000", "description": "Local Development Server" }, { "url": "https:/demo.honcho.dev", "description": "Demo Server" } ], "paths": { "/v1/apps/{app_id}": { "get": { "tags": ["apps"], "summary": "Get App", "description": "Get an App by ID", "operationId": "get_app_v1_apps__app_id__get", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/App" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const app = await client.apps.get('app_id');\n\n console.log(app.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\napp = client.apps.get(\n \"app_id\",\n)\nprint(app.id)" } ] }, "put": { "tags": ["apps"], "summary": "Update App", "description": "Update an App", "operationId": "update_app_v1_apps__app_id__put", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppUpdate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/App" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const app = await client.apps.update('app_id');\n\n console.log(app.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\napp = client.apps.update(\n app_id=\"app_id\",\n)\nprint(app.id)" } ] } }, "/v1/apps/name/{name}": { "get": { "tags": ["apps"], "summary": "Get App By Name", "description": "Get an App by Name", "operationId": "get_app_by_name_v1_apps_name__name__get", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/App" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const app = await client.apps.getByName('name');\n\n console.log(app.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\napp = client.apps.get_by_name(\n \"name\",\n)\nprint(app.id)" } ] } }, "/v1/apps": { "post": { "tags": ["apps"], "summary": "Create App", "description": "Create a new App", "operationId": "create_app_v1_apps_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppCreate" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/App" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [{ "HTTPBearer": [] }, {}], "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const app = await client.apps.create({ name: 'x' });\n\n console.log(app.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\napp = client.apps.create(\n name=\"x\",\n)\nprint(app.id)" } ] } }, "/v1/apps/get_or_create/{name}": { "get": { "tags": ["apps"], "summary": "Get Or Create App", "description": "Get or Create an App", "operationId": "get_or_create_app_v1_apps_get_or_create__name__get", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/App" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const app = await client.apps.getOrCreate('name');\n\n console.log(app.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\napp = client.apps.get_or_create(\n \"name\",\n)\nprint(app.id)" } ] } }, "/v1/apps/{app_id}/users": { "post": { "tags": ["users"], "summary": "Create User", "description": "Create a new User", "operationId": "create_user_v1_apps__app_id__users_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserCreate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const user = await client.apps.users.create('app_id', { name: 'x' });\n\n console.log(user.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nuser = client.apps.users.create(\n app_id=\"app_id\",\n name=\"x\",\n)\nprint(user.id)" } ] } }, "/v1/apps/{app_id}/users/list": { "post": { "tags": ["users"], "summary": "Get Users", "description": "Get All Users for an App", "operationId": "get_users_v1_apps__app_id__users_list_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "reverse", "in": "query", "required": false, "schema": { "type": "boolean", "default": false, "title": "Reverse" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "Page number", "default": 1, "title": "Page" }, "description": "Page number" }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "description": "Page size", "default": 50, "title": "Size" }, "description": "Page size" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserGet" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Page_User_" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n // Automatically fetches more pages as needed.\n for await (const user of client.apps.users.list('app_id')) {\n console.log(user.id);\n }\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\npage = client.apps.users.list(\n app_id=\"app_id\",\n)\npage = page.items[0]\nprint(page.id)" } ] } }, "/v1/apps/{app_id}/users/name/{name}": { "get": { "tags": ["users"], "summary": "Get User By Name", "description": "Get a User by name", "operationId": "get_user_by_name_v1_apps__app_id__users_name__name__get", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const user = await client.apps.users.getByName('app_id', 'name');\n\n console.log(user.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nuser = client.apps.users.get_by_name(\n name=\"name\",\n app_id=\"app_id\",\n)\nprint(user.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}": { "get": { "tags": ["users"], "summary": "Get User", "description": "Get a User by ID", "operationId": "get_user_v1_apps__app_id__users__user_id__get", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const user = await client.apps.users.get('app_id', 'user_id');\n\n console.log(user.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nuser = client.apps.users.get(\n user_id=\"user_id\",\n app_id=\"app_id\",\n)\nprint(user.id)" } ] }, "put": { "tags": ["users"], "summary": "Update User", "description": "Update a User's name and/or metadata", "operationId": "update_user_v1_apps__app_id__users__user_id__put", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserUpdate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const user = await client.apps.users.update('app_id', 'user_id');\n\n console.log(user.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nuser = client.apps.users.update(\n user_id=\"user_id\",\n app_id=\"app_id\",\n)\nprint(user.id)" } ] } }, "/v1/apps/{app_id}/users/get_or_create/{name}": { "get": { "tags": ["users"], "summary": "Get Or Create User", "description": "Get a User or create a new one by the input name", "operationId": "get_or_create_user_v1_apps__app_id__users_get_or_create__name__get", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const user = await client.apps.users.getOrCreate('app_id', 'name');\n\n console.log(user.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nuser = client.apps.users.get_or_create(\n name=\"name\",\n app_id=\"app_id\",\n)\nprint(user.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/sessions/list": { "post": { "tags": ["sessions"], "summary": "Get Sessions", "description": "Get All Sessions for a User", "operationId": "get_sessions_v1_apps__app_id__users__user_id__sessions_list_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "reverse", "in": "query", "required": false, "schema": { "anyOf": [{ "type": "boolean" }, { "type": "null" }], "default": false, "title": "Reverse" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "Page number", "default": 1, "title": "Page" }, "description": "Page number" }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "description": "Page size", "default": 50, "title": "Size" }, "description": "Page size" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionGet" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Page_Session_" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n // Automatically fetches more pages as needed.\n for await (const session of client.apps.users.sessions.list('app_id', 'user_id')) {\n console.log(session.id);\n }\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\npage = client.apps.users.sessions.list(\n user_id=\"user_id\",\n app_id=\"app_id\",\n)\npage = page.items[0]\nprint(page.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/sessions": { "post": { "tags": ["sessions"], "summary": "Create Session", "description": "Create a Session for a User", "operationId": "create_session_v1_apps__app_id__users__user_id__sessions_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionCreate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Session" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const session = await client.apps.users.sessions.create('app_id', 'user_id');\n\n console.log(session.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nsession = client.apps.users.sessions.create(\n user_id=\"user_id\",\n app_id=\"app_id\",\n)\nprint(session.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}": { "put": { "tags": ["sessions"], "summary": "Update Session", "description": "Update the metadata of a Session", "operationId": "update_session_v1_apps__app_id__users__user_id__sessions__session_id__put", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionUpdate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Session" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const session = await client.apps.users.sessions.update('app_id', 'user_id', 'session_id', {\n metadata: { foo: 'bar' },\n });\n\n console.log(session.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nsession = client.apps.users.sessions.update(\n session_id=\"session_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n metadata={\n \"foo\": \"bar\"\n },\n)\nprint(session.id)" } ] }, "delete": { "tags": ["sessions"], "summary": "Delete Session", "description": "Delete a session by marking it as inactive", "operationId": "delete_session_v1_apps__app_id__users__user_id__sessions__session_id__delete", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const session = await client.apps.users.sessions.delete('app_id', 'user_id', 'session_id');\n\n console.log(session);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nsession = client.apps.users.sessions.delete(\n session_id=\"session_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n)\nprint(session)" } ] }, "get": { "tags": ["sessions"], "summary": "Get Session", "description": "Get a specific session for a user by ID", "operationId": "get_session_v1_apps__app_id__users__user_id__sessions__session_id__get", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Session" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const session = await client.apps.users.sessions.get('app_id', 'user_id', 'session_id');\n\n console.log(session.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nsession = client.apps.users.sessions.get(\n session_id=\"session_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n)\nprint(session.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/chat": { "post": { "tags": ["sessions"], "summary": "Chat", "description": "Chat with the Dialectic API", "operationId": "chat_v1_apps__app_id__users__user_id__sessions__session_id__chat_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentQuery" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentChat" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const agentChat = await client.apps.users.sessions.chat('app_id', 'user_id', 'session_id', {\n queries: 'string',\n });\n\n console.log(agentChat.content);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nagent_chat = client.apps.users.sessions.chat(\n session_id=\"session_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n queries=\"string\",\n)\nprint(agent_chat.content)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/chat/stream": { "post": { "tags": ["sessions"], "summary": "Get Chat Stream", "description": "Stream Results from the Dialectic API", "operationId": "get_chat_stream_v1_apps__app_id__users__user_id__sessions__session_id__chat_stream_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentQuery" } } } }, "responses": { "200": { "description": "Chat stream", "content": { "application/json": { "schema": {} }, "text/event-stream": { "schema": { "type": "string", "format": "binary" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const response = await client.apps.users.sessions.stream('app_id', 'user_id', 'session_id', {\n queries: 'string',\n });\n\n console.log(response);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.apps.users.sessions.stream(\n session_id=\"session_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n queries=\"string\",\n)\nprint(response)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/clone": { "get": { "tags": ["sessions"], "summary": "Clone Session", "description": "Clone a session for a user, optionally will deep clone metamessages as well", "operationId": "clone_session_v1_apps__app_id__users__user_id__sessions__session_id__clone_get", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } }, { "name": "message_id", "in": "query", "required": false, "schema": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Message Id" } }, { "name": "deep_copy", "in": "query", "required": false, "schema": { "type": "boolean", "default": false, "title": "Deep Copy" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Session" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const session = await client.apps.users.sessions.clone('app_id', 'user_id', 'session_id');\n\n console.log(session.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nsession = client.apps.users.sessions.clone(\n session_id=\"session_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n)\nprint(session.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/messages": { "post": { "tags": ["messages"], "summary": "Create Message For Session", "description": "Adds a message to a session", "operationId": "create_message_for_session_v1_apps__app_id__users__user_id__sessions__session_id__messages_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageCreate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const message = await client.apps.users.sessions.messages.create('app_id', 'user_id', 'session_id', {\n content: 'content',\n is_user: true,\n });\n\n console.log(message.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nmessage = client.apps.users.sessions.messages.create(\n session_id=\"session_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n content=\"content\",\n is_user=True,\n)\nprint(message.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/messages/batch": { "post": { "tags": ["messages"], "summary": "Create Batch Messages For Session", "description": "Bulk create messages for a session while maintaining order. Maximum 100 messages per batch.", "operationId": "create_batch_messages_for_session_v1_apps__app_id__users__user_id__sessions__session_id__messages_batch_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageBatchCreate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Message" }, "title": "Response Create Batch Messages For Session V1 Apps App Id Users User Id Sessions Session Id Messages Batch Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const messages = await client.apps.users.sessions.messages.batch('app_id', 'user_id', 'session_id', {\n messages: [{ content: 'content', is_user: true }],\n });\n\n console.log(messages);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nmessages = client.apps.users.sessions.messages.batch(\n session_id=\"session_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n messages=[{\n \"content\": \"content\",\n \"is_user\": True,\n }],\n)\nprint(messages)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/messages/list": { "post": { "tags": ["messages"], "summary": "Get Messages", "description": "Get all messages for a session", "operationId": "get_messages_v1_apps__app_id__users__user_id__sessions__session_id__messages_list_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } }, { "name": "reverse", "in": "query", "required": false, "schema": { "anyOf": [{ "type": "boolean" }, { "type": "null" }], "default": false, "title": "Reverse" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "Page number", "default": 1, "title": "Page" }, "description": "Page number" }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "description": "Page size", "default": 50, "title": "Size" }, "description": "Page size" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageGet" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Page_Message_" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n // Automatically fetches more pages as needed.\n for await (const message of client.apps.users.sessions.messages.list('app_id', 'user_id', 'session_id')) {\n console.log(message.id);\n }\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\npage = client.apps.users.sessions.messages.list(\n session_id=\"session_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n)\npage = page.items[0]\nprint(page.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/messages/{message_id}": { "get": { "tags": ["messages"], "summary": "Get Message", "description": "Get a Message by ID", "operationId": "get_message_v1_apps__app_id__users__user_id__sessions__session_id__messages__message_id__get", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } }, { "name": "message_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Message Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const message = await client.apps.users.sessions.messages.get(\n 'app_id',\n 'user_id',\n 'session_id',\n 'message_id',\n );\n\n console.log(message.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nmessage = client.apps.users.sessions.messages.get(\n message_id=\"message_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n session_id=\"session_id\",\n)\nprint(message.id)" } ] }, "put": { "tags": ["messages"], "summary": "Update Message", "description": "Update the metadata of a Message", "operationId": "update_message_v1_apps__app_id__users__user_id__sessions__session_id__messages__message_id__put", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } }, { "name": "message_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Message Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageUpdate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const message = await client.apps.users.sessions.messages.update(\n 'app_id',\n 'user_id',\n 'session_id',\n 'message_id',\n { metadata: { foo: 'bar' } },\n );\n\n console.log(message.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nmessage = client.apps.users.sessions.messages.update(\n message_id=\"message_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n session_id=\"session_id\",\n metadata={\n \"foo\": \"bar\"\n },\n)\nprint(message.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/metamessages": { "post": { "tags": ["metamessages"], "summary": "Create Metamessage", "description": "Adds a message to a session", "operationId": "create_metamessage_v1_apps__app_id__users__user_id__sessions__session_id__metamessages_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetamessageCreate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Metamessage" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const metamessage = await client.apps.users.sessions.metamessages.create(\n 'app_id',\n 'user_id',\n 'session_id',\n { content: 'content', message_id: 'message_id', metamessage_type: 'x' },\n );\n\n console.log(metamessage.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nmetamessage = client.apps.users.sessions.metamessages.create(\n session_id=\"session_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n content=\"content\",\n message_id=\"message_id\",\n metamessage_type=\"x\",\n)\nprint(metamessage.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/metamessages/list": { "post": { "tags": ["metamessages"], "summary": "Get Metamessages", "description": "Get all messages for a session", "operationId": "get_metamessages_v1_apps__app_id__users__user_id__sessions__session_id__metamessages_list_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } }, { "name": "reverse", "in": "query", "required": false, "schema": { "anyOf": [{ "type": "boolean" }, { "type": "null" }], "default": false, "title": "Reverse" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "Page number", "default": 1, "title": "Page" }, "description": "Page number" }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "description": "Page size", "default": 50, "title": "Size" }, "description": "Page size" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetamessageGet" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Page_Metamessage_" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n // Automatically fetches more pages as needed.\n for await (const metamessage of client.apps.users.sessions.metamessages.list(\n 'app_id',\n 'user_id',\n 'session_id',\n )) {\n console.log(metamessage.id);\n }\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\npage = client.apps.users.sessions.metamessages.list(\n session_id=\"session_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n)\npage = page.items[0]\nprint(page.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/sessions/{session_id}/metamessages/{metamessage_id}": { "get": { "tags": ["metamessages"], "summary": "Get Metamessage", "description": "Get a specific Metamessage by ID", "operationId": "get_metamessage_v1_apps__app_id__users__user_id__sessions__session_id__metamessages__metamessage_id__get", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } }, { "name": "metamessage_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Metamessage Id" } }, { "name": "message_id", "in": "query", "required": true, "schema": { "type": "string", "title": "Message Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Metamessage" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const metamessage = await client.apps.users.sessions.metamessages.get(\n 'app_id',\n 'user_id',\n 'session_id',\n 'metamessage_id',\n { message_id: 'message_id' },\n );\n\n console.log(metamessage.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nmetamessage = client.apps.users.sessions.metamessages.get(\n metamessage_id=\"metamessage_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n session_id=\"session_id\",\n message_id=\"message_id\",\n)\nprint(metamessage.id)" } ] }, "put": { "tags": ["metamessages"], "summary": "Update Metamessage", "description": "Update's the metadata of a metamessage", "operationId": "update_metamessage_v1_apps__app_id__users__user_id__sessions__session_id__metamessages__metamessage_id__put", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } }, { "name": "metamessage_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Metamessage Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetamessageUpdate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Metamessage" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const metamessage = await client.apps.users.sessions.metamessages.update(\n 'app_id',\n 'user_id',\n 'session_id',\n 'metamessage_id',\n { message_id: 'message_id' },\n );\n\n console.log(metamessage.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\nmetamessage = client.apps.users.sessions.metamessages.update(\n metamessage_id=\"metamessage_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n session_id=\"session_id\",\n message_id=\"message_id\",\n)\nprint(metamessage.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/metamessages/list": { "post": { "tags": ["metamessages"], "summary": "Get Metamessages By User", "description": "Paginate through the user metamessages for a user", "operationId": "get_metamessages_by_user_v1_apps__app_id__users__user_id__metamessages_list_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "reverse", "in": "query", "required": false, "schema": { "anyOf": [{ "type": "boolean" }, { "type": "null" }], "default": false, "title": "Reverse" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "Page number", "default": 1, "title": "Page" }, "description": "Page number" }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "description": "Page size", "default": 50, "title": "Size" }, "description": "Page size" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetamessageGetUserLevel" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Page_Metamessage_" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n // Automatically fetches more pages as needed.\n for await (const metamessage of client.apps.users.metamessages.list('app_id', 'user_id')) {\n console.log(metamessage.id);\n }\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\npage = client.apps.users.metamessages.list(\n user_id=\"user_id\",\n app_id=\"app_id\",\n)\npage = page.items[0]\nprint(page.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/collections/list": { "post": { "tags": ["collections"], "summary": "Get Collections", "description": "Get All Collections for a User", "operationId": "get_collections_v1_apps__app_id__users__user_id__collections_list_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "reverse", "in": "query", "required": false, "schema": { "anyOf": [{ "type": "boolean" }, { "type": "null" }], "default": false, "title": "Reverse" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "Page number", "default": 1, "title": "Page" }, "description": "Page number" }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "description": "Page size", "default": 50, "title": "Size" }, "description": "Page size" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CollectionGet" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Page_Collection_" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n // Automatically fetches more pages as needed.\n for await (const collection of client.apps.users.collections.list('app_id', 'user_id')) {\n console.log(collection.id);\n }\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\npage = client.apps.users.collections.list(\n user_id=\"user_id\",\n app_id=\"app_id\",\n)\npage = page.items[0]\nprint(page.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/collections/name/{name}": { "get": { "tags": ["collections"], "summary": "Get Collection By Name", "description": "Get a Collection by Name", "operationId": "get_collection_by_name_v1_apps__app_id__users__user_id__collections_name__name__get", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Collection" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const collection = await client.apps.users.collections.getByName('app_id', 'user_id', 'name');\n\n console.log(collection.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\ncollection = client.apps.users.collections.get_by_name(\n name=\"name\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n)\nprint(collection.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/collections/{collection_id}": { "get": { "tags": ["collections"], "summary": "Get Collection By Id", "description": "Get a Collection by ID", "operationId": "get_collection_by_id_v1_apps__app_id__users__user_id__collections__collection_id__get", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "collection_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Collection Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Collection" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const collection = await client.apps.users.collections.get('app_id', 'user_id', 'collection_id');\n\n console.log(collection.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\ncollection = client.apps.users.collections.get(\n collection_id=\"collection_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n)\nprint(collection.id)" } ] }, "put": { "tags": ["collections"], "summary": "Update Collection", "description": "Update a Collection's name or metadata", "operationId": "update_collection_v1_apps__app_id__users__user_id__collections__collection_id__put", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "collection_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Collection Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CollectionUpdate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Collection" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const collection = await client.apps.users.collections.update('app_id', 'user_id', 'collection_id');\n\n console.log(collection.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\ncollection = client.apps.users.collections.update(\n collection_id=\"collection_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n)\nprint(collection.id)" } ] }, "delete": { "tags": ["collections"], "summary": "Delete Collection", "description": "Delete a Collection and its documents", "operationId": "delete_collection_v1_apps__app_id__users__user_id__collections__collection_id__delete", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "collection_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Collection Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const collection = await client.apps.users.collections.delete('app_id', 'user_id', 'collection_id');\n\n console.log(collection);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\ncollection = client.apps.users.collections.delete(\n collection_id=\"collection_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n)\nprint(collection)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/collections": { "post": { "tags": ["collections"], "summary": "Create Collection", "description": "Create a new Collection", "operationId": "create_collection_v1_apps__app_id__users__user_id__collections_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CollectionCreate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Collection" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const collection = await client.apps.users.collections.create('app_id', 'user_id', { name: 'x' });\n\n console.log(collection.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\ncollection = client.apps.users.collections.create(\n user_id=\"user_id\",\n app_id=\"app_id\",\n name=\"x\",\n)\nprint(collection.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/collections/{collection_id}/documents/list": { "post": { "tags": ["documents"], "summary": "Get Documents", "description": "Get all of the Documents in a Collection", "operationId": "get_documents_v1_apps__app_id__users__user_id__collections__collection_id__documents_list_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "collection_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Collection Id" } }, { "name": "reverse", "in": "query", "required": false, "schema": { "anyOf": [{ "type": "boolean" }, { "type": "null" }], "default": false, "title": "Reverse" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "Page number", "default": 1, "title": "Page" }, "description": "Page number" }, { "name": "size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "description": "Page size", "default": 50, "title": "Size" }, "description": "Page size" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentGet" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Page_Document_" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n // Automatically fetches more pages as needed.\n for await (const document of client.apps.users.collections.documents.list(\n 'app_id',\n 'user_id',\n 'collection_id',\n )) {\n console.log(document.id);\n }\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\npage = client.apps.users.collections.documents.list(\n collection_id=\"collection_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n)\npage = page.items[0]\nprint(page.id)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/collections/{collection_id}/documents/{document_id}": { "get": { "tags": ["documents"], "summary": "Get Document", "description": "Get a document by ID", "operationId": "get_document_v1_apps__app_id__users__user_id__collections__collection_id__documents__document_id__get", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "collection_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Collection Id" } }, { "name": "document_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Document Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Document" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const document = await client.apps.users.collections.documents.get(\n 'app_id',\n 'user_id',\n 'collection_id',\n 'document_id',\n );\n\n console.log(document.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\ndocument = client.apps.users.collections.documents.get(\n document_id=\"document_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n collection_id=\"collection_id\",\n)\nprint(document.id)" } ] }, "put": { "tags": ["documents"], "summary": "Update Document", "description": "Update the content and/or the metadata of a Document", "operationId": "update_document_v1_apps__app_id__users__user_id__collections__collection_id__documents__document_id__put", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "collection_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Collection Id" } }, { "name": "document_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Document Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentUpdate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Document" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const document = await client.apps.users.collections.documents.update(\n 'app_id',\n 'user_id',\n 'collection_id',\n 'document_id',\n );\n\n console.log(document.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\ndocument = client.apps.users.collections.documents.update(\n document_id=\"document_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n collection_id=\"collection_id\",\n)\nprint(document.id)" } ] }, "delete": { "tags": ["documents"], "summary": "Delete Document", "description": "Delete a Document by ID", "operationId": "delete_document_v1_apps__app_id__users__user_id__collections__collection_id__documents__document_id__delete", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "collection_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Collection Id" } }, { "name": "document_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Document Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const document = await client.apps.users.collections.documents.delete(\n 'app_id',\n 'user_id',\n 'collection_id',\n 'document_id',\n );\n\n console.log(document);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\ndocument = client.apps.users.collections.documents.delete(\n document_id=\"document_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n collection_id=\"collection_id\",\n)\nprint(document)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/collections/{collection_id}/documents/query": { "post": { "tags": ["documents"], "summary": "Query Documents", "description": "Cosine Similarity Search for Documents", "operationId": "query_documents_v1_apps__app_id__users__user_id__collections__collection_id__documents_query_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "collection_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Collection Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentQuery" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Document" }, "title": "Response Query Documents V1 Apps App Id Users User Id Collections Collection Id Documents Query Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const documents = await client.apps.users.collections.documents.query(\n 'app_id',\n 'user_id',\n 'collection_id',\n { query: 'x' },\n );\n\n console.log(documents);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\ndocuments = client.apps.users.collections.documents.query(\n collection_id=\"collection_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n query=\"x\",\n)\nprint(documents)" } ] } }, "/v1/apps/{app_id}/users/{user_id}/collections/{collection_id}/documents": { "post": { "tags": ["documents"], "summary": "Create Document", "description": "Embed text as a vector and create a Document", "operationId": "create_document_v1_apps__app_id__users__user_id__collections__collection_id__documents_post", "security": [{ "HTTPBearer": [] }, {}], "parameters": [ { "name": "app_id", "in": "path", "required": true, "schema": { "type": "string", "title": "App Id" } }, { "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "title": "User Id" } }, { "name": "collection_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Collection Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentCreate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Document" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "x-codeSamples": [ { "lang": "JavaScript", "source": "import Honcho from 'honcho-ai';\n\nconst client = new Honcho({\n apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted\n});\n\nasync function main() {\n const document = await client.apps.users.collections.documents.create(\n 'app_id',\n 'user_id',\n 'collection_id',\n { content: 'x' },\n );\n\n console.log(document.id);\n}\n\nmain();" }, { "lang": "Python", "source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n api_key=os.environ.get(\"HONCHO_API_KEY\"), # This is the default and can be omitted\n)\ndocument = client.apps.users.collections.documents.create(\n collection_id=\"collection_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n content=\"x\",\n)\nprint(document.id)" } ] } } }, "components": { "schemas": { "AgentChat": { "properties": { "content": { "type": "string", "title": "Content" } }, "type": "object", "required": ["content"], "title": "AgentChat" }, "AgentQuery": { "properties": { "queries": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" } ], "title": "Queries" } }, "type": "object", "required": ["queries"], "title": "AgentQuery" }, "App": { "properties": { "id": { "type": "string", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "metadata": { "type": "object", "title": "Metadata", "additionalProperties": true }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" } }, "type": "object", "required": ["id", "name", "metadata", "created_at"], "title": "App", "exclude": ["h_metadata", "public_id"] }, "AppCreate": { "properties": { "name": { "type": "string", "maxLength": 100, "minLength": 1, "title": "Name" }, "metadata": { "type": "object", "title": "Metadata", "default": {}, "additionalProperties": true } }, "type": "object", "required": ["name"], "title": "AppCreate" }, "AppUpdate": { "properties": { "name": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Name" }, "metadata": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Metadata" } }, "type": "object", "title": "AppUpdate" }, "Collection": { "properties": { "id": { "type": "string", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "user_id": { "type": "string", "title": "User Id" }, "metadata": { "type": "object", "title": "Metadata", "additionalProperties": true }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" } }, "type": "object", "required": ["id", "name", "user_id", "metadata", "created_at"], "title": "Collection", "exclude": ["h_metadata", "public_id"] }, "CollectionCreate": { "properties": { "name": { "type": "string", "maxLength": 100, "minLength": 1, "title": "Name" }, "metadata": { "type": "object", "title": "Metadata", "default": {}, "additionalProperties": true } }, "type": "object", "required": ["name"], "title": "CollectionCreate" }, "CollectionGet": { "properties": { "filter": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Filter" } }, "type": "object", "title": "CollectionGet" }, "CollectionUpdate": { "properties": { "name": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Name" }, "metadata": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Metadata" } }, "type": "object", "title": "CollectionUpdate" }, "Document": { "properties": { "id": { "type": "string", "title": "Id" }, "content": { "type": "string", "title": "Content" }, "metadata": { "type": "object", "title": "Metadata", "additionalProperties": true }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" }, "collection_id": { "type": "string", "title": "Collection Id" } }, "type": "object", "required": [ "id", "content", "metadata", "created_at", "collection_id" ], "title": "Document", "exclude": ["h_metadata", "public_id"] }, "DocumentCreate": { "properties": { "content": { "type": "string", "maxLength": 100000, "minLength": 1, "title": "Content" }, "metadata": { "type": "object", "title": "Metadata", "default": {}, "additionalProperties": true } }, "type": "object", "required": ["content"], "title": "DocumentCreate" }, "DocumentGet": { "properties": { "filter": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Filter" } }, "type": "object", "title": "DocumentGet" }, "DocumentQuery": { "properties": { "query": { "type": "string", "maxLength": 1000, "minLength": 1, "title": "Query" }, "filter": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Filter" }, "top_k": { "type": "integer", "maximum": 50, "minimum": 1, "title": "Top K", "default": 5 } }, "type": "object", "required": ["query"], "title": "DocumentQuery" }, "DocumentUpdate": { "properties": { "metadata": { "anyOf": [ { "type": "object", "maxProperties": 10000, "additionalProperties": true }, { "type": "null" } ], "title": "Metadata" }, "content": { "anyOf": [ { "type": "string", "maxLength": 100000, "minLength": 1 }, { "type": "null" } ], "title": "Content" } }, "type": "object", "title": "DocumentUpdate" }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "Message": { "properties": { "id": { "type": "string", "title": "Id" }, "content": { "type": "string", "title": "Content" }, "is_user": { "type": "boolean", "title": "Is User" }, "session_id": { "type": "string", "title": "Session Id" }, "metadata": { "type": "object", "title": "Metadata", "additionalProperties": true }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" } }, "type": "object", "required": [ "id", "content", "is_user", "session_id", "metadata", "created_at" ], "title": "Message", "exclude": ["h_metadata", "public_id"] }, "MessageBatchCreate": { "properties": { "messages": { "items": { "$ref": "#/components/schemas/MessageCreate" }, "type": "array", "maxItems": 100, "title": "Messages" } }, "type": "object", "required": ["messages"], "title": "MessageBatchCreate", "description": "Schema for batch message creation with a max of 100 messages" }, "MessageCreate": { "properties": { "content": { "type": "string", "maxLength": 50000, "minLength": 0, "title": "Content" }, "is_user": { "type": "boolean", "title": "Is User" }, "metadata": { "type": "object", "title": "Metadata", "default": {}, "additionalProperties": true } }, "type": "object", "required": ["content", "is_user"], "title": "MessageCreate" }, "MessageGet": { "properties": { "filter": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Filter" } }, "type": "object", "title": "MessageGet" }, "MessageUpdate": { "properties": { "metadata": { "type": "object", "title": "Metadata", "additionalProperties": true } }, "type": "object", "required": ["metadata"], "title": "MessageUpdate" }, "Metamessage": { "properties": { "id": { "type": "string", "title": "Id" }, "metamessage_type": { "type": "string", "title": "Metamessage Type" }, "content": { "type": "string", "title": "Content" }, "message_id": { "type": "string", "title": "Message Id" }, "metadata": { "type": "object", "title": "Metadata", "additionalProperties": true }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" } }, "type": "object", "required": [ "id", "metamessage_type", "content", "message_id", "metadata", "created_at" ], "title": "Metamessage", "exclude": ["h_metadata", "public_id"] }, "MetamessageCreate": { "properties": { "metamessage_type": { "type": "string", "maxLength": 50, "minLength": 1, "title": "Metamessage Type" }, "content": { "type": "string", "maxLength": 50000, "minLength": 0, "title": "Content" }, "message_id": { "type": "string", "title": "Message Id" }, "metadata": { "type": "object", "title": "Metadata", "default": {}, "additionalProperties": true } }, "type": "object", "required": ["metamessage_type", "content", "message_id"], "title": "MetamessageCreate" }, "MetamessageGet": { "properties": { "metamessage_type": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Metamessage Type" }, "message_id": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Message Id" }, "filter": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Filter" } }, "type": "object", "title": "MetamessageGet" }, "MetamessageGetUserLevel": { "properties": { "filter": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Filter" }, "metamessage_type": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Metamessage Type" } }, "type": "object", "title": "MetamessageGetUserLevel" }, "MetamessageUpdate": { "properties": { "message_id": { "type": "string", "title": "Message Id" }, "metamessage_type": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Metamessage Type" }, "metadata": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Metadata" } }, "type": "object", "required": ["message_id"], "title": "MetamessageUpdate" }, "Page_Collection_": { "properties": { "items": { "items": { "$ref": "#/components/schemas/Collection" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "minimum": 0, "title": "Total" }, "page": { "type": "integer", "minimum": 1, "title": "Page" }, "size": { "type": "integer", "minimum": 1, "title": "Size" }, "pages": { "type": "integer", "minimum": 0, "title": "Pages" } }, "type": "object", "required": ["items", "total", "page", "size"], "title": "Page[Collection]" }, "Page_Document_": { "properties": { "items": { "items": { "$ref": "#/components/schemas/Document" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "minimum": 0, "title": "Total" }, "page": { "type": "integer", "minimum": 1, "title": "Page" }, "size": { "type": "integer", "minimum": 1, "title": "Size" }, "pages": { "type": "integer", "minimum": 0, "title": "Pages" } }, "type": "object", "required": ["items", "total", "page", "size"], "title": "Page[Document]" }, "Page_Message_": { "properties": { "items": { "items": { "$ref": "#/components/schemas/Message" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "minimum": 0, "title": "Total" }, "page": { "type": "integer", "minimum": 1, "title": "Page" }, "size": { "type": "integer", "minimum": 1, "title": "Size" }, "pages": { "type": "integer", "minimum": 0, "title": "Pages" } }, "type": "object", "required": ["items", "total", "page", "size"], "title": "Page[Message]" }, "Page_Metamessage_": { "properties": { "items": { "items": { "$ref": "#/components/schemas/Metamessage" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "minimum": 0, "title": "Total" }, "page": { "type": "integer", "minimum": 1, "title": "Page" }, "size": { "type": "integer", "minimum": 1, "title": "Size" }, "pages": { "type": "integer", "minimum": 0, "title": "Pages" } }, "type": "object", "required": ["items", "total", "page", "size"], "title": "Page[Metamessage]" }, "Page_Session_": { "properties": { "items": { "items": { "$ref": "#/components/schemas/Session" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "minimum": 0, "title": "Total" }, "page": { "type": "integer", "minimum": 1, "title": "Page" }, "size": { "type": "integer", "minimum": 1, "title": "Size" }, "pages": { "type": "integer", "minimum": 0, "title": "Pages" } }, "type": "object", "required": ["items", "total", "page", "size"], "title": "Page[Session]" }, "Page_User_": { "properties": { "items": { "items": { "$ref": "#/components/schemas/User" }, "type": "array", "title": "Items" }, "total": { "type": "integer", "minimum": 0, "title": "Total" }, "page": { "type": "integer", "minimum": 1, "title": "Page" }, "size": { "type": "integer", "minimum": 1, "title": "Size" }, "pages": { "type": "integer", "minimum": 0, "title": "Pages" } }, "type": "object", "required": ["items", "total", "page", "size"], "title": "Page[User]" }, "Session": { "properties": { "id": { "type": "string", "title": "Id" }, "is_active": { "type": "boolean", "title": "Is Active" }, "user_id": { "type": "string", "title": "User Id" }, "metadata": { "type": "object", "title": "Metadata", "additionalProperties": true }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" } }, "type": "object", "required": ["id", "is_active", "user_id", "metadata", "created_at"], "title": "Session", "exclude": ["h_metadata", "public_id"] }, "SessionCreate": { "properties": { "metadata": { "type": "object", "title": "Metadata", "default": {}, "additionalProperties": true } }, "type": "object", "title": "SessionCreate" }, "SessionGet": { "properties": { "filter": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Filter" }, "is_active": { "type": "boolean", "title": "Is Active", "default": false } }, "type": "object", "title": "SessionGet" }, "SessionUpdate": { "properties": { "metadata": { "type": "object", "title": "Metadata", "additionalProperties": true } }, "type": "object", "required": ["metadata"], "title": "SessionUpdate" }, "User": { "properties": { "id": { "type": "string", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "app_id": { "type": "string", "title": "App Id" }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" }, "metadata": { "type": "object", "title": "Metadata", "additionalProperties": true } }, "type": "object", "required": ["id", "name", "app_id", "created_at", "metadata"], "title": "User", "exclude": ["h_metadata", "public_id"] }, "UserCreate": { "properties": { "name": { "type": "string", "maxLength": 100, "minLength": 1, "title": "Name" }, "metadata": { "type": "object", "title": "Metadata", "default": {}, "additionalProperties": true } }, "type": "object", "required": ["name"], "title": "UserCreate" }, "UserGet": { "properties": { "filter": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Filter" } }, "type": "object", "title": "UserGet" }, "UserUpdate": { "properties": { "name": { "anyOf": [{ "type": "string" }, { "type": "null" }], "title": "Name" }, "metadata": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Metadata" } }, "type": "object", "title": "UserUpdate" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [{ "type": "string" }, { "type": "integer" }] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" } }, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError" } }, "securitySchemes": { "HTTPBearer": { "type": "http", "scheme": "bearer" } } } }