Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.powabase.ai/llms.txt

Use this file to discover all available pages before exploring further.

The Copilot API provides an AI-assisted workflow builder. Create a copilot session linked to a workflow, describe what you want in natural language, and the copilot generates the workflow graph. You can iterate through multiple chat turns to refine the workflow, then save a snapshot to apply the generated graph.

Common Patterns

Create a copilot session with a workflow_id, send messages via the chat endpoint (streaming SSE), and save good suggestions with the snapshot endpoint. Each chat message can produce a new version of the workflow graph. The copilot maintains conversation context within a session.

POST /api/copilot/sessions

Create a copilot session for a workflow.
{ "workflow_id": "wf-uuid" }
requests.post(f"{BASE_URL}/api/copilot/sessions", headers=headers, json={"workflow_id": wf_id})

GET /api/copilot/sessions

Get session by workflow_id.
workflow_id
string
required
Workflow ID
requests.get(f"{BASE_URL}/api/copilot/sessions?workflow_id={wf_id}", headers=headers)

DELETE /api/copilot/sessions/

Delete a copilot session.
id
string
required
Session ID
requests.delete(f"{BASE_URL}/api/copilot/sessions/{session_id}", headers=headers)

GET /api/copilot/sessions//messages

Get copilot conversation history.
id
string
required
Session ID
requests.get(f"{BASE_URL}/api/copilot/sessions/{session_id}/messages", headers=headers)

POST /api/copilot/sessions//messages//snapshot

Save the copilot’s workflow suggestion as a snapshot.
id
string
required
Session ID
mid
string
required
Message ID
requests.post(f"{BASE_URL}/api/copilot/sessions/{session_id}/messages/{message_id}/snapshot", headers=headers)

POST /api/copilot/sessions//chat

Send a message and stream the copilot response (SSE).
id
string
required
Session ID
{ "message": "Build a workflow that..." }
requests.post(f"{BASE_URL}/api/copilot/sessions/{session_id}/chat", headers=headers, json={"message": "Build a workflow that..."}, stream=True)

GET /api/copilot/settings/model

Get copilot model configuration.
requests.get(f"{BASE_URL}/api/copilot/settings/model", headers=headers)

PUT /api/copilot/settings/model

Set copilot model.
{ "model": "gpt-4o" }
requests.put(f"{BASE_URL}/api/copilot/settings/model", headers=headers, json={"model": "gpt-4o"})

Error Responses

StatusCodeDescription
404session_not_foundNo copilot session exists with the given ID