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

# Upload Form File

> Upload a file for one of an online form's file fields.

Submit the returned ID as the field's value. A file that is not submitted
within 24 hours is deleted.



## OpenAPI

````yaml https://platform.tracecat.com/api/openapi.json post /workspaces/{workspace_id}/forms/{form_id}/files
openapi: 3.1.0
info:
  title: Tracecat API
  summary: Tracecat API
  description: The open source AI automation platform for security teams and agents.
  termsOfService: >-
    https://docs.google.com/document/d/e/2PACX-1vQvDe3SoVAPoQc51MgfGCP71IqFYX_rMVEde8zC4qmBCec5f8PLKQRdxa6tsUABT8gWAR9J-EVs2CrQ/pub
  contact:
    name: Tracecat Founders
    email: founders@tracecat.com
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  version: '1'
servers:
  - url: /api
security: []
tags:
  - name: public
    description: Public facing endpoints
  - name: workflows
    description: Workflow management
  - name: actions
    description: Action management
  - name: triggers
    description: Workflow triggers
  - name: secrets
    description: Secret management
  - name: variables
    description: Workspace variable management
paths:
  /workspaces/{workspace_id}/forms/{form_id}/files:
    post:
      tags:
        - forms
      summary: Upload Form File
      description: >-
        Upload a file for one of an online form's file fields.


        Submit the returned ID as the field's value. A file that is not
        submitted

        within 24 hours is deleted.
      operationId: forms-upload_form_file
      parameters:
        - name: form_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Form Id
        - name: workspace_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Workspace Id
        - name: field
          in: query
          required: true
          schema:
            type: string
            maxLength: 255
            description: Name of the file field the upload is for.
            title: Field
          description: Name of the file field the upload is for.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_forms-upload_form_file'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormFileRead'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormErrorResponse'
          description: Bad Request
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormErrorResponse'
          description: Conflict
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormErrorResponse'
          description: Request Entity Too Large
        '415':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormErrorResponse'
          description: Unsupported Media Type
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormErrorResponse'
          description: Unprocessable Entity
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormErrorResponse'
          description: Service Unavailable
      security:
        - APIKeyCookie: []
        - ServiceAccountApiKeyBearer: []
components:
  schemas:
    Body_forms-upload_form_file:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
      type: object
      required:
        - file
      title: Body_forms-upload_form_file
    FormFileRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        content_type:
          type: string
          title: Content Type
        size:
          type: integer
          title: Size
        sha256:
          type: string
          title: Sha256
      type: object
      required:
        - id
        - name
        - content_type
        - size
        - sha256
      title: FormFileRead
      description: |-
        An uploaded file. Also what a file ID expands to in the answers.

        Carries no storage key and no URL.
    FormErrorResponse:
      properties:
        detail:
          $ref: '#/components/schemas/FormErrorDetail'
      type: object
      required:
        - detail
      title: FormErrorResponse
    FormErrorDetail:
      properties:
        code:
          $ref: '#/components/schemas/FormErrorCode'
        message:
          type: string
          title: Message
        errors:
          anyOf:
            - items:
                $ref: '#/components/schemas/FormFieldError'
              type: array
            - type: 'null'
          title: Errors
          description: Per-field errors of a rejected submission.
        issues:
          anyOf:
            - items:
                $ref: '#/components/schemas/FormIssue'
              type: array
            - type: 'null'
          title: Issues
          description: Issues of a rejected form config.
      type: object
      required:
        - code
        - message
      title: FormErrorDetail
    FormErrorCode:
      type: string
      enum:
        - not_found
        - already_exists
        - form_config_invalid
        - form_workflow_unpublished
        - form_offline
        - form_unavailable
        - form_changed
        - form_validation_error
        - workflow_start_failed
        - workflow_start_unconfirmed
        - file_field_invalid
        - file_invalid
        - file_type_not_allowed
        - file_too_large
        - file_limit_reached
        - file_upload_failed
      title: FormErrorCode
      description: Machine-readable failures of a forms request.
    FormFieldError:
      properties:
        field:
          type: string
          title: Field
        code:
          $ref: '#/components/schemas/FormFieldErrorCode'
        message:
          type: string
          title: Message
      type: object
      required:
        - field
        - code
        - message
      title: FormFieldError
    FormIssue:
      properties:
        severity:
          $ref: '#/components/schemas/FormIssueSeverity'
        code:
          $ref: '#/components/schemas/FormIssueCode'
        message:
          type: string
          title: Message
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Loc
          description: Path to the offending config key.
      type: object
      required:
        - severity
        - code
        - message
        - loc
      title: FormIssue
      description: A problem found while resolving a form config against its inputs.
    FormFieldErrorCode:
      type: string
      enum:
        - required
        - unknown_field
        - invalid_value
        - invalid_option
        - invalid_date
        - invalid_user
        - invalid_file
        - too_many_files
      title: FormFieldErrorCode
      description: Why a submitted value was rejected.
    FormIssueSeverity:
      type: string
      enum:
        - error
        - warning
      title: FormIssueSeverity
    FormIssueCode:
      type: string
      enum:
        - unknown_field
        - duplicate_field
        - incompatible_widget
        - no_widget_for_type
        - unsupported_widget_option
        - options_required
        - options_not_supported
        - option_not_in_enum
        - default_invalid
        - conditional_field_required
        - visible_if_unknown_field
        - visible_if_invalid_controller
        - visible_if_invalid_value
        - autofill_type_mismatch
        - hidden_with_autofill
        - unrendered_optional_input
        - integer_out_of_range
      title: FormIssueCode
      description: Problems the resolver finds in a form config.
  securitySchemes:
    APIKeyCookie:
      type: apiKey
      in: cookie
      name: fastapiusersauth
    ServiceAccountApiKeyBearer:
      type: http
      description: Tracecat service account API key.
      scheme: bearer

````

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