---
title: "Submit Chat Explore Query"
method: POST
path: "/api/v1/chat-explore/new"
tags: ["Chat Explore"]
---

# Submit Chat Explore Query

`POST /api/v1/chat-explore/new`

Query Chat Explore through API. Takes in a list of messages and gives you the message Chat Explore sent back.

## Request body

- ChatExploreRequestPayload
  - `project_id` string, nullable — The project ID which you want to run a Chat Explore query against. Either this or dataset_id must be specified; if this is specified, custom instructions attached to the project will be provided as context to the query.
  - `dataset_id` string, nullable — The dataset ID which you want to run a Chat Explore query against. Either this or project_id must be specified.
  - `messages` APIChatMessage[], required — A list of messages to query Chat Explore with.
    - `role` 'user' | 'assistant', required
    - `content` string, required — The text content of this message.
    - `images` union[] — List of images for this message (potentially of length zero). May be exposed either as a base64 string or as stringified Plotly JSON, typically if the user requested it as such.
      - union
        - string
        - object
    - `table` object[], nullable — If there exists a table for this message, this will be set to a list of objects/records, where each record has a key of the column name and a value for that row's corresponding value for the column.
  - `chatContext` string — Anything you'd like Chat Explore to know about this application to provide better responses. For example: (1) This dataset is customer engagement data, (2) The units of the sales column are in millions, (3) The data is messy and contains typos
  - `chatInstructions` string

## Response `201`

Successful Response

- APITaskStartedResponse
  - `task_id` string, required — The ID of the task that was started. This is generally queryable at a nearby `/status` endpoint to get the current status of the task.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/akk/apis/fastapi.md) · [All operations](https://skmtc.net/akk/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/akk/fastapi/revisions/6662a407c637/schema)
