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

# Create A File

> Returns a presigned url for the upload, along with an attachment which can be used across various endpoints.



## OpenAPI

````yaml /openapi.json post /v1/files/presign
openapi: 3.0.3
info:
  contact:
    name: Stuut Support
    url: https://stuut.ai
    email: devs@stuut.co
  termsOfService: https://stuut.ai/terms-and-conditions
  title: Stuut API
  version: 0.1.0
servers:
  - url: http://api.stuut.ai
security: []
tags:
  - name: Analytics
  - name: Bank Accounts
  - name: Bank Statements
  - name: Bank Transactions
  - name: Call Agents
  - name: Call Agent Scenarios
  - name: Calls
  - name: Contact Suggestions
  - name: demo
  - name: Email Senders
  - name: Email Templates
  - name: Email Template Folders
  - name: Email Threads
  - name: Emails
  - name: Files
  - name: Invoices
  - name: Notes
  - name: Organizations
  - name: Outreach Workflows
  - name: Partners
  - name: Partner Contacts
  - name: Payments
  - name: Phone Numbers
  - name: Plaid
  - name: Profile
  - name: Pusher
  - name: Remittances
  - name: Tags
  - name: Tasks
  - name: User Invites
  - name: Users
paths:
  /v1/files/presign:
    post:
      tags:
        - Files
      summary: Create A File
      description: >-
        Returns a presigned url for the upload, along with an attachment which
        can be used across various endpoints.
      operationId: file.presign
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadFile'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadAttachmentResponse'
          description: Successful response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StuutErrorHTTP'
          description: Authentication error
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: Validation error
      security:
        - BearerAuth: []
components:
  schemas:
    UploadFile:
      type: object
      properties:
        name:
          type: string
        mime_type:
          type: string
        size:
          type: integer
          minimum: 0
          maximum: 52428800
          description: 'File size in bytes. Max: '
        purpose:
          type: string
          enum:
            - knowledge-base
            - email
            - chat
      required:
        - mime_type
        - name
        - purpose
        - size
    UploadAttachmentResponse:
      type: object
      properties:
        attachment:
          $ref: '#/components/schemas/Attachment'
        presigned_url:
          $ref: '#/components/schemas/PresignedUrl'
      required:
        - attachment
        - presigned_url
    StuutErrorHTTP:
      type: object
      properties:
        data:
          type: object
          additionalProperties: {}
        error:
          type: string
        message:
          type: string
      required:
        - data
        - error
        - message
    ValidationError:
      properties:
        detail:
          type: object
          properties:
            <location>:
              type: object
              properties:
                <field_name>:
                  type: array
                  items:
                    type: string
        message:
          type: string
      type: object
    Attachment:
      type: object
      properties:
        id:
          type: string
          maxLength: 32
        content_id:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        disposition:
          type: string
        file_type:
          maxLength: 8
          enum:
            - audio
            - document
            - gif
            - image
            - video
        is_verified:
          type: boolean
        mime_type:
          type: string
        modified_at:
          type: string
          format: date-time
          nullable: true
        name:
          type: string
        object:
          type: string
        organization_id:
          type: string
          maxLength: 32
        presigned_url:
          type: string
          nullable: true
        presigned_url_expires_at:
          type: string
          format: date-time
          nullable: true
        purpose:
          type: string
          description: The use case for this attachment
          nullable: true
        remote_id:
          type: string
          description: The address' third party API ID.
          nullable: true
        size:
          type: integer
          nullable: true
        src:
          readOnly: true
        user_id:
          type: string
          maxLength: 32
          nullable: true
      required:
        - file_type
        - mime_type
        - name
        - object
        - organization_id
    PresignedUrl:
      type: object
      properties:
        url:
          type: string
        fields:
          type: object
          additionalProperties: {}
      required:
        - url
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````