{ "openapi": "3.1.0", "info": { "title": "mlcore_web", "version": "192.1.2" }, "paths": { "/api/v1/login/access-token": { "post": { "tags": [ "login" ], "summary": "Login Access Token", "description": "OAuth2-compatible token login, get a bearer token for future requests.\n\nThe bearer token must be included in the Authorization header of all future requests.\n\nNote that access token authentication cannot be used to access user-specific resources\nsuch as user passwords and superuser status.", "operationId": "login_access_token", "parameters": [ { "name": "account_name", "in": "query", "required": false, "schema": { "description": "The name of the account to validate that the user is authorized to access. If the user does not have access to this account, the endpoint will return a 403 even if the user is successfully authenticated. This is useful for third party applications which want users to be restricted to a particular account.", "title": "Account Name", "type": [ "string", "null" ] }, "description": "The name of the account to validate that the user is authorized to access. If the user does not have access to this account, the endpoint will return a 403 even if the user is successfully authenticated. This is useful for third party applications which want users to be restricted to a particular account." }, { "name": "m2m_token", "in": "query", "required": false, "schema": { "description": "A custom M2M access token in case one is needed to access resources in your environment. This is not relevant for cloud customers. It's only used for VPC deployments.", "title": "M2M Token", "type": [ "string", "null" ] }, "description": "A custom M2M access token in case one is needed to access resources in your environment. This is not relevant for cloud customers. It's only used for VPC deployments." } ], "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/Body_login_access_token_api_v1_login_access_token_post" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Token" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/logout/access-token": { "post": { "tags": [ "login" ], "summary": "Logout Access Token", "description": "Logout and revoke the access token.", "operationId": "logout_access_token", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "204": { "description": "Successful Response" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/login/access-token/api-key": { "post": { "tags": [ "login" ], "summary": "Login Access Token Api Key", "description": "API key login, get a bearer token for future requests.\n\nThe bearer token must be included in the Authorization header of all future requests.\n\nInclude your API key in the `x-api-key` header.", "operationId": "login_access_token_api_key", "security": [ { "APIKeyHeader": [] } ], "parameters": [ { "name": "account_name", "in": "query", "required": true, "schema": { "type": "string", "description": "The name of the account to authenticate the API key against.", "title": "Account Name" }, "description": "The name of the account to authenticate the API key against." }, { "name": "email", "in": "query", "required": true, "schema": { "type": "string", "format": "email", "description": "The email address of the user in this account to authenticate.", "title": "Email" }, "description": "The email address of the user in this account to authenticate." }, { "name": "create", "in": "query", "required": false, "schema": { "type": "boolean", "description": "Whether to create the user if it doesn't exist. If set to false and the user with the email is not part of the account, the endpoint will return a 404. If set to true and the user does not exist, the endpoint will create the user and add them to the account. If set to true and the user exists, the endpoint will add the user to the account.", "default": false, "title": "Create" }, "description": "Whether to create the user if it doesn't exist. If set to false and the user with the email is not part of the account, the endpoint will return a 404. If set to true and the user does not exist, the endpoint will create the user and add them to the account. If set to true and the user exists, the endpoint will add the user to the account." }, { "name": "m2m_token", "in": "query", "required": false, "schema": { "description": "A custom M2M access token in case one is needed to access resources in your environment. This is not relevant for cloud customers. It's only used for VPC deployments.", "title": "M2M Token", "type": [ "string", "null" ] }, "description": "A custom M2M access token in case one is needed to access resources in your environment. This is not relevant for cloud customers. It's only used for VPC deployments." } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Token" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/login/session": { "post": { "tags": [ "login" ], "summary": "Login Session", "description": "Login and get a session-based cookie.\n\nThe response headers will contain the cookie. Note that you must use the cookie for all\nother requests to the API.", "operationId": "login_session", "parameters": [ { "name": "third_party", "in": "query", "required": false, "schema": { "type": "boolean", "description": "Whether to set a third-party cookie for cross-origin iframes.", "default": false, "title": "Third Party" }, "description": "Whether to set a third-party cookie for cross-origin iframes." }, { "name": "slack_id", "in": "query", "required": false, "schema": { "description": "An optional base64-encoded Slack {team_id}:{user_id} to link to (for use by the NS Slack App).", "title": "Slack Id", "type": [ "string", "null" ] }, "description": "An optional base64-encoded Slack {team_id}:{user_id} to link to (for use by the NS Slack App)." }, { "name": "account_name", "in": "query", "required": false, "schema": { "description": "The name of the account to validate that the user is authorized to access. If the user does not have access to this account, the endpoint will return a 403 even if the user is successfully authenticated. This is useful for third party applications which want users to be restricted to a particular account.", "title": "Account Name", "type": [ "string", "null" ] }, "description": "The name of the account to validate that the user is authorized to access. If the user does not have access to this account, the endpoint will return a 403 even if the user is successfully authenticated. This is useful for third party applications which want users to be restricted to a particular account." } ], "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/Body_login_session_api_v1_login_session_post" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Login Session Api V1 Login Session Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/logout/session": { "post": { "tags": [ "login" ], "summary": "Logout Session", "description": "Logout and unset session-based cookie value.", "operationId": "logout_session", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "third_party", "in": "query", "required": false, "schema": { "type": "boolean", "description": "Whether to set a third-party cookie for cross-origin iframes.", "default": false, "title": "Third Party" }, "description": "Whether to set a third-party cookie for cross-origin iframes." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Logout Session Api V1 Logout Session Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v1/login/session/oauth": { "get": { "tags": [ "login" ], "summary": "Login Session Oauth", "description": "Login via OAuth2.0 authorization code flow with PKCE.\n\nThe currently supported OAuth2.0 providers are:\n- Okta\n- Google", "operationId": "login_session_oauth", "parameters": [ { "name": "provider", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/Provider", "description": "The OAuth provider. At the moment this defaults to 'okta' but this default will be removed in the future. Please specify the provider explicitly to avoid issues." }, "description": "The OAuth provider. At the moment this defaults to 'okta' but this default will be removed in the future. Please specify the provider explicitly to avoid issues." }, { "name": "account_name", "in": "query", "required": false, "schema": { "description": "The name of the account to validate that the user is authorized to access. If the user does not have access to this account, the endpoint will return a 403 even if the user is successfully authenticated. This is useful for third party applications which want users to be restricted to a particular account.", "title": "Account Name", "type": [ "string", "null" ] }, "description": "The name of the account to validate that the user is authorized to access. If the user does not have access to this account, the endpoint will return a 403 even if the user is successfully authenticated. This is useful for third party applications which want users to be restricted to a particular account." }, { "name": "redirect_header", "in": "query", "required": false, "schema": { "type": "boolean", "description": "Whether to redirect at the HTTP level or not. Browsers set origin=null if a cross-origin resource redirects to yet another origin. This can be problematic for an embedded iframe. Instead, setting redirect to False puts the redirect information in the response body. Then it is up to the client to handle the redirect themselves.", "default": false, "title": "Redirect Header" }, "description": "Whether to redirect at the HTTP level or not. Browsers set origin=null if a cross-origin resource redirects to yet another origin. This can be problematic for an embedded iframe. Instead, setting redirect to False puts the redirect information in the response body. Then it is up to the client to handle the redirect themselves." }, { "name": "redirect_uri", "in": "query", "required": false, "schema": { "description": "The URI to redirect to after the login is complete. This is needed for clients to redirect back to the original page. When OAuth is complete, the user will be redirected to this URI. If the login is successful, a session cookie will be set. If the login is unsuccessful, an error parameter will be set in the redirect_uri query params. If this value is set to None then the redirect_uri will default to https://app.numbersstation.ai/login.", "title": "Redirect Uri", "type": [ "string", "null" ] }, "description": "The URI to redirect to after the login is complete. This is needed for clients to redirect back to the original page. When OAuth is complete, the user will be redirected to this URI. If the login is successful, a session cookie will be set. If the login is unsuccessful, an error parameter will be set in the redirect_uri query params. If this value is set to None then the redirect_uri will default to https://app.numbersstation.ai/login." }, { "name": "third_party", "in": "query", "required": false, "schema": { "type": "boolean", "description": "Whether to set a third-party cookie for cross-origin iframes.", "default": false, "title": "Third Party" }, "description": "Whether to set a third-party cookie for cross-origin iframes." }, { "name": "slack_id", "in": "query", "required": false, "schema": { "description": "An optional base64-encoded Slack {team_id}:{user_id} to link to (for use by the NS Slack App).", "title": "Slack Id", "type": [ "string", "null" ] }, "description": "An optional base64-encoded Slack {team_id}:{user_id} to link to (for use by the NS Slack App)." } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "string", "title": "Response Login Session Oauth Api V1 Login Session Oauth Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/chat/": { "post": { "tags": [ "chat" ], "summary": "Create Chat", "description": "Create a chat. This will not send a message to the chat.\n\nNote that you can also create a chat using the send message endpoint. Doing so will\nlet you skip making a separate call to create the chat.", "operationId": "create_chat", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatAPICreate" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatAPIResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "get": { "tags": [ "chat" ], "summary": "Get Chats", "description": "Read all chats.", "operationId": "get_chats", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "sort_ascending", "in": "query", "required": false, "schema": { "type": "boolean", "description": "Sort ascending. If false, sort descending.", "default": true, "title": "Sort Ascending" }, "description": "Sort ascending. If false, sort descending." }, { "name": "sort_by", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/ChatsSort", "description": "The field to sort by.", "default": "created_at" }, "description": "The field to sort by." }, { "name": "filter_by", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/ChatsFilter", "description": "Filter for a particular kind of chats.", "default": "is_by_user" }, "description": "Filter for a particular kind of chats." }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 1000, "minimum": 1, "description": "The maximum number of chats to include in the response.", "default": 100, "title": "Limit" }, "description": "The maximum number of chats to include in the response." }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "description": "The maximum number of chats to include in the response.", "default": 0, "title": "Offset" }, "description": "The maximum number of chats to include in the response." }, { "name": "creator_ids", "in": "query", "required": false, "schema": { "title": "Creator Ids", "type": [ "array", "null" ] } }, { "name": "before_timestamp", "in": "query", "required": false, "schema": { "title": "Before Timestamp", "type": [ "string", "null" ] } }, { "name": "after_timestamp", "in": "query", "required": false, "schema": { "title": "After Timestamp", "type": [ "string", "null" ] } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatAPIResponsePage" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/chat/{chat_id}": { "delete": { "tags": [ "chat" ], "summary": "Delete Chat", "description": "Delete a chat.\n\nCAUTION: This is unrecoverable. All messages associated with the chat will be deleted.", "operationId": "delete_chat", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "chat_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The ID of the chat.", "title": "Chat Id" }, "description": "The ID of the chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatAPIResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "put": { "tags": [ "chat" ], "summary": "Update Chat", "description": "Update a chat.", "operationId": "update_chat", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "chat_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The ID of the chat.", "title": "Chat Id" }, "description": "The ID of the chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatAPIUpdate", "description": "The updates to the chat object." } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatAPIResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "get": { "tags": [ "chat" ], "summary": "Get Chat", "description": "Read a single chat.\n\nNote that this does NOT include the messages of the chat. See the get\nchat messages endpoint (GET api/v3/orgs/{account_name}/chats/{chat_id}/messages/) for that.", "operationId": "get_chat", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "chat_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The ID of the chat.", "title": "Chat Id" }, "description": "The ID of the chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatAPIResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/chat/{chat_id}/messages": { "get": { "tags": [ "chat" ], "summary": "Get Chat Messages", "description": "Get messages in a chat.\n\nThis paginated endpoint returns a chat with up to the requested number of\nmessages. Note that the messages are ordered from newest to oldest.", "operationId": "get_chat_messages", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "chat_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The ID of the chat.", "title": "Chat Id" }, "description": "The ID of the chat." }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 1000, "minimum": 1, "description": "The maximum number of messages to include in the response.", "default": 20, "title": "Limit" }, "description": "The maximum number of messages to include in the response." }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "description": "The messages to skip. The response will not include indexes greater than the offset. Equivalent of 'skip' in database queries.", "default": 0, "title": "Offset" }, "description": "The messages to skip. The response will not include indexes greater than the offset. Equivalent of 'skip' in database queries." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageAPIResponsePage" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/chat/{chat_id}/interrupt": { "post": { "tags": [ "chat" ], "summary": "Send Interrupt", "description": "Send a interrupt signal in a chat.\n\nNote that this sends the signal regardless of whether the AI is currently\ngenerating", "operationId": "send_interrupt", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "chat_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The ID of the chat.", "title": "Chat Id" }, "description": "The ID of the chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/chat/{chat_id}/clone": { "post": { "tags": [ "chat" ], "summary": "Clone Chat", "description": "Clone a chat with the new user as the creator.", "operationId": "clone_chat", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "chat_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The ID of the chat.", "title": "Chat Id" }, "description": "The ID of the chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatAPIResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/chat/{chat_id}/has_admin_feedback": { "get": { "tags": [ "chat" ], "summary": "Has Admin Feedback (Experimental \ud83e\uddea)", "description": "Check if the feedback chat has admin feedback.\n\nWARNING: This endpoint is experimental and its behavior may change without warning.", "operationId": "check_feedback_chat_has_admin_feedback", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Account Name" } }, { "name": "chat_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The ID of the chat.", "title": "Chat Id" }, "description": "The ID of the chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "boolean", "title": "Response Check Feedback Chat Has Admin Feedback Api V3 Orgs Account Name Chat Chat Id Has Admin Feedback Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/messages/": { "post": { "tags": [ "messages" ], "summary": "Send Message", "description": "Send a message.\n\nThis endpoint returns a server sent event stream composed of `MessageAPIResponse` objects.\nThe stream will close when the model is done generating responses and is ready for more\ninput.\n\nIf a chat_id is provided, the message will be sent to that chat. A chat will be created and\nthe MessageAPIResponse will contain the new chat_id. If the chat does not have a name, then\na name will be generated asynchronously. It should be available within a few seconds.\n\nIf the message_text is empty, then the message will be ignored. If the chat is currently\nbusy, then this will trigger a 409 CONFLICT response. This can be useful to reattach to a\nchat that is currently running.\n\nNote that messages can only be sent by the owner of the chat or by an admin in certain cases.", "operationId": "send_message", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageAPISendV3" } } } }, "responses": { "201": { "description": "Message sent successfully. Returns an event stream of `MessageAPIResponse` objects.", "content": { "text/event-stream": { "schema": { "$ref": "#/components/schemas/MessageAPIResponse" } } } }, "204": { "description": "The message is empty and was ignored." }, "409": { "description": "Chat is busy. Returns an event stream of the running chat.", "content": { "text/event-stream": { "schema": { "$ref": "#/components/schemas/MessageAPIResponse" } } } }, "404": { "description": "The chat or message could not be found." }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/messages/{message_id}/refresh": { "put": { "tags": [ "messages" ], "summary": "Refresh Query Message", "description": "Refresh the SQL table in a chat message.\n\nThis will return an error if the message does not contain a table ID.\nNote that you will need to refetch the data from the data endpoint to see the updates.", "operationId": "refresh_query_message", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "message_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The id of a message in a chat.", "title": "Message Id" }, "description": "The id of a message in a chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "The table associated with the message was refreshed successfully.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageAPIResponse" } } } }, "400": { "description": "Bad request. Verify that the message contains a table ID." }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/messages/{message_id}/feedback": { "put": { "tags": [ "messages" ], "summary": "Update Message Feedback (Experimental \ud83e\uddea)", "description": "Update the thumbs up / down user-provided feedback on a chat message.\n\nFeedback for the system response to a user question is associated with the\nuser question, instead of the response messages. Only user messages can\nreceive feedback at this time.\n\nOnly the chat creator can provide feedback on messages within the chat.\n\nWARNING: This endpoint is experimental and its behavior may change without warning.", "operationId": "update_message_feedback", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "message_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The id of a message in a chat.", "title": "Message Id" }, "description": "The id of a message in a chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageUpdateFeedbackAPI" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageAPIResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/messages/{message_id}/admin_feedback": { "put": { "tags": [ "messages" ], "summary": "Update Message Admin Feedback (Experimental \ud83e\uddea)", "description": "Update the thumbs up / down admin-provided feedback on a chat message.\n\nAdmin feedback for the system response to a user question is associated with the\nuser question, instead of the response messages. Only admin messages can\nreceive feedback at this time.\n\nAny admin can provide admin feedback on messages within the chat. Note that admins\ncan only provide feedback on their own chats or other chats that already have admin\nfeedback.\n\nWARNING: This endpoint is experimental and its behavior may change without warning.", "operationId": "update_message_admin_feedback", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "message_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The id of a message in a chat.", "title": "Message Id" }, "description": "The id of a message in a chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageUpdateAdminFeedbackAPI" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageAPIResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/messages/{message_id}/data": { "get": { "tags": [ "messages" ], "summary": "Read Message Table Data", "description": "Get the table data associated with a message.\n\nThis will return an error if the message does not contain a table ID.", "operationId": "read_message_table_data", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "message_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The id of a message in a chat.", "title": "Message Id" }, "description": "The id of a message in a chat." }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 1000, "minimum": 1, "description": "The maximum number of rows to include in the response.", "default": 100, "title": "Limit" }, "description": "The maximum number of rows to include in the response." }, { "name": "skip", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "description": "The number of rows to skip. Equivalent of 'skip' in database queries.", "default": 0, "title": "Skip" }, "description": "The number of rows to skip. Equivalent of 'skip' in database queries." }, { "name": "sort", "in": "query", "required": false, "schema": { "description": "The columns to sort by. Prefix with '-' for descending order.", "title": "Sort", "type": [ "array", "null" ] }, "description": "The columns to sort by. Prefix with '-' for descending order." }, { "name": "format", "in": "query", "required": false, "schema": { "type": "boolean", "description": "If true, format the table data according to display type.", "default": true, "title": "Format" }, "description": "If true, format the table data according to display type." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DataPage" } } } }, "400": { "description": "Bad request. Verify that the message contains a table ID." }, "404": { "description": "The item could not be found." }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/messages/{message_id}/data/csv": { "get": { "tags": [ "messages" ], "summary": "Read Message Table Data As Csv", "description": "Read message table data as a CSV.\n\nThe data in the CSV is not formatted according to display types. This will return an\nerror if the message does not contain a table ID.", "operationId": "read_message_table_data_as_csv", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Account Name" } }, { "name": "message_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The id of a message in a chat.", "title": "Message Id" }, "description": "The id of a message in a chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "The table data as a CSV file.", "content": { "text/csv": {} } }, "400": { "description": "Bad request. Verify that the message contains a table ID." }, "404": { "description": "The item could not be found." }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/messages/{message_id}/chart_data": { "get": { "tags": [ "messages" ], "summary": "Read Message Chart Data", "description": "Get the table data associated with a message.", "operationId": "read_message_chart_data", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "message_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The id of a message in a chat.", "title": "Message Id" }, "description": "The id of a message in a chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChartData" } } } }, "400": { "description": "Bad request. Verify that the message contains a table ID." }, "404": { "description": "The item could not be found." }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/messages/{message_id}/admin_feedback_clone": { "post": { "tags": [ "messages" ], "summary": "Admin Feedback Clone (Experimental \ud83e\uddea)", "description": "Clone a user chat for admin to provide admin feedback.\n\nArgs:\n message: The user message that has user feedback. The copy will convert messages from the\n first one to the response of the response for this user message.\n\nWARNING: This endpoint is experimental and its behavior may change without warning.", "operationId": "admin_feedback_clone", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "message_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The id of a message in a chat.", "title": "Message Id" }, "description": "The id of a message in a chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatAPIResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/messages/{message_id}/explain/sql": { "get": { "tags": [ "messages" ], "summary": "Explain SQL Query", "description": "Read SQL response from this message and the chat and generate explanation.\n\nThis endpoint sends a ExplanationAPIResponse response back that will explain, in text, why\nthe model generated the SQL statement that it did.\n\nThis endpoint assumes that the message_id given is the same one used to retrieve the table data.\nWe use the message history up to this message for context for the explanation.\n\nThis will return an error message if the message_id is invalid or if the message isn't a SQL response.", "operationId": "explain_sql_message", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Account Name" } }, { "name": "message_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The id of a message in a chat.", "title": "Message Id" }, "description": "The id of a message in a chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExplanationAPIResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/messages/{message_id}/pdf": { "get": { "tags": [ "messages" ], "summary": "Get Chat Summary Pdf", "operationId": "get_chat_summary_pdf", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Account Name" } }, { "name": "message_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The id of a message in a chat.", "title": "Message Id" }, "description": "The id of a message in a chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "The chat summary as a PDF file.", "content": { "application/pdf": {} } }, "400": { "description": "Bad request. Verify that the message contains a valid user message ID." }, "404": { "description": "The PDF file could not be found most likely due to file expiration." }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/messages/{message_id}/deep_research_summary_pdf": { "get": { "tags": [ "messages" ], "summary": "Get Deep Research Summary Pdf", "description": "Get the deep research summary as a PDF file.", "operationId": "get_deep_research_summary_pdf", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Account Name" } }, { "name": "message_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid4", "description": "The id of a message in a chat.", "title": "Message Id" }, "description": "The id of a message in a chat." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "The deep research summary as a PDF file.", "content": { "application/pdf": {} } }, "400": { "description": "Bad request. Verify user message ID is valid." }, "404": { "description": "The PDF file could not be generated." }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/users/me": { "get": { "tags": [ "user" ], "summary": "Get Current User", "description": "Get the current user.", "operationId": "get_current_user", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/data_assets/": { "get": { "tags": [ "data_assets" ], "summary": "Get Data Assets For Account", "description": "Get data assets for an account.\n\nIf `chat_id` is provided, then SSDSs local only to that chat will\nbe also be returned. Right now, the only way an SSDS will be local\nto a chat is if it was created by uploading a CSV to the chat.", "operationId": "get_data_assets_for_account", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "chat_id", "in": "query", "required": false, "schema": { "title": "Chat Id", "type": [ "string", "null" ] } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 500, "minimum": 1, "default": 100, "title": "Limit" } }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "default": 0, "title": "Offset" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DataAssetAPIPage" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/data_assets/suggestions": { "get": { "tags": [ "data_assets" ], "summary": "Get Suggestions For Account", "description": "Get suggested prompts for an account across all datasets in the account.", "operationId": "get_suggestions_for_account", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 5, "title": "Limit" } }, { "name": "agent_name", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/AgentName", "default": "sql_query_agent" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/SuggestionAPI" }, "title": "Response Get Suggestions For Account Api V3 Orgs Account Name Data Assets Suggestions Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/knowledge_layer/context": { "get": { "tags": [ "knowledge_layer" ], "summary": "Get Entity Context", "description": "Get the context associated with an entity - either a data asset or some other piece of knowledge in the system..", "operationId": "get_entity_context", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "entity_type", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/KnowledgeLayerEntityType", "description": "Type of the entity" }, "description": "Type of the entity" }, { "name": "entity_id", "in": "query", "required": true, "schema": { "type": "string", "description": "ID of the entity. This can either be a UUID4 str or an 8 character base64 short ID. Every entity can be identified by both.", "title": "Entity Id" }, "description": "ID of the entity. This can either be a UUID4 str or an 8 character base64 short ID. Every entity can be identified by both." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "The context associated with the entity was fetched successfully.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/KnowledgeLayerContextAPI" } } } }, "404": { "description": "The entity was not found." }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/dataset/{dataset_id}/dimensions/": { "post": { "tags": [ "dimensions" ], "summary": "Create New Dimension", "description": "Create a new dimension in the specified star schema data source.\n\nThis API creates a dimension within a star schema data source which can then\nbe used for querying data. A dimension is essentially a field or attribute\nthat can be used to select, filter or group data.", "operationId": "create_new_dimension", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Account Name" } }, { "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Dataset Id" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMCreateRequest", "description": "The dimension details." } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "get": { "tags": [ "dimensions" ], "summary": "Read Dimensions", "description": "Retrieve a list of dimensions.\n\nThis API returns a paginated list of dimensions with optional filtering by state\nand update timestamp.", "operationId": "read_dimensions", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Dataset Id" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 1000, "minimum": 1, "description": "Maximum number of dimensions to return.", "default": 20, "title": "Limit" }, "description": "Maximum number of dimensions to return." }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "description": "Number of dimensions to skip for pagination.", "default": 0, "title": "Offset" }, "description": "Number of dimensions to skip for pagination." }, { "name": "state_filter", "in": "query", "required": false, "schema": { "enum": [ "ALL", "VERIFIED", "DEPRECATED" ], "type": "string", "description": "Filter dimensions by state.", "default": "ALL", "title": "State Filter" }, "description": "Filter dimensions by state." }, { "name": "updated_since", "in": "query", "required": false, "schema": { "description": "Return only dimensions updated since this timestamp (ISO 8601).", "title": "Updated Since", "type": [ "string", "null" ] }, "description": "Return only dimensions updated since this timestamp (ISO 8601)." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMResponsePage" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/dataset/{dataset_id}/dimensions/{dimension_id}": { "patch": { "tags": [ "dimensions" ], "summary": "Update Dimension Properties", "description": "Update an existing dimension's properties.\n\nThis API allows you to update properties of an existing dimension such as name,\ndescription, expression, and display type.", "operationId": "update_dimension_properties", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Account Name" } }, { "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Dataset Id" } }, { "name": "dimension_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Dimension Id" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMUpdateRequest", "description": "The updated dimension details." } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/dataset/{dataset_id}/dimensions/{dimension_id}/state": { "patch": { "tags": [ "dimensions" ], "summary": "Update Dimension State Endpoint", "description": "Update a dimension's state (e.g., Verified, Deprecated).\n\nThis API allows you to update the state of a dimension, which controls its visibility\nand availability for use in queries.", "operationId": "update_dimension_state_endpoint", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Dataset Id" } }, { "name": "dimension_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Dimension Id" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMUpdateStateRequest", "description": "The new state for the dimension." } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/dataset/{dataset_id}/dimensions/{dimension_id}/sensitivity": { "patch": { "tags": [ "dimensions" ], "summary": "Update Dimension Sensitivity", "description": "Update a dimension's sensitivity status.\n\nThis API allows you to mark a dimension as sensitive or non-sensitive, which\naffects how it's treated in account management.", "operationId": "update_dimension_sensitivity", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Account Name" } }, { "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Dataset Id" } }, { "name": "dimension_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Dimension Id" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMUpdateSensitivityRequest", "description": "The new sensitivity state." } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/dataset/{dataset_id}/metrics/": { "post": { "tags": [ "metrics" ], "summary": "Create New Metric", "description": "Create a new metric in the specified star schema data source.\n\nThis API creates a metric within a star schema data source that can then\nbe used for querying data. A metric is a measure or aggregate calculation\nover data, such as sums, averages, or counts.", "operationId": "create_new_metric", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Account Name" } }, { "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Dataset Id" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMCreateRequest", "description": "The metric details." } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "get": { "tags": [ "metrics" ], "summary": "Read Metrics", "description": "Retrieve a list of metrics.\n\nThis API returns a paginated list of metrics with optional filtering by state\nand update timestamp.", "operationId": "read_metrics", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Dataset Id" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 1000, "minimum": 1, "description": "Maximum number of metrics to return.", "default": 20, "title": "Limit" }, "description": "Maximum number of metrics to return." }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "description": "Number of metrics to skip for pagination.", "default": 0, "title": "Offset" }, "description": "Number of metrics to skip for pagination." }, { "name": "state_filter", "in": "query", "required": false, "schema": { "enum": [ "ALL", "VERIFIED", "DEPRECATED" ], "type": "string", "description": "Filter metrics by state.", "default": "ALL", "title": "State Filter" }, "description": "Filter metrics by state." }, { "name": "updated_since", "in": "query", "required": false, "schema": { "description": "Return only metrics updated since this timestamp (ISO 8601).", "title": "Updated Since", "type": [ "string", "null" ] }, "description": "Return only metrics updated since this timestamp (ISO 8601)." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMResponsePage" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/dataset/{dataset_id}/metrics/{metric_id}": { "patch": { "tags": [ "metrics" ], "summary": "Update Metric Properties", "description": "Update an existing metric's properties.\n\nThis API allows you to update properties of an existing metric such as name,\ndescription, expression, and display type.", "operationId": "update_metric_properties", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Account Name" } }, { "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Dataset Id" } }, { "name": "metric_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Metric Id" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMUpdateRequest", "description": "The updated metric details." } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/dataset/{dataset_id}/metrics/{metric_id}/state": { "patch": { "tags": [ "metrics" ], "summary": "Update Metric State Endpoint", "description": "Update a metric's state (e.g., Verified, Deprecated).\n\nThis API allows you to update the state of a metric, which controls its visibility\nand availability for use in queries.", "operationId": "update_metric_state_endpoint", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Account Name" } }, { "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Dataset Id" } }, { "name": "metric_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Metric Id" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMUpdateStateRequest", "description": "The new state for the metric." } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/dataset/{dataset_id}/metrics/{metric_id}/sensitivity": { "patch": { "tags": [ "metrics" ], "summary": "Update Metric Sensitivity", "description": "Update a metric's sensitivity status.\n\nThis API allows you to mark a metric as sensitive or non-sensitive, which\naffects how it's treated in account management.", "operationId": "update_metric_sensitivity", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Account Name" } }, { "name": "dataset_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Dataset Id" } }, { "name": "metric_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Metric Id" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMUpdateSensitivityRequest", "description": "The new sensitivity state." } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DMResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/deep_research_plan/": { "post": { "tags": [ "deep_research_plan" ], "summary": "Create Deep Research Plan", "description": "Create a chat. This will not send a message to the chat.\n\nNote that you can also create a chat using the send message endpoint. Doing so will\nlet you skip making a separate call to create the chat.", "operationId": "create_deep_research_plan", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "question", "in": "query", "required": true, "schema": { "type": "string", "title": "Question" } }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeepResearchPlanSchema-Input" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeepResearchPlanInDBBase" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "get": { "tags": [ "deep_research_plan" ], "summary": "Get Deep Research Plans (Experimental \ud83e\uddea)", "description": "Get all deep research plans.\n\nWARNING: This endpoint is experimental and its behavior may change without warning.", "operationId": "get_deep_research_plans", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DeepResearchPlanInDBBase" }, "title": "Response Get Deep Research Plans Api V3 Orgs Account Name Deep Research Plan Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/v3/orgs/{account_name}/deep_research_plan/{deep_research_plan_id}": { "get": { "tags": [ "deep_research_plan" ], "summary": "Get Deep Research Plan", "description": "Get a deep research plan by ID.", "operationId": "get_deep_research_plan", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "deep_research_plan_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Deep Research Plan Id" } }, { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeepResearchPlanInDBBase" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "deep_research_plan" ], "summary": "Delete Deep Research Plan", "description": "Delete a deep research plan by ID.", "operationId": "delete_deep_research_plan", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "deep_research_plan_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Deep Research Plan Id" } }, { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeepResearchPlanInDBBase" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "put": { "tags": [ "deep_research_plan" ], "summary": "Update Deep Research Plan", "description": "Update a deep research plan by ID.", "operationId": "update_deep_research_plan", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "deep_research_plan_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Deep Research Plan Id" } }, { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeepResearchPlanUpdate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeepResearchPlanInDBBase" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "deep_research_plan" ], "summary": "Create Chat from Deep Research Plan (Experimental \ud83e\uddea)", "description": "Create a chat from a deep research plan.\n\nWARNING: This endpoint is experimental and its behavior may change without warning.", "operationId": "create_chat_from_deep_research_plan", "security": [ { "OAuth2PasswordBearer": [] } ], "parameters": [ { "name": "deep_research_plan_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Deep Research Plan Id" } }, { "name": "account_name", "in": "path", "required": true, "schema": { "type": "string", "description": "The name of the organization or account.", "title": "Account Name" }, "description": "The name of the organization or account." }, { "name": "session_id", "in": "cookie", "required": false, "schema": { "title": "Session Id", "type": [ "string", "null" ] } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatAPIResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } } }, "components": { "schemas": { "AgentName": { "type": "string", "enum": [ "user", "manager", "ghost", "email_agent", "query agent", "sql_query_agent", "planner_agent", "search_agent", "ssds_tool_agent", "predictive_model_agent", "vega_chart_agent", "file_search_agent", "web_search_agent", "pdf_agent", "research_planner_agent", "research_solver_agent", "research_solver_agent_for_execution", "research_summary_agent", "dataset_metadata_agent" ], "title": "AgentName", "description": "Agent names." }, "Body_login_access_token_api_v1_login_access_token_post": { "properties": { "username": { "type": "string", "title": "Username", "description": "The email address of the user to authenticate." }, "password": { "type": "string", "title": "Password", "description": "The password of the user to authenticate." }, "grant_type": { "title": "Grant Type", "description": "The grant type. Must be 'password' for this endpoint. If not provided, it defaults to 'password'.", "default": "password", "type": [ "string", "null" ] } }, "type": "object", "required": [ "username", "password" ], "title": "Body_login_access_token_api_v1_login_access_token_post" }, "Body_login_session_api_v1_login_session_post": { "properties": { "username": { "type": "string", "title": "Username", "description": "The email address of the user to authenticate." }, "password": { "type": "string", "title": "Password", "description": "The password of the user to authenticate." }, "grant_type": { "title": "Grant Type", "description": "The grant type. Must be 'password' for this endpoint. If not provided, it defaults to 'password'.", "default": "password", "type": [ "string", "null" ] } }, "type": "object", "required": [ "username", "password" ], "title": "Body_login_session_api_v1_login_session_post" }, "ChartData": { "properties": { "id": { "type": "string", "format": "uuid4", "title": "Id", "description": "The ID of the chart" }, "data": { "type": "string", "title": "Data", "description": "The data for the chart" } }, "type": "object", "required": [ "id", "data" ], "title": "ChartData" }, "ChatAPICreate": { "properties": { "chat_name": { "title": "Chat Name", "description": "The name of the chat. If one is not provided, the chat is auto-named based on the first message.", "type": [ "string", "null" ] }, "slack_id": { "title": "Slack Id", "description": "The ID of the Slack conversation associated with the chat.", "type": [ "string", "null" ] } }, "type": "object", "title": "ChatAPICreate", "description": "Payload for creating a chat.\n\nUser can optionally name the chat if desired." }, "ChatAPIResponse": { "properties": { "id": { "type": "string", "format": "uuid4", "title": "Id", "description": "The ID of the chat." }, "name": { "title": "Name", "description": "The name of the chat.", "type": [ "string", "null" ] }, "is_feedback_chat": { "type": "boolean", "title": "Is Feedback Chat", "description": "Whether the chat is a feedback chat or not." }, "created_at": { "type": "string", "format": "date-time", "title": "Created At", "description": "The time the chat was created." }, "last_modified_at": { "type": "string", "format": "date-time", "title": "Last Modified At", "description": "The time the chat was last modified. This includes adding messages." }, "creator": { "$ref": "#/components/schemas/UserBasicAPIResponse", "description": "The user who created the chat." }, "is_sensitive": { "title": "Is Sensitive", "description": "Whether the chat is sensitive or not. None indicates no information available.", "type": [ "boolean", "null" ] }, "is_valid": { "title": "Is Valid", "description": "Whether the chat is valid or not. None indicates no information available.", "type": [ "boolean", "null" ] }, "in_review": { "title": "In Review", "description": "Whether the chat is review or not. None indicates no information available", "type": [ "boolean", "null" ] } }, "type": "object", "required": [ "id", "name", "is_feedback_chat", "created_at", "last_modified_at", "creator" ], "title": "ChatAPIResponse", "description": "Response object containing information about a single chat." }, "ChatAPIResponsePage": { "properties": { "data": { "items": { "$ref": "#/components/schemas/ChatAPIResponse" }, "type": "array", "title": "Data", "description": "The list of `ChatAPIResponse` objects." }, "total": { "type": "integer", "title": "Total", "description": "The total number of chats. This may be greater than the number of chats returned." } }, "type": "object", "required": [ "data", "total" ], "title": "ChatAPIResponsePage", "description": "A list of chats used in a paginated response." }, "ChatAPIUpdate": { "properties": { "chat_name": { "type": "string", "maxLength": 255, "minLength": 1, "title": "Chat Name", "description": "The name of the chat. It must be at least 1 character long." } }, "type": "object", "required": [ "chat_name" ], "title": "ChatAPIUpdate", "description": "Payload for updating a chat with the API" }, "ChatsFilter": { "type": "string", "enum": [ "is_pinned", "is_by_user", "is_eval", "is_feedback", "all" ], "title": "ChatsFilter", "description": "Filter chats by." }, "ChatsSort": { "type": "string", "enum": [ "created_at", "last_modified_at", "creator_name", "name" ], "title": "ChatsSort", "description": "Sort chats by." }, "DMCreateRequest": { "properties": { "name": { "type": "string", "title": "Name", "description": "The display name of the dimension or metric." }, "description": { "title": "Description", "description": "A human-readable description of the dimension or metric.", "type": [ "string", "null" ] }, "expression": { "type": "string", "title": "Expression", "description": "The SQL expression or column for the dimension." }, "display_type": { "$ref": "#/components/schemas/DisplayTypeV3", "description": "The display type for the dimension (e.g., string, number, date).", "default": "unknown" } }, "type": "object", "required": [ "name", "expression" ], "title": "DMCreateRequest", "description": "Request body for creating a new dimension or metric in the knowledge layer." }, "DMResponse": { "properties": { "entity": { "$ref": "#/components/schemas/KnowledgeLayerEntityAPI", "description": "The entity associated with the context." }, "name": { "type": "string", "title": "Name", "description": "The display name of the dimension or metric." }, "description": { "title": "Description", "description": "A human-readable description of the dimension or metric.", "type": [ "string", "null" ] }, "expression": { "type": "string", "title": "Expression", "description": "The SQL expression or column for the dimension or metric." }, "display_type": { "$ref": "#/components/schemas/DisplayTypeV3", "description": "The display type for the dimension or metric." }, "state": { "$ref": "#/components/schemas/PublishStateAPI", "description": "The current state of the dimension or metric." }, "is_sensitive": { "type": "boolean", "title": "Is Sensitive", "description": "Whether the dimension or metric contains sensitive data." }, "last_updated_at": { "type": "string", "format": "date-time", "title": "Last Updated At", "description": "Timestamp when the dimension or metric's fields were last updated." } }, "type": "object", "required": [ "entity", "name", "description", "expression", "display_type", "state", "is_sensitive", "last_updated_at" ], "title": "DMResponse", "description": "A dimension or metric in the knowledge layer." }, "DMResponsePage": { "properties": { "data": { "items": { "$ref": "#/components/schemas/DMResponse" }, "type": "array", "title": "Data", "description": "The list of dimensions or metrics in the knowledge layer." }, "total": { "type": "integer", "title": "Total", "description": "The total number of dimensions or metrics in the knowledge layer." } }, "type": "object", "required": [ "data", "total" ], "title": "DMResponsePage", "description": "A page of DMResponses with the total number of elements in the db." }, "DMUpdateRequest": { "properties": { "name": { "title": "Name", "description": "The new display name of the dimension or metric.", "type": [ "string", "null" ] }, "description": { "title": "Description", "description": "The new description of the dimension or metric.", "type": [ "string", "null" ] }, "expression": { "title": "Expression", "description": "The new SQL expression or column for the dimension.", "type": [ "string", "null" ] }, "display_type": { "anyOf": [ { "$ref": "#/components/schemas/DisplayTypeV3" }, { "type": "null" } ], "description": "The new display type for the dimension." } }, "type": "object", "title": "DMUpdateRequest", "description": "Request body for updating an existing dimension or metric in the knowledge layer." }, "DMUpdateSensitivityRequest": { "properties": { "is_sensitive": { "type": "boolean", "title": "Is Sensitive", "description": "The new sensitivity state for the dimension or metric." } }, "type": "object", "required": [ "is_sensitive" ], "title": "DMUpdateSensitivityRequest", "description": "Request body for updating the sensitivity of a dimension or metric." }, "DMUpdateStateRequest": { "properties": { "state": { "$ref": "#/components/schemas/PublishStateAPI", "description": "The new state for the dimension or metric." } }, "type": "object", "required": [ "state" ], "title": "DMUpdateStateRequest", "description": "Request body for updating the state of a dimension or metric." }, "DataAssetAPI": { "properties": { "short_id": { "type": "string", "title": "Short Id", "description": "The short ID for the data asset." }, "name": { "type": "string", "title": "Name", "description": "The display name of the data asset." }, "description": { "title": "Description", "description": "The description of the data asset.", "type": [ "string", "null" ] }, "asset_type": { "$ref": "#/components/schemas/DataAssetTypeAPI" }, "connection_type": { "$ref": "#/components/schemas/DataAssetConnectionTypeAPI" }, "id": { "type": "string", "title": "Id", "description": "Use the `short_id` field instead.", "deprecated": true } }, "type": "object", "required": [ "short_id", "name", "description", "asset_type", "connection_type", "id" ], "title": "DataAssetAPI", "description": "A data asset within the application.\n\nA data asset is a referenceable entity that can contain data. This might be a\ndataset (also sometimes referred to as a Star Schema Data Source) or a report." }, "DataAssetAPIPage": { "properties": { "data": { "items": { "$ref": "#/components/schemas/DataAssetAPI" }, "type": "array", "title": "Data" }, "total": { "type": "integer", "title": "Total", "description": "The total number of data assets." } }, "type": "object", "required": [ "data", "total" ], "title": "DataAssetAPIPage", "description": "A page of data assets." }, "DataAssetConnectionTypeAPI": { "type": "string", "enum": [ "snowflake", "bigquery", "databricks", "redshift", "tableau", "mode", "unknown" ], "title": "DataAssetConnectionTypeAPI", "description": "The connection type of the data asset.", "x-enumDescriptions": { "bigquery": "A BigQuery data source. Only available for 'dataset' asset types.", "databricks": "A Databricks data source. Only available for 'dataset' asset types.", "mode": "A Mode report. Only available for 'report' asset types.", "redshift": "A Redshift data source. Only available for 'dataset' asset types.", "snowflake": "A Snowflake data source. Only available for 'dataset' asset types.", "tableau": "A Tableau report. Only available for 'report' asset types.", "unknown": "An unknown data source." } }, "DataAssetTypeAPI": { "type": "string", "enum": [ "dataset", "report" ], "title": "DataAssetTypeAPI", "description": "The type of data asset.", "x-enumDescriptions": { "dataset": "A collection of joinable tables and their associated dimensions and metrics. This is also often referred to as a dataset or a datasource within the application UI.", "report": "A report or dashboard such as Tableau or Mode." } }, "DataPage": { "properties": { "data": { "items": {}, "type": "array", "title": "Data", "description": "A list of objects where each object is a row. The keys are the column names and the value is the formatted value for that column." }, "display_types": { "additionalProperties": { "$ref": "#/components/schemas/DisplayTypeV3" }, "type": "object", "title": "Display Types", "description": "Mapping of column name to its display type." }, "raw_data": { "items": {}, "type": "array", "title": "Raw Data", "description": "The same as `data` except without formatting using the display types." }, "total": { "type": "integer", "title": "Total" } }, "type": "object", "required": [ "data", "display_types", "raw_data", "total" ], "title": "DataPage", "description": "Paginated data response." }, "DeepResearchPlanInDBBase": { "properties": { "account_id": { "type": "string", "format": "uuid4", "title": "Account Id" }, "creator_id": { "type": "string", "format": "uuid4", "title": "Creator Id" }, "question": { "type": "string", "title": "Question" }, "plan": { "$ref": "#/components/schemas/DeepResearchPlanSchema-Output" }, "id": { "type": "string", "format": "uuid4", "title": "Id" }, "sync_id": { "type": "string", "format": "uuid4", "title": "Sync Id" }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" }, "updated_at": { "type": "string", "format": "date-time", "title": "Updated At" } }, "type": "object", "required": [ "account_id", "creator_id", "question", "plan", "id", "sync_id", "created_at", "updated_at" ], "title": "DeepResearchPlanInDBBase", "description": "Base class to map Pydantic DeepResearchPlan to ORM." }, "DeepResearchPlanSchema-Input": { "properties": { "plan_title": { "type": "string", "title": "Plan Title", "description": "The title of the research plan. This is used to identify the plan." }, "plan_steps": { "items": { "$ref": "#/components/schemas/ResearchStep-Input" }, "type": "array", "title": "Plan Steps", "description": "The research plan as a list of main goals with distinct analytics questions to answer for each goal." }, "plan_goal": { "type": "string", "title": "Plan Goal", "description": "The main research goal. This is used to help generate the final report.", "default": "" } }, "type": "object", "required": [ "plan_title", "plan_steps" ], "title": "DeepResearchPlanSchema", "description": "Parameters for the verify plan tool." }, "DeepResearchPlanSchema-Output": { "properties": { "plan_title": { "type": "string", "title": "Plan Title", "description": "The title of the research plan. This is used to identify the plan." }, "plan_steps": { "items": { "$ref": "#/components/schemas/mlcore_web__schemas__deep_research_plan__ResearchStep-Output" }, "type": "array", "title": "Plan Steps", "description": "The research plan as a list of main goals with distinct analytics questions to answer for each goal." }, "plan_goal": { "type": "string", "title": "Plan Goal", "description": "The main research goal. This is used to help generate the final report.", "default": "" } }, "type": "object", "required": [ "plan_title", "plan_steps" ], "title": "DeepResearchPlanSchema", "description": "Parameters for the verify plan tool." }, "DeepResearchPlanUpdate": { "properties": { "sync_id": { "title": "Sync Id", "type": [ "string", "null" ] }, "question": { "title": "Question", "type": [ "string", "null" ] }, "plan": { "anyOf": [ { "$ref": "#/components/schemas/DeepResearchPlanSchema-Input" }, { "type": "null" } ] }, "created_at": { "title": "Created At", "type": [ "string", "null" ] }, "updated_at": { "title": "Updated At", "type": [ "string", "null" ] } }, "type": "object", "title": "DeepResearchPlanUpdate", "description": "Properties to use in CRUD for updating." }, "DeepResearchPlanVerifyParameters": { "properties": { "plan_title": { "type": "string", "title": "Plan Title", "description": "The title of the research plan. This is used to identify the plan." }, "plan_steps": { "items": { "$ref": "#/components/schemas/mlcore_web__mlcore__agents__v3__tools__deep_research_tools__ResearchStep" }, "type": "array", "title": "Plan Steps", "description": "The research plan as a list of main goals with distinct analytics questions to answer for each goal." }, "plan_goal": { "type": "string", "title": "Plan Goal", "description": "The main research goal. This is used to help generate the final report." } }, "additionalProperties": false, "type": "object", "required": [ "plan_title", "plan_steps", "plan_goal" ], "title": "DeepResearchPlanVerifyParameters", "description": "Parameters for the verify plan tool." }, "DisplayTypeV3": { "type": "string", "enum": [ "unknown", "text", "numeric", "date", "datetime", "boolean", "month", "week", "quarter", "day_of_week", "year", "year_quarter", "year_month", "year_week", "year_month_day", "country", "country_code", "continent", "continent_code", "region", "region_code", "lat_long", "zip_code", "id", "url", "email", "phone", "count", "float", "percent", "percent_decimal", "percent_standard", "feet", "meters", "square_feet", "square_meters", "currency_usd", "currency_gbp", "currency_eur", "currency_aud", "currency_usd_per_square_feet", "currency_usd_per_square_meters" ], "title": "DisplayTypeV3", "description": "Display type enum." }, "ExplanationAPIResponse": { "properties": { "response": { "type": "string", "title": "Response", "description": "The explanation response in markdown format." } }, "additionalProperties": true, "type": "object", "required": [ "response" ], "title": "ExplanationAPIResponse", "description": "Explanation API response.\n\nProvide the response to the /explain endpoints that explain why the model\ndid certain actions (e.g. why it generated the SQL that it did)." }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "InstructionState": { "type": "string", "enum": [ "pending", "in_progress", "completed" ], "title": "InstructionState", "description": "Enum for instruction status." }, "KnowledgeLayerContextAPI": { "properties": { "entity": { "$ref": "#/components/schemas/KnowledgeLayerEntityAPI", "description": "The entity associated with the context." }, "markdown": { "type": "string", "title": "Markdown", "description": "The markdown content of the context." }, "example_questions": { "items": { "$ref": "#/components/schemas/KnowledgeLayerLinkedQuestionAPI" }, "type": "array", "title": "Example Questions", "description": "The example questions associated with the context. If there are no related example questions, this field will be empty." }, "embedded_viz_url": { "title": "Embedded Viz Url", "description": "The URL of an embedded visualization/dashboard.", "type": [ "string", "null" ] }, "vega_spec": { "title": "Vega Spec", "description": "The vega spec of the chart.", "type": [ "string", "null" ] }, "table_id": { "title": "Table Id", "description": "The UUID ID of the table.", "type": [ "string", "null" ] }, "table_ssds_id": { "title": "Table Ssds Id", "description": "The UUID ID of the table's SSDS.", "type": [ "string", "null" ] }, "table_message_id": { "title": "Table Message Id", "description": "The UUID ID of the table's message.", "type": [ "string", "null" ] } }, "type": "object", "required": [ "entity", "markdown", "example_questions" ], "title": "KnowledgeLayerContextAPI", "description": "Knowledge layer entity response." }, "KnowledgeLayerEntityAPI": { "properties": { "type": { "$ref": "#/components/schemas/KnowledgeLayerEntityType", "description": "The type of the entity." }, "uuid": { "type": "string", "format": "uuid4", "title": "Uuid", "description": "The UUID ID of the entity." }, "short_id": { "type": "string", "title": "Short Id", "description": "The short ID of the entity." }, "id": { "type": "string", "format": "uuid4", "title": "Id", "description": "Deprecated field, use `uuid` instead.", "deprecated": true, "readOnly": true } }, "type": "object", "required": [ "type", "uuid", "short_id", "id" ], "title": "KnowledgeLayerEntityAPI", "description": "Knowledge layer entity." }, "KnowledgeLayerEntityType": { "type": "string", "enum": [ "dimension", "metric", "dataset", "tableau", "mode", "table", "chart" ], "title": "KnowledgeLayerEntityType", "description": "Knowledge layer entity type." }, "KnowledgeLayerLinkedQuestionAPI": { "properties": { "question": { "type": "string", "title": "Question" } }, "type": "object", "required": [ "question" ], "title": "KnowledgeLayerLinkedQuestionAPI" }, "MessageAPIResponse": { "properties": { "id": { "type": "string", "format": "uuid4", "title": "Id", "description": "The ID of the message. Note that if two messages have the same ID and response index, they are the same message even if the content differs. Prefer the newest message." }, "creator": { "anyOf": [ { "$ref": "#/components/schemas/UserBasicAPIResponse" }, { "type": "null" } ], "description": "The user who created the message. Note that this is only available for user messages." }, "response_index": { "type": "integer", "title": "Response Index", "description": "The index of the response. This is non-zero if a single agent message (one ID) has multiple responses.", "default": 0 }, "chat_id": { "type": "string", "format": "uuid4", "title": "Chat Id", "description": "The ID of the chat." }, "render_type": { "$ref": "#/components/schemas/RenderType", "description": "The type of rendering to use for the message.", "default": "STANDARD" }, "signal_type": { "anyOf": [ { "$ref": "#/components/schemas/SignalTypeAPI" }, { "type": "null" } ], "description": "The type of signal message. If this is None, then the message is not a signal message." }, "sending_agent": { "type": "string", "title": "Sending Agent", "description": "The agent that sent the message." }, "receiving_agent": { "title": "Receiving Agent", "description": "The agent that received the message.", "type": [ "string", "null" ] }, "timestamp": { "type": "string", "format": "date-time", "title": "Timestamp", "description": "The time the message was sent." }, "markdown": { "title": "Markdown", "description": "The markdown content of the message.", "type": [ "string", "null" ] }, "questions": { "title": "Questions", "description": "A list of suggested questions.", "type": [ "array", "null" ] }, "rephrased_user_question": { "title": "Rephrased User Question", "description": "The rephrased user question. Only available for user questions and used for feedback chat.", "type": [ "string", "null" ] }, "sql": { "title": "Sql", "description": "The SQL content of the message.", "type": [ "string", "null" ] }, "embedded_viz_url": { "title": "Embedded Viz Url", "description": "The URL of an embedded visualization/dashboard.", "type": [ "string", "null" ] }, "vega_spec": { "title": "Vega Spec", "description": "The Vega chart specification.", "type": [ "string", "null" ] }, "vega_chart_id": { "title": "Vega Chart Id", "description": "The ID of the Vega chart.", "type": [ "string", "null" ] }, "message_table_id": { "title": "Message Table Id", "description": "The ID of the table containing data associated with the message. The presence of this field indicates that the message contains a table.\n\nNote that this field is not actually used in the frontend, and the message ID should be used when retrieving the table data. This field will be removed in the future.", "type": [ "string", "null" ] }, "is_positive_feedback": { "title": "Is Positive Feedback", "description": "User provided thumbs up or down feedback.", "type": [ "boolean", "null" ] }, "is_positive_admin_feedback": { "title": "Is Positive Admin Feedback", "description": "Admin provided thumbs up or down feedback.", "type": [ "boolean", "null" ] }, "feedback_chat_id": { "title": "Feedback Chat Id", "description": "The feedback chat id associated with this message", "type": [ "string", "null" ] }, "is_last_user_message_for_feedback_chat": { "type": "boolean", "title": "Is Last User Message For Feedback Chat", "description": "Whether the (cloned) message is the last user message from the original user chat.", "default": false }, "is_admin_feedback_incorporated": { "title": "Is Admin Feedback Incorporated", "description": "Whether the admin feedback is incorporated into the system.", "type": [ "boolean", "null" ] }, "is_user_sensitive": { "title": "Is User Sensitive", "description": "Whether the message is manually marked sensitive by a user. If None, no information available.", "type": [ "boolean", "null" ] }, "is_dm_sensitive": { "title": "Is Dm Sensitive", "description": "Whether the message is system-computed as sensitive based on its dimensions/metrics. If None, no information available.", "type": [ "boolean", "null" ] }, "deep_research_plan": { "anyOf": [ { "$ref": "#/components/schemas/DeepResearchPlanVerifyParameters" }, { "type": "null" } ], "description": "The deep research plan. Only available for deep research agent messages." } }, "additionalProperties": false, "type": "object", "required": [ "id", "chat_id", "sending_agent", "timestamp" ], "title": "MessageAPIResponse", "description": "The API response corresponding to a message.\n\nThe intent of this class is to provide a unified message format for clients.\nTherefore every response can contain a number of fields and it is up to the client\nto render them accordingly." }, "MessageAPIResponsePage": { "properties": { "data": { "items": { "$ref": "#/components/schemas/MessageAPIResponse" }, "type": "array", "title": "Data" }, "total": { "type": "integer", "title": "Total" } }, "type": "object", "required": [ "data", "total" ], "title": "MessageAPIResponsePage", "description": "Paginated message response." }, "MessageAPISendV3": { "properties": { "message_text": { "title": "Message Text", "description": "The message that the user sent. To refer to a particular dataset, client should format it like a markdown link. For example, `[dataset_name](ds-dataset_id)`. Note that you need to ensure that the dataset ID is prefixed with `ds-`. The dataset id will be the short_id returned by the \"Get Data Assets for Account\" endpoint. Also, for the time being, we only support referring to datasets, not other asset types (e.g. reports). If the message is null or empty, then the message will be ignored. Sending an empty message is useful for pinging the system to get a current event stream.", "examples": [ "#[Sales](ds-12345678) How do my sales compare to last year?", "What are our most popular products?", "Can you show me a chart of sales by region?" ], "type": [ "string", "null" ] }, "chat_id": { "title": "Chat Id", "description": "The existing chat to send a message to. If not provided, a new chat will be created. Cannot be null if the message is null or empty.", "type": [ "string", "null" ] }, "allowed_agent_names": { "title": "Allowed Agent Names", "description": "The agents that are allowed to respond to this message. If null or not provided, then all agents are allowed to respond.", "type": [ "array", "null" ] }, "deep_research_mode": { "type": "boolean", "title": "Deep Research Mode", "description": "Experimental!! Please leave unset for production usage. Whether to use deep research mode.", "default": false } }, "type": "object", "required": [ "message_text" ], "title": "MessageAPISendV3", "description": "Payload for sending a message to a chat." }, "MessageUpdateAdminFeedbackAPI": { "properties": { "is_positive_admin_feedback": { "title": "Is Positive Admin Feedback", "description": "Whether or not to use this chat to improve system. TRUE for positive feedback, FALSE for negative feedback, or NULL to not to use to improve system.", "type": [ "boolean", "null" ] }, "is_user_sensitive": { "title": "Is User Sensitive", "description": "Whether or not the system should consider this feedback sensitive.", "type": [ "boolean", "null" ] }, "in_review": { "title": "In Review", "description": "Whether or not the system should consider this feedback as under review.", "type": [ "boolean", "null" ] } }, "type": "object", "title": "MessageUpdateAdminFeedbackAPI", "description": "Request body to update the message admin feedback." }, "MessageUpdateFeedbackAPI": { "properties": { "is_positive_feedback": { "title": "Is Positive Feedback", "description": "Whether or not the chat is correct. TRUE for thumbs up, FALSE for thumbs down, or NULL to remove the feedback.", "type": [ "boolean", "null" ] } }, "type": "object", "required": [ "is_positive_feedback" ], "title": "MessageUpdateFeedbackAPI", "description": "Request body to update the message feedback." }, "Provider": { "type": "string", "enum": [ "okta", "google" ], "title": "Provider" }, "PublishStateAPI": { "type": "string", "enum": [ "VERIFIED", "DEPRECATED" ], "title": "PublishStateAPI" }, "RenderType": { "type": "string", "enum": [ "NONE", "TEMPORARY", "SOFT", "STANDARD" ], "title": "RenderType", "description": "Enum for the render type of the message\n\nThese types are used to guide the client on how to render the message.", "x-enumDescriptions": { "NONE": "Do not render. Only to inform the client.", "SOFT": "Render softly. Should not be prominent.", "STANDARD": "Render as a standard message.", "TEMPORARY": "Render temporarily. Will be replaced by later messages." } }, "ResearchInstruction": { "properties": { "instruction": { "type": "string", "title": "Instruction", "description": "The instruction/question for the research step. Use markdown links with the prefixed-id to reference to datasets, columns, aggregations, etc. E.g. [column_name](col-column_id)" }, "instruction_id": { "type": "string", "title": "Instruction Id", "description": "UUID of the instruction. This is used to track the instruction and its progress." }, "status": { "$ref": "#/components/schemas/InstructionState", "description": "Status of the instruction. This is used to track the progress of the instruction.", "default": "pending" } }, "type": "object", "required": [ "instruction", "instruction_id" ], "title": "ResearchInstruction", "description": "Instruction with ID." }, "ResearchStep-Input": { "properties": { "section_header": { "type": "string", "title": "Section Header", "description": "The main goal for this research step as a high level header to present to the user." }, "instructions": { "items": { "$ref": "#/components/schemas/ResearchInstruction" }, "type": "array", "title": "Instructions", "description": "The list of analytics questions for the research step." } }, "type": "object", "required": [ "section_header", "instructions" ], "title": "ResearchStep" }, "SignalTypeAPI": { "type": "string", "enum": [ "REQUEST_INPUT", "REJECTED_INPUT" ], "title": "SignalTypeAPI", "description": "Enum for the signal type of the message.\n\nThese signals are used to inform the client about the state of the chat.", "x-enumDescriptions": { "REJECTED_INPUT": "Previously provided input was rejected.", "REQUEST_INPUT": "Request input from the user. It's typically the final message in a sequence." } }, "SuggestionAPI": { "properties": { "short_id": { "type": "string", "title": "Short Id", "description": "The short ID for the data asset." }, "asset_type": { "$ref": "#/components/schemas/DataAssetTypeAPI" }, "asset_name": { "type": "string", "title": "Asset Name", "description": "The display name of the data asset." }, "prompt": { "type": "string", "title": "Prompt", "description": "The suggested prompt to use with this asset." }, "agent_name": { "$ref": "#/components/schemas/AgentName", "description": "The agent used to answer this suggested prompt." }, "asset_id": { "type": "string", "title": "Asset Id", "description": "Use the `short_id` field instead.", "deprecated": true } }, "type": "object", "required": [ "short_id", "asset_type", "asset_name", "prompt", "agent_name", "asset_id" ], "title": "SuggestionAPI", "description": "A suggested prompt." }, "Token": { "properties": { "access_token": { "type": "string", "title": "Access Token" }, "token_type": { "type": "string", "title": "Token Type" } }, "type": "object", "required": [ "access_token", "token_type" ], "title": "Token", "description": "An access token." }, "UserBasicAPIResponse": { "properties": { "id": { "type": "string", "format": "uuid4", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "avatar": { "title": "Avatar", "type": [ "string", "null" ] } }, "type": "object", "required": [ "id", "name", "avatar" ], "title": "UserBasicAPIResponse", "description": "Basic information about a user from the API\n\nAttributes:\n id: The ID of the user.\n name: The name of the user.\n avatar: The URL of the user's avatar if they have one." }, "UserResponse": { "properties": { "id": { "type": "string", "format": "uuid4", "title": "Id", "description": "The ID of the user." }, "email": { "type": "string", "title": "Email", "description": "The user's email address. This is the user's unique identifier." }, "name": { "type": "string", "title": "Name", "description": "The user's name." }, "account_name": { "type": "string", "title": "Account Name", "description": "The name of the account the user is associated with." }, "role": { "$ref": "#/components/schemas/UserRole", "description": "The user's role in the account." } }, "type": "object", "required": [ "id", "email", "name", "account_name", "role" ], "title": "UserResponse", "description": "Information about the current user." }, "UserRole": { "type": "string", "enum": [ "USER", "ADMIN" ], "title": "UserRole", "description": "Roles that a user can have.", "x-enumDescriptions": { "ADMIN": "An account administrator. This user can leave admin feedback.", "USER": "A regular user." } }, "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" }, "mlcore_web__mlcore__agents__v3__tools__deep_research_tools__ResearchStep": { "properties": { "section_header": { "type": "string", "title": "Section Header", "description": "The main goal for this research step as a high level header to present to the user." }, "instructions": { "items": { "$ref": "#/components/schemas/ResearchInstruction" }, "type": "array", "title": "Instructions", "description": "The list of analytics questions for the research step." } }, "type": "object", "required": [ "section_header", "instructions" ], "title": "ResearchStep" }, "mlcore_web__schemas__deep_research_plan__ResearchStep-Output": { "properties": { "section_header": { "type": "string", "title": "Section Header", "description": "The main goal for this research step as a high level header to present to the user." }, "instructions": { "items": { "$ref": "#/components/schemas/ResearchInstruction" }, "type": "array", "title": "Instructions", "description": "The list of analytics questions for the research step." } }, "type": "object", "required": [ "section_header", "instructions" ], "title": "ResearchStep" } } } }