> ## 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.

# Validate Form

> Resolve a config, saved or not, against the inputs of a form's workflow.

Needs form:update or form:submission:read on top of form:read; other
callers get 404.



## OpenAPI

````yaml https://platform.tracecat.com/api/openapi.json post /workspaces/{workspace_id}/forms/{form_id}/validate
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}/validate:
    post:
      tags:
        - forms
      summary: Validate Form
      description: |-
        Resolve a config, saved or not, against the inputs of a form's workflow.

        Needs form:update or form:submission:read on top of form:read; other
        callers get 404.
      operationId: forms-validate_form
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FormValidateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormValidateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyCookie: []
        - ServiceAccountApiKeyBearer: []
components:
  schemas:
    FormValidateRequest:
      properties:
        config:
          $ref: '#/components/schemas/FormConfig-Input'
      type: object
      required:
        - config
      title: FormValidateRequest
    FormValidateResponse:
      properties:
        valid:
          type: boolean
          title: Valid
        issues:
          items:
            $ref: '#/components/schemas/FormIssue'
          type: array
          title: Issues
        preview:
          $ref: '#/components/schemas/FormPreview'
      type: object
      required:
        - valid
        - issues
        - preview
      title: FormValidateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FormConfig-Input:
      properties:
        title:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Title
          description: Defaults to the workflow title.
        description:
          anyOf:
            - type: string
              maxLength: 10000
            - type: 'null'
          title: Description
          description: Markdown. Defaults to the workflow description.
        success_message:
          anyOf:
            - type: string
              maxLength: 10000
            - type: 'null'
          title: Success Message
        layout:
          anyOf:
            - items:
                oneOf:
                  - $ref: '#/components/schemas/FormFieldEntry'
                  - $ref: '#/components/schemas/FormHeadingEntry'
                  - $ref: '#/components/schemas/FormTextEntry'
                  - $ref: '#/components/schemas/FormNoticeEntry'
                  - $ref: '#/components/schemas/FormDividerEntry'
              type: array
              maxItems: 200
            - type: 'null'
          title: Layout
          description: Ordered blocks. Inputs left out are appended in schema order.
      additionalProperties: false
      type: object
      title: FormConfig
      description: >-
        Presentation layer of a form. The workflow input schema supplies the
        rest.
    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.
    FormPreview:
      properties:
        title:
          type: string
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        success_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Success Message
        definition_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Definition Version
          description: Published workflow version the blocks come from.
        config_version:
          type: string
          title: Config Version
          description: Version of the config the blocks come from.
        blocks:
          items:
            oneOf:
              - $ref: '#/components/schemas/FormHeadingBlock'
              - $ref: '#/components/schemas/FormTextBlock'
              - $ref: '#/components/schemas/FormNoticeBlock'
              - $ref: '#/components/schemas/FormDividerBlock'
              - $ref: '#/components/schemas/FormFieldBlock'
            discriminator:
              propertyName: type
              mapping:
                divider: '#/components/schemas/FormDividerBlock'
                field: '#/components/schemas/FormFieldBlock'
                heading: '#/components/schemas/FormHeadingBlock'
                notice: '#/components/schemas/FormNoticeBlock'
                text: '#/components/schemas/FormTextBlock'
          type: array
          title: Blocks
      type: object
      required:
        - title
        - config_version
        - blocks
      title: FormPreview
      description: What a form renders. Hidden and autofill fields never appear.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    FormFieldEntry:
      properties:
        field:
          type: string
          maxLength: 255
          title: Field
          description: Name of the workflow input.
        label:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Label
        help:
          anyOf:
            - type: string
              maxLength: 10000
            - type: 'null'
          title: Help
        placeholder:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Placeholder
        widget:
          anyOf:
            - $ref: '#/components/schemas/FormWidget'
            - type: 'null'
        options:
          anyOf:
            - items:
                $ref: '#/components/schemas/FormOption'
              type: array
              maxItems: 100
              minItems: 1
            - type: 'null'
          title: Options
        visible_if:
          anyOf:
            - $ref: '#/components/schemas/FormVisibleIf'
            - type: 'null'
        autofill:
          anyOf:
            - $ref: '#/components/schemas/FormAutofillSource'
            - type: 'null'
        hidden:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Hidden
        accept:
          anyOf:
            - items:
                type: string
                maxLength: 255
              type: array
              maxItems: 20
            - type: 'null'
          title: Accept
          description: File extensions or MIME types a file field takes.
        max_files:
          anyOf:
            - type: integer
              maximum: 10
              minimum: 1
            - type: 'null'
          title: Max Files
      additionalProperties: false
      type: object
      required:
        - field
      title: FormFieldEntry
      description: Presentation of one workflow input.
    FormHeadingEntry:
      properties:
        heading:
          type: string
          maxLength: 255
          title: Heading
      additionalProperties: false
      type: object
      required:
        - heading
      title: FormHeadingEntry
    FormTextEntry:
      properties:
        text:
          type: string
          maxLength: 10000
          title: Text
          description: Markdown.
      additionalProperties: false
      type: object
      required:
        - text
      title: FormTextEntry
    FormNoticeEntry:
      properties:
        notice:
          type: string
          maxLength: 10000
          title: Notice
        tone:
          $ref: '#/components/schemas/FormNoticeTone'
          default: info
      additionalProperties: false
      type: object
      required:
        - notice
      title: FormNoticeEntry
    FormDividerEntry:
      properties:
        divider:
          type: boolean
          const: true
          title: Divider
      additionalProperties: false
      type: object
      required:
        - divider
      title: FormDividerEntry
    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.
    FormHeadingBlock:
      properties:
        type:
          type: string
          const: heading
          title: Type
        text:
          type: string
          title: Text
      type: object
      required:
        - type
        - text
      title: FormHeadingBlock
    FormTextBlock:
      properties:
        type:
          type: string
          const: text
          title: Type
        text:
          type: string
          title: Text
          description: Markdown.
      type: object
      required:
        - type
        - text
      title: FormTextBlock
    FormNoticeBlock:
      properties:
        type:
          type: string
          const: notice
          title: Type
        text:
          type: string
          title: Text
        tone:
          $ref: '#/components/schemas/FormNoticeTone'
      type: object
      required:
        - type
        - text
        - tone
      title: FormNoticeBlock
    FormDividerBlock:
      properties:
        type:
          type: string
          const: divider
          title: Type
      type: object
      required:
        - type
      title: FormDividerBlock
    FormFieldBlock:
      properties:
        type:
          type: string
          const: field
          title: Type
        name:
          type: string
          title: Name
        label:
          type: string
          title: Label
        help:
          anyOf:
            - type: string
            - type: 'null'
          title: Help
        placeholder:
          anyOf:
            - type: string
            - type: 'null'
          title: Placeholder
        widget:
          $ref: '#/components/schemas/FormWidget'
        required:
          type: boolean
          title: Required
        multiple:
          type: boolean
          title: Multiple
        default:
          title: Default
        options:
          anyOf:
            - items:
                $ref: '#/components/schemas/FormFieldOption'
              type: array
            - type: 'null'
          title: Options
        visible_if:
          anyOf:
            - $ref: '#/components/schemas/FormVisibleIf'
            - type: 'null'
        config:
          anyOf:
            - $ref: '#/components/schemas/FormFieldConfig'
            - type: 'null'
      type: object
      required:
        - type
        - name
        - label
        - widget
        - required
        - multiple
      title: FormFieldBlock
      description: An input the requester fills in.
    FormWidget:
      type: string
      enum:
        - text
        - long_text
        - number
        - toggle
        - select
        - multi_select
        - cards
        - tags
        - date
        - datetime
        - user
        - file
      title: FormWidget
      description: Input controls a form field can render as.
    FormOption:
      properties:
        value:
          type: string
          maxLength: 255
          minLength: 1
          title: Value
        label:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Label
        description:
          anyOf:
            - type: string
              maxLength: 10000
            - type: 'null'
          title: Description
        image:
          anyOf:
            - type: string
            - type: 'null'
          title: Image
          description: Inline PNG, JPEG or WebP data URI.
      additionalProperties: false
      type: object
      required:
        - value
      title: FormOption
      description: One choice of a select, multi-select or cards field.
    FormVisibleIf:
      properties:
        field:
          type: string
          maxLength: 255
          title: Field
        equals:
          anyOf:
            - type: boolean
            - type: integer
            - type: number
            - type: string
              maxLength: 255
          title: Equals
      additionalProperties: false
      type: object
      required:
        - field
        - equals
      title: FormVisibleIf
      description: Show a field only while another field has this value.
    FormAutofillSource:
      type: string
      enum:
        - requester
        - requester.user_id
        - requester.email
        - requester.first_name
        - requester.last_name
        - submission.id
      title: FormAutofillSource
      description: Values the server fills in on submit.
    FormNoticeTone:
      type: string
      enum:
        - info
        - success
        - warning
        - danger
      title: FormNoticeTone
    FormFieldOption:
      properties:
        value:
          type: string
          title: Value
        label:
          type: string
          title: Label
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        image:
          anyOf:
            - type: string
            - type: 'null'
          title: Image
      type: object
      required:
        - value
        - label
      title: FormFieldOption
    FormFieldConfig:
      properties:
        accept:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Accept
        max_files:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Files
        max_file_size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max File Size
          description: Largest file the field takes, in bytes.
      type: object
      title: FormFieldConfig
      description: Widget-specific settings.
  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.