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

# Plan file extraction

> Plan an extraction run and its cost before starting it.

**Operation ID:** `http.semantic_tasks.file_extractions.plan`

```http theme={null}
POST /v1/orgs/{org}/projects/{project}/semantic-tasks/file-extractions/plan
```


## OpenAPI

````yaml openapi.json POST /v1/orgs/{org}/projects/{project}/semantic-tasks/file-extractions/plan
openapi: 3.1.0
info:
  title: Penumbra API
  version: v1
  description: >-
    HTTP reference for Files, search, extraction, reviews, Graph, Shapes and
    sharing.
servers:
  - url: https://api.pnbr.io
    description: Penumbra API
security: []
paths:
  /v1/orgs/{org}/projects/{project}/semantic-tasks/file-extractions/plan:
    post:
      tags:
        - Extraction
      summary: Plan file extraction
      description: |-
        Plan an extraction run and its cost before starting it.

        Product guidance: [Extraction](/concepts/extraction).
      operationId: http.semantic_tasks.file_extractions.plan
      parameters:
        - name: org
          in: path
          required: true
          schema:
            type: string
        - name: project
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/http_semantic_tasks_file_extractions_plan_request
      responses:
        2XX:
          description: Success.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/http_semantic_tasks_file_extractions_plan_response
      security:
        - bearerAuth: []
components:
  schemas:
    http_semantic_tasks_file_extractions_plan_request:
      type: object
      properties:
        scope:
          oneOf:
            - type: object
              properties:
                kind:
                  type: string
                  const: files
                file_ids:
                  minItems: 1
                  maxItems: 256
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - kind
                - file_ids
              additionalProperties: false
            - type: object
              properties:
                kind:
                  type: string
                  const: collection
                collection_id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - kind
                - collection_id
              additionalProperties: false
        preset:
          oneOf:
            - type: object
              properties:
                kind:
                  type: string
                  const: shape
                shape:
                  type: string
                  minLength: 1
                  maxLength: 256
              required:
                - kind
                - shape
              additionalProperties: false
            - type: object
              properties:
                kind:
                  type: string
                  const: lens
                lens: {}
              required:
                - kind
                - lens
              additionalProperties: false
        level:
          description: >-
            How thorough the extraction is: standard (items are double-checked
            before review) or fast (one read, no double-check). Omit for the
            project's default.
          type: string
          enum:
            - standard
            - fast
            - deep
      required:
        - scope
        - preset
      additionalProperties: false
    http_semantic_tasks_file_extractions_plan_response:
      type: object
      properties:
        data:
          type: object
          properties:
            schema:
              type: string
              const: penumbra.file-extraction-plan
            version:
              type: number
              const: 1
            scope:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      const: files
                    file_ids:
                      minItems: 1
                      maxItems: 256
                      type: array
                      items:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  required:
                    - kind
                    - file_ids
                  additionalProperties: false
                - type: object
                  properties:
                    kind:
                      type: string
                      const: collection
                    collection_id:
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  required:
                    - kind
                    - collection_id
                  additionalProperties: false
            collection:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                    revision:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                  required:
                    - id
                    - name
                    - revision
                  additionalProperties: {}
                - type: 'null'
            files:
              type: array
              items:
                type: object
                properties:
                  file_id:
                    type: string
                  name:
                    type: string
                  version_id:
                    type: string
                  version_number:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  text_bytes:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                required:
                  - file_id
                  - name
                  - version_id
                  - version_number
                  - text_bytes
                additionalProperties: {}
            total_text_bytes:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            max_source_bytes:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            shape:
              type: object
              properties:
                id:
                  type: string
                name:
                  type: string
              required:
                - id
                - name
              additionalProperties: {}
            types:
              type: array
              items:
                type: object
                properties:
                  type_id:
                    type: string
                  name:
                    type: string
                  route:
                    type: string
                    enum:
                      - record
                      - synthesis
                required:
                  - type_id
                  - name
                  - route
                additionalProperties: {}
            level:
              anyOf:
                - type: string
                - type: 'null'
            estimate:
              anyOf:
                - type: object
                  properties:
                    expected_credits:
                      type: number
                    high_credits:
                      type: number
                  required:
                    - expected_credits
                    - high_credits
                  additionalProperties: {}
                - type: 'null'
            max_credits:
              anyOf:
                - type: number
                - type: 'null'
            partial_policy:
              type: string
              const: deliver_completed
            unattended:
              anyOf:
                - type: object
                  properties:
                    allowed:
                      type: boolean
                    per_run_cap_credits:
                      anyOf:
                        - type: number
                        - type: 'null'
                  required:
                    - allowed
                    - per_run_cap_credits
                  additionalProperties: {}
                - type: 'null'
            plan_digest:
              type: string
          required:
            - schema
            - version
            - scope
            - collection
            - files
            - total_text_bytes
            - max_source_bytes
            - shape
            - types
            - level
            - estimate
            - max_credits
            - partial_policy
            - unattended
            - plan_digest
          additionalProperties: {}
      required:
        - data
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.