The same brain, inside your own tools
Your portal, your CRM, your intranet, your bot. Call SupaCortex over HTTPS and get back passages or a cited answer from the projects your key is allowed to read.
- Scoped, revocable API keys
- Cited answers as JSON
- Search costs no credits
What is the SupaCortex API?
The SupaCortex API is an HTTPS interface to a workspace's knowledge. /v1/search returns the most relevant passages for a query; /v1/answer returns a written answer with numbered citations, or says there is not enough evidence; /v1/ingest/documents adds or updates content from your own systems. Requests are made with an API key and the workspace's sub-domain header. Each key has scopes, is limited to chosen projects, and can be revoked at any time.
- Scopes: search:read, answer:read, ingest:write, chat:write, drafts:write and identity:resolve.
- Keys are limited to the projects you select - or all of them.
- The secret is shown once and stored only as a hash.
- Answers report a status: answer found, needs information, or insufficient evidence.
- Optional filters by category and by customer.
- Errors are RFC 7807 problem documents with a stable code.
Ask, and get the sources with the answer
Every citation names the document, the section and the passage, and links to the source page when it has one - so your UI can show where the answer came from.
When nothing relevant is found, the status says so and no answer is invented. Your code can then fall back to a contact form or a person.
curl -X POST https://api.supacortex.com/v1/answer \
-H "X-API-Key: sck_live_..." \
-H "sub-domain: acme" \
-H "Content-Type: application/json" \
-d '{ "project": "help-centre",
"question": "How do I add a second admin?" }'
{
"Success": true,
"Data": {
"Status": "answer_found",
"Answer": "Open Settings > Users, choose Add user and pick the Admin role [1]...",
"Citations": [
{ "N": 1, "Title": "Managing users", "Section": "Roles",
"Url": "https://help.acme.example/users#roles" }
],
"Grounded": true
}
}
Shortened response.
Endpoints
Every endpoint takes the project by its key and returns JSON.
POST /v1/search
The best passages for a query, with title, section, snippet, score and source link. Hybrid vector and full-text search. 0 credits.
POST /v1/answer
A written answer from the passages it found, with checked citations and a status. 1 credit per answer.
POST /v1/ingest/documents
Push text or a file from your own system. Upserted by your own reference, so updates replace rather than duplicate.
/v1/chat
The chat engine behind the widget, for your own front end: sessions, follow-ups and your connector's lookups for a verified user.
/v1/drafts
Reply drafts for a help desk ticket, asynchronous with signed callbacks. See reply drafts.
GET /v1/whoami
Check a key: its name, its scopes and the projects it may use. Handy for a "Test connection" button.
Keys you can hand out without worrying
Least privilege by default
A key for the portal search box should not be able to push documents. Each key gets exactly what it needs.
- Pick scopes per key: search, answer, ingest, chat, drafts, identity lookup.
- Limit a key to one or more projects; a project it may not use looks like one that does not exist.
- The secret is shown once at creation and stored as a hash.
- Last-used time on every key, and revocation that takes effect on the next request.
Two things to get in
Every request needs the key and your workspace's sub-domain header - so a key found in a log is not enough.
- A wrong key, a wrong workspace and a revoked key all get the same refusal - nothing is revealed.
- Customer-tagged documents are only searched when that customer's id is in the request.
- If the plan has lapsed, the API stops answering; your documents stay where they are.
- Model and search outages are reported as errors with a code, never as a made-up answer.
Related
Questions people ask before they start
Get a trial workspace and an API key, and call it from your own code.
Book a 30-minute demo on your own documents. We set up a 14-day trial workspace for you - no credit card, no setup fee.
Questions first? Email info@greatdevelopers.com or call +91 8585953085.