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

# Create File Upload

> Generate a pre-signed URL for uploading a JSON file. After uploading, you must call the [complete endpoint](/api-reference/files/complete) to finalize the upload.



## OpenAPI

````yaml openapi/files.json POST /v1/files
openapi: 3.0.3
info:
  title: Files API
  version: 1.0.0
servers:
  - url: https://api.olostep.com
security: []
paths:
  /v1/files:
    post:
      summary: Create File Upload
      description: >-
        Generate a pre-signed URL for uploading a JSON file. After uploading,
        you must call the complete endpoint to finalize the upload. The upload
        URL expires in 10 minutes.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  description: The filename for the file. Must end with .json extension.
                  pattern: \.json$
                purpose:
                  type: string
                  description: >-
                    The purpose of the file. Supported values: 'context' or
                    'batch'. Defaults to 'context'.
                  enum:
                    - context
                    - batch
                  default: context
              required:
                - filename
      responses:
        '200':
          description: Successful response with upload URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: File ID
                  object:
                    type: string
                    description: The kind of object. "file.upload" for this endpoint.
                  created:
                    type: integer
                    description: Created epoch timestamp
                  upload_url:
                    type: string
                    format: uri
                    description: >-
                      Pre-signed URL for uploading the file. Expires in 10
                      minutes.
                  expires_in:
                    type: integer
                    description: >-
                      Number of seconds until the upload URL expires (600
                      seconds = 10 minutes)
        '400':
          description: >-
            Bad request. Missing filename or invalid file type (only .json files
            are supported).
        '401':
          description: Invalid API key
        '500':
          description: Internal server error
      security:
        - Authorization: []
components:
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form Bearer <token>, where <token>
        is your auth token.

````