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

# Public file upload

> Create a file record and generate a presigned upload URL for public uploads using an upload key. Supports hidden files.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /cp/upload
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /cp/upload:
    post:
      tags:
        - client-portal
      summary: Public file upload
      description: >-
        Create a file record and generate a presigned upload URL for public
        uploads using an upload key. Supports hidden files.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
        description: >-
          Upload request (team, name, size required; parent, key, hidden
          optional)
        required: true
      responses:
        '200':
          description: File ID and upload URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg_routes_cp_files.PublicUploadResponse'
        '400':
          description: >-
            Bad request - invalid team ID, parent folder ID, upload key, or file
            name without extension
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '403':
          description: Forbidden - invalid upload key or no access to folder
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          description: Team or parent folder not found
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
components:
  schemas:
    pkg_routes_cp_files.PublicUploadResponse:
      type: object
      properties:
        _id:
          type: string
        upload_url:
          type: string

````

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