> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meibel.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> Complete API reference for the Meibel API

# API Reference

## Base URL

```
https://api.meibel.ai/v2
```

## Resources

### Agents

Create, manage, and publish AI agents

* `GET /agents` - List Agents
* `POST /agents` - Create Agent
* `GET /agents/{agent_id}` - Get Agent
* `PUT /agents/{agent_id}` - Update Agent
* `DELETE /agents/{agent_id}` - Delete Agent
* `POST /agents/{agent_id}/publish` - Publish Agent
* `GET /agents/{agent_id}/versions` - List Agent Versions

### AgentsSessions

Create, manage, and chat with agent sessions

* `POST /agents/name/{name}/sessions` - Create Session By Name
* `GET /agents/{agent_id}/sessions` - List Sessions
* `POST /agents/{agent_id}/sessions` - Create Session
* `POST /sessions/{session_id}/chat` - Send Chat Message
* `POST /sessions/{session_id}/chat/stream` - Send a chat message with file attachments and stream the response via SSE

### ArtifactSchemas

Define structured output schemas for agent artifacts

* `GET /artifact-schemas` - List Artifact Schemas
* `POST /artifact-schemas` - Create Artifact Schema
* `GET /artifact-schemas/{artifact_id}` - Get Artifact Schema
* `PUT /artifact-schemas/{artifact_id}` - Update Artifact Schema
* `DELETE /artifact-schemas/{artifact_id}` - Delete Artifact Schema

### Batches

Create and manage batch processing definitions

* `GET /batch-definitions` - List Batch Definitions
* `POST /batch-definitions` - Create Batch Definition
* `GET /batch-definitions/catalog-urn` - Get Batch Definition By Catalog Urn
* `GET /batch-definitions/id/{definition_id}` - Get Batch Definition By Id
* `PUT /batch-definitions/id/{definition_id}` - Update Batch Definition By Id
* `DELETE /batch-definitions/id/{definition_id}` - Delete Batch Definition By Id
* `GET /batch-definitions/id/{definition_id}/versions` - List Batch Definition Versions
* `POST /batch-definitions/id/{definition_id}/execute` - Execute Batch Definition

### Executions

Run, monitor, and manage batch executions

* `GET /batch-executions` - List Batch Executions
* `POST /batch-executions` - Create Batch Execution
* `GET /batch-executions/id/{execution_id}` - Get Batch Execution By Id
* `PUT /batch-executions/id/{execution_id}` - Update Batch Execution By Id
* `GET /batch-executions/id/{execution_id}/realtime-progress` - Get Batch Realtime Progress
* `POST /batch-executions/id/{execution_id}/retry-failed` - Retry Failed Items
* `POST /batch-executions/id/{execution_id}/cancel` - Cancel Batch Execution

### ConfidenceScoring

Track and analyze confidence scores

* `GET /confidence-scoring/job/{job_id}` - Get a scoring job
* `GET /confidence-scoring/jobs` - List scoring jobs
* `GET /confidence-scoring/summary/agent/{agent_name}` - Get agent scoring summary
* `GET /confidence-scoring/summary/agent/{agent_name}/session/{session_id}` - Get agent session scoring summary

### Datasources

Manage data source connections

* `GET /datasources` - List Datasources
* `POST /datasources` - Create Datasource
* `GET /datasources/{datasource_id}` - Get Datasource
* `PUT /datasources/{datasource_id}` - Update Datasource
* `DELETE /datasources/{datasource_id}` - Delete Datasource

### DataElements

Manage data elements within datasources

* `GET /datasources/{datasource_id}/data-elements/{data_element_id}` - Get Data Element
* `PUT /datasources/{datasource_id}/data-elements/{data_element_id}` - Update Data Element
* `GET /datasources/{datasource_id}/data-elements` - List Data Elements
* `POST /datasources/{datasource_id}/data-elements/search` - Search Data Elements

### Downloads

Export datasources as downloadable files

* `POST /datasources/{datasource_id}/downloads` - Create Download Job (async)
* `GET /datasources/{datasource_id}/downloads/{job_id}/progress` - Stream Download Progress
* `GET /datasources/{datasource_id}/downloads/{job_id}/file` - Download File
* `POST /datasources/{datasource_id}/downloads/process` - Process Download (sync)

### FileUploads

Upload and manage content files

* `GET /datasources/{datasource_id}/content` - List Content
* `POST /datasources/{datasource_id}/content` - Upload Content (async)
* `POST /datasources/{datasource_id}/content/process` - Upload Content (sync)
* `GET /datasources/uploads/{upload_id}/progress` - Stream Upload Progress

### Ingest

Trigger and monitor datasource ingestion

* `POST /datasources/{datasource_id}/trigger-ingest` - Trigger Ingest
* `GET /datasources/{datasource_id}/ingest-status` - Get Ingest Status

### Tables

Manage table and column descriptions for AI context

* `GET /datasources/{datasource_id}/tables` - List Tables
* `PUT /datasources/{datasource_id}/tables` - Update Table Descriptions
* `GET /datasources/{datasource_id}/tables/{table_name}/columns` - List Columns
* `PUT /datasources/{datasource_id}/tables/{table_name}/columns` - Update Column Descriptions

### Documents

Parse and transform documents into structured data

* `POST /documents` - Parse a document (async)
* `POST /documents/process` - Parse a document (sync)
* `GET /documents/{job_id}` - Get document parsing status
* `GET /documents/{job_id}/result` - Get parsed document result
* `GET /documents/{job_id}/children` - List child documents
* `GET /documents/{job_id}/trace` - Stream document parsing trace
* `POST /documents/transform` - Transform a document using AI extraction (sync)
* `POST /documents/transform/submit` - Submit a document transform (async)

### MetadataModelCatalog

Browse available metadata extraction models

* `GET /metadata-model-catalog` - List Metadata Model Catalog
* `GET /metadata-model-catalog/{model_id}` - Get Metadata Model Catalog Entry

### Sessions

View session details across agents

* `GET /sessions/{session_id}` - Get Session
* `GET /sessions/{session_id}/messages` - Get Session Messages

## Response Codes

| Code | Description           |
| ---- | --------------------- |
| 200  | Success               |
| 201  | Created               |
| 400  | Bad Request           |
| 401  | Unauthorized          |
| 403  | Forbidden             |
| 404  | Not Found             |
| 422  | Validation Error      |
| 429  | Rate Limited          |
| 500  | Internal Server Error |

<Note>
  The interactive API playground is available on each endpoint page. You can test API calls directly from the documentation.
</Note>
