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

# API Introduction

> External API documentation for integrating with Chamelio

# Chamelio External API

The Chamelio External API provides programmatic access to core platform functionality, enabling you to:

* **Retrieve organization information** - Access details about your organization and configuration
* **Manage documents in Core** - Programmatically upload documents and update their attributes
* **Manage workflows** - List, initiate, and monitor workflow execution
* **Control tasks** - Get task status, approve, cancel, and manage task operations
* **Handle files** - Download files and documents associated with workflows
* **Receive webhooks** - Subscribe to real-time event notifications for documents, workflows, and tasks
* **Integrate with your systems** - Connect Chamelio with your existing tech stack

## Base URL

All API requests should be made to:

```
https://platform.chamelio.ai
```

## Authentication

The External API uses API key authentication. All requests must include a valid API key in the request header.

### API Key Header

Include your API key in every request using the `X-API-Key` header:

```bash theme={null}
X-API-Key: ca_your_api_key_here
```

### API Key Format

API keys follow the format: `ca_<base64url_encoded_string>`

Example: `ca_xYz123AbCdEfGhIjKlMnOpQrStUvWxYz`

### Authentication Errors

The API will return a `401 Unauthorized` status code with the following error messages:

| Error                      | Description                                        |
| -------------------------- | -------------------------------------------------- |
| `API key required`         | The `X-API-Key` header is missing from the request |
| `Invalid API key`          | The provided API key does not exist in our system  |
| `API key is inactive`      | The API key has been deactivated                   |
| `API key has been revoked` | The API key has been permanently revoked           |
| `API key has expired`      | The API key has passed its expiration date         |

## Available Endpoints

### Organization

<Card title="Get Organization Info" icon="building" href="/api-reference/endpoint/org-info">
  Retrieve your organization details and configuration
</Card>

### Core

<Card title="Upload Document" icon="upload" href="/api-reference/endpoint/core/upload">
  Upload documents to Core for processing
</Card>

<Card title="Update File Attributes" icon="pen-to-square" href="/api-reference/endpoint/core/update-attribute">
  Update or add metadata attributes on an existing document
</Card>

### Workflows

<Card title="List Workflows" icon="diagram-project" href="/api-reference/endpoint/workflows/list">
  Retrieve all available workflows for your organization
</Card>

<Card title="Get Workflow Schema" icon="sitemap" href="/api-reference/endpoint/workflows/get-schema">
  Get the complete schema for a specific workflow version
</Card>

<Card title="Initiate Workflow" icon="play" href="/api-reference/endpoint/workflows/initiate">
  Start a new workflow task instance with specified variables
</Card>

### Tasks

<Card title="Get Task" icon="clipboard-check" href="/api-reference/endpoint/tasks/get">
  Retrieve the current status and details of a workflow task
</Card>

<Card title="Cancel Task" icon="xmark" href="/api-reference/endpoint/tasks/cancel">
  Cancel a running or pending workflow task
</Card>

<Card title="Approve Task" icon="stamp" href="/api-reference/endpoint/tasks/approve">
  Submit approval or rejection decision for a task
</Card>

<Card title="Get Approval Details" icon="magnifying-glass" href="/api-reference/endpoint/tasks/approval-details">
  Retrieve approval details, eligible approvers, and pending variables for a task
</Card>

<Card title="Initiate Signature" icon="signature" href="/api-reference/endpoint/tasks/initiate-sign">
  Start the signature collection process for a task
</Card>

<Card title="List Task Files" icon="folder-open" href="/api-reference/endpoint/tasks/list-files">
  Retrieve all files associated with a workflow task
</Card>

<Card title="Download Step Document" icon="file-arrow-down" href="/api-reference/endpoint/tasks/download-document">
  Download a document generated by a specific workflow step
</Card>

<Card title="Get Latest Negotiation Versions" icon="file-contract" href="/api-reference/endpoint/tasks/latest-negotiation-versions">
  Retrieve the latest version of each negotiation document on a step
</Card>

<Card title="Get Signed Documents" icon="file-signature" href="/api-reference/endpoint/tasks/signed-documents">
  Retrieve all signed documents associated with a workflow task
</Card>

### Files

<Card title="Download File" icon="download" href="/api-reference/endpoint/files/download">
  Download a file by its unique file ID
</Card>

### Webhooks

<Card title="Webhooks Overview" icon="webhook" href="/api-reference/webhooks/introduction">
  Subscribe to real-time event notifications for documents, workflows, and tasks
</Card>

## Getting Started

1. **Obtain an API key** - Generate an API key through the Chamelio web application
2. **Test authentication** - Make a test request to `/users/org-info` to verify your API key
3. **Start integrating** - Use the available endpoints to build your integration

## Support

For questions about the API or integration support, contact our team at [support@chamelio.ai](mailto:support@chamelio.ai).
