Confluye
Endpoints

Research

Create, list, read, and cancel durable Research runs over HTTP.

Endpoints under /api/v1/research. Envelope: api-contracts.v1. Conceptual behavior: Research.

There are no HTTP routes for web.search, web.read, or web.crawl. Those are preview capabilities only.

Endpoints

MethodPathDescription
GET/api/v1/researchList runs
POST/api/v1/researchCreate / dedupe a run (202/200)
GET/api/v1/research/{id}Get one run
POST/api/v1/research/{id}/cancelRequest cancel

POST create and cancel require Idempotency-Key.

List

GET /api/v1/research

QueryNotes
statusOptional. One of queued, running, succeeded, failed, canceled. Else 400.
cursorOpaque { createdAt, id } base64url. Invalid: 400.
limitOptional integer 1100. Omitted → store default 25.

data: { runs, nextCursor }. Dates on the run and sources are ISO-8601.

Create

POST /api/v1/research

{
  "query": "release notes",
  "sourceUrls": ["https://example.com/notes"],
  "limits": { "maxPages": 4, "maxDomains": 2 }
}

First insert: 202. Idempotent replay (same key and payload): 200, Idempotency-Replayed: true, deduplicated: true, dispatch: { dispatched: false }.

data:

FieldNotes
runSerialized run (may already be failed if direct dispatch ran)
deduplicatedboolean
dispatch{ dispatched: true, queued: boolean, mode: "direct" \| "bullmq" } or { dispatched: false }

Run id: research_ + first 32 hex of sha256(workspaceId + NUL + Idempotency-Key).

Zod/parse failures: 400 validation_failed. Idempotency payload clash: 409 conflict.

Get and cancel

GET /api/v1/research/{id}{ run }.

POST /api/v1/research/{id}/cancel{ run }. Missing id: 404. Terminal statuses are not converted to 409; the current row is returned.

Run object

FieldType / values
idstring
workspaceIdstring
createdByIdstring (API key user)
querystring
sourceUrlsstring[]
limitsobject (stored limits only; may be {})
statusqueued | running | succeeded | failed | canceled
resultDocumentIdstring or null (research_document_{id} on success)
errorstring or null
cancelRequestedAtISO or null
startedAtISO or null
finishedAtISO or null
createdAtISO
updatedAtISO
sourcesarray of snapshots

Source fields: id, runId, canonicalUrl, title, fetchedAt, sha256, snapshotText, snapshotFileId (null unless a caller stored one; the executor does not), createdAt.

Gap: this API does not return the result document body. With the Prisma store, read it via Documents using resultDocumentId.

Error map

HTTPerror.codeTypical cause
400idempotency_key_invalidMissing/invalid key on create or cancel
400validation_failedBody, status, cursor, or limit
401authentication_requiredBearer
403authorization_failedNon-workspace key
404resource_not_foundRun not in this workspace
409conflictIdempotency key reused with different payload

Create/execute failures that the store records as failed still return 202 with that run when dispatch ran in-process; they are not mapped to 500 by the route.

Next steps