Skip to main content

API Reference

The ClarityQ API allows you to interact with ClarityQ programmatically using API keys. All endpoints require authentication via the X-API-Key header. Base URL: https://api.clarityq.ai

Authentication

Send your API key in the X-API-Key header. There are two kinds of keys:
  • A personal API key acts as you, with your role and your workspaces. Create one under Settings → API keys.
  • A service account key acts as a service account, which has its own role and workspaces. Admins create these under Organization Settings → API.
See API Keys and Service Accounts for how to create and manage them. Every endpoint takes a workspace ID in its URL, as product_id. To find yours, see Finding a Workspace ID. A call to a workspace the key can’t reach returns 403. A few rules apply to every key:
  • Role. The key’s role decides what it can do, as it does in the app. Get Prompt Usage and minting an embed token need the Admin role. Without it they return 403.
  • Chats. A key can read the status and summary of, and send feedback on, only its own chats. For a personal key, those are your chats. For a service account key, those are the service account’s chats. Any other chat ID returns 404.
  • Limits. Ask a Question returns 429 when the key reaches its daily prompt limit, or when a monthly usage limit is reached.

Endpoints

Ask a Question

Submit a natural-language question to the ClarityQ agent.

Get Conversation Status

Poll for the status of an ongoing conversation.

Get Conversation Summary

Retrieve the summary of a completed conversation.

Get Last Completed Task Run Summary

Get the summary of the last completed task run.

Get Prompt Usage

Pull org-wide prompt usage by product, broken down by user, origin and day.