import os
from pathlib import Path
from eigenpal import EigenpalClient
client = EigenpalClient(api_key=os.environ["EIGENPAL_API_KEY"])
# Run a workflow with a file input (multipart upload, no base64).
result = client.workflows.executions.run_and_wait(
"extract-invoice",
input={"contract": Path("contract.pdf")},
)
print(result["finished"], result["output"])client
├── run
├── rerun
├── agents
│ ├── list
│ ├── get
│ ├── create
│ ├── update
│ ├── list_files
│ ├── put_file
│ ├── upload_files
│ ├── versions
│ └── email_triggers
│ ├── list
│ ├── get
│ ├── create_alias
│ ├── delete_alias
│ ├── update
│ └── update_alias
├── workflows
│ ├── list
│ ├── get
│ ├── versions
│ └── executions
│ └── run_and_wait
├── runs
│ ├── list
│ ├── get
│ ├── artifacts
│ │ ├── list
│ │ ├── download
│ │ └── download_zip
│ ├── cancel
│ ├── compare
│ ├── comparison
│ │ └── get
│ ├── connect
│ ├── definition
│ ├── expected
│ │ ├── list
│ │ ├── copy_output
│ │ ├── delete
│ │ ├── download
│ │ ├── rename
│ │ └── upload
│ ├── feedback
│ │ ├── get
│ │ ├── clear
│ │ ├── resolve
│ │ └── update
│ ├── files
│ │ ├── list
│ │ ├── delete
│ │ └── upload
│ └── trace
│ └── get
├── source
│ ├── decrypt_secrets
│ ├── encrypt_secrets
│ ├── lockfile
│ ├── raw
│ ├── releases
│ └── repository
└── automations
└── sync
Start runs with client.run(...) and create a new run from a previous snapshot with client.rerun(...).
Run inspection and artifact/feedback/file mutation lives under client.runs.*, which maps to /api/v1/runs.
client.runs.artifacts.* lists and downloads artifacts for both workflow and agent runs. Output artifacts live under output/; workflow outputs may include stepName, and agent diagnostics use root paths such as trace.jsonl, issues.md, and eigenpal.lock. client.runs.files.* remains the DB-backed workflow file surface for input management and structured file listings.
client.workflows.executions.run_and_wait remains a workflow-specific helper because it triggers a workflow and then polls the canonical runs API until completion.
import os
from eigenpal import EigenpalClient
client = EigenpalClient(
api_key=os.environ["EIGENPAL_API_KEY"],
# For self-hosted deployments:
base_url=os.environ.get("EIGENPAL_BASE_URL"),
)The constructor argument always wins; the env var is a fallback so scripts don't have to write api_key=os.environ["EIGENPAL_API_KEY"] explicitly.
| Option | Type | Default | Description |
|---|---|---|---|
api_key |
str |
os.environ["EIGENPAL_API_KEY"] |
Bearer key from the dashboard. |
base_url |
str |
os.environ.get("EIGENPAL_BASE_URL") or default |
API host. Set to your deployment for self-hosted. |
timeout_seconds |
float |
60.0 |
Per-request timeout. |
verify_ssl |
bool |
True |
Disable for self-signed dev hosts. |
GET /api/v1/agents/:agentId/files
List or download agent source files
List or read agent source files from Git.
Path parameters
| Name | Type | Description |
|---|---|---|
agent_id |
str |
Agent id or slug |
Query parameters
| Name | Type | Description |
|---|---|---|
path |
str |
(optional) |
prefix |
str |
(optional) |
ref |
str |
(optional)Git ref (default main) |
Response
// AnyPUT /api/v1/agents/:agentId/files
Upload one agent file (deprecated)
Agent source is Git-backed. Use Git push or the builder instead.
Path parameters
| Name | Type | Description |
|---|---|---|
agent_id |
str |
Agent id or slug |
Query parameters
| Name | Type | Description |
|---|---|---|
path |
str |
(optional) |
prefix |
str |
(optional) |
ref |
str |
(optional)Git ref (default main) |
Request body
// dict[str, Any]POST /api/v1/agents/:agentId/files
Upload agent files (deprecated)
Agent source is Git-backed. Use Git push or the builder instead.
Path parameters
| Name | Type | Description |
|---|---|---|
agent_id |
str |
Agent id or slug |
Request body
// dict[str, Any]GET /api/v1/agents/:agentId
Get an agent
Returns one agent by id or slug.
Path parameters
| Name | Type | Description |
|---|---|---|
agent_id |
str |
Agent id or slug |
Query parameters
| Name | Type | Description |
|---|---|---|
include |
str |
(optional)Comma-separated optional sections, e.g. files,dataset |
Response
// GetAgentResponsePATCH /api/v1/agents/:agentId
Update an agent
Updates mutable agent metadata and configuration.
Path parameters
| Name | Type | Description |
|---|---|---|
agent_id |
str |
Agent id or slug |
Request body
// PatchAgentBodyResponse
// PatchAgentResponsePATCH /api/v1/agents/:agentId/triggers/email/:emailId
Update an agent email alias
Updates an email trigger alias for one agent.
Path parameters
| Name | Type | Description |
|---|---|---|
agent_id |
str |
Agent id or slug |
email_id |
str |
Email trigger alias id |
Request body
// dict[str, Any]Response
// dict[str, Any]DELETE /api/v1/agents/:agentId/triggers/email/:emailId
Delete an agent email alias
Revokes an email trigger alias for one agent.
Path parameters
| Name | Type | Description |
|---|---|---|
agent_id |
str |
Agent id or slug |
email_id |
str |
Email trigger alias id |
Response
// dict[str, Any]GET /api/v1/agents/:agentId/triggers/email
Get an agent email trigger
Returns email trigger configuration and aliases for one agent.
Path parameters
| Name | Type | Description |
|---|---|---|
agent_id |
str |
Agent id or slug |
Response
// dict[str, Any]PATCH /api/v1/agents/:agentId/triggers/email
Update an agent email trigger
Enables or disables the email trigger for one agent.
Path parameters
| Name | Type | Description |
|---|---|---|
agent_id |
str |
Agent id or slug |
Request body
// dict[str, Any]Response
// dict[str, Any]POST /api/v1/agents/:agentId/triggers/email
Create an agent email alias
Creates an email trigger alias for one agent.
Path parameters
| Name | Type | Description |
|---|---|---|
agent_id |
str |
Agent id or slug |
Request body
// dict[str, Any]Response
// dict[str, Any]GET /api/v1/agents/:agentId/versions
List agent Git versions
List Git release versions for an agent.
Path parameters
| Name | Type | Description |
|---|---|---|
agent_id |
str |
Agent id or slug |
Response
// ListAgentVersionsResponseGET /api/v1/agents
List agents
List agents with pagination.
Query parameters
| Name | Type | Description |
|---|---|---|
search |
str |
(optional)Substring match against agent fields |
slug |
str |
(optional)Return a single agent by slug |
limit |
int |
(optional) |
offset |
int |
(optional) |
include_archived |
bool |
(optional) |
Response
// ListAgentsResponsePOST /api/v1/agents
Create an agent
Create an agent and scaffold its Git source package.
Request body
// CreateAgentBodyResponse
// CreateAgentResponseGET /api/v1/agents/triggers/email
List agent email triggers
Lists email trigger aliases for the authenticated organization.
Response
// dict[str, Any]POST /api/v1/automations/:automation/sync
Sync an automation from latest source
Reconciles lightweight automation metadata from the latest released Git source package. This does not enqueue executions.
Path parameters
| Name | Type | Description |
|---|---|---|
automation |
str |
Response
// AutomationSyncResponsePOST /api/v1/runs
Start a run
Start a run. Send JSON or multipart/form-data.
Query parameters
| Name | Type | Description |
|---|---|---|
version |
str |
(optional)Release or git ref. Defaults to latest. |
wait_for_completion |
int |
(optional)Seconds to wait before returning (max 600). Omit for async. |
Request body
// RunStartBodyResponse
// RunStartResponseGET /api/v1/runs
List runs
List workflow and agent runs with cursor pagination.
Query parameters
| Name | Type | Description |
|---|---|---|
type |
str |
(optional) |
source |
str |
(optional) |
status |
str |
(optional) |
trigger |
str |
(optional) |
triggered_by |
str |
(optional) |
source_ref |
str |
(optional) |
batch_id |
str |
(optional) |
example_id |
str |
(optional) |
example_id_contains |
str |
(optional) |
from |
str |
(optional) |
to |
str |
(optional) |
created_after |
str |
(optional) |
created_before |
str |
(optional) |
completed_after |
str |
(optional) |
completed_before |
str |
(optional) |
cursor |
str |
(optional) |
offset |
int |
(optional) |
limit |
int |
(optional) |
ids |
str |
(optional) |
Response
// RunsListResponseGET /api/v1/runs/:id/artifacts/:path
Download run artifact
Download one artifact by path.
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
|
path |
str |
GET /api/v1/runs/:id/artifacts
List run artifacts
List downloadable artifact paths for a run.
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Run id |
Response
// RunArtifactsResponsePOST /api/v1/runs/:id/cancel
Cancel run
Cancel a queued run or request cancellation of an in-flight run.
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Response
// RunCancelResponseGET /api/v1/runs/:id/comparison
Get run comparison
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Response
// dict[str, Any]POST /api/v1/runs/:id/connect
Connect to live run
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Response
// dict[str, Any]GET /api/v1/runs/:id/definition
Get run definition snapshot
Workflow definition snapshot captured when the run was created. Workflow runs only; agent runs return not_found.
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Run id |
Response
// RunDefinitionResponseGET /api/v1/runs/:id/expected/:filename
Download expected artifact file
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
|
filename |
str |
PATCH /api/v1/runs/:id/expected/:filename
Rename expected artifact file
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
|
filename |
str |
Request body
// dict[str, Any]Response
// dict[str, Any]DELETE /api/v1/runs/:id/expected/:filename
Delete expected artifact file
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
|
filename |
str |
GET /api/v1/runs/:id/expected
Get run expected artifacts
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Response
// dict[str, Any]POST /api/v1/runs/:id/expected
Create or update expected artifacts
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Request body
// dict[str, Any]Response
// dict[str, Any]GET /api/v1/runs/:id/feedback
Get run feedback
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Response
// dict[str, Any]PATCH /api/v1/runs/:id/feedback
Update run feedback
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Request body
// RunFeedbackRequestResponse
// dict[str, Any]DELETE /api/v1/runs/:id/feedback
Clear run feedback
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Response
// dict[str, Any]GET /api/v1/runs/:id/files-zip
Download run output files zip
Download agent run output files as a zip.
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Query parameters
| Name | Type | Description |
|---|---|---|
files |
str |
(optional) |
token |
str |
(optional) |
DELETE /api/v1/runs/:id/files/:fileId
Delete run input file
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
|
file_id |
str |
GET /api/v1/runs/:id/files
List run files
List workflow run input and output file rows.
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Response
// RunFilesResponsePOST /api/v1/runs/:id/files
Upload run input file
Upload a workflow run input file before execution starts.
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Response
// dict[str, Any]POST /api/v1/runs/:id/rerun
Rerun run
Start a new run from an existing run id.
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Query parameters
| Name | Type | Description |
|---|---|---|
version |
str |
(optional)Version for the new run. original pins the source run. Defaults to latest. |
wait_for_completion |
int |
(optional)Seconds to wait before returning (max 600). Omit for async. |
Response
// RunRerunResponseGET /api/v1/runs/:id
Get run
Fetch one run by id. Use expand for input, usage, execution, and debug detail.
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Run id |
Query parameters
| Name | Type | Description |
|---|---|---|
expand |
str |
(optional)Optional sections: input, usage, execution, debug. Terminal runs always include top-level output, files, and error. |
Response
// RunGET /api/v1/runs/:id/trace
Get run trace
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Response
// dict[str, Any]GET /api/v1/source/lockfile
Preview a source lockfile
Resolves a package ref and returns the would-be eigenpal.lock without enqueueing or writing runtime artifacts.
Query parameters
| Name | Type | Description |
|---|---|---|
package_ref |
str |
Response
// SourceLockfileResponseGET /api/v1/source/raw
Preview a raw Git source file
Reads a raw file from the organization Git repository for metadata previews.
Query parameters
| Name | Type | Description |
|---|---|---|
ref |
str |
(optional) |
path |
str |
Response
// RawSourceResponseGET /api/v1/source/releases
List Git source package releases
Lists package-scoped Git release tags, or returns one exact version when requested.
Query parameters
| Name | Type | Description |
|---|---|---|
package_path |
str |
|
version |
str |
(optional) |
Response
// SourceReleasesResponseGET /api/v1/source/repository
Get organization Git source repository
Returns the authenticated organization Git remote used by hidden source CLI commands.
Response
// SourceRepositoryResponsePOST /api/v1/source/secrets/decrypt
Decrypt a Git-backed source secret
Decrypts one or more encrypted source secret values for the authenticated tenant. Single-secret requests require an execution id and are checked against that execution lockfile graph; batch secrets[] requests are tenant-scoped for local CLI use.
Request body
// SourceSecretsDecryptBodyResponse
// SourceSecretsDecryptResponsePOST /api/v1/source/secrets/encrypt
Encrypt a Git-backed source secret
Encrypts one or more plaintext secret values for the authenticated tenant using the organization active decrypt key. Organization decrypt keys never leave the server; callers send plaintext over TLS with normal app authentication.
Request body
// SourceSecretsEncryptBodyResponse
// SourceSecretsEncryptResponseGET /api/v1/workflows/:id
Get a workflow by id
Get a workflow by id, including current YAML.
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Workflow id (e.g. wf_abc123) |
Response
// WorkflowDetailGET /api/v1/workflows/:id/versions
List tagged versions for a workflow
List published workflow versions.
Path parameters
| Name | Type | Description |
|---|---|---|
id |
str |
Workflow id |
Query parameters
| Name | Type | Description |
|---|---|---|
limit |
int |
(optional)Page size (max 100, default 50) |
offset |
int |
(optional)Page offset |
Response
// ListVersionsResponseGET /api/v1/workflows
List workflows
List workflows with pagination.
Query parameters
| Name | Type | Description |
|---|---|---|
search |
str |
(optional)Substring match against workflow name |
name |
str |
(optional)Exact-match lookup by workflow name (slug) |
kind |
Literal["workflow", "block"] |
(optional)Filter by workflow kind |
folder_id |
Union[str, None] |
(optional)Filter by folder: omit for all workflows, 'null' for root/unfiled only, or a folder id |
limit |
int |
(optional)Page size (max 100, default 50) |
offset |
int |
(optional)Page offset |
Response
// ListWorkflowsResponseEvery non-2xx response throws a typed exception:
| HTTP | TypeScript | Python |
|---|---|---|
| 400 | EigenpalValidationError |
EigenpalValidationError |
| 401 | EigenpalAuthError |
EigenpalAuthError |
| 403 | EigenpalForbiddenError |
EigenpalForbiddenError |
| 404 | EigenpalNotFoundError |
EigenpalNotFoundError |
| 429 | EigenpalRateLimitError |
EigenpalRateLimitError |
| 5xx | EigenpalServerError |
EigenpalServerError |
| timeout | EigenpalTimeoutError |
EigenpalTimeoutError |
The thrown exception carries status, requestId, envelope (raw ApiErrorEnvelope), and (for 429) retryAfter.