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

# Get Submission

> Returns a single submission by ID.

By default, returns `quoteIds` as an array of quote IDs.
Use `expand=quotes` to include full quote details.

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




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /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}:
    get:
      tags:
        - Submissions
      summary: Get Submission
      description: |
        Returns a single submission by ID.

        By default, returns `quoteIds` as an array of quote IDs.
        Use `expand=quotes` to include full quote details.

        **Required permission:** `company.submission:read`
      operationId: getSubmission
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/submissionIdPath'
        - $ref: '#/components/parameters/submissionExpand'
      responses:
        '200':
          description: Submission details
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Submission'
                  - $ref: '#/components/schemas/SubmissionWithQuotes'
              examples:
                withQuoteIds:
                  summary: Submission with quote IDs
                  value:
                    id: 550e8400-e29b-41d4-a716-446655440001
                    companyId: 660e8400-e29b-41d4-a716-446655440000
                    number: SUB-2024-001
                    name: Acme Corp Submission
                    status: quoted
                    type: new_business
                    primaryInsuredName: Acme Corporation
                    applicationId: 550e8400-e29b-41d4-a716-446655440010
                    renewingPolicyId: null
                    renewingPolicyNumber: null
                    declineReason: null
                    quoteIds:
                      - 660e8400-e29b-41d4-a716-446655440001
                      - 660e8400-e29b-41d4-a716-446655440002
                    createdAt: '2024-01-15T10:30:00.000Z'
                    updatedAt: '2024-01-16T14:20:00.000Z'
                    closedAt: null
                    boundAt: null
                withExpandedQuotes:
                  summary: Submission with expanded quotes (expand=quotes)
                  value:
                    id: 550e8400-e29b-41d4-a716-446655440001
                    companyId: 660e8400-e29b-41d4-a716-446655440000
                    number: SUB-2024-001
                    name: Acme Corp Submission
                    status: quoted
                    type: new_business
                    primaryInsuredName: Acme Corporation
                    applicationId: 550e8400-e29b-41d4-a716-446655440010
                    renewingPolicyId: null
                    renewingPolicyNumber: null
                    declineReason: null
                    quotes:
                      - id: 660e8400-e29b-41d4-a716-446655440001
                        number: Q00000001-01
                        status: complete
                        submissionId: 550e8400-e29b-41d4-a716-446655440001
                        applicationId: null
                        policyId: null
                        description: General Liability Coverage
                        policyCurrency: USD
                        grandTotal: 2500
                        createdAt: '2024-01-15T11:00:00.000Z'
                        updatedAt: '2024-01-15T12:00:00.000Z'
                      - id: 660e8400-e29b-41d4-a716-446655440002
                        number: Q00000001-02
                        status: in_progress
                        submissionId: 550e8400-e29b-41d4-a716-446655440001
                        applicationId: null
                        policyId: null
                        description: null
                        policyCurrency: USD
                        grandTotal: null
                        createdAt: '2024-01-16T09:00:00.000Z'
                        updatedAt: null
                    createdAt: '2024-01-15T10:30:00.000Z'
                    updatedAt: '2024-01-16T14:20:00.000Z'
                    closedAt: null
                    boundAt: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Submission not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                submissionNotFound:
                  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
    submissionExpand:
      name: expand
      in: query
      schema:
        type: string
        enum:
          - quotes
      description: >-
        Expand related entities. Use `quotes` to include full quote details
        instead of IDs.
  schemas:
    Submission:
      type: object
      description: A submission containing policy information and associated quotes
      properties:
        id:
          type: string
          format: uuid
          description: Submission identifier
        companyId:
          type: string
          format: uuid
          description: Company identifier
        number:
          type: string
          description: Submission number (auto-generated)
          example: SUB-2024-001
        name:
          type: string
          nullable: true
          description: Submission name (optional)
        status:
          $ref: '#/components/schemas/SubmissionStatus'
        type:
          $ref: '#/components/schemas/SubmissionType'
        primaryInsuredName:
          type: string
          nullable: true
          description: Name of the primary insured
        applicationId:
          type: string
          format: uuid
          nullable: true
          description: Associated application ID
        renewingPolicyId:
          type: string
          format: uuid
          nullable: true
          description: Policy ID being renewed (for renewal submissions)
        renewingPolicyNumber:
          type: string
          nullable: true
          description: Policy number being renewed (for renewal submissions)
        declineReason:
          type: string
          nullable: true
          description: Reason for declining the submission (when status is declined)
        isEmailSubmission:
          type: boolean
          description: Whether this submission appears in the Inbox tab
        quoteIds:
          type: array
          items:
            type: string
            format: uuid
          description: IDs of quotes associated with this submission
        createdAt:
          type: string
          format: date-time
          description: When the submission was created (ISO 8601)
        updatedAt:
          type: string
          format: date-time
          nullable: true
          description: When the submission was last updated (ISO 8601)
        closedAt:
          type: string
          format: date-time
          nullable: true
          description: When the submission was closed (ISO 8601)
        boundAt:
          type: string
          format: date-time
          nullable: true
          description: When the submission was bound (ISO 8601)
    SubmissionWithQuotes:
      type: object
      description: A submission with expanded quote details (when expand=quotes is used)
      properties:
        id:
          type: string
          format: uuid
          description: Submission identifier
        companyId:
          type: string
          format: uuid
          description: Company identifier
        number:
          type: string
          description: Submission number
        name:
          type: string
          nullable: true
          description: Submission name
        status:
          $ref: '#/components/schemas/SubmissionStatus'
        type:
          $ref: '#/components/schemas/SubmissionType'
        primaryInsuredName:
          type: string
          nullable: true
          description: Name of the primary insured
        applicationId:
          type: string
          format: uuid
          nullable: true
          description: Associated application ID
        renewingPolicyId:
          type: string
          format: uuid
          nullable: true
          description: Policy ID being renewed
        renewingPolicyNumber:
          type: string
          nullable: true
          description: Policy number being renewed
        declineReason:
          type: string
          nullable: true
          description: Reason for declining the submission
        quotes:
          type: array
          items:
            $ref: '#/components/schemas/QuoteInfo'
          description: Full quote details (when expand=quotes)
        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
    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
    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
    QuoteInfo:
      type: object
      properties:
        id:
          type: string
          format: uuid
        number:
          type: string
          example: Q00000001-01
        status:
          $ref: '#/components/schemas/QuoteStatus'
        submissionId:
          type: string
          format: uuid
        applicationId:
          type: string
          format: uuid
        policyId:
          type: string
          format: uuid
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        description:
          type: string
        policyCurrency:
          type: string
          example: USD
        grandTotal:
          type: number
          example: 2500
    QuoteStatus:
      type: string
      enum:
        - in_progress
        - complete
        - sent
        - accepted
        - bound
        - cancelled
        - archived
        - applied_to_policy
  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.

````