Welcome to Lekana API
The Lekana API allows you to programmatically interact with our document processing engine. You can trigger workflows, check execution status, and retrieve processed data seamlessly from your own applications. Our API is built on RESTful principles, using standard HTTP methods and JSON for communication.
Authentication
To authenticate with the Lekana API, you must include your private API key in the `X-API-Key` header of every request. You can manage your API keys in the developer settings of your Lekana dashboard. Treat your API key as a secret—never share it or commit it to version control.
X-API-Key: YOUR_API_KEY Core Concepts
Workflows
A workflow is a sequence of actions defined in the Lekana editor. Each workflow has a unique ID and must be published before it can be triggered via the API.
Executions
When you run a workflow, an 'Execution' is created. This process is asynchronous. The API will return an `executionId` which you can use to poll for status or receive results via webhooks.
Run Workflow (File Upload)
Trigger a workflow by uploading document files directly.
Use this endpoint to upload files directly from your application. This endpoint requires a multipart/form-data request body containing the files and an optional message.
Headers
Body Parameters
The message or prompt to pass to the workflow.
One or more files to be processed by the workflow.
Request Example
curl -X POST https://api.lekana.dev/workflows/:workflow_id/run-with-files \
-H "X-API-Key: YOUR_API_KEY" \
-F "message=Analyze these documents" \
-F "files=@/path/to/document.pdf"Responses
{
"id": "exec_xyz789",
"status": "pending",
"message": "Files uploaded successfully"
}Error Codes
Lekana uses conventional HTTP response codes to indicate the success or failure of an API request.
| Code | Description |
|---|---|
| 400 Bad Request | The request was malformed or missing required parameters. |
| 401 Unauthorized | The API key is missing or invalid. |
| 404 Not Found | The requested workflow or resource does not exist. |