AIx2 V2 API Documentation (2.1.1)

Download OpenAPI specification:Download

user

Endpoints for user registration and login

User login

Logs in an existing user using email/password. Returns a JWT-like token on success.

Request Body schema: application/json
required
email
required
string <email>
password
required
string <password>

Responses

Request samples

Content type
application/json
{
  • "email": "",
  • "password": ""
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Login successful.",
  • "data": {
    }
}

user-summary

Endpoint for retrieving aggregated user data

Retrieve the user's content summary

Fetches the user's active projects (not deleted), templates, reports, documents, and basic user info in a single response.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "User content retrieved successfully.",
  • "data": {
    }
}

project

Endpoints for creating, listing, and deleting Projects

Create a new project

Creates a new project under the authenticated user. Requires a JSON body with name, entity_type, entity_name.

Authorizations:
bearerAuth
Request Body schema: application/json
required
name
required
string
entity_type
required
string
entity_name
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "Test Dec 25",
  • "entity_type": "asset",
  • "entity_name": "Amazon"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Soft-delete a project

Sets deleted_at to the current time. The project remains in the database but is considered inactive.

Authorizations:
bearerAuth
path Parameters
projectId
required
integer

The project's ID

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

thread

Endpoints for retrieving thread queries or deleting a thread

Retrieve all queries of a thread

Returns all queries belonging to a specific thread, provided the user owns the project that the thread is part of.

Authorizations:
bearerAuth
path Parameters
threadId
required
integer

The thread ID

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Thread queries retrieved successfully.",
  • "data": [
    ]
}

Delete a thread and orphaned queries

  1. Removes references to this thread from any reports. 2. Deletes the thread-query relations. 3. Deletes any queries that no longer belong to any thread. 4. Finally removes the thread itself.
Authorizations:
bearerAuth
path Parameters
threadId
required
integer

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

mlops

Endpoints for querying documents, uploading, or parsing

Run a single query on one or more documents

Given a list of document IDs and a query text, the system returns an AI-generated answer, categorization, etc.

Authorizations:
bearerAuth
Request Body schema: application/json
required
documents
required
Array of integers
project_id
required
integer
query
required
string
category
string
sub_category
string
type
string

Example: 'os'

length
string

Example: 'short' or 'long'

Responses

Request samples

Content type
application/json
{
  • "documents": [
    ],
  • "project_id": 1,
  • "query": "Is the preferred stock redeemable?",
  • "category": "",
  • "sub_category": "",
  • "type": "os",
  • "length": "short"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Upload a document (multipart/form-data)

Receives one or more files. Files are associated with the user and a specific Project. Then they're parsed or stored internally.

Authorizations:
bearerAuth
path Parameters
projectId
required
integer
Request Body schema: multipart/form-data
required
files
Array of strings <binary> [ items <binary > ]

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Run multiple queries based on a saved report template

Given a report ID and a list of question objects, the system returns multiple AI-generated answers, grouped or enumerated by the original questions.

Authorizations:
bearerAuth
Request Body schema: application/json
required
report_id
required
integer
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "report_id": 40,
  • "questions": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Delete one or more documents from a project

Expects a JSON body with an array of document_ids to remove from the specified Project.

Authorizations:
bearerAuth
path Parameters
projectId
required
integer
Request Body schema: application/json
required
document_ids
required
Array of integers

Responses

Request samples

Content type
application/json
{
  • "document_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Request S3 presigned URLs for upload

Given a list of filenames, returns presigned URLs to allow uploading directly to S3.

Authorizations:
bearerAuth
path Parameters
projectId
required
integer
Request Body schema: application/json
required
file_names
required
Array of strings

Responses

Request samples

Content type
application/json
{
  • "file_names": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Parse files from S3

Receives an array of S3 URLs. The system will parse and store them as documents linked to the specified project.

Authorizations:
bearerAuth
path Parameters
projectId
required
integer
Request Body schema: application/json
required
required
Array of objects

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Test direct upload to S3 (Presigned URL)

Direct PUT to S3 with the presigned query parameters. This endpoint is auto-generated by AWS or your backend presigning logic.

query Parameters
AWSAccessKeyId
string
Signature
string
content-type
string
Expires
string
Request Body schema: application/pdf
required
string <binary>

Responses

template

Endpoints for creating, updating, and deleting Templates

Create a new template

Creates a template under the current user.

Authorizations:
bearerAuth
Request Body schema: application/json
required
name
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "t back"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Replace all questions in a template

Deletes existing questions for the template, then inserts the provided list of new questions.

Authorizations:
bearerAuth
path Parameters
templateId
required
integer
Request Body schema: application/json
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "questions": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Retrieve questions of a template

Authorizations:
bearerAuth
path Parameters
templateId
required
integer

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Delete a template

Authorizations:
bearerAuth
path Parameters
templateId
required
integer

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

report

Endpoints for creating, querying, and deleting Reports

Create a new report

Can create either a "thread-based" or "template-based" report, based on the supplied body. - If type=thread, you can attach threads. - If type=template, attach a template_id.

Authorizations:
bearerAuth
Request Body schema: application/json
required
template_id
integer or null
name
required
string
type
required
string

Either 'thread' or 'template'

status
required
string
project_id
required
integer
thread_ids
Array of integers
sources
object

Optional source structure, e.g. {web: false, documents: [11]}

Responses

Request samples

Content type
application/json
Example
{
  • "name": "Sample unified thread",
  • "type": "thread",
  • "status": "finished",
  • "thread_ids": [
    ],
  • "project_id": 6
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Retrieve queries for a report

Authorizations:
bearerAuth
path Parameters
reportId
required
integer

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Retrieve threads in a thread-based report

Only valid if the report's type is "thread". Otherwise, returns an error.

Authorizations:
bearerAuth
path Parameters
reportId
required
integer

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Delete a report

Authorizations:
bearerAuth
path Parameters
reportId
required
integer

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Parse Markdown to PDF

Accepts Markdown in the request body (text/markdown or text/plain) and returns a PDF or some form of processed output.

Request Body schema:
required
string

Responses

Request samples

Content type
# Sample Markdown
This is a document in **markdown** format.
...

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

question-bank

Endpoints for user-specific question bank management

Add a question (or multiple) to a user's question bank

Expects a list of question objects with optional category/sub-category.

Authorizations:
bearerAuth
Request Body schema: application/json
required
Array
question
required
string
category
string
sub_category
string

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Get all user's questions

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Delete one or more user questions by ID

Authorizations:
bearerAuth
Request Body schema: application/json
required
question_ids
required
Array of integers

Responses

Request samples

Content type
application/json
{
  • "question_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}

Edit a single user question

Authorizations:
bearerAuth
path Parameters
questionId
required
integer
Request Body schema: application/json
required
question
string
category
string
sub_category
string

Responses

Request samples

Content type
application/json
{
  • "category": "New category2",
  • "sub_category": "New subcategory",
  • "question": "How much revenue does Google have?"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Operation succeeded.",
  • "data": { }
}