Skip to content

Latest commit

 

History

History
258 lines (213 loc) · 3.83 KB

File metadata and controls

258 lines (213 loc) · 3.83 KB

API Documentation

Authentication

All endpoints except /auth/login and /auth/register require JWT bearer authentication.

Register New User

POST /auth/register

Request Body:

{
  "username": "string (3-50 chars, alphanumeric + ._-)",
  "name": "string (max 100 chars)",
  "email": "valid email address",
  "password": "string (min 8 chars)",
  "inviteCode": "string (optional)"
}

Login

POST /auth/login

Request Body:

{
  "username": "string",
  "password": "string"
}

Both authentication endpoints return:

{
  "token": "JWT token",
  "user": {
    "id": "string",
    "username": "string",
    "name": "string",
    "email": "string"
  }
}

User Management

Get Current User Profile

GET /users/me

Update User Profile

PATCH /users/me

Request Body:

{
  "name": "string (max 100 chars)",
  "email": "string"
}

Change Password

PUT /users/me/password

Request Body:

{
  "currentPassword": "string",
  "newPassword": "string (min 8 chars)"
}

Tasks

List Tasks

GET /api/tasks

Returns array of TaskDTO objects.

Create New Task

Instantiate a new task but don't call the Agent yet. This allows for also adding documents to the task workspace prior to execution.

POST /api/tasks

Request Body:

{
  "message": "string"
}

Get Task Details

GET /api/tasks/{task_id}

Progress Task

Progress the task for one step. This call is synchronous and will return when the agent has progressed a single step. Check the boolean action.final to see if the agent expects the task to be completed or not.

You can keep progressing a task for as long as you need. You can provide additional instructions in between or can leave the message empty to just instruct the agent to keep progressing.

POST /api/tasks/{task_id}

Request Body:

{
  "message": "string" (optional)
}

List Task Steps

GET /api/tasks/{task_id}/steps

Upload Document to Task

POST /api/tasks/{task_id}/documents

Request Body: Multipart form data with file

Download Task Document

GET /api/tasks/{task_id}/documents/{document_id}

Document Management

List Documents

GET /api/documents

Returns array of RagDocumentDTO objects.

Upload New Document

POST /api/documents

Query Parameters:

  • title: string (required)
  • description: string (required)

Request Body: Multipart form data with file

Get Document Details

GET /api/documents/{documentId}

Delete Document

DELETE /api/documents/{documentId}

Get Document Chunks

GET /api/documents/{documentId}/chunks

Get Specific Chunk

GET /api/chunks/{chunkId}

Data Models

TaskDTO

{
  "created": "datetime",
  "completed": "datetime",
  "id": "string",
  "title": "string",
  "description": "string",
  "request": "string",
  "context": {
    "key": "value"
  }
}

StepDTO

{
  "input": "string",
  "action": {
    "name": "string",
    "parameters": {
      "key": "value"
    },
    "reasoning": "string",
    "final": "boolean"
  },
  "result": {
    "status": "string",
    "details": "object",
    "summary": "string",
    "error": "string",
    "message": "string"
  },
  "documents": [
    {
      "taskId": "string",
      "filename": "string",
      "metadata": {
        "key": "value"
      }
    }
  ]
}

RagDocumentDTO

{
  "id": "string",
  "filename": "string",
  "title": "string",
  "description": "string",
  "contentType": "string",
  "progress": "float"
}

RagChunkDTO

{
  "id": "string",
  "documentId": "string",
  "documentTitle": "string",
  "documentDescription": "string",
  "content": "string"
}