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

# Data Extraction (synchronous)

> Upload a file and extract its content.



## OpenAPI

````yaml post /projects/{project_name}/tables/{table_id}/extract
openapi: 3.0.3
info:
  title: Cloudsquid
  description: This is the backend of cloudsquid specification
  termsOfService: cloudsquid.io
  contact:
    email: info@cloudsquid.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.11
servers:
  - url: https://api.cloudsquid.io/api
    description: API
security:
  - api-key: []
paths:
  /projects/{project_name}/tables/{table_id}/extract:
    parameters:
      - name: project_name
        in: path
        required: true
        description: The name of the project
        schema:
          type: string
      - name: table_id
        in: path
        required: true
        description: The ID of the table
        schema:
          type: string
          format: uuid
    post:
      tags:
        - unified
      summary: Synchronous extraction for a file end to end
      description: This is a blocking call until the extraction is done.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Document'
      responses:
        '200':
          description: Successfully extracted file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataRow'
        '400':
          description: Bad or malformed request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Something unexpected happened
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Document:
      type: object
      properties:
        mimetype:
          description: the mimetype of the document being uploaded
          type: string
          enum:
            - application/pdf
            - application/json
            - image/jpg
            - image/jpeg
            - image/png
            - text/csv
            - text/plain
            - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
            - application/vnd.ms-excel
            - video/mp4
            - audio/mp3
            - audio/wav
            - audio/ogg
            - multipart/related
            - message/rfc822
        filename:
          description: the name of the file being uploaded
          type: string
        file_type:
          description: >-
            Indicates whether the file is a binary upload or a signed link to
            the document.
          type: string
          enum:
            - uri
            - binary
            - multipart
        file:
          oneOf:
            - type: string
              format: uri
              description: A signed URL to the file.
            - type: string
              description: A base64 encoded string of the file.
            - type: array
              description: A multipart file upload.
              items:
                type: object
                properties:
                  text:
                    type: string
                    description: The text content of the file.
                  file:
                    type: object
                    properties:
                      mimetype:
                        type: string
                        description: The MIME type of the file.
                      file_type:
                        description: >-
                          Indicates whether the file is a binary upload or a
                          signed link to the document.
                        type: string
                        enum:
                          - uri
                          - binary
                      content:
                        oneOf:
                          - type: string
                            description: The base64 encoded content of the file.
                          - type: string
                            format: uri
                            description: A signed URL to the file.
                    required:
                      - mimetype
                      - file_type
                      - content
      required:
        - file
        - mimetype
        - filename
        - file_type
    DataRow:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Data'
        created_at:
          type: string
          format: date-time
        reasoning:
          type: string
        row_id:
          type: string
          format: uuid
        review:
          $ref: '#/components/schemas/Review'
        status:
          $ref: '#/components/schemas/RunStatus'
        input:
          $ref: '#/components/schemas/AgentJobInput'
      required:
        - data
        - row_id
        - created_at
    Error:
      type: object
      properties:
        errorMessage:
          type: string
      required:
        - errorMessage
    Data:
      type: object
      additionalProperties:
        oneOf:
          - type: string
          - type: boolean
          - type: number
          - type: array
            items:
              oneOf:
                - type: string
                - type: boolean
                - type: number
      description: >-
        Object with direct values for each key, allowing single values or arrays
        of values.
    Review:
      type: object
      properties:
        approved:
          type: boolean
          description: Whether it is approved or not
        comment:
          type: string
          description: review comment
        reviewed_by:
          type: string
          description: Email of the user who reviewed it
        review_date:
          type: string
          format: date-time
      required:
        - comment
        - reviewed_by
        - review_date
    RunStatus:
      type: string
      description: status of the AI run
      enum:
        - running
        - done
        - error
        - pending
    AgentJobInput:
      type: object
      properties:
        files:
          type: array
          description: Filesystem object references
          items:
            $ref: '#/components/schemas/AgentJobFilesystemObject'
        data:
          description: Arbitrary data payload
          type: object
          additionalProperties: true
      required:
        - data
    AgentJobFilesystemObject:
      type: object
      properties:
        id:
          type: string
          format: uuid
      required:
        - id
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-API-Key

````