> ## 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 (async)

> Submit an extraction against a JSON schema and return immediately with a job id. Provide the document either as a `multipart/form-data` upload (`file`) or, to reuse an existing parse, as an `application/json` body with a `document_job_id` from POST /documents (the document is not re-parsed). 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
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:
    post:
      tags:
        - Documents
      summary: Submit a deep-transform extraction (async)
      description: >-
        Submit an extraction against a JSON schema and return immediately with a
        job id. Provide the document either as a `multipart/form-data` upload
        (`file`) or, to reuse an existing parse, as an `application/json` body
        with a `document_job_id` from POST /documents (the document is not
        re-parsed). Poll status via GET /documents/deep-transform/{job_id} and
        download artifacts once it succeeds. Submission is idempotent on the
        (document, schema) pair.
      operationId: submitDeepTransform
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
                - schema
              properties:
                file:
                  type: string
                  format: binary
                  description: Document file to extract from
                schema:
                  type: string
                  description: JSON Schema (as a JSON string) of the entities to extract
                root_name:
                  type: string
                  description: >-
                    Name of the root entity in the schema. Optional: resolved
                    from the schema's title or inferred when omitted.
                guidance:
                  type: string
                  description: Optional domain guidance for the extraction
                max_pages:
                  type: integer
                  description: Optional cap on the number of pages to process
          application/json:
            schema:
              type: object
              required:
                - document_job_id
                - schema
              properties:
                document_job_id:
                  type: string
                  description: >-
                    A document job id from POST /documents; reuses that parse
                    instead of re-parsing
                schema:
                  type: object
                  description: JSON Schema of the entities to extract
                root_name:
                  type: string
                  description: >-
                    Name of the root entity in the schema. Optional: resolved
                    from the schema's title or inferred when omitted.
                guidance:
                  type: string
                  description: Optional domain guidance for the extraction
                max_pages:
                  type: integer
                  description: Optional cap on the number of pages to process
      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: |-
            from meibel import MeibelClient

            client = MeibelClient(api_key="your-api-key")

            # Upload a file
            with open("document.pdf", "rb") as f:
                result = client.documents.submit_deep_transform(file=f, filename="document.pdf")
                print(result)
        - lang: TypeScript
          label: TypeScript
          source: >-
            import { MeibelClient } from 'meibel';


            const client = new MeibelClient({ apiKey: 'your-api-key' });


            import fs from 'fs';


            // Upload a file

            const file = fs.createReadStream('document.pdf');

            const result = await client.documents.submitDeepTransform(file,
            'document.pdf');

            console.log(result);
        - lang: Go
          label: Go
          source: >-
            import v2 "github.com/meibel-ai/meibel-go/v2"


            client := v2.NewClient(v2.WithAPIKey("your-api-key"))

            ctx := context.Background()


            // Upload a file

            f, err := os.Open("document.pdf")

            if err != nil {
                log.Fatal(err)
            }

            defer f.Close()


            result, err := client.Documents.SubmitDeepTransform(ctx, f,
            "document.pdf", nil)

            if err != nil {
                log.Fatal(err)
            }

            fmt.Println(result)
components:
  schemas:
    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

````