honcho/docs/openapi.json

3236 lines
122 KiB
JSON

{
"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.12"
},
"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\n\nArgs:\n app_id (str): The ID of the app\n\nReturns:\n schemas.App: App object",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\n)\napp = client.apps.get(\n \"app_id\",\n)\nprint(app.id)"
}
]
},
"put": {
"tags": ["apps"],
"summary": "Update App",
"description": "Update an App\n\nArgs:\n app_id (str): The ID of the app to update\n app (schemas.AppUpdate): The App object containing any new metadata\n\nReturns:\n schemas.App: The App object of the updated 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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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\n\nArgs:\n app_name (str): The name of the app\n\nReturns:\n schemas.App: App object",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\n)\napp = client.apps.get_by_name(\n \"name\",\n)\nprint(app.id)"
}
]
}
},
"/v1/apps": {
"post": {
"tags": ["apps"],
"summary": "Create App",
"description": "Create an App\n\nArgs:\n app (schemas.AppCreate): The App object containing any metadata\n\nReturns:\n schemas.App: Created App object",
"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';\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: 'name' });\n\n console.log(app.id);\n}\n\nmain();"
},
{
"lang": "Python",
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\n)\napp = client.apps.create(\n name=\"name\",\n)\nprint(app.id)"
}
]
}
},
"/v1/apps/get_or_create/{name}": {
"get": {
"tags": ["apps"],
"summary": "Get Or Create App",
"description": "Get or Create an App\n\nArgs:\n app_name (str): The name of the app\n\nReturns:\n schemas.App: App object",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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 User\n\nArgs:\n app_id (str): The ID of the app representing the client application using\n honcho\n user (schemas.UserCreate): The User object containing any metadata\n\nReturns:\n schemas.User: Created User object",
"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';\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: 'name' });\n\n console.log(user.id);\n}\n\nmain();"
},
{
"lang": "Python",
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\n)\nuser = client.apps.users.create(\n app_id=\"app_id\",\n name=\"name\",\n)\nprint(user.id)"
}
]
}
},
"/v1/apps/{app_id}/users/list": {
"post": {
"tags": ["users"],
"summary": "Get Users",
"description": "Get All Users for an App\n\nArgs:\n app_id (str): The ID of the app representing the client\n application using honcho\n\nReturns:\n list[schemas.User]: List of User objects",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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\n\nArgs:\n app_id (str): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n\nReturns:\n schemas.User: User object",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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\n\nArgs:\n app_id (str): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n\nReturns:\n schemas.User: User object",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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\n\nArgs:\n app_id (str): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n user (schemas.UserCreate): The User object containing any metadata\n\nReturns:\n schemas.User: Updated User object",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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 or Create a User\n\nArgs:\n app_id (str): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n\nReturns:\n schemas.User: User object",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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\n\nArgs:\n app_id (str): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n\nReturns:\n list[schemas.Session]: List of Session objects",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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\n\nArgs:\n app_id (str): The ID of the app representing the client\n application using honcho\n user_id (str): The User ID representing the user, managed by the user\n session (schemas.SessionCreate): The Session object containing any\n metadata\n\nReturns:\n schemas.Session: The Session object of the new Session",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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\n\nArgs:\n app_id (str): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (str): The ID of the Session to update\n session (schemas.SessionUpdate): The Session object containing any new metadata\n\nReturns:\n schemas.Session: The Session object of the updated 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';\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\n console.log(session.id);\n}\n\nmain();"
},
{
"lang": "Python",
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\n)\nsession = client.apps.users.sessions.update(\n session_id=\"session_id\",\n app_id=\"app_id\",\n user_id=\"user_id\",\n)\nprint(session.id)"
}
]
},
"delete": {
"tags": ["sessions"],
"summary": "Delete Session",
"description": "Delete a session by marking it as inactive\n\nArgs:\n app_id (str): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (str): The ID of the Session to delete\n\nReturns:\n dict: A message indicating that the session was deleted\n\nRaises:\n HTTPException: If the session is not found",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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\n\nArgs:\n app_id (str): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (str): The ID of the Session to retrieve\n\nReturns:\n schemas.Session: The Session object of the requested Session\n\nRaises:\n HTTPException: If the session is not found",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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}/messages": {
"post": {
"tags": ["messages"],
"summary": "Create Message For Session",
"description": "Adds a message to a session\n\nArgs:\n app_id (str): The ID of the app representing the client application using honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (int): The ID of the Session to add the message to\n message (schemas.MessageCreate): The Message object to add containing the message content and type\n\nReturns:\n schemas.Message: The Message object of the added message\n\nRaises:\n HTTPException: If the session is not found",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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/list": {
"post": {
"tags": ["messages"],
"summary": "Get Messages",
"description": "Get all messages for a session\n\nArgs:\n app_id (str): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (int): The ID of the Session to retrieve\n reverse (bool): Whether to reverse the order of the messages\n\nReturns:\n list[schemas.Message]: List of Message objects\n\nRaises:\n HTTPException: If the session is not found",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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's 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';\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 );\n\n console.log(message.id);\n}\n\nmain();"
},
{
"lang": "Python",
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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)\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\n\nArgs:\n app_id (str): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (int): The ID of the Session to add the message to\n metamessage (schemas.MeteamessageCreate): The metamessage creation object\n\nReturns:\n schemas.Metamessage: The Metamessage object of the added metamessage\n\nRaises:\n HTTPException: If the session is not found",
"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';\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: 'metamessage_type' },\n );\n\n console.log(metamessage.id);\n}\n\nmain();"
},
{
"lang": "Python",
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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=\"metamessage_type\",\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\n\nArgs:\n app_id (str): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (int): The ID of the Session to retrieve\n reverse (bool): Whether to reverse the order of the metamessages\n\nReturns:\n list[schemas.Message]: List of Message objects\n\nRaises:\n HTTPException: If the session is not found",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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\n\nArgs:\n app_id (str): The ID of the app representing the client application using\n honcho\n user_id (str): The User ID representing the user, managed by the user\n session_id (int): The ID of the Session to retrieve\n\nReturns:\n schemas.Session: The Session object of the requested Session\n\nRaises:\n HTTPException: If the session is not found",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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\n\nArgs:\n app_id (str): The ID of the app representing the client application using honcho\n user_id (str): The User ID representing the user, managed by the user\n reverse (bool): Whether to reverse the order of the metamessages\n\nReturns:\n list[schemas.Message]: List of Message objects\n\nRaises:\n HTTPException: If the session is not found",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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\n\nArgs:\n app_id (str): The ID of the app representing the client\n application using honcho\n user_id (str): The User ID representing the user, managed by the user\n\nReturns:\n list[schemas.Collection]: List of Collection objects",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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",
"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';\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: 'name' });\n\n console.log(collection.id);\n}\n\nmain();"
},
{
"lang": "Python",
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\n)\ncollection = client.apps.users.collections.create(\n user_id=\"user_id\",\n app_id=\"app_id\",\n name=\"name\",\n)\nprint(collection.id)"
}
]
}
},
"/v1/apps/{app_id}/users/{user_id}/collections/{collection_id}/documents/list": {
"post": {
"tags": ["documents"],
"summary": "Get Documents",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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",
"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';\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 # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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": {
"get": {
"tags": ["documents"],
"summary": "Query Documents",
"operationId": "query_documents_v1_apps__app_id__users__user_id__collections__collection_id__documents_query_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": "query",
"in": "query",
"required": true,
"schema": { "type": "string", "title": "Query" }
},
{
"name": "top_k",
"in": "query",
"required": false,
"schema": { "type": "integer", "default": 5, "title": "Top K" }
},
{
"name": "filter",
"in": "query",
"required": false,
"schema": {
"anyOf": [{ "type": "string" }, { "type": "null" }],
"title": "Filter"
}
}
],
"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 Get"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/HTTPValidationError" }
}
}
}
},
"x-codeSamples": [
{
"lang": "JavaScript",
"source": "import Honcho from 'honcho';\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: 'query' },\n );\n\n console.log(documents);\n}\n\nmain();"
},
{
"lang": "Python",
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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=\"query\",\n)\nprint(documents)"
}
]
}
},
"/v1/apps/{app_id}/users/{user_id}/collections/{collection_id}/documents": {
"post": {
"tags": ["documents"],
"summary": "Create 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';\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: 'content' },\n );\n\n console.log(document.id);\n}\n\nmain();"
},
{
"lang": "Python",
"source": "import os\nfrom honcho import Honcho\n\nclient = Honcho(\n # This is the default and can be omitted\n api_key=os.environ.get(\"HONCHO_API_KEY\"),\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=\"content\",\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"
},
"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", "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", "title": "Name" },
"metadata": {
"anyOf": [
{ "type": "object", "additionalProperties": true },
{ "type": "null" }
],
"title": "Metadata",
"default": {}
}
},
"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", "title": "Content" },
"metadata": {
"anyOf": [
{ "type": "object", "additionalProperties": true },
{ "type": "null" }
],
"title": "Metadata",
"default": {}
}
},
"type": "object",
"required": ["content"],
"title": "DocumentCreate"
},
"DocumentGet": {
"properties": {
"filter": {
"anyOf": [
{ "type": "object", "additionalProperties": true },
{ "type": "null" }
],
"title": "Filter"
}
},
"type": "object",
"title": "DocumentGet"
},
"DocumentUpdate": {
"properties": {
"metadata": {
"anyOf": [
{ "type": "object", "additionalProperties": true },
{ "type": "null" }
],
"title": "Metadata"
},
"content": {
"anyOf": [{ "type": "string" }, { "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"]
},
"MessageCreate": {
"properties": {
"content": { "type": "string", "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": {
"anyOf": [
{ "type": "object", "additionalProperties": true },
{ "type": "null" }
],
"title": "Metadata"
}
},
"type": "object",
"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", "title": "Metamessage Type" },
"content": { "type": "string", "title": "Content" },
"message_id": { "type": "string", "title": "Message Id" },
"metadata": {
"anyOf": [
{ "type": "object", "additionalProperties": true },
{ "type": "null" }
],
"title": "Metadata",
"default": {}
}
},
"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": {
"anyOf": [
{ "type": "object", "additionalProperties": true },
{ "type": "null" }
],
"title": "Metadata"
}
},
"type": "object",
"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", "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" } }
}
}