> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meibel.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit a deep-transform extraction reusing a parsed document (async)

> Submit an extraction that reuses an already-parsed document (by `document_job_id` from POST /documents) instead of re-parsing an upload. Returns immediately with a job id. Poll status via GET /documents/deep-transform/{job_id} and download artifacts once it succeeds. Submission is idempotent on the (document, schema) pair.



## OpenAPI

````yaml /api-v2.json post /documents/deep-transform/from-document
openapi: 3.1.0
info:
  title: Meibel AI API
  summary: Meibel Gateway Service
  description: >-
    Our API allows you to interact with our services. Read the
    [docs](https://docs.meibel.ai) to learn how to use it.
  version: 0.6.4
servers:
  - url: https://api.meibel.ai/v2
    description: Meibel API (v2)
  - url: https://api.dev.meibel.ai/v2
    description: Meibel Dev API (v2)
  - url: http://localhost:8000/v2
    description: Local Development
security: []
tags:
  - name: Datasources
    description: v2 datasource management
  - name: Data Elements
    description: v2 data element CRUD and search
  - name: File Upload
    description: Upload files to a datasource and track upload progress
  - name: Ingest
    description: Trigger and monitor datasource ingestion
  - name: Datasource Downloads
    description: Export all datasource content as a zip archive
  - name: Table Descriptions
    description: v2 table and column descriptions
  - name: Metadata Model Catalog
    description: v2 metadata model catalog
  - name: Confidence Scoring
    description: v2 confidence scoring jobs and summaries
  - name: Documents
    description: Parse and transform documents into structured data
  - name: Agents
    description: Agent definition management
  - name: Sessions
    description: Agent session (execution) management and chat
  - name: Execution Policies
    description: Data access and tool usage constraints scoped to agent sessions
  - name: Artifact Schemas
    description: Agent artifact schema management
paths:
  /documents/deep-transform/from-document:
    post:
      tags:
        - Documents
      summary: Submit a deep-transform extraction reusing a parsed document (async)
      description: >-
        Submit an extraction that reuses an already-parsed document (by
        `document_job_id` from POST /documents) instead of re-parsing an upload.
        Returns immediately with a job id. Poll status via GET
        /documents/deep-transform/{job_id} and download artifacts once it
        succeeds. Submission is idempotent on the (document, schema) pair.
      operationId: submitDeepTransformFromDocument
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitDeepTransformFromDocument'
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitDeepTransformResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: Python
          label: Python
          source: |-
            import os
            from meibel import MeibelClient
            from meibel.models import SubmitDeepTransformFromDocument

            client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])

            schema = {
                "title": "Invoice",
                "type": "object",
                "properties": {
                    "invoice_number": {"type": "string"},
                    "total_amount": {"type": "number"},
                    "due_date": {"type": "string", "format": "date"},
                },
                "required": ["invoice_number", "total_amount"],
            }

            response = client.documents.submit_deep_transform_from(
                SubmitDeepTransformFromDocument(
                    document_job_id="docjob_8f3a1c2e9b",
                    schema=schema,
                    root_name="Invoice",
                    guidance="Extract line items from the invoice's charges table",
                    max_pages=10,
                )
            )

            print(f"Submitted deep-transform job: {response.job_id}")
        - lang: TypeScript
          label: TypeScript
          source: >-
            import { MeibelClient } from "meibel";


            const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY
            });


            const response = await client.documents.submitDeepTransformFrom({
              document_job_id: "doc_job_9f8a7b6c5d",
              schema: {
                title: "Invoice",
                type: "object",
                properties: {
                  invoice_number: { type: "string" },
                  total_amount: { type: "number" },
                  line_items: {
                    type: "array",
                    items: {
                      type: "object",
                      properties: {
                        description: { type: "string" },
                        quantity: { type: "integer" },
                        unit_price: { type: "number" },
                      },
                    },
                  },
                },
                required: ["invoice_number", "total_amount"],
              },
              root_name: "Invoice",
              guidance: "Extract line items exactly as they appear, preserving original ordering",
              max_pages: 10,
            });


            console.log(`Submitted deep-transform job: ${response.job_id}`);
        - lang: Go
          label: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tv2 \"github.com/meibel-ai/meibel-go/v2\"\n)\n\nfunc main() {\n\tclient := v2.NewClient(v2.WithAPIKey(os.Getenv(\"MEIBEL_API_KEY\")))\n\n\tschema := map[string]any{\n\t\t\"title\": \"Invoice\",\n\t\t\"type\":  \"object\",\n\t\t\"properties\": map[string]any{\n\t\t\t\"invoice_number\": map[string]any{\"type\": \"string\"},\n\t\t\t\"total_amount\":   map[string]any{\"type\": \"number\"},\n\t\t\t\"due_date\":       map[string]any{\"type\": \"string\", \"format\": \"date\"},\n\t\t},\n\t\t\"required\": []string{\"invoice_number\", \"total_amount\"},\n\t}\n\n\tresp, err := client.Documents.SubmitDeepTransformFrom(context.Background(), v2.SubmitDeepTransformFromDocument{\n\t\tDocumentJobID: \"doc_job_9f8a7b6c5d4e\",\n\t\tSchema:        schema,\n\t\tRootName:      v2.String(\"Invoice\"),\n\t\tGuidance:      v2.String(\"Extract totals from the final summary table, not line items\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"Submitted deep-transform job: %s\\n\", resp.JobID)\n}"
components:
  schemas:
    SubmitDeepTransformFromDocument:
      properties:
        document_job_id:
          type: string
          title: Document Job Id
          description: >-
            A document job id returned by POST /documents. Reuses that parse so
            the document is not parsed again. The document must belong to the
            calling customer.
        schema:
          additionalProperties: true
          type: object
          title: Schema
          description: JSON Schema of the entities to extract
        root_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Root Name
          description: >-
            Name of the root entity in the schema. Optional: when omitted it is
            resolved from the schema's `title` or inferred during extraction.
        guidance:
          anyOf:
            - type: string
            - type: 'null'
          title: Guidance
          description: Optional domain guidance for the extraction
        max_pages:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Pages
          description: Optional cap on the number of pages to process
      type: object
      required:
        - document_job_id
        - schema
      title: SubmitDeepTransformFromDocument
      description: Reuse an already-parsed document instead of re-parsing an upload.
    SubmitDeepTransformResponse:
      properties:
        job_id:
          type: string
          title: Job Id
          description: Poll status via GET /documents/deep-transform/{job_id}
      type: object
      required:
        - job_id
      title: SubmitDeepTransformResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Meibel-API-Key

````