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

# Initiate Upload

> Initiate an attachment upload.

Returns a temporary upload URL.
The upload must be confirmed after the file is uploaded.



## OpenAPI

````yaml /api-reference/openapi.json post /attachments/upload
openapi: 3.1.0
info:
  title: Aspect API
  description: Manage and search media in Aspect.
  version: 1.0.0
servers:
  - url: https://api.aspect.inc
security:
  - ApiKeyAuth: []
tags:
  - name: Users
  - name: API Keys
  - name: Workspaces
  - name: Projects
  - name: Directories
  - name: Assets
  - name: Attachments
  - name: Filesystem Items
  - name: Jobs
  - name: Collections
  - name: Comments
  - name: Search
  - name: Transcription
  - name: Metadata
  - name: Shares
  - name: Share Templates
  - name: Watermarks
paths:
  /attachments/upload:
    post:
      tags:
        - Attachments
      summary: Initiate Upload
      description: |-
        Initiate an attachment upload.

        Returns a temporary upload URL.
        The upload must be confirmed after the file is uploaded.
      operationId: initiate_upload
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AttachmentUploadInitRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentUploadInitResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AttachmentUploadInitRequest:
      properties:
        filename:
          type: string
          maxLength: 255
          title: Filename
          description: Original filename
        mime_type:
          type: string
          maxLength: 127
          title: Mime Type
          description: MIME type of the file
        size_bytes:
          type: integer
          maximum: 100000000
          exclusiveMinimum: 0
          title: Size Bytes
          description: File size in bytes (max 100MB)
      type: object
      required:
        - filename
        - mime_type
        - size_bytes
      title: AttachmentUploadInitRequest
      description: API request schema for initiating an attachment upload
    AttachmentUploadInitResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Resource identifier
        url:
          type: string
          title: Url
          description: Temporary URL for the upload or download
        url_expires_at:
          type: string
          format: date-time
          title: Url Expires At
          description: UTC datetime when the URL expires
      type: object
      required:
        - id
        - url
        - url_expires_at
      title: AttachmentUploadInitResponse
      description: Temporary upload URL for a new attachment.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Aspect API key (sk_...) in Authorization header. 'Bearer ' optional.

````

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