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

# Create Submission

> Create a submission from one or more pre-uploaded assets.

Each asset must have been uploaded first via POST /uploads/url. Pass the
returned blob_path for each asset here.

Authentication: Requires X-API-Key header with valid API key.

Raises:
    400: If simulationDelaySeconds is used with a live API key
    401: If API key missing or invalid
    403: If a blob path fails validation
    404: If a previous_submission_id is not found in the workspace
    413: If an uploaded blob exceeds the per-bucket size cap
    415: If the uploaded bytes don't match the blob path's declared type,
        or the declared type is not in the allowlist
    422: If request validation fails



## OpenAPI

````yaml post /api/integrations/submissions
openapi: 3.1.0
info:
  title: Midmarket Integrations API
  description: An API for Midmarket integrations.
  version: 0.1.0
servers:
  - url: https://mm-midmarket-integrations-api-preview.azurewebsites.net
    description: preview
security: []
paths:
  /api/integrations/submissions:
    post:
      tags:
        - submissions
      summary: Create Submission
      description: |-
        Create a submission from one or more pre-uploaded assets.

        Each asset must have been uploaded first via POST /uploads/url. Pass the
        returned blob_path for each asset here.

        Authentication: Requires X-API-Key header with valid API key.

        Raises:
            400: If simulationDelaySeconds is used with a live API key
            401: If API key missing or invalid
            403: If a blob path fails validation
            404: If a previous_submission_id is not found in the workspace
            413: If an uploaded blob exceeds the per-bucket size cap
            415: If the uploaded bytes don't match the blob path's declared type,
                or the declared type is not in the allowlist
            422: If request validation fails
      operationId: create_submission_api_integrations_submissions_post
      parameters:
        - name: simulationDelaySeconds
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 30
                minimum: 0
              - type: 'null'
            title: Simulationdelayseconds
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubmissionRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSubmissionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - apiKey: []
components:
  schemas:
    CreateSubmissionRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 120
            - type: 'null'
          title: Name
          description: >-
            Optional display name for the submission. Defaults to the first
            asset's filename if omitted.
        assets:
          items:
            $ref: '#/components/schemas/AssetInput'
          type: array
          minItems: 1
          title: Assets
          description: Assets to include in the submission
        sidekickIds:
          items:
            type: string
            format: uuid
          type: array
          minItems: 1
          title: Sidekickids
          description: >-
            Sidekick UUIDs to run for compliance checking. At least one is
            required — a submission with no sidekick has nothing to check.
        tags:
          items:
            $ref: '#/components/schemas/TagInput'
          type: array
          title: Tags
          description: Tags to apply to assets, referenced by key/value (found-or-created).
        contextItems:
          items:
            $ref: '#/components/schemas/ContextItemInput'
          type: array
          title: Contextitems
          description: >-
            Supporting files/links to attach to assets for the compliance
            review.
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: Optional custom metadata
      type: object
      required:
        - assets
        - sidekickIds
      title: CreateSubmissionRequest
      description: Request model for creating a submission.
      example:
        assets:
          - blobPath: 550e8400-e29b-41d4-a716-446655440000/campaign-video.mp4
        contextItems:
          - applyTo: all
            blobPath: 660e8400-e29b-41d4-a716-446655440111/evidence.pdf
            contextType: substantiation
            kind: file
            mimeType: application/pdf
            name: evidence.pdf
        name: Summer Campaign Launch
        sidekickIds:
          - 3b2f766c-14e5-4d96-bcb1-dd1c963818ca
        tags:
          - applyTo: all
            key: Campaign
            value: Summer
    CreateSubmissionResponse:
      properties:
        submissionId:
          type: string
          format: uuid
          title: Submissionid
          description: Created submission ID
        workflowId:
          type: string
          title: Workflowid
          description: Workflow ID (job tracking ID)
        ablyChannel:
          type: string
          title: Ablychannel
          description: Ably channel for real-time updates
        status:
          $ref: '#/components/schemas/SubmissionStatus'
          description: Submission status
        assets:
          items:
            $ref: '#/components/schemas/AssetCreatedResponse'
          type: array
          title: Assets
          description: Created assets
      type: object
      required:
        - submissionId
        - workflowId
        - ablyChannel
        - status
        - assets
      title: CreateSubmissionResponse
      description: Response model for submission creation.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AssetInput:
      properties:
        blobPath:
          type: string
          minLength: 1
          title: Blobpath
          description: Azure blob storage path
        previousSubmissionId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Previoussubmissionid
          description: >-
            UUID of a previous submission whose asset this replaces. Links the
            new asset as the next version in the version chain.
        sidekickIds:
          items:
            type: string
            format: uuid
          type: array
          title: Sidekickids
          description: >-
            Per-asset sidekick selection — only these sidekicks run on this
            asset. Must be a subset of the submission-level sidekickIds. Empty
            => run the submission-level set on this asset.
      type: object
      required:
        - blobPath
      title: AssetInput
      description: A single asset to include in a submission.
    TagInput:
      properties:
        key:
          type: string
          minLength: 1
          title: Key
          description: Tag key/namespace, e.g. 'Campaign'.
        value:
          type: string
          minLength: 1
          title: Value
          description: Tag value/label, e.g. 'Summer'.
        applyTo:
          anyOf:
            - type: string
              const: all
            - items:
                type: string
              type: array
          title: Applyto
          description: 'Which assets to tag: ''all'' (default), or a list of asset blobPaths.'
          default: all
      type: object
      required:
        - key
        - value
      title: TagInput
      description: >-
        A tag to apply to one or more assets in the submission.


        Tags are referenced by ``key``/``value`` (not an id); the workspace tag
        is

        found-or-created on submit. ``applyTo`` selects which assets receive the
        tag.
    ContextItemInput:
      properties:
        kind:
          type: string
          enum:
            - file
            - link
          title: Kind
          description: '''file'' or ''link''.'
        contextType:
          $ref: '#/components/schemas/ContextType'
          description: Semantic role of the context (e.g. 'substantiation', 'legal').
        applyTo:
          anyOf:
            - type: string
              const: all
            - items:
                type: string
              type: array
          title: Applyto
          description: >-
            Which assets this applies to: 'all' (default), or a list of asset
            blobPaths.
          default: all
        blobPath:
          anyOf:
            - type: string
            - type: 'null'
          title: Blobpath
          description: Pending-container blobPath of the uploaded file (file kind).
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Original filename (file kind).
        mimeType:
          anyOf:
            - type: string
            - type: 'null'
          title: Mimetype
          description: MIME type (file kind).
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: https:// URL (link kind).
        linkName:
          anyOf:
            - type: string
            - type: 'null'
          title: Linkname
          description: Display name for the link (link kind).
      type: object
      required:
        - kind
        - contextType
      title: ContextItemInput
      description: >-
        A supporting file or link attached to one or more assets.


        A ``file`` references a blob already uploaded to the pending container
        (via

        ``POST /uploads/url``) by ``blobPath``; a ``link`` carries a ``url``.

        ``applyTo`` selects which assets the context applies to.
    SubmissionStatus:
      type: string
      enum:
        - uploading
        - submitted
        - queued
        - processing
        - complete
        - failed
        - partial
      title: SubmissionStatus
    AssetCreatedResponse:
      properties:
        assetId:
          type: string
          format: uuid
          title: Assetid
          description: Created asset ID
        versionGroupId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Versiongroupid
          description: Version group ID
        versionNumber:
          type: integer
          title: Versionnumber
          description: Version number
          default: 1
      type: object
      required:
        - assetId
      title: AssetCreatedResponse
      description: Summary of a created asset within a submission.
    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
    ContextType:
      type: string
      enum:
        - substantiation
        - product_info
        - brand_guidelines_evidence
        - legal
        - transcript_script
        - talent_licensing
        - brand_guidelines_publishing
        - platform_metadata
        - other
      title: ContextType
      description: >-
        Allowed supporting-context types for a submission's context items.


        Mirrors the frontend ``ContextType`` union in
        ``lib/constants/submissions.ts``

        and the worker's ``_CONTEXT_TYPE_TO_ROLE`` map. Keep in sync when adding
        types.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'Workspace-scoped API key. Format: sk_live_{64 hex chars}'
      x-default: sk_live_your_api_key_here

````