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

# Update Submission

> Updates an existing submission. Only send fields you want to change (PATCH semantics).

**Optional update fields:**
- `name` - Update submission name (send null to clear)
- `status` - Update submission status
- `type` - Update submission type
- `renewingPolicyId` - Update renewing policy (send null to clear)
- `declineReason` - Update decline reason (send null to clear)

**Note:** The `renewingPolicyId` must reference an existing, non-deleted policy.

**Required permission:** `company.submission:update`




## OpenAPI

````yaml /openapi/generated-external-api.yaml patch /api/external/companies/{companyId}/submissions/{submissionId}
openapi: 3.0.3
info:
  title: AI Insurance External API
  description: External API for AI Insurance platform
  version: 1.0.0
  contact:
    email: support@aiinsurance.io
servers:
  - url: https://app.aiinsurance.io
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/external/companies/{companyId}/submissions/{submissionId}:
    patch:
      tags:
        - Submissions
      summary: Update Submission
      description: >
        Updates an existing submission. Only send fields you want to change
        (PATCH semantics).


        **Optional update fields:**

        - `name` - Update submission name (send null to clear)

        - `status` - Update submission status

        - `type` - Update submission type

        - `renewingPolicyId` - Update renewing policy (send null to clear)

        - `declineReason` - Update decline reason (send null to clear)


        **Note:** The `renewingPolicyId` must reference an existing, non-deleted
        policy.


        **Required permission:** `company.submission:update`
      operationId: updateSubmission
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/submissionIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubmissionRequest'
            examples:
              updateName:
                summary: Update name
                value:
                  name: Acme Corp - Updated Submission
              updateStatus:
                summary: Update status only
                value:
                  status: quoted
              decline:
                summary: Decline submission
                value:
                  status: declined
                  declineReason: Insufficient coverage history
              setRenewal:
                summary: Link to renewing policy
                value:
                  type: renewal
                  renewingPolicyId: 770e8400-e29b-41d4-a716-446655440001
              clearRenewal:
                summary: Clear renewing policy
                value:
                  renewingPolicyId: null
      responses:
        '200':
          description: Submission updated successfully
          content:
            application/json:
              schema:
                type: object
                description: The updated submission (without quoteIds)
                properties:
                  id:
                    type: string
                    format: uuid
                  companyId:
                    type: string
                    format: uuid
                  number:
                    type: string
                  name:
                    type: string
                    nullable: true
                  status:
                    $ref: '#/components/schemas/SubmissionStatus'
                  type:
                    $ref: '#/components/schemas/SubmissionType'
                  primaryInsuredName:
                    type: string
                    nullable: true
                  applicationId:
                    type: string
                    format: uuid
                    nullable: true
                  renewingPolicyId:
                    type: string
                    format: uuid
                    nullable: true
                  renewingPolicyNumber:
                    type: string
                    nullable: true
                  declineReason:
                    type: string
                    nullable: true
                  createdAt:
                    type: string
                    format: date-time
                  updatedAt:
                    type: string
                    format: date-time
                    nullable: true
                  closedAt:
                    type: string
                    format: date-time
                    nullable: true
                  boundAt:
                    type: string
                    format: date-time
                    nullable: true
              examples:
                success:
                  summary: Updated submission
                  value:
                    id: 550e8400-e29b-41d4-a716-446655440001
                    companyId: 660e8400-e29b-41d4-a716-446655440000
                    number: SUB-2024-001
                    name: Acme Corp - Updated Submission
                    status: quoted
                    type: new_business
                    primaryInsuredName: Acme Corporation
                    applicationId: 550e8400-e29b-41d4-a716-446655440010
                    renewingPolicyId: null
                    renewingPolicyNumber: null
                    declineReason: null
                    createdAt: '2024-01-15T10:30:00.000Z'
                    updatedAt: '2024-01-20T09:00:00.000Z'
                    closedAt: null
                    boundAt: null
        '400':
          description: Bad Request - Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalidPolicyId:
                  summary: Renewing policy not found
                  value:
                    error:
                      code: NOT_FOUND
                      message: The specified renewingPolicyId was not found
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Submission not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  summary: Submission not found
                  value:
                    error:
                      code: NOT_FOUND
                      message: Submission not found
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
    submissionIdPath:
      name: submissionId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Submission identifier
  schemas:
    UpdateSubmissionRequest:
      type: object
      description: >-
        Request to update a submission. All fields are optional (PATCH
        semantics).
      properties:
        name:
          type: string
          nullable: true
          description: Update submission name (send null to clear)
        status:
          $ref: '#/components/schemas/SubmissionStatus'
        type:
          $ref: '#/components/schemas/SubmissionType'
        renewingPolicyId:
          type: string
          format: uuid
          nullable: true
          description: Policy ID being renewed (send null to clear)
        declineReason:
          type: string
          nullable: true
          description: >-
            Reason for declining (send null to clear, typically set when status
            is 'declined')
    SubmissionStatus:
      type: string
      enum:
        - in_progress
        - submitted
        - quote_in_progress
        - quoted
        - bound
        - declined
        - expired
        - cancelled
    SubmissionType:
      type: string
      description: Internal submission type
      enum:
        - new_business
        - renewal
        - endorsement
        - cancellation
        - reinstatement
    ErrorResponse:
      type: object
      description: Standard error response for all external API endpoints
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: VALIDATION_ERROR
            message:
              type: string
              description: Human-readable error message
              example: 'submissionId: Required field is missing'
            details:
              type: array
              description: Additional details for validation errors (field-level errors)
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: The field that caused the error
                    example: submissionId
                  message:
                    type: string
                    description: Description of the field error
                    example: Required field is missing
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                error:
                  code: UNAUTHORIZED
                  message: Authorization header is required
            bearerTokenNotAllowed:
              summary: Bearer token used instead of API key
              value:
                error:
                  code: UNAUTHORIZED
                  message: External API endpoints require API key authentication
    Forbidden:
      description: Forbidden - Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientPermissions:
              summary: Insufficient permissions
              value:
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
    InternalServerError:
      description: Internal Server Error - Unexpected error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internalError:
              summary: Unexpected server error
              value:
                error:
                  code: INTERNAL_ERROR
                  message: An unexpected error occurred. Please try again later.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Include your API key in the Authorization
        header.

````