POST
/
query
curl --request POST \
  --url https://api.askmy.biz/query \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "job_id": "vI2wMzZwuf2l1hkYYO_Fb",
  "namespace": "avamo_fr",
  "query": "<string>",
  "schema": {
    "type": "object",
    "properties": {
      "product_categories": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "product_type": {
              "type": "string"
            },
            "reasoning": {
              "type": "string"
            },
            "source_urls": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "prompt": "<string>",
  "k": 5
}'
{
  "job_id": "<string>",
  "namespace": "<string>",
  "query": "<string>",
  "answer": {},
  "metadata": {
    "processing_time_ms": 123
  }
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Body

application/json
job_id
string

Unique identifier for the crawl job. At least one of job_id or namespace must be provided.

Example:

"vI2wMzZwuf2l1hkYYO_Fb"

namespace
string

Namespace identifier, useful to reference a specific crawl using your internal identifier. At least one of job_id or namespace must be provided.

Example:

"avamo_fr"

query
string

The query to execute against the vector store

schema
object

A JSON schema defining the structure of extracted data. Read more about it on OpenAI's Structured Outputs documentation

Example:
{
  "type": "object",
  "properties": {
    "product_categories": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "product_type": { "type": "string" },
          "reasoning": { "type": "string" },
          "source_urls": {
            "type": "array",
            "items": { "type": "string" }
          }
        }
      }
    }
  }
}
prompt
string

Custom prompt to guide the query processing

k
integer
default:5

Number of similar vectors to retrieve

Response

200
application/json
Query executed successfully
job_id
string
namespace
string
query
string
answer
object

This is a JSON object containing the extracted data based on the provided schema.

metadata
object