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

# Get upload by ID

> Retrieves a single upload by Mongo ObjectId with user and institution populated. The thumbnail Buffer is returned base64-encoded, and if the embeddings DB connection is ready an embeddings array of chunk text (sorted by chunkIndex) is attached.



## OpenAPI

````yaml /mdx/api-reference/admin/admin-api.json get /api/admin/upload/{id}
openapi: 3.0.0
info:
  title: Pria Admin API
  version: 2.0.1
  description: >-
    Pria API Documentation Praxis's developer platform is a core part of our
    mission to empower organizations to grow better. Our APIs are designed to
    enable teams of any shape or size to build robust integrations that help
    them customize and get the most value out of Pria. All Pria APIs are built
    using REST conventions and designed to have a predictable URL structure.
    <br/>  <br/>They use many standard HTTP features, including methods (POST,
    GET, PUT, DELETE) and error response codes.  <br/> <br/>All API calls are
    made under https://hiimpria.ai/api and all responses return standard JSON.
    In these docs, you'll find lists of all available endpoints for a given API,
    along with interactive code blocks for building requests. For walkthroughs
    of basic usage for these APIs, check out the API guides.
servers:
  - url: https://pria.praxislxp.com
    description: Pria API Server
security: []
tags:
  - name: Authentication
    description: User authentication, registration, and password management (/api/auth)
  - name: OAuth
    description: OAuth authentication providers - Google, GitHub, SSO (/api/auth/oauth)
  - name: User
    description: User profile management and account operations (/api/user)
  - name: User Institutions
    description: User institution memberships and switching (/api/user/institution)
  - name: User Tools
    description: Available tools for authenticated users (/api/user/tools)
  - name: Institutions
    description: Institution settings and configuration (/api/user/institution)
  - name: Conversation
    description: AI conversation and Q&A endpoints (/api/ai)
  - name: Realtime
    description: Real-time voice AI and WebRTC sessions (/api/ai/rt)
  - name: Assistant
    description: AI assistant configuration and management (/api/user/assistant)
  - name: History
    description: Conversation history and favorites (/api/user/history)
  - name: RAG
    description: >-
      Document upload, embedding, and retrieval-augmented generation
      (/api/user/files, /api/user/rag)
  - name: Setting
    description: Instance variables and settings management (/api/user/setting)
  - name: Branding
    description: Digital twin branding and customization (/api/agent/branding)
  - name: Agent
    description: Agent engagement and session management (/api/agent)
  - name: SDK Launch
    description: >-
      SDK launch token signing and verification for secure iframe embedding
      (/api/auth/sdk-sign, /api/auth/sdk-verify)
  - name: Testing
    description: Health checks, diagnostics, and test endpoints (/api/test)
  - name: Admin Accounts
    description: Account management for super admins (/api/admin/account)
  - name: Admin Institutions
    description: Institution management for admins (/api/admin/institution)
  - name: Admin Users
    description: User management for admins (/api/admin/user)
  - name: Admin Entitlements
    description: >-
      User-institution relationships and permissions
      (/api/admin/userInstitution)
  - name: Admin Sessions
    description: Session management for admins (/api/admin/session)
  - name: Admin Histories
    description: Conversation history management and analytics (/api/admin/history)
  - name: Admin Assistants
    description: AI assistant management for admins (/api/admin/assistant)
  - name: Admin Questions
    description: Institution question and prompt management (/api/admin/question)
  - name: Admin Tools
    description: Tool configuration management (/api/admin/tool)
  - name: Admin AI Models
    description: AI model configuration (/api/admin/aimodel)
  - name: Admin MCP Servers
    description: Model Context Protocol server management (/api/admin/mcpserver)
  - name: Admin Feedbacks
    description: User feedback management (/api/admin/feedback)
  - name: Admin Uploads
    description: Upload management (/api/admin/upload)
  - name: Admin Charts
    description: Analytics and visualization chart management (/api/admin/chart)
  - name: Admin Memory
    description: Admin inspection and editing of user/instance memory parameters.
  - name: Admin Usage Limits
    description: Per-user usage-vs-cap reporting and account-wide at-limit counts.
paths:
  /api/admin/upload/{id}:
    get:
      tags:
        - Admin Uploads
      summary: Get upload by ID
      description: >-
        Retrieves a single upload by Mongo ObjectId with user and institution
        populated. The thumbnail Buffer is returned base64-encoded, and if the
        embeddings DB connection is ready an embeddings array of chunk text
        (sorted by chunkIndex) is attached.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: Upload ID (Mongo ObjectId)
      responses:
        '200':
          description: Upload retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
        '400':
          description: >-
            Bad request — missing or malformed upload id, or an unexpected error
            was thrown
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Invalid upload Id
        '404':
          description: Upload not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Upload not found
      security:
        - apiKeyAuth: []
components:
  schemas:
    UploadResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          $ref: '#/components/schemas/Upload'
    Upload:
      type: object
      description: >-
        Admin view of an upload row. Mirrors the persisted shape from
        routes/models/upload.js, with two admin-handler shape changes: (1)
        thumbnail is returned as a base64-encoded string instead of a Buffer,
        and (2) an embeddings array of chunk text strings is appended when the
        embeddings DB connection is ready.
      properties:
        _id:
          type: string
          description: Upload ID (Mongo ObjectId)
        filename:
          type: string
          description: System-generated unique filename used as the on-disk identifier
        originalname:
          type: string
          description: Original filename as uploaded by the user (display name)
        mimetype:
          type: string
          description: MIME type of the file
        thumbnail:
          type: string
          description: >-
            Base64-encoded thumbnail (admin endpoint converts the underlying
            Buffer to base64 before returning)
        created:
          type: string
          format: date-time
          description: Upload creation timestamp
        filesize:
          type: integer
          description: File size in bytes
        status:
          type: string
          enum:
            - inactive
            - selected
            - active
            - error
            - deleted
          description: >-
            Persisted upload state. inactive: waiting on RAG / ingestion queue
            (default). selected: RAG-ingested and included in the vault. active:
            uploaded with skipIndexing — visible but not RAG-indexed. error:
            RAG/ingestion failed. deleted: soft-delete tombstone.
        user:
          oneOf:
            - type: string
            - type: object
          description: >-
            User ID who uploaded the file. Populated on GET
            /api/admin/upload/{id} with { fname, lname, email }.
          properties:
            _id:
              type: string
            email:
              type: string
              format: email
            fname:
              type: string
            lname:
              type: string
        institution:
          oneOf:
            - type: string
            - type: object
          description: >-
            Institution ID the file is shared with (null for personal files).
            Populated on GET /api/admin/upload/{id} with { name }.
          properties:
            _id:
              type: string
            name:
              type: string
        account_shared:
          type: boolean
          description: >-
            When true the file is shared across all institutions in the same
            account
          default: false
        collection:
          type: string
          description: Collection ID this upload belongs to (null when not in a collection)
        file_summary:
          type: string
          description: AI-generated summary of file content
        file_title:
          type: string
          description: AI-generated title for the file
        file_authors:
          type: string
          description: Authors of the content
        file_url:
          type: string
          description: URL to access the file
        source_url:
          type: string
          description: Original source URL the file was fetched from (when applicable)
        embed_url:
          type: string
          description: Embed URL for the file (when applicable)
        file_dimensions:
          type: string
          description: Image dimensions string (for image files)
        tokens_used:
          type: integer
          description: >-
            Number of tokens consumed processing this file (summarization +
            embeddings)
          default: 0
        is_public:
          type: boolean
          description: >-
            When true the file is publicly accessible (anyone with the link, no
            auth)
          default: false
        is_private:
          type: boolean
          description: >-
            When true the file is confidential (owner-only access, suppressed
            from citations). Cannot coexist with is_public:true.
          default: false
        embeddings_model:
          type: string
          description: Model identifier used to generate the embeddings
        summary_model:
          type: string
          description: Model identifier used to generate the file summary
        image_analysis_model:
          type: string
          description: Model identifier used for image analysis
        audio_analysis_model:
          type: string
          description: Model identifier used for audio analysis
        googleDriveFileId:
          type: string
          description: Google Drive file ID when synced from Drive
        googleDriveModifiedTime:
          type: string
          format: date-time
          description: Last-modified timestamp from Google Drive
        ragHitCount:
          type: integer
          description: >-
            Count of times this file appeared in RAG search results
            (deduplicated per search)
          default: 0
        lastRagHitAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp of most recent RAG search match
        vaultHealthScore:
          type: integer
          nullable: true
          description: >-
            Percentage (0-100) of chunks flagged as unoptimized content. null =
            not yet scanned.
        downloadCount:
          type: integer
          description: Number of times the file has been downloaded
          default: 0
        lastDownloadAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp of the most recent download
        diskMissCount:
          type: integer
          description: >-
            Strike counter incremented when res.sendFile errors on a selected
            upload (record exists but file missing from disk). Auto-tombstones
            after N strikes past the grace window — see
            routes/middlewares/uploadAuth.js.
          default: 0
        diskMissFirstAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp of the first disk-miss strike in the current run
        batchId:
          type: string
          nullable: true
          description: >-
            Identifier of the upload batch this file was part of (set when
            uploaded as a multi-file batch)
        history:
          type: string
          nullable: true
          description: >-
            Back-reference to the upload-time History row (runFinalize updates
            it with final usage/credits/price)
        replacedBy:
          type: array
          items:
            type: string
          description: >-
            Upload IDs that supersede this row (set when the original was split
            into parts)
        ingestion:
          type: object
          description: >-
            Per-upload ingestion progress block written by
            routes/middlewares/ingestionWorker.js heartbeats
          properties:
            phase:
              type: string
              enum:
                - queued
                - extract
                - chunk
                - sanitize
                - embed
                - finalize
                - done
                - error
              nullable: true
              description: Current ingestion phase
            progress:
              type: number
              description: 0-1 progress fraction for the active phase
              default: 0
            attempts:
              type: integer
              description: Retry attempts so far
              default: 0
            heartbeatAt:
              type: string
              format: date-time
              nullable: true
              description: Last heartbeat timestamp from the ingestion worker
            claimedBy:
              type: string
              nullable: true
              description: Worker identifier currently processing this upload
            lastError:
              type: string
              nullable: true
              description: Most recent error message (capped at 2000 chars)
            errorStack:
              type: string
              nullable: true
              description: Most recent error stack trace (capped at 4500 chars)
            errorClass:
              type: string
              enum:
                - permanent
                - transient
                - unknown
                - stalled
                - canceled
                - sanitize-threshold
                - sanitize-empty
              nullable: true
              description: Classification of the most recent error
            enqueuedAt:
              type: string
              format: date-time
              nullable: true
            startedAt:
              type: string
              format: date-time
              nullable: true
            completedAt:
              type: string
              format: date-time
              nullable: true
            counts:
              type: object
              description: Per-chunk progress snapshot
              properties:
                total:
                  type: integer
                  default: 0
                sanitized:
                  type: integer
                  default: 0
                embedded:
                  type: integer
                  default: 0
            sanitizeSkippedCount:
              type: integer
              description: >-
                Number of chunks where chunkNeedsSanitize() returned false and
                the sanitize LLM call was skipped
              default: 0
        embeddings:
          type: array
          items:
            type: string
          description: >-
            Admin-only: chunk text strings for every embedding row belonging to
            this upload, sorted by chunkIndex. Only attached when the embeddings
            DB connection is ready; omitted otherwise.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-access-token
      description: JWT token passed in x-access-token header

````