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

# Prepare receipt upload

> Prepares an image or PDF upload for a task cost.

Task cost receipts have a **10 MB** limit. See the [receipt upload steps](https://docs.conduit.ai/api-reference/tasks/costs.md#attach-a-receipt).


## OpenAPI

````yaml POST /v1/uploads
openapi: 3.0.0
info:
  title: Conduit API
  version: 1.0.0
  description: Public API for Conduit.
servers:
  - url: https://api.conduit.ai
    description: Production
security: []
tags:
  - name: meta
    description: Discovery and API metadata endpoints.
  - name: agents
    description: >-
      Chat agent configuration, including instructions, skills, triggers, and
      automation behavior.
  - name: contacts
    description: >-
      Contact profile and contact-scoped related resources such as tickets and
      calls.
  - name: workspaces
    description: Workspaces accessible to the current API token.
  - name: escalations
    description: >-
      Chat escalations that require operator review, including message, proposed
      response, and disposition context when available.
  - name: conversations
    description: >-
      Canonical message threads. Use these endpoints to list threads, inspect
      conversation state, read transcripts, and send replies.
  - name: conversation-tags
    description: >-
      Conversation labels, root topics, and subtopics used for classification
      and topic analytics.
  - name: tickets
    description: >-
      Operational queue items tied to conversations, including ticket-scoped
      transcripts and replies.
  - name: calls
    description: Phone call records, transcripts, summaries, and recordings when available.
  - name: reservations
    description: >-
      PMS reservations synced from the workspace's integrations (Hostaway,
      Guesty, Airbnb, etc.), including guest identity, payment status, and stay
      dates.
  - name: appointments
    description: >-
      Scheduled appointments (bookings) backed by the Conduit booking service.
      Exposes allocation context and the upstream booking-service `external_id`.
  - name: helpdesk_tickets
    description: >-
      Helpdesk tickets mirrored from external helpdesk integrations (Zendesk,
      Pylon, Plain), including requester identity and upstream metadata.
  - name: kb
    description: >-
      Knowledge base search and node management. Nodes represent knowledge base
      entries (files or directories), chunks are the indexed retrieval units
      used by search.
  - name: skills
    description: >-
      Workspace agent skills that can be attached to chat agents.
      Sidebar/global-assistant skills are intentionally excluded.
  - name: custom_tools
    description: >-
      Custom code tools: user-authored Python/JavaScript functions executed in a
      sandbox when an agent calls them. Includes a runtimes endpoint describing
      the entrypoint signature, return shape, and available dependencies per
      language.
  - name: inbox_types
    description: >-
      Workspace inbox types. Each id is stable and usable as a message trigger's
      `inbox_type_id` and as the `inbox_type_id` filter on list conversations.
  - name: workflows
    description: >-
      Workspace automation workflows: definitions, executions, and per-execution
      event timelines.
  - name: insights
    description: Aggregated workspace analytics, such as conversation automation rate.
paths:
  /v1/uploads:
    post:
      tags:
        - uploads
      summary: Prepare File Upload
      description: >-
        Prepare a direct upload for a file, such as an image or PDF, so a tool
        that accepts a file can use it by its upload_id.


        Workflow:

        1. Call this tool with filename, content_type, and the exact size in
        bytes.

        2. Upload the raw bytes with PUT to upload_request.url, outside MCP,
        sending upload_request.headers exactly as given.

        3. After the PUT succeeds, pass upload_id wherever a tool accepts an
        uploaded file.


        Do not base64-encode or transform the file. Use curl --data-binary @path
        or fetch(url, { method: "PUT", body: blob }).

        The upload is refused, and nothing is kept, if the Content-Type differs
        from content_type or the body is not exactly size bytes.

        The URL works once and expires after one hour; an upload_id that is
        never used is deleted with its file. Prepare a new upload for each file
        and each use. Files can be up to 50 MB.


        Example:

        curl -X PUT --data-binary @report.pdf -H "Content-Type: application/pdf"
        "<upload_request.url>"
      operationId: prepareFileUpload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_id:
                  type: string
                  description: Workspace identifier from `list_workspaces`
                filename:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: File name with extension, e.g. floor-plan.pdf
                content_type:
                  type: string
                  minLength: 1
                  description: MIME type, e.g. image/png or application/pdf
                size:
                  type: integer
                  minimum: 1
                  maximum: 52428800
                  description: Exact file size in bytes, up to 52428800
              required:
                - workspace_id
                - filename
                - content_type
                - size
      responses:
        '200':
          description: Prepare File Upload
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      upload_id:
                        type: string
                      upload_request:
                        type: object
                        properties:
                          url:
                            type: string
                          method:
                            type: string
                            enum:
                              - PUT
                          headers:
                            type: object
                            properties:
                              Content-Type:
                                type: string
                            required:
                              - Content-Type
                        required:
                          - url
                          - method
                          - headers
                      expires_at:
                        type: string
                        description: ISO 8601 time after which the URL stops working
                    required:
                      - upload_id
                      - upload_request
                      - expires_at
                required:
                  - data
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Token
      description: >-
        Conduit API token. Use `Authorization: Bearer <token>`. Read/write
        endpoints require a token with write access.

````

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