// This file is auto-generated by @hey-api/openapi-ts import { type Client, formDataBodySerializer, type Options as Options2, type TDataShape } from './client'; import { client } from './client.gen'; import type { AuthCheckData, AuthCheckErrors, AuthCheckResponses, AutomationsDatasetExportData, AutomationsDatasetExportErrors, AutomationsDatasetExportResponses, AutomationsDatasetImportData, AutomationsDatasetImportErrors, AutomationsDatasetImportResponses, AutomationsDeleteData, AutomationsDeleteErrors, AutomationsDeleteResponses, AutomationsEvaluatorsGetData, AutomationsEvaluatorsGetErrors, AutomationsEvaluatorsGetResponses, AutomationsEvaluatorsUpdateData, AutomationsEvaluatorsUpdateErrors, AutomationsEvaluatorsUpdateResponses, AutomationsExamplesCreateData, AutomationsExamplesCreateErrors, AutomationsExamplesCreateResponses, AutomationsExamplesDeleteData, AutomationsExamplesDeleteErrors, AutomationsExamplesDeleteResponses, AutomationsExamplesExpectedFileDeleteData, AutomationsExamplesExpectedFileDeleteErrors, AutomationsExamplesExpectedFileDeleteResponses, AutomationsExamplesExpectedFileGetData, AutomationsExamplesExpectedFileGetErrors, AutomationsExamplesExpectedFileGetResponses, AutomationsExamplesExpectedFilesCreateData, AutomationsExamplesExpectedFilesCreateErrors, AutomationsExamplesExpectedFilesCreateResponses, AutomationsExamplesExpectedFilesListData, AutomationsExamplesExpectedFilesListErrors, AutomationsExamplesExpectedFilesListResponses, AutomationsExamplesExpectedFileUpdateData, AutomationsExamplesExpectedFileUpdateErrors, AutomationsExamplesExpectedFileUpdateResponses, AutomationsExamplesGetData, AutomationsExamplesGetErrors, AutomationsExamplesGetResponses, AutomationsExamplesInputFileDeleteData, AutomationsExamplesInputFileDeleteErrors, AutomationsExamplesInputFileDeleteResponses, AutomationsExamplesInputFileGetData, AutomationsExamplesInputFileGetErrors, AutomationsExamplesInputFileGetResponses, AutomationsExamplesInputFilesCreateData, AutomationsExamplesInputFilesCreateErrors, AutomationsExamplesInputFilesCreateResponses, AutomationsExamplesInputFilesListData, AutomationsExamplesInputFilesListErrors, AutomationsExamplesInputFilesListResponses, AutomationsExamplesInputFileUpdateData, AutomationsExamplesInputFileUpdateErrors, AutomationsExamplesInputFileUpdateResponses, AutomationsExamplesListData, AutomationsExamplesListErrors, AutomationsExamplesListResponses, AutomationsExamplesRunData, AutomationsExamplesRunErrors, AutomationsExamplesRunResponses, AutomationsExamplesUpdateData, AutomationsExamplesUpdateErrors, AutomationsExamplesUpdateResponses, AutomationsExperimentsCancelData, AutomationsExperimentsCancelErrors, AutomationsExperimentsCancelResponses, AutomationsExperimentsCreateData, AutomationsExperimentsCreateErrors, AutomationsExperimentsCreateResponses, AutomationsExperimentsCreateStreamData, AutomationsExperimentsCreateStreamErrors, AutomationsExperimentsCreateStreamResponses, AutomationsExperimentsExportAllData, AutomationsExperimentsExportAllErrors, AutomationsExperimentsExportAllResponses, AutomationsExperimentsExportData, AutomationsExperimentsExportErrors, AutomationsExperimentsExportResponses, AutomationsExperimentsGetData, AutomationsExperimentsGetErrors, AutomationsExperimentsGetResponses, AutomationsExperimentsListData, AutomationsExperimentsListErrors, AutomationsExperimentsListResponses, AutomationsGetData, AutomationsGetErrors, AutomationsGetResponses, AutomationsListData, AutomationsListErrors, AutomationsListResponses, AutomationsReviewsHealthData, AutomationsReviewsHealthErrors, AutomationsReviewsHealthResponses, AutomationsSyncData, AutomationsSyncErrors, AutomationsSyncResponses, AutomationsTriggersGetData, AutomationsTriggersGetErrors, AutomationsTriggersGetResponses, AutomationsUpdateData, AutomationsUpdateErrors, AutomationsUpdateResponses, AutomationsVersionsCreateData, AutomationsVersionsCreateErrors, AutomationsVersionsCreateResponses, AutomationsVersionsListData, AutomationsVersionsListErrors, AutomationsVersionsListResponses, AutomationsVersionsPromoteData, AutomationsVersionsPromoteErrors, AutomationsVersionsPromoteResponses, AutomationsVersionsRestoreData, AutomationsVersionsRestoreErrors, AutomationsVersionsRestoreResponses, EmailServersCreateData, EmailServersCreateErrors, EmailServersCreateResponses, EmailServersDeleteData, EmailServersDeleteErrors, EmailServersDeleteResponses, EmailServersGetData, EmailServersGetErrors, EmailServersGetResponses, EmailServersListData, EmailServersListErrors, EmailServersListResponses, EmailServersTestData, EmailServersTestErrors, EmailServersTestResponses, EmailServersUpdateData, EmailServersUpdateErrors, EmailServersUpdateResponses, ExperimentsResolveData, ExperimentsResolveErrors, ExperimentsResolveResponses, FilesContentGetData, FilesContentGetErrors, FilesContentGetResponses, FilesCreateData, FilesCreateErrors, FilesCreateResponses, FilesDeleteData, FilesDeleteErrors, FilesDeleteResponses, FilesGetData, FilesGetErrors, FilesGetResponses, FilesUploadsAbortData, FilesUploadsAbortErrors, FilesUploadsAbortResponses, FilesUploadsCompleteData, FilesUploadsCompleteErrors, FilesUploadsCompleteResponses, FilesUploadsCreateData, FilesUploadsCreateErrors, FilesUploadsCreateResponses, FilesUploadsGetData, FilesUploadsGetErrors, FilesUploadsGetResponses, FilesUploadsPartsListData, FilesUploadsPartsListErrors, FilesUploadsPartsListResponses, FilesUploadsPartsPresignData, FilesUploadsPartsPresignErrors, FilesUploadsPartsPresignResponses, FoldersCreateData, FoldersCreateErrors, FoldersCreateResponses, FoldersDeleteData, FoldersDeleteErrors, FoldersDeleteResponses, FoldersGetData, FoldersGetErrors, FoldersGetResponses, FoldersListData, FoldersListErrors, FoldersListResponses, FoldersUpdateData, FoldersUpdateErrors, FoldersUpdateResponses, HumanReviewsApproveData, HumanReviewsApproveErrors, HumanReviewsApproveResponses, HumanReviewsConfirmFieldData, HumanReviewsConfirmFieldErrors, HumanReviewsConfirmFieldResponses, HumanReviewsFilesContentGetData, HumanReviewsFilesContentGetErrors, HumanReviewsFilesContentGetResponses, HumanReviewsGetData, HumanReviewsGetErrors, HumanReviewsGetResponses, HumanReviewsListData, HumanReviewsListErrors, HumanReviewsListResponses, HumanReviewsRejectData, HumanReviewsRejectErrors, HumanReviewsRejectResponses, ModelsListData, ModelsListErrors, ModelsListResponses, RunsArtifactsGetData, RunsArtifactsGetErrors, RunsArtifactsGetResponses, RunsArtifactsListData, RunsArtifactsListErrors, RunsArtifactsListResponses, RunsCancelData, RunsCancelErrors, RunsCancelResponses, RunsEventsListData, RunsEventsListErrors, RunsEventsListResponses, RunsGetData, RunsGetErrors, RunsGetResponses, RunsListData, RunsListErrors, RunsListResponses, RunsPromoteData, RunsPromoteErrors, RunsPromoteResponses, RunsRerunData, RunsRerunErrors, RunsRerunResponses, RunsReviewsClearData, RunsReviewsClearErrors, RunsReviewsClearResponses, RunsReviewsExpectedCreateData, RunsReviewsExpectedCreateErrors, RunsReviewsExpectedCreateResponses, RunsReviewsExpectedFileDeleteData, RunsReviewsExpectedFileDeleteErrors, RunsReviewsExpectedFileDeleteResponses, RunsReviewsExpectedFileGetData, RunsReviewsExpectedFileGetErrors, RunsReviewsExpectedFileGetResponses, RunsReviewsExpectedFileUpdateData, RunsReviewsExpectedFileUpdateErrors, RunsReviewsExpectedFileUpdateResponses, RunsReviewsExpectedGetData, RunsReviewsExpectedGetErrors, RunsReviewsExpectedGetResponses, RunsReviewsGetData, RunsReviewsGetErrors, RunsReviewsGetResponses, RunsReviewsUpdateData, RunsReviewsUpdateErrors, RunsReviewsUpdateResponses, RunsScoresListData, RunsScoresListErrors, RunsScoresListResponses, RunsStartData, RunsStartErrors, RunsStartResponses, RunsStepsGetData, RunsStepsGetErrors, RunsStepsGetResponses, RunsStepsListData, RunsStepsListErrors, RunsStepsListResponses, RunsTraceGetData, RunsTraceGetErrors, RunsTraceGetResponses, RunsUsageGetData, RunsUsageGetErrors, RunsUsageGetResponses, TemplatesContentGetData, TemplatesContentGetErrors, TemplatesContentGetResponses, TemplatesCreateData, TemplatesCreateErrors, TemplatesCreateResponses, TemplatesDeleteData, TemplatesDeleteErrors, TemplatesDeleteResponses, TemplatesGetData, TemplatesGetErrors, TemplatesGetResponses, TemplatesListData, TemplatesListErrors, TemplatesListResponses, TemplatesReplaceData, TemplatesReplaceErrors, TemplatesReplaceResponses, TemplatesStagingData, TemplatesStagingErrors, TemplatesStagingResponses } from './types.gen'; export type Options = Options2 & { /** * You can provide a client instance returned by `createClient()` instead of * individual options. This might be also useful if you want to implement a * custom client. */ client?: Client; /** * You can pass arbitrary values through the `meta` object. This can be * used to access values that aren't defined as part of the SDK function. */ meta?: Record; }; /** * Check API key identity * * Return the tenant, user, API key, and scope represented by the current API key. */ export const authCheck = (options?: Options) => (options?.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/auth/check', ...options }); /** * List automations * * Returns workflows and agents through one runnable automation collection. Use `type` to narrow to workflows or agents, `search` to find automations by slug, name, or description, and `folderId` to list YAML workflows in a folder (`null` for root). */ export const automationsList = (options?: Options) => (options?.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations', ...options }); /** * Delete automation * * Delete a workflow or agent automation using the same cleanup as the dashboard. Workflows archive the automations registry parent and keep execution history. Agents delete the agent row, archive the registry parent, and best-effort-delete agent storage. Identifiers match GET. */ export const automationsDelete = (options: Options) => (options.client ?? client).delete({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}', ...options }); /** * Get automation * * Get one runnable workflow or agent automation by id or typed alias. */ export const automationsGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}', ...options }); /** * Move workflow automation * * Move a YAML workflow between organizing folders. `folderPath` auto-creates missing workflow folders; empty or `/` files the workflow at root. Agent automations have no database folder model and are rejected. Identifiers match GET (workflow id, automation id, or `workflows.`). */ export const automationsUpdate = (options: Options) => (options.client ?? client).patch({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Export automation dataset * * Download the automation dataset as a ZIP archive. The archive uses the examples//input and examples//expected folder convention, so it can be re-imported into another automation or environment. Cloud deployments may redirect large archives to a short-lived storage URL. */ export const automationsDatasetExport = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/dataset/export', ...options }); /** * Import automation dataset * * Import a dataset ZIP archive using the examples//input and examples//expected folder convention. Use `mode=append` for additive imports or `mode=replace` to replace the dataset. */ export const automationsDatasetImport = (options: Options) => (options.client ?? client).post({ ...formDataBodySerializer, security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/dataset/import', ...options, headers: { 'Content-Type': null, ...options.headers } }); /** * Get evaluators * * Fetch the evaluator configuration for an automation. Evaluators produce automated `score` results, which are separate from human review verdicts. */ export const automationsEvaluatorsGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/evaluators', ...options }); /** * Replace evaluators * * Replace the evaluator YAML for an automation. The submitted YAML is validated before it becomes the source for future experiment scores. */ export const automationsEvaluatorsUpdate = (options: Options) => (options.client ?? client).put({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/evaluators', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * List dataset examples * * List dataset examples for one automation. Examples contain input, expected output, expected files, metadata, and optional overrides used by evaluation runs. Pass `include=metadata` to return ids, names, metadata, and expected file refs without loading input or expected JSON. */ export const automationsExamplesList = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples', ...options }); /** * Create dataset example * * Create one dataset example from JSON fields. Use dataset import for archive-based uploads and file-bearing examples. */ export const automationsExamplesCreate = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Delete dataset example * * Delete one dataset example from the automation dataset. This removes the example from future experiments. */ export const automationsExamplesDelete = (options: Options) => (options.client ?? client).delete({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}', ...options }); /** * Get dataset example * * Fetch one dataset example, including input, expected output, expected files, metadata, and overrides. */ export const automationsExamplesGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}', ...options }); /** * Update dataset example * * Partially update a dataset example. Omitted fields are preserved; pass null for nullable fields to clear them. */ export const automationsExamplesUpdate = (options: Options) => (options.client ?? client).patch({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * List expected files * * List files stored under the expected folder for one automation dataset example. */ export const automationsExamplesExpectedFilesList = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}/expected', ...options }); /** * Upload expected files * * Upload one or more files into the expected folder for an automation dataset example. Use `$file` references such as `expected/result.pdf` from expected JSON to compare file outputs. */ export const automationsExamplesExpectedFilesCreate = (options: Options) => (options.client ?? client).post({ ...formDataBodySerializer, security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}/expected', ...options, headers: { 'Content-Type': null, ...options.headers } }); /** * Delete expected file * * Delete one file from an automation dataset example expected folder. */ export const automationsExamplesExpectedFileDelete = (options: Options) => (options.client ?? client).delete({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}/expected/{path}', ...options }); /** * Download expected dataset file * * Download one expected file attached to an automation dataset example. */ export const automationsExamplesExpectedFileGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}/expected/{path}', ...options }); /** * Rename expected file * * Rename one expected file attached to an automation dataset example. The parent folder is preserved. */ export const automationsExamplesExpectedFileUpdate = (options: Options) => (options.client ?? client).patch({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}/expected/{path}', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * List input files * * List files stored under the input folder for one automation dataset example. */ export const automationsExamplesInputFilesList = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}/input', ...options }); /** * Upload input files * * Upload one or more files into the input folder for an automation dataset example. Use `$file` references such as `input/invoice.pdf` from the example input JSON to consume them. */ export const automationsExamplesInputFilesCreate = (options: Options) => (options.client ?? client).post({ ...formDataBodySerializer, security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}/input', ...options, headers: { 'Content-Type': null, ...options.headers } }); /** * Delete input file * * Delete one file from an automation dataset example input folder. */ export const automationsExamplesInputFileDelete = (options: Options) => (options.client ?? client).delete({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}/input/{path}', ...options }); /** * Download input file * * Download one file from an automation dataset example input folder. */ export const automationsExamplesInputFileGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}/input/{path}', ...options }); /** * Rename input file * * Rename one input file attached to an automation dataset example. The parent folder is preserved. */ export const automationsExamplesInputFileUpdate = (options: Options) => (options.client ?? client).patch({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}/input/{path}', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Run dataset example * * Start an asynchronous run using the input from one dataset example. Poll `GET /api/v1/runs/{id}` for completion and use run scores or review endpoints to review the result. */ export const automationsExamplesRun = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/examples/{exampleId}/run', ...options }); /** * List experiments * * List experiment batches for one automation. Each experiment runs selected dataset examples and records automated evaluator scores. */ export const automationsExperimentsList = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/experiments', ...options }); /** * Create experiment * * Start an asynchronous experiment batch for one automation. Omit `examples` to run the full dataset, or pass specific example ids to run a subset. */ export const automationsExperimentsCreate = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/experiments', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Get experiment * * Fetch one experiment batch with its run summaries and evaluator results grouped by run id. */ export const automationsExperimentsGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/experiments/{experimentId}', ...options }); /** * Cancel experiment * * Request cancellation for an experiment batch. Already-completed runs remain recorded; queued or running work is cancelled when possible. */ export const automationsExperimentsCancel = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/experiments/{experimentId}/cancel', ...options }); /** * Export experiment eval results * * Download eval result rows for a single experiment batch as CSV or JSON. */ export const automationsExperimentsExport = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/experiments/{experimentId}/export', ...options }); /** * Export all experiment eval results * * Download every eval result row for an automation as CSV or JSON. */ export const automationsExperimentsExportAll = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/experiments/export', ...options }); /** * Create automation experiment with NDJSON progress * * Starts a batch eval experiment for workflow or agent automations and streams per-run completion events as NDJSON. */ export const automationsExperimentsCreateStream = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/experiments/stream', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Get automation review health * * Aggregates reviewed correctness, review coverage, bucketed counts, and rolling-window confidence for one automation. Prefer this endpoint for single-automation monitoring dashboards. */ export const automationsReviewsHealth = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/reviews/health', ...options }); /** * Sync automation from latest Git release * * Reconciles automation registry metadata and trigger projections from the latest Git source release. This operation is idempotent for unchanged source state: repeated calls against the same latest release leave the same automation registry state and may repeat the same warnings. Requires a Bearer API token for the organization and a user-backed API key. It does not publish source; it reads the already-published latest release manifest. Versioned targets are rejected with 400, missing organization/source/release/manifest state returns 404, invalid manifests return 400, and provider or persistence failures return 5xx. */ export const automationsSync = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/sync', ...options }); /** * Get automation triggers * * Read trigger state for a workflow or agent automation. Trigger mutation is not public v1. */ export const automationsTriggersGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/triggers', ...options }); /** * List automation versions * * List versions for a workflow or agent automation. YAML workflow lists include tagged releases plus the current untagged snapshot when HEAD is untagged (for example after restore), so the current version is always present. Agent lists remain Git release tags. */ export const automationsVersionsList = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/versions', ...options }); /** * Create a workflow version * * Create a tagged YAML workflow candidate from validated YAML or by copying an existing snapshot (`historyId`). Provide exactly one of `yaml` or `historyId`. Copy creates a new tagged row and leaves the source tag unchanged; it does not retag the original. Defaults to making the new version current. Set `activate: false` to keep it off live traffic until promote — that path requires an existing current workflow version and returns 400 if HEAD is empty. Agent automations are Git-backed and return 400. Requires a Bearer API key or a dashboard session. */ export const automationsVersionsCreate = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/versions', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Promote a workflow version * * Make an existing tagged YAML workflow candidate current without creating another history row. Only tagged version rows can be promoted; untagged snapshots (including restore HEAD) and missing ids return 404. Agent automations return 400. Requires a Bearer API key or a dashboard session. */ export const automationsVersionsPromote = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/versions/{versionId}/promote', ...options }); /** * Restore a workflow version * * Restore a YAML workflow automation by copying a previous snapshot into a new untagged current version. The source tag is left unchanged; the new HEAD appears in subsequent version lists as the untagged current row and cannot be promoted until you create a tagged copy. The JSON body may be `{}`; `message` is optional and defaults to a timestamped restore note. Agent automations return 400. Requires a Bearer API key or a dashboard session. */ export const automationsVersionsRestore = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/automations/{id}/versions/{versionId}/restore', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * List email servers * * List outbound email servers for the current workspace. Secrets are never returned; each server includes configuration flags instead of credentials. */ export const emailServersList = (options?: Options) => (options?.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/email-servers', ...options }); /** * Create email server * * Create an outbound email server. Secrets are encrypted at rest and never returned. Names must be unique among live servers in the workspace. */ export const emailServersCreate = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/email-servers', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Delete email server * * Soft-delete an outbound email server. Deleted ids are indistinguishable from missing. */ export const emailServersDelete = (options: Options) => (options.client ?? client).delete({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/email-servers/{id}', ...options }); /** * Get email server * * Inspect a stored outbound email server. Cross-tenant and deleted ids are indistinguishable from missing. Secrets are never returned. */ export const emailServersGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/email-servers/{id}', ...options }); /** * Update email server * * Rename, enable/disable, or replace transport configuration. Omitted secrets are retained only when the existing transport is compatible and, for SMTP, the host and username are unchanged. Changing transport or SMTP destination requires a complete valid target; a new password or explicit auth clearing is required when host or username changes. */ export const emailServersUpdate = (options: Options) => (options.client ?? client).patch({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/email-servers/{id}', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Test email server * * Send a concise connectivity email through the selected stored server. Disabled servers conflict. Provider failures are returned as a generic outcome and never include credentials or the test recipient. */ export const emailServersTest = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/email-servers/{id}/test', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Resolve experiment by id * * Returns the owning automation for an experiment batch id. Used when callers only know the experiment id. */ export const experimentsResolve = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/experiments/{experimentId}', ...options }); /** * Upload file * * Upload a reusable file that can later be referenced by run inputs or dataset examples. */ export const filesCreate = (options: Options) => (options.client ?? client).post({ ...formDataBodySerializer, security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/files', ...options, headers: { 'Content-Type': null, ...options.headers } }); /** * Delete file * * Delete a reusable uploaded file. Past runs that referenced it stay readable until those runs are deleted. */ export const filesDelete = (options: Options) => (options.client ?? client).delete({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/files/{id}', ...options }); /** * Get file metadata * * Get metadata for a reusable uploaded file. */ export const filesGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/files/{id}', ...options }); /** * Download file content * * Download bytes for a reusable uploaded file. Direct-enabled deployments redirect responses above their configured body limit to a short-lived signed storage URL; multipart-only/on-prem deployments stream through the API. */ export const filesContentGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/files/{id}/content', ...options }); /** * Prepare file upload * * Negotiate HTTP multipart for small bodies, a short-lived signed PUT under the single-object ceiling, or storage-direct multipart (presigned-multipart) for larger files when storage supports MPU. The response transport is authoritative; clients must not guess from file size alone. */ export const filesUploadsCreate = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/files/uploads', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Abort file upload * * Abort a pending storage-direct upload. Multipart sessions call AbortMultipartUpload; pending PUT objects are deleted. Completed canonical files are never deleted. */ export const filesUploadsAbort = (options: Options) => (options.client ?? client).delete({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/files/uploads/{uploadId}', ...options }); /** * Get file upload session * * Return session status for resume. Multipart sessions include authoritative uploaded parts from storage, not client-reported ETags. */ export const filesUploadsGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/files/uploads/{uploadId}', ...options }); /** * Complete file upload * * Verify a storage-direct pending object and promote it into a reusable file. Safe to retry. */ export const filesUploadsComplete = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/files/uploads/{uploadId}/complete', ...options }); /** * List uploaded multipart parts * * List authoritative uploaded parts from storage for resume. Do not trust client-only ETags. */ export const filesUploadsPartsList = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/files/uploads/{uploadId}/parts', ...options }); /** * Presign one multipart upload part * * Mint a short-lived signed UploadPart URL for one validated part. Part URLs are not issued at session create. */ export const filesUploadsPartsPresign = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/files/uploads/{uploadId}/parts', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * List folders * * List folders in one tree. `type` is required (`workflow` or `template`). Pass `tree=true` for the full nested tree with counts; otherwise list direct children of `parentId` (`null` for root). Deleting a folder later unfiles contained workflows or templates and does not delete them. */ export const foldersList = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/folders', ...options }); /** * Create folder * * Create a folder in the workflow or template tree. `type` is required. Missing parents 404; a same-named sibling at that location returns 409. Nested agent directories in Git are source organization only and are not folders. */ export const foldersCreate = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/folders', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Delete folder * * Delete a folder and cascade-delete child folders. Workflows and templates in the tree are unfiled, not deleted. */ export const foldersDelete = (options: Options) => (options.client ?? client).delete({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/folders/{id}', ...options }); /** * Get folder * * Get one workflow or template folder by id. */ export const foldersGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/folders/{id}', ...options }); /** * Update folder * * Rename or reparent a folder. Moving a folder onto itself, into a descendant, or into the other tree is rejected. A same-named sibling at the destination returns 409. */ export const foldersUpdate = (options: Options) => (options.client ?? client).patch({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/folders/{id}', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * List pending human review tasks * * Cursor-paginated queue of pending human-review tasks for the tenant, oldest first. */ export const humanReviewsList = (options?: Options) => (options?.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/human-reviews', ...options }); /** * Get human review task * * Fetch one authorized human-review task with draft data, derived non-file input, files, and decisions. */ export const humanReviewsGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/human-reviews/{taskId}', ...options }); /** * Approve human review task * * Approve a complete review task and resume the paused run. Requires every required field to be confirmed. */ export const humanReviewsApprove = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/human-reviews/{taskId}/approve', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Confirm or edit a review field * * Confirm or edit a scalar field using optimistic concurrency and a durable idempotency key. */ export const humanReviewsConfirmField = (options: Options) => (options.client ?? client).put({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/human-reviews/{taskId}/fields', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Download human review task file * * Download one file attached to a human-review task after strict tenant, task, and run ownership checks. Large cloud deployments may redirect to a short-lived signed storage URL. */ export const humanReviewsFilesContentGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/human-reviews/{taskId}/files/{fileId}/content', ...options }); /** * Reject human review task * * Reject a review task and fail the paused run with the supplied reason. */ export const humanReviewsReject = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/human-reviews/{taskId}/reject', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * List configured models * * List text, vision, and OCR models configured for this tenant's environment from the workspace model catalog. This is a cheap read-only inventory: it does not call providers. `health` is `configured` or `unconfigured` from local credentials, never a live probe. Secrets and provider endpoints are never returned. */ export const modelsList = (options?: Options) => (options?.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/models', ...options }); /** * List runs * * List workflow and agent runs with cursor pagination. */ export const runsList = (options?: Options) => (options?.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs', ...options }); /** * Start a run * * Start a run. Send JSON or multipart/form-data. * * How to read a run: the envelope is at the root. The automation business result is in `output` (per-automation, not this generic schema). Status is `execution.status` (`execution.retry.nextRun.status` is a later retry). `input`, `usage`, and `debug` appear only with `?expand=`. `eval` is present only on eval-scoped runs. */ export const runsStart = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Get a run * * Fetch one run by id. By default this returns core metadata plus terminal output/error fields. Pass `?expand=input,usage,execution,debug` to include detailed sub-objects; `expand=execution` is also where embedded review and expected artifacts appear. * * How to read a run: the envelope is at the root. The automation business result is in `output` (per-automation, not this generic schema). Status is `execution.status` (`execution.retry.nextRun.status` is a later retry). `input`, `usage`, and `debug` appear only with `?expand=`. `eval` is present only on eval-scoped runs. */ export const runsGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}', ...options }); /** * List run artifacts * * Returns a JSON list of downloadable artifact paths for a run. Pass `zip=1` to switch the response to a ZIP download containing output files. */ export const runsArtifactsList = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/artifacts', ...options }); /** * Download run artifact * * Download one artifact by path. Cloud deployments may redirect to a short-lived storage URL for large files. */ export const runsArtifactsGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/artifacts/{path}', ...options }); /** * Cancel run * * Cancel a queued run or request cancellation of an in-flight run. */ export const runsCancel = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/cancel', ...options }); /** * List run events * * List a stable chronological lifecycle timeline for a run. */ export const runsEventsList = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/events', ...options }); /** * Promote run to example * * Turn a reviewed run into a dataset example. The new example uses the run input and any corrected output/files stored through the review endpoints. */ export const runsPromote = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/promote', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Retry run * * Start a new run using the source run input. By default the retry uses the latest automation version; pass `version=original` to pin the same source version as the original run. */ export const runsRerun = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/rerun', ...options }); /** * Clear run review * * Deletes review metadata, corrections, and corrected files for the run. */ export const runsReviewsClear = (options: Options) => (options.client ?? client).delete({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/reviews', ...options }); /** * Get run review * * Returns review metadata and corrections for a run. Corrected files are listed at GET /runs/{id}/reviews/expected; embed review + expected artifacts with GET /runs/{id}?expand=execution. */ export const runsReviewsGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/reviews', ...options }); /** * Update run review * * Create or replace review metadata for a run. */ export const runsReviewsUpdate = (options: Options) => (options.client ?? client).put({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/reviews', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * List corrected files * * Returns corrected artifact files attached to the run review. Review metadata and corrected JSON output live at GET /runs/{id}/reviews. */ export const runsReviewsExpectedGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/reviews/expected', ...options }); /** * Add corrected file * * Attach one corrected file to a run review. Send multipart/form-data with `file` and optional `name` to upload a local file, or JSON with `outputFileName` and optional `expectedName` to copy an existing run output file. */ export const runsReviewsExpectedCreate = (options: Options) => (options.client ?? client).post({ ...((options.body && typeof options.body === 'object' && 'file' in options.body) ? formDataBodySerializer : {}), security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/reviews/expected', ...options, headers: { 'Content-Type': (options.body && typeof options.body === 'object' && 'file' in options.body) ? null : 'application/json', ...options.headers } }); /** * Delete corrected artifact file * * Deletes one corrected artifact file attached to the run review. */ export const runsReviewsExpectedFileDelete = (options: Options) => (options.client ?? client).delete({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/reviews/expected/{filename}', ...options }); /** * Download corrected artifact file * * Downloads one corrected artifact file attached to the run review. Use the `filename` returned by the corrected-output collection endpoint. */ export const runsReviewsExpectedFileGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/reviews/expected/{filename}', ...options }); /** * Rename corrected artifact file * * Renames one corrected artifact file attached to the run review. */ export const runsReviewsExpectedFileUpdate = (options: Options) => (options.client ?? client).patch({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/reviews/expected/{filename}', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * List run evaluator scores * * List automated evaluator results for one run. Use `score` for evaluator output and run reviews for human verdicts. */ export const runsScoresList = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/scores', ...options }); /** * List run steps * * List slim workflow step rows for a run (no input/output payloads) plus the total count. Fetch a single step for full payloads. */ export const runsStepsList = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/steps', ...options }); /** * Get a run step * * Return the full single step execution (including input/output) for on-demand inspection. The step must belong to this run or a child invoke-workflow run. */ export const runsStepsGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/steps/{stepExecutionId}', ...options }); /** * Get run trace * * Return low-level execution trace events for debugging one run. Workflow runs expose observability phases or step records; agent runs expose parsed trace.jsonl events. The shape is intentionally extensible, but common fields are documented. */ export const runsTraceGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/trace', ...options }); /** * Get run usage * * Get token, credit, duration, and execution usage for a run. */ export const runsUsageGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/runs/{id}/usage', ...options }); /** * List templates * * List tenant-scoped DOCX and XLSX template resources. */ export const templatesList = (options?: Options) => (options?.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/templates', ...options }); /** * Upload template * * Create a stable `tmpl_…` resource and its first immutable content revision from a reusable `fileId`. Public SDK helpers `create(file)` and `createFromFileId(fileId)` upload through the Files API when needed, then send this JSON body. Generated clients send `{ fileId }` JSON only. The HTTP route still accepts a multipart `file` for CLI/internal use; that path is not generated into the public SDKs. */ export const templatesCreate = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/templates', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Delete template * * Delete the mutable logical template. Immutable revisions are retained so workflows pinned with `templateRevisionId` continue to execute; unpinned workflows can no longer resolve the deleted `tmpl_…` id. */ export const templatesDelete = (options: Options) => (options.client ?? client).delete({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/templates/{id}', ...options }); /** * Inspect template * * Get template metadata, checksum, discovered tokens, grammar capabilities, and current immutable revision. Storage keys are never exposed. */ export const templatesGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/templates/{id}', ...options }); /** * Create template revision * * Append an immutable revision and advance the logical template pointer from a reusable `fileId`. Public SDK helpers `replace(file)` and `replaceFromFileId(fileId)` upload through the Files API when needed, then send this JSON body. Generated clients send `{ fileId }` JSON only. The HTTP route still accepts a multipart `file` for CLI/internal use; that path is not generated into the public SDKs. */ export const templatesReplace = (options: Options) => (options.client ?? client).put({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/templates/{id}', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); /** * Download template content * * Download current bytes while the logical template exists, or a specific immutable revision using `revisionId`. Pinned revision downloads remain available after logical template deletion. Large objects may 302 to a short-lived signed storage URL. */ export const templatesContentGet = (options: Options) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/templates/{id}/content', ...options }); /** * Finalize or hard-clean a staged template * * Consume the one-time cleanupProof issued on a staged create. `finalize` makes the template live so later deletion keeps pinned revisions. `cleanup` hard-removes only unpublished resources from that staging attempt. Normal DELETE is unchanged and never takes this path. */ export const templatesStaging = (options: Options) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/v1/templates/{id}/staging', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } });