Confluye
Endpoints

Confluye Command

Enqueue, poll, confirm, cancel, and schedule Confluye Command jobs (legacy fluxus-command paths).

All routes below keep the path segment fluxus-command. That is a compatibility name. JSON errors and UI copy say Confluye Command. Artifacts: Command artifacts.

Two HTTP families:

FamilyAuthSuccess shape
/api/fluxus-commandSessionBare { job }, send payload, etc.
/api/v1/fluxus-command/jobsWorkspace API keyapi-contracts.v1 envelope
/api/v1/fluxus-command/schedulesAny valid API keyBare { schedules } / { schedule }

Session endpoints

MethodPathStatusNotes
POST/api/fluxus-command201Same send as chat without idempotency or attachmentFileIds
GET/api/fluxus-command/jobs/{id}200{ threadId, plan, job, result?, error?, attempt?, retryOfJobId? } or chat-message fallback
POST/api/fluxus-command/jobs/{id}/confirm200Body { confirmationId }
POST/api/fluxus-command/jobs/{id}/cancel200{ job }
POST/api/fluxus-command/jobs/{id}/retry202New job { job, queued }
GET/api/fluxus-command/schedules200{ schedules }
POST/api/fluxus-command/schedules201{ schedule }

workspaceId query (jobs) or body (send/schedules) defaults to the session workspace. Membership required. Send/confirm/cancel/retry use action create (Cannot create chat threads|command schedules for another workspace.). GET job/schedules use access.

Empty send message: 400 Message is required. Missing job: 404 Confluye Command job not found (confirm: ... or not awaiting confirmation). Other transition failures: 409 with the thrown message.

After same-origin and session authorization checks pass, confirmation validation and lifecycle failures carry an errorCode next to error. Earlier request-integrity and authorization failures retain their own error envelopes and may omit errorCode.

StatuserrorCodeWhen
400request_malformedMissing, non-string, or blank confirmationId
404confirmation_not_foundJob without plan, unknown id, or a confirmation that never resumed this job. A single-use confirmation that was already consumed settles the job to failed and the response carries it, so Retry can issue a fresh confirmation
409confirmation_mismatchAnother user's job, or an id that belongs to a different confirmation
409confirmation_expiredThe 300 s window closed; the response also carries the settled job (blocked)
409confirmation_consumedConsumed concurrently and the job never resumed (rare; a normal double click is 200)
409execution_failedThe confirmed plan failed; the job is failed and the response carries it. The message is opaque and the raw exception stays in the server log
500internal_errorUnexpected failure with no settled failed job; opaque message, no raw internal exception

After an unexpected 500 or a lost response (network drop before any body), poll GET /api/fluxus-command/jobs/{id} (session) or GET /api/v1/fluxus-command/jobs/{id} (API key) to reconcile before deciding recovery. A 200 or a typed 409 with a settled job already establishes the outcome. v1 confirm failures use the envelope in Errors (v1 jobs); the per-cause errorCode and optional job payload above are the session-endpoint contract.

TTL when issued through Command: 300 seconds. Confirmation is single-use, but a replay of the same confirmationId after it resumed the job (double click, retried request) answers 200 with the current job. GET /api/fluxus-command/jobs/{id} settles an expired confirmation into a recoverable blocked job on read; the worker also sweeps stale confirmations every scheduler tick so unattended threads are released.

No Idempotency-Key on session Command send/confirm/cancel/retry/schedules.

v1 job endpoints

Workspace API key only. 401 authentication_required / 403 authorization_failed (same messages as Files). Query workspaceId on list is ignored; isolation is the key. Viewer keys receive a workspace-safe.v1 job projection containing lifecycle metadata only. Keys with workspace.secret.read or workspace.write retain the full job contract.

MethodPathStatusIdempotency
GET/api/v1/fluxus-command/jobs200 { jobs, nextCursor }No
POST/api/v1/fluxus-command/jobs202 { job }Required
GET/api/v1/fluxus-command/jobs/{id}200 { job }No
POST/api/v1/fluxus-command/jobs/{id}/confirm200 { job }Required
POST/api/v1/fluxus-command/jobs/{id}/cancel200 { job }Required
POST/api/v1/fluxus-command/jobs/{id}/artifacts201 { job }Required
POST/api/v1/fluxus-command/jobs/{id}/artifacts/{fileId}/complete200 { job }Required

There is no v1 retry route.

List

Query: threadId optional, cursor optional (job id of the last item on the previous page), limit optional default 50, integer 1–100. Bad limit/cursor: 400 request_malformed (limit must be between 1 and 100 or Confluye Command cursor is invalid for this workspace and thread.).

Order: thread sequence desc when present, otherwise store order. nextCursor is the last job id on the page, or null.

Create

{
  "threadId": "existing-thread-id",
  "message": "Query incidents",
  "assistantContext": "optional",
  "aiProvider": "optional",
  "aiModel": "optional",
  "attachmentFileIds": ["ready-file-id"]
}

threadId and message must be non-empty strings. attachmentFileIds if present must be unique non-empty strings. Else 400 request_malformed (threadId, message and valid attachmentFileIds are required.).

Does not append a user chat message. Job id is a random UUID. FIFO: if the thread already has an active job, the new row stays queued. Ready attachments are validated then bound (423 if not ready). Files service is not touched when the array is empty.

Confirm

{ "confirmationId": "cnf_…" }. Failures use the v1 error envelope below (409 conflict for an expired, consumed, mismatched or failed confirmation); the per-cause errorCode and job payload are a session-endpoint contract (see above). TTL when issued through Command: 300 seconds. Confirmation is single-use, but a replay of the same confirmationId after it resumed the job (double click, retried request) answers 200 with the current job. The worker sweeps stale confirmations every scheduler tick, so an unattended thread is released as a recoverable blocked job.

Cancel

Queued jobs use FIFO cancelQueued (releases the thread slot). Otherwise the store cancels non-terminal jobs. Terminal cancel: 409. Unknown: 404.

Job object (public)

FieldNotes
idSession sends use command_ + UUID; v1 create uses UUID
planIdSet after planning
statusqueued | running | waiting_confirmation | succeeded | failed | canceled | blocked
tracesPer-action tool traces
confirmation{ id, expiresAt } while waiting
progress{ runId?, state, message, events } (events empty if no live buffer)
attachmentsSerialized ready file refs
artifactsPublished outputs
createdAt / updatedAtISO-8601

Session GET may also return plan, result (content, actions, citations, ragMode), error, attempt, retryOfJobId. Each citation may include optional runId as an explicit run target; when present, clients open Logs for that run. documentId remains the document target for knowledge and other resources. Legacy run citations may carry only documentId with knowledgeBaseName: "Runs" and a run_… id. If the durable row is gone, it falls back to the assistant message that still embeds fluxusCommandJob.

Schedules

{
  "title": "Morning failures",
  "prompt": "summarize yesterday's failed runs",
  "cron": "0 8 * * *",
  "timezone": "UTC",
  "threadId": "optional",
  "workspaceId": "session-only"
}

Blank title/prompt: 400 Schedule title is required. / Schedule prompt is required. Invalid cron/timezone fails in nextRunFromCron as 400. Default timezone UTC. Created enabled: true.

Serialized schedule: id, workspaceId, createdById, title, prompt, cron, timezone, enabled, optional threadId, nextRunAt, lastRunAt, runCount, createdAt, updatedAt.

v1 GET/POST: 401 if no bearer; personal/copilot keys are accepted. No idempotency. No envelope. No HTTP update/delete.

Due runner (not these routes): claims due rows, writes fluxusCommandScheduleRun, dispatches sendWorkspaceChatMessage with the stored prompt.

Errors (v1 jobs)

HTTPerror.codeCause
400idempotency_key_invalidMissing/invalid key on mutations
400request_malformedBody, limit, cursor
401authentication_requiredBearer
403authorization_failedNon-workspace key
404resource_not_foundJob / artifact
409conflictIllegal transition, confirm consume
409idempotency_replay_mismatchSame key, different body
423conflictFile not ready

Gaps

  • Session send is a second entry point beside /api/chat without idempotency or attachments.
  • v1 create requires a pre-existing threadId and does not write the user line.
  • No v1 retry; session retry only from failed or canceled.
  • v1 GET job returns { job } only (no plan/result wrapper used by the session GET).
  • Schedule HTTP is create/list only; v1 schedule auth is weaker than v1 jobs.

Next steps