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

# Read a bounded chunk of existing extracted text

> Read-only optional representation for persistent files with an existing extraction in versioned storage, including SERFF. Never starts acquisition, OCR, extraction or materialization. Rechecks content access and export policy on every request. Reads at most maxBytes + 128 text bytes from storage; JSON is below 400 KiB including escaping. Source-page mapping is not inferred. A changed revision requires restarting without a cursor.



## OpenAPI

````yaml /openapi.json get /files/{fileId}/text
openapi: 3.0.3
info:
  title: Effective API
  version: 2.0.0
  description: The public Effective REST API. Authenticate using an Effective API key.
servers:
  - url: https://canary.effectiveai.app/api/v2
    description: Canary
security:
  - bearerAuth: []
paths:
  /files/{fileId}/text:
    get:
      tags:
        - Files
      summary: Read a bounded chunk of existing extracted text
      description: >-
        Read-only optional representation for persistent files with an existing
        extraction in versioned storage, including SERFF. Never starts
        acquisition, OCR, extraction or materialization. Rechecks content access
        and export policy on every request. Reads at most maxBytes + 128 text
        bytes from storage; JSON is below 400 KiB including escaping.
        Source-page mapping is not inferred. A changed revision requires
        restarting without a cursor.
      operationId: readFileText
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: fileId
          in: path
        - schema:
            type: integer
            minimum: 4
            maximum: 65536
            default: 16384
            description: >-
              Maximum UTF-8 bytes of text per response, 4–65536 (default 16384).
              Character boundaries may shorten a chunk. Repeat unchanged with
              cursor.
          required: false
          description: >-
            Maximum UTF-8 bytes of text per response, 4–65536 (default 16384).
            Character boundaries may shorten a chunk. Repeat unchanged with
            cursor.
          name: maxBytes
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 128
            description: >-
              Opaque nextCursor. Fixed 24-hour lifetime; bound to caller scope,
              file, maxBytes and text revision.
          required: false
          description: >-
            Opaque nextCursor. Fixed 24-hour lifetime; bound to caller scope,
            file, maxBytes and text revision.
          name: cursor
          in: query
      responses:
        '200':
          description: A revision-bound text chunk with byte location and continuation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2FileText'
        '400':
          description: >-
            invalid_request or invalid_cursor. For invalid, expired, differently
            bound or changed-revision cursors, restart without cursor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '403':
          description: 'download_restricted: visible file is restricted from content export.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '404':
          description: 'not_found: file is missing or inaccessible.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '409':
          description: >-
            text_unavailable: no supported, revision-bound UTF-8 extraction
            exists. Try the original download; this request starts no work.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '503':
          description: >-
            temporarily_unavailable: storage or continuation dependency failed.
            Retry the same request after Retry-After seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
      security:
        - bearerAuth: []
components:
  schemas:
    V2FileText:
      type: object
      properties:
        fileId:
          type: string
          format: uuid
        textRevision:
          type: string
          maxLength: 68
          description: >-
            Opaque identity of this extracted-text revision, distinct from an
            original-file version. Changed text invalidates continuation.
        versionId:
          type: string
          nullable: true
          description: >-
            Source file version that produced this extraction, or null when
            unproven. Currently null; never inferred from the current download.
        text:
          type: string
          maxLength: 65536
          description: >-
            Existing UTF-8 extracted text, at most maxBytes UTF-8 bytes. Empty
            available text is a successful terminal response. Page markers, if
            present, remain in text.
        location:
          type: object
          properties:
            startOffsetBytes:
              type: integer
              minimum: 0
              description: Inclusive zero-based UTF-8 byte offset in this text revision.
            endOffsetBytes:
              type: integer
              minimum: 0
              description: >-
                Exclusive UTF-8 byte offset. Source-page coordinates are not
                verified by this representation.
          required:
            - startOffsetBytes
            - endOffsetBytes
        nextCursor:
          type: string
          nullable: true
          description: >-
            Continue with the same file and maxBytes, or null at the end. Retry
            the same request safely; deduplicate by revision and start offset.
      required:
        - fileId
        - textRevision
        - versionId
        - text
        - location
        - nextCursor
    V2CodedError:
      allOf:
        - $ref: '#/components/schemas/V2Error'
        - type: object
          properties:
            code:
              type: string
              minLength: 1
              description: Stable error code. Clients must tolerate unknown future codes.
            details:
              type: array
              items:
                type: object
                properties:
                  location:
                    type: string
                    enum:
                      - path
                      - query
                      - header
                      - body
                  path:
                    type: array
                    items:
                      type: string
                      maxLength: 64
                    maxItems: 12
                  code:
                    type: string
                    enum:
                      - required
                      - invalid_type
                      - invalid_value
                      - unknown_field
                  message:
                    type: string
                    minLength: 1
                    maxLength: 200
                required:
                  - location
                  - path
                  - code
                  - message
              minItems: 1
              maxItems: 20
              description: Bounded safe validation issues; may omit some invalid fields.
            requestId:
              type: string
              minLength: 1
              maxLength: 128
              description: >-
                Existing server correlation for this HTTP attempt, when
                available.
          required:
            - code
    V2Error:
      type: object
      properties:
        error:
          type: string
          minLength: 1
          description: Human-readable explanation of the failure.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Effective API key. Send Authorization: Bearer sk-eai-...'

````

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