API reference
- Base URL
https://api.cogniweave.com.au- Authentication
- All
/api/*endpoints (except the public lead form) require a Bearer token. Sign in to CogniWeave to obtain your access token, then send it asAuthorization: Bearer <access_token>. Requests are automatically scoped to your workspace. - Content type
application/json, except file upload which usesmultipart/form-data.
Making requests
Send your bearer token in the Authorization header. Here is the same agent query in two flavours:
curl https://api.cogniweave.com.au/api/agent/query \
-H "Authorization: Bearer $COGNIWEAVE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"question": "What are the payment terms in the Acme contract?"}'const res = await fetch("https://api.cogniweave.com.au/api/agent/query", {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ question: "What are the payment terms in the Acme contract?" }),
});
const data = await res.json();Tenancy & isolation
Every CogniWeave account is its own isolated tenant. Your access token identifies your tenant, and every API request is automatically scoped to it — you can only read and write data that belongs to your own tenant, and there is no cross-tenant access.
The tenant your token belongs to is returned by GET /api/me as the tenant object (its id, slug, name, and your role within it). All Files, Ingestion jobs, Search, Agent, and Workspace settings endpoints operate only within your tenant. Data uploaded under one account is never visible to another.
Health
/healthLiveness and version.
curl https://api.cogniweave.com.au/health{
"ok": true,
"version": "0.3.0",
"control_plane": true
}Identity
/api/meThe current user, their workspace, and role.
curl https://api.cogniweave.com.au/api/me \
-H "Authorization: Bearer $TOKEN"{
"user": { "id": "uuid", "email": "you@example.com" },
"tenant": {
"id": "uuid",
"slug": "default",
"name": "Default",
"role": "owner"
},
"is_platform_admin": false
}role is one of: owner, admin, member, viewer. tenant may be null if no workspace is linked.
Files
/api/files/uploadUpload one or more files (multipart/form-data, field name "files"). Accepted extensions: .eml, .msg, .mbox, .pdf, .docx, .doc, .txt, .md, .rtf, .csv, .xlsx, .pptx, .png, .jpg, .jpeg, .webp, .tiff, .html, .json.
curl -X POST https://api.cogniweave.com.au/api/files/upload \
-H "Authorization: Bearer $TOKEN" \
-F "files=@report.pdf"{
"job_id": "uuid",
"file_ids": ["uuid"]
}/api/filesList files in your workspace.
curl https://api.cogniweave.com.au/api/files \
-H "Authorization: Bearer $TOKEN"Response: array of File objects (see shape below).
/api/files/{id}Get one file.
curl https://api.cogniweave.com.au/api/files/FILE_ID \
-H "Authorization: Bearer $TOKEN"Response: File object.
/api/files/{id}Delete a file.
curl -X DELETE https://api.cogniweave.com.au/api/files/FILE_ID \
-H "Authorization: Bearer $TOKEN"{ "ok": true }/api/files/{id}/reprocessRe-run ingestion for a file.
curl -X POST https://api.cogniweave.com.au/api/files/FILE_ID/reprocess \
-H "Authorization: Bearer $TOKEN"{ "job_id": "uuid" }/api/files/{id}/download-url?expires_in=600Get a temporary download URL.
curl "https://api.cogniweave.com.au/api/files/FILE_ID/download-url?expires_in=600" \
-H "Authorization: Bearer $TOKEN"{
"url": "https://...",
"expires_in": 600
}{
"id": "uuid",
"filename": "report.pdf",
"source_type": "pdf",
"status": "success",
"uploaded_at": "ISO-8601",
"processed_at": "ISO-8601 | null",
"chunk_count": 12,
"ocr_used": false,
"parent_id": "uuid | null",
"size_bytes": 84213,
"warnings": [],
"error": null
}source_type enum: pdf, email, image, docx, csv, xlsx, pptx, html, txt, json, other.
status enum: queued, processing, success, failed, skipped.
Ingestion jobs
/api/ingestion/jobsList recent ingestion jobs.
curl https://api.cogniweave.com.au/api/ingestion/jobs \
-H "Authorization: Bearer $TOKEN"Response: array of Job objects (see shape below).
/api/ingestion/jobs/{id}Get one job.
curl https://api.cogniweave.com.au/api/ingestion/jobs/JOB_ID \
-H "Authorization: Bearer $TOKEN"Response: Job object.
{
"id": "uuid",
"status": "success",
"total": 1,
"succeeded": 1,
"failed": 0,
"current_step": null,
"created_at": "ISO-8601",
"finished_at": "ISO-8601 | null",
"file_ids": ["uuid"],
"errors": []
}status enum: queued, running, success, failed, partial.
Search
/api/searchDirect hybrid retrieval over your memory.
curl -X POST https://api.cogniweave.com.au/api/search \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "string", "top_k": 20}'{
"query": "string",
"top_k": 20
}top_k is optional.
{
"hits": [
{
"unit_id": "uuid",
"file_id": "uuid",
"file_title": "report.pdf",
"source_type": "pdf",
"snippet": "…matched text…",
"final_score": 0.82,
"semantic_score": 0.79,
"lexical_score": 0.4,
"symbolic_match": false,
"page_number": 3,
"date": "ISO-8601 | null"
}
]
}Agent
/api/agent/queryAsk a question; get a cited answer composed from your memory.
curl -X POST https://api.cogniweave.com.au/api/agent/query \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"question": "string", "include_citations": true}'{
"question": "string",
"include_citations": true
}{
"answer": "…answer text with [1] style citations…",
"citations": [
{
"unit_id": "uuid",
"final_score": 0.82,
"source_file_id": "uuid",
"snippet": "…",
"file_title": "report.pdf",
"page_number": 3
}
],
"follow_ups": ["…suggested question…"],
"limitations": "null or a note when memory is insufficient"
}Workspace settings
/api/settings/workspaceGet workspace settings.
curl https://api.cogniweave.com.au/api/settings/workspace \
-H "Authorization: Bearer $TOKEN"{
"ocr_enabled": true,
"ocr_language": "eng",
"chunk_size": 800,
"chunk_overlap": 120
}/api/settings/workspaceUpdate workspace settings.
curl -X PUT https://api.cogniweave.com.au/api/settings/workspace \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"ocr_enabled": true, "ocr_language": "eng", "chunk_size": 800, "chunk_overlap": 120}'{
"ocr_enabled": true,
"ocr_language": "eng",
"chunk_size": 800,
"chunk_overlap": 120
}Send any subset of the fields above. Response: the updated settings object.
Lead capture (public)
/api/public/leadsPublic contact form; no authentication. Rate limited to 5 requests per minute per IP.
curl -X POST https://api.cogniweave.com.au/api/public/leads \
-H "Content-Type: application/json" \
-d '{"first_name": "string", "last_name": "string", "email": "string", "company": "string", "phone": "optional", "job_title": "optional", "message": "optional", "plan_interest": "optional"}'{
"first_name": "string",
"last_name": "string",
"email": "string",
"company": "string",
"phone": "optional",
"job_title": "optional",
"message": "optional",
"plan_interest": "optional"
}{ "ok": true, "lead_id": null }Errors
All errors return JSON of the form { "detail": "message" }.
| Status | Meaning |
|---|---|
| 400 | invalid request |
| 401 | missing or expired token |
| 403 | no workspace, or not permitted |
| 404 | not found |
| 429 | too many requests |
| 500 | server error |