import type * as Extend from "../index"; /** * Extract run object. */ export interface ExtractRun { /** The type of object. Will always be `"extract_run"`. */ object: "extract_run"; /** * The unique identifier for this extract run. * * Example: `"exr_Xj8mK2pL9nR4vT7qY5wZ"` */ id: string; status: Extend.ProcessorRunStatus; /** * The final output, either reviewed or initial. This is a union of two possible shapes: * * - **[JSON Schema output](https://docs.extend.ai/2026-02-09/product/extraction/output-types):** The current output format, returned for runs created with a JSON Schema config. * - **[Legacy output](https://docs.extend.ai/2025-04-21/product/legacy/output-type-legacy):** A legacy output format from a previous API version. This shape is only returned for runs that were originally created with a legacy config. * * **Availability:** Present when `status` is `"PROCESSED"`. */ output: Extend.ExtractOutput | null; /** * The initial output from the extract run, before any review edits. * * **Availability:** Present when `reviewed` is `true`. */ initialOutput: Extend.ExtractOutput | null; /** * The output after human review. * * **Availability:** Present when `reviewed` is `true`. */ reviewedOutput: Extend.ExtractOutput | null; /** * The reason for failure. * * **Availability:** Present when `status` is `"FAILED"`. * * Possible values include: * * `ABORTED` - The run was aborted by the user * * `INTERNAL_ERROR` - An unexpected internal error occurred * * `FAILED_TO_PROCESS_FILE` - Failed to process the file (e.g., OCR failure, file access issues) * * `INVALID_PROCESSOR` - The processor configuration is invalid * * `INVALID_CONFIGURATION` - The provided configuration is incompatible with the selected model * * `PARSING_ERROR` - Failed to parse the extraction output * * `PRE_PROCESSING_FAILURE` - An error occurred during preprocessing (e.g., chunking) * * `POST_PROCESSING_FAILURE` - An error occurred during postprocessing * * `OUT_OF_CREDITS` - Insufficient credits to run the extraction * * **Note:** Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully. */ failureReason: string | null; /** * A detailed message about the failure. * * **Availability:** Present when `status` is `"FAILED"`. */ failureMessage: string | null; /** * Any metadata that was provided when creating the extract run. * * **Availability:** Present when metadata was provided during creation. */ metadata: Extend.RunMetadata | null; /** Indicates whether the run has been reviewed by a human. */ reviewed: boolean; /** Indicates whether the run results have been edited during review. */ edited: boolean; /** * Details of edits made during review. * * **Availability:** Present when `edited` is `true`. */ edits: Record | null; /** * The configuration used for this extract run. This is a union of two possible shapes: * * - **[JSON Schema config](https://docs.extend.ai/2026-02-09/product/extraction/schema):** The current config format. All runs created through this API version use this shape. * - **[Legacy config](https://docs.extend.ai/2025-04-21/product/legacy/legacy-schema):** A fields-array config from a previous API version. This shape is only returned when retrieving runs that were originally created with the legacy format. This API version does not support creating runs with legacy configs. */ config: Extend.ExtractConfig; /** * The extractor that was used for this run. * * **Availability:** Present when an extractor reference was provided. Not present when using inline `config`. */ extractor: Extend.ExtractorSummary | null; /** * The version of the extractor that was used for this run. * * **Availability:** Present when an extractor reference was provided. Not present when using inline `config`. */ extractorVersion: Extend.ExtractorVersionSummary | null; /** The file that was processed. */ file: Extend.FileSummary; /** * The ID of the parse run that was used for this extract run. * * **Availability:** Present when a parse run was created. */ parseRunId: string | null; /** The URL to view the extract run in the Extend dashboard. */ dashboardUrl: string; /** * Usage credits consumed by this extract run. * * **Availability:** Present when `status` is `"PROCESSED"`. Will not be returned for runs created before October 7, 2025 or for customers on legacy billing systems. */ usage: Extend.RunUsage | null; createdAt: Extend.CreatedAt; updatedAt: Extend.UpdatedAt; }