Skip to content

Rest API

Sending a question (async)

POST
/api/v1/ai/async/query

Submit AI queries for asynchronous processing using the Unless API. This returns a questionId to retrieve the results later.

The async AI query endpoint allows you to submit questions for background processing, ideal for long-running queries or batch processing scenarios where immediate response is not required.

How it works

  1. Submit query: Send your question to /ai/async/query
  2. Get question ID: Receive a questionId immediately
  3. Retrieve results: Use the questionId with /ai/async/answer to get results when ready
x-api-key
required
string

Your API key from account settings.

x-user-email
required
string

The email address of your user.

x-account-id
required
string

The ID of your account. You can find this in the account settings.

x-website-id
required
string

The ID of the workspace you want to use.

object
query
required

The question you want to send to the AI.

string
sessionId
required

An unique identifier for the current session.

string
visitorId
required

An unique identifier for your visitor.

string
segmentId

Optional segment ID to search within for relevant content.

string
metadata

Optional metadata object displayed in the dashboard.

object
conversationName

In case you have multiple topics, you can give each a different name.

string
audienceId

An audienceId to use for content lookup.

string

Question accepted. Use questionId to poll for the answer.

object
questionId
required

Unique identifier for retrieving the query results later.

string format: uuid
Example
550e8400-e29b-41d4-a716-446655440000