Konto Login Register

Alice API Documentation

Welcome to the current Alice API documentation. Only actively supported endpoints are documented here for this release.

Authentication

All API requests must be authenticated using your Organization's API credentials. You can generate these keys in the Organization Admin Panel.

Headers

Include the following headers with every request:

Header Description Example
X-API-KEY Your public Access Key ak_a1b2c3d4...
X-API-SECRET Your private Secret Key sk_9z8y7x6w...

GET /api/external/test/

Test your authentication credentials and retrieve basic organization info.

Response Example
{
  "message": "Authentication successful",
  "organization": "Acme Corp",
  "tier": "Enterprise"
}

GET /api/v1/rows/

Retrieve a paginated list of all saved rows (insights) for your organization.

Parameters
Parameter Type Description
page integer Page number (default: 1)
q string Search query (filters provider, topic, content, commercial rating, source, etc.)
Response Example
{
  "rows": [
    {
      "id": 123,
      "anbieter": "Microsoft",
      "thema": "Licensing Update",
      "date": "2025-10-15",
      "created_by": "john.doe"
    }
  ],
  "count": 50,
  "has_next": true,
  "next_page": 2
}

GET /api/v1/rows/<id>/

Retrieve full details, including AI analysis and specific fields like commercial rating and source passages.

Response Example
{
  "id": 123,
  "anbieter": "Microsoft",
  "thema": "Licensing Update",
  "eindeutige_id": "MSG-2025-001",
  "bewertung_kommerziell": "High Impact",
  "vorteil_nachteil_detail": "Price increase of 15% effective next year.",
  "datum_kommunikation": "2025-10-01",
  "datum_inkrafttretens": "2026-01-01",
  "quellenpassus": "Source: Official Blog Post...",
  "details_markdown": "## Detailed Analysis...",
  "enhanced_information": "## AI Summary...",
  "created_at": "2025-10-15T10:30:00Z",
  "created_by": "john.doe"
}

PUT / PATCH /api/v1/rows/<id>/

Update an existing row's content. All fields are optional (partial update).

Payload (JSON)
Field Type Description
anbieter string Provider name (e.g. "SAP")
thema string Short topic or subject
eindeutige_id string Unique Identifier (e.g. "ID-123")
bewertung_kommerziell string Commercial rating (e.g. "Neutral", "Critical")
vorteil_nachteil_detail string Detailed description of pros/cons
datum_kommunikation string Date of communication
datum_inkrafttretens string Effective date
quellenpassus string Source text or excerpt
details_markdown string Full content in Markdown format
Response Example
{
  "message": "Row updated",
  "id": 123
}

DELETE /api/v1/rows/<id>/

Permanently delete a specific row.

Response Example
{
  "message": "Row deleted successfully"
}

POST /api/request/

Start a chat request asynchronously. The endpoint returns immediately with conversation and chat session IDs. Use the status endpoint for polling until the response is completed.

Payload
Field Type Description
prompt string Required. The user instruction or question.
context_row_ids array[int] List of Row IDs to include as context for the AI.
model_type string 'standard' or 'pro' (default: 'standard')
chat_session_id int Optional. Reuse an existing chat session. If omitted, ALICE creates a new session.
Response Example
{
    "status": "started",
    "conversation_id": 731,
    "chat_session_id": 88,
    "estimated_duration_seconds": 65,
    "message": "Analyse läuft im Hintergrund..."
}
Polling Endpoint

GET /api/task_status/<conversation_id>/

Completed Response Example
{
    "status": "completed",
    "id": 731,
    "chat_session_id": 88,
    "response": "Hier ist die Analyse...",
    "sources": [],
    "new_rows": [],
    "token_balance": 120,
    "tokens_used": 5,
    "is_question": false
}

GET /api/chats/list/

Returns a compact list of recent chat sessions for the current user.

Response Example
{
    "sessions": [
        {
            "id": 88,
            "title": "Lieferantenrisiken Q1",
            "updated_at": "2026-03-09T09:40:00Z",
            "messages_count": 6,
            "latest_prompt": "Welche Risiken siehst du ..."
        }
    ]
}

GET /api/chats/<session_id>/

Loads the full message timeline for one chat session.

Response Example
{
    "ok": true,
    "session": {"id": 88, "title": "Lieferantenrisiken Q1"},
    "messages": [
        {"role": "user", "content": "Frage 1", "id": 731},
        {"role": "assistant", "content": "Antwort 1", "id": 731, "sources": []}
    ]
}

POST /api/sentinel/create/

Creates a new "Sentinel" routine based on an existing row. This sets up a recurring automated check (monthly) for the supplier or topic in the specified row.

Payload (JSON)
Field Type Description
row_id int Required. The ID of the row to base the sentinel on.
Response Example
{
  "status": "ok",
  "routine_id": 42
}

SESSION AUTH Workflow API

Workflow endpoints are available for signed-in users via browser session (not via X-API-KEY/X-API-SECRET).

Method Endpoint Description
GET /api/workflows/list/ Returns workflow list payload including KPIs and card map data.
GET /api/workflows/create/context/ Returns creation context payload (memberships, defaults, helper metadata).
POST /api/workflows/create/ Creates a new workflow definition from API-first payload.
GET /api/workflows/<workflow_id>/payload/ Returns details for one workflow (cards, runs, metadata).
POST /workflows/<workflow_id>/start/ Starts a workflow run (token-based; uses configured deep-dive-equivalent cost).
GET /api/workflows/runs/<run_id>/status/ Returns live run status for progress polling.
GET /api/workflows/runs/<run_id>/payload/ Returns full run payload including cards and report data.