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

# Get attachments text



## OpenAPI

````yaml /openapi.json get /attachments/{id}/text
openapi: 3.1.1
info:
  title: Anima API
  version: 0.1.0
  description: >-
    The Anima API provides programmatic access to unified infrastructure for AI
    agents: create and manage agents; send and receive email; place phone calls
    and send/receive SMS and voice; store and retrieve vault credentials; manage
    agent identity; and configure webhooks for real-time events. Authenticate
    using a Bearer token or an API key passed via the X-API-Key header.
  contact:
    name: Anima Labs
    url: https://useanima.sh
    email: support@useanima.sh
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.useanima.sh/v1
    description: Production
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /attachments/{id}/text:
    get:
      operationId: message.getAttachmentText
      parameters:
        - name: id
          in: path
          required: true
          schema:
            anyOf:
              - type: string
                pattern: ^[0-9a-z]+$
              - type: string
                pattern: ^[cC][^\s-]{8,}$
            description: Unique attachment identifier
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    pattern: ^[cC][^\s-]{8,}$
                    description: Unique identifier of the attachment
                  filename:
                    type: string
                    description: Original filename of the attachment
                  mimeType:
                    type: string
                    description: Declared MIME type of the attachment
                  status:
                    enum:
                      - PENDING
                      - EXTRACTED
                      - UNSUPPORTED
                      - FAILED
                    type: string
                    description: >-
                      Outcome of extraction. EXTRACTED: `text` holds the content
                      (possibly an empty string — a scanned PDF with no text
                      layer extracts to nothing). UNSUPPORTED: no extractor for
                      this file type; only PDF, DOCX, and plain-text formats are
                      supported. FAILED: the bytes could not be parsed
                      (malformed, encrypted, or too large). UNSUPPORTED and
                      FAILED are final — the file never changes, so retrying
                      returns the same answer. PENDING is never returned; it is
                      the pre-extraction state of the stored row.
                  text:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Extracted plain text, or null unless `status` is
                      EXTRACTED. Truncated at 1,000,000 characters. Extracted
                      once and cached, so repeat reads are free.
                required:
                  - id
                  - filename
                  - mimeType
                  - status
                  - text
                description: Text extracted from a PDF, DOCX, or plain-text attachment
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Bearer token obtained from authentication. Pass as: Authorization:
        Bearer <token>
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API key for programmatic access. Pass as: X-API-Key: <your-key>'

````