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

# Create direct-upload deployment session

> Registers a source file manifest and returns file IDs for direct file uploads.



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/deployments.yaml post /api/deployments/direct
openapi: 3.0.3
info:
  title: Insforge Deployments API
  version: 1.0.0
  description: >-
    Frontend deployment sessions, source uploads, environment variables, and
    custom domains.
servers: []
security: []
paths:
  /api/deployments/direct:
    post:
      tags:
        - Admin
      summary: Create direct-upload deployment session
      description: >-
        Registers a source file manifest and returns file IDs for direct file
        uploads.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDirectDeploymentRequest'
      responses:
        '201':
          description: Direct deployment session created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDirectDeploymentResponse'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          description: Unauthorized
        '403':
          description: Admin access required
        '500':
          $ref: '#/components/responses/Error'
        '503':
          description: Deployment provider is not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
        - apiKey: []
components:
  schemas:
    CreateDirectDeploymentRequest:
      type: object
      required:
        - files
      properties:
        files:
          type: array
          minItems: 1
          maxItems: 5000
          description: Source file manifest. The default backend limit is 5000 files.
          items:
            $ref: '#/components/schemas/DeploymentManifestFileEntry'
    CreateDirectDeploymentResponse:
      type: object
      required:
        - id
        - status
        - files
      properties:
        id:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/DeploymentStatus'
        files:
          type: array
          items:
            $ref: '#/components/schemas/DeploymentManifestFile'
    ErrorResponse:
      type: object
      required:
        - error
        - message
        - statusCode
      properties:
        error:
          type: string
          description: Error code for programmatic handling.
        message:
          type: string
          description: Human-readable error message.
        statusCode:
          type: integer
        nextActions:
          type: string
          description: Suggested action to resolve the error.
    DeploymentManifestFileEntry:
      type: object
      required:
        - path
        - sha
        - size
      properties:
        path:
          type: string
          minLength: 1
          maxLength: 2048
          description: Relative source path using forward slashes.
          example: src/App.tsx
        sha:
          type: string
          pattern: ^[a-fA-F0-9]{40}$
          description: SHA-1 hex digest of the file content.
        size:
          type: integer
          minimum: 0
          description: File size in bytes.
    DeploymentStatus:
      type: string
      enum:
        - WAITING
        - UPLOADING
        - QUEUED
        - BUILDING
        - READY
        - ERROR
        - CANCELED
    DeploymentManifestFile:
      allOf:
        - $ref: '#/components/schemas/DeploymentManifestFileEntry'
        - type: object
          required:
            - fileId
            - uploadedAt
          properties:
            fileId:
              type: string
              format: uuid
            uploadedAt:
              type: string
              format: date-time
              nullable: true
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Project admin JWT or an API key passed as a Bearer token.
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````