import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient"; import * as core from "../../../../core"; import * as Extend from "../../../index"; export declare namespace ExtractRunsClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class ExtractRunsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: ExtractRunsClient.Options); /** * List all extract runs. * * Returns a summary of each run. Use `GET /extract_runs/{id}` to retrieve the full object including `output` and `config`. * * @param {Extend.ExtractRunsListRequest} request * @param {ExtractRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.extractRuns.list({ * nextPageToken: "xK9mLPqRtN3vS8wF5hB2cQ==:zWvUxYjM4nKpL7aDgE9HbTcR2mAyX3/Q+CNkfBSw1dZ=" * }) */ list(request?: Extend.ExtractRunsListRequest, requestOptions?: ExtractRunsClient.RequestOptions): core.HttpResponsePromise; private __list; /** * Extract structured data from a file using an existing extractor or an inline configuration. * * The request returns immediately with a `PROCESSING` status. Use webhooks or poll the Get Extract Run endpoint for results. * * @param {Extend.ExtractRunsCreateRequest} request * @param {ExtractRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.extractRuns.create({ * extractor: { * id: "ex_1234567890" * }, * file: { * url: "https://example.com/invoice.pdf" * } * }) */ create(request: Extend.ExtractRunsCreateRequest, requestOptions?: ExtractRunsClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Retrieve details about a specific extract run, including its status, outputs, and any edits made during review. * * A common use case for this endpoint is to poll for the status and final output of an extract run when using the [Create Extract Run](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/extract/create-extract-run) endpoint. For instance, if you do not want to not configure webhooks to receive the output via completion/failure events. * * @param {string} id - The unique identifier for this extract run. * * Example: `"ex_Xj8mK2pL9nR4vT7qY5wZ"` * @param {Extend.ExtractRunsRetrieveRequest} request * @param {ExtractRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.extractRuns.retrieve("extract_run_id_here") */ retrieve(id: string, request?: Extend.ExtractRunsRetrieveRequest, requestOptions?: ExtractRunsClient.RequestOptions): core.HttpResponsePromise; private __retrieve; /** * Delete an extract run and all associated data from Extend. This operation is permanent and cannot be undone. * * This endpoint can be used if you'd like to manage data retention on your own rather than automated data retention policies. Or make one-off deletions for your downstream customers. * * @param {string} id - The ID of the extract run. * @param {Extend.ExtractRunsDeleteRequest} request * @param {ExtractRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.extractRuns.delete("id") */ delete(id: string, request?: Extend.ExtractRunsDeleteRequest, requestOptions?: ExtractRunsClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Cancel an in-progress extract run. * * Note: Only extract runs with a status of `"PROCESSING"` can be cancelled. Extractor runs that have already completed, failed, or been cancelled cannot be cancelled again. * * @param {string} id - The ID of the extract run to cancel. * * Example: `"ex_Xj8mK2pL9nR4vT7qY5wZ"` * @param {Extend.ExtractRunsCancelRequest} request * @param {ExtractRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.extractRuns.cancel("extract_run_id_here") */ cancel(id: string, request?: Extend.ExtractRunsCancelRequest, requestOptions?: ExtractRunsClient.RequestOptions): core.HttpResponsePromise; private __cancel; /** * Submit up to **1,000 files** for extraction in a single request. Each file is processed as an independent extract run using the same extractor and configuration. * * Unlike the single [Extract File (Async)](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/extract/create-extract-run) endpoint, this batch endpoint accepts an `inputs` array and immediately returns a `BatchRun` object containing a batch `id` and a `PENDING` status. The individual runs are then queued and processed asynchronously. * * **Monitoring results:** * - **Webhooks (recommended):** Subscribe to `batch_processor_run.processed` and `batch_processor_run.failed` events. The webhook payload indicates the batch has finished — fetch individual run results using `GET /extract_runs?batchId={id}`. * - **Polling:** Call `GET /batch_runs/{id}` to check the overall batch status, and use `GET /extract_runs` filtered by `batchId` to retrieve individual run results. * * **Notes:** * - A processor reference (`extractor.id`) is required — inline `config` is not supported for batch requests. * - `inputs` must contain between 1 and 1,000 items. * - All inputs in a batch use the same extractor version and override config. * * @param {Extend.ExtractRunsCreateBatchRequest} request * @param {ExtractRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.extractRuns.createBatch({ * extractor: { * id: "ex_xK9mLPqRtN3vS8wF5hB2cQ" * }, * inputs: [{ * file: { * url: "https://example.com/invoice1.pdf" * }, * metadata: { * "customerId": "cust_abc123" * } * }, { * file: { * url: "https://example.com/invoice2.pdf" * }, * metadata: { * "customerId": "cust_def456" * } * }, { * file: { * url: "https://example.com/invoice3.pdf" * }, * metadata: { * "customerId": "cust_ghi789" * } * }] * }) */ createBatch(request: Extend.ExtractRunsCreateBatchRequest, requestOptions?: ExtractRunsClient.RequestOptions): core.HttpResponsePromise; private __createBatch; }