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

# Upload a file

> Write one file into a folder you can write to.

Your WRITE is checked on the finished key, not on the folder, so a policy
that opens one subfolder and not another is honoured. An existing object
is refused unless ``overwrite``.



## OpenAPI

````yaml post /api/storage/buckets/{bucket}/objects
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/storage/buckets/{bucket}/objects:
    post:
      tags:
        - Object storage
      summary: Upload a file
      description: >-
        Write one file into a folder you can write to.


        Your WRITE is checked on the finished key, not on the folder, so a
        policy

        that opens one subfolder and not another is honoured. An existing object

        is refused unless ``overwrite``.
      operationId: upload_object_api_storage_buckets__bucket__objects_post
      parameters:
        - name: bucket
          in: path
          required: true
          schema:
            type: string
            title: Bucket
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_upload_object_api_storage_buckets__bucket__objects_post
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectInfo'
        '403':
          description: 'The general PSK or a schedule: browse as a person.'
        '404':
          description: Not found, or not yours to read (they look the same).
        '409':
          description: Something is already there; set overwrite.
        '413':
          description: The file is larger than the upload limit.
        '422':
          description: Not a valid bucket, path or format.
        '502':
          description: Storage couldn't be read.
        '503':
          description: 'Ranger''s evaluator is unavailable: nothing is shown.'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    Body_upload_object_api_storage_buckets__bucket__objects_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
          description: The file's bytes.
        prefix:
          type: string
          title: Prefix
          description: The folder to write into, e.g. raw/2026/.
          default: ''
        path:
          anyOf:
            - type: string
            - type: 'null'
          title: Path
          description: >-
            The file's path within the folder being uploaded, e.g. q1/sales.csv.
            This is how a folder upload arrives: the browser gives each file its
            path and sends one request per file. Defaults to the file's own
            name.
        overwrite:
          type: boolean
          title: Overwrite
          description: Replace an object already at that key.
          default: false
      type: object
      required:
        - file
      title: Body_upload_object_api_storage_buckets__bucket__objects_post
    ObjectInfo:
      properties:
        bucket:
          type: string
          title: Bucket
        key:
          type: string
          title: Key
        name:
          type: string
          title: Name
        url:
          type: string
          title: Url
          description: s3://bucket/key
        size:
          type: integer
          title: Size
        modified:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Modified
        content_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Type
        etag:
          anyOf:
            - type: string
            - type: 'null'
          title: Etag
      type: object
      required:
        - bucket
        - key
        - name
        - url
        - size
      title: ObjectInfo
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

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