---
title: "Execute Natural Language Query (Moby AI)"
method: POST
path: "/orcabase/api/moby"
tags: ["Data Out"]
---

# Execute Natural Language Query (Moby AI)

`POST /orcabase/api/moby`

Process natural language prompts to retrieve data. This endpoint interprets user-provided questions and generates SQL queries to fetch the desired results. The response returns the query results in a JSON format, grouped based on the question.

## Request body

- object
  - `shopId` string, required — The shop domain for which you are requesting data (e.g., `example.myshopify.com`).
  - `question` string, required — The natural language input describing the data you want to query. The AI interprets this to generate SQL or directly retrieve relevant data.

## Response `200`

The natural language query was successfully processed, and the response contains the query results in JSON format, grouped by `question` and its respective `answer`.

- object
  - `isError` boolean — Indicates whether any errors occurred in processing the request.
  - `error` string, nullable — An optional error field if an error occurred.
  - `responses` object[] — List of responses to the provided questions.
    - `question` string — The original user-provided question.
    - `answer` object — The computed response with structured data. In practice, this object can contain arbitrary fields depending on the question, so it's declared using additionalProperties.
    - `isError` boolean — Indicates whether an error occurred in processing the query.
    - `errorMsg` string, nullable — An optional message describing why an error occurred.
    - `assistant` string — Internal assistant instructions and metadata (hidden from users).
  - `assistantConclusion` string — Summary provided by the assistant regarding the processed queries.

## Other responses

- `400` — Invalid request due to missing or malformed parameters.
- `403` — Access forbidden due to missing or invalid access token.
- `429` — Rate limit exceeded. Too many requests were sent in a short period.
- `500` — Internal server error. An unexpected issue occurred on the server.

---

[API](https://skmtc.net/triplewhale/apis/triple-whale-api.md) · [All operations](https://skmtc.net/triplewhale/apis/triple-whale-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/triplewhale/triple-whale-api/revisions/96b22ac9b5a7/schema)
