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

# Get Import Job

> Returns an import job's definition, status, and result counts. Poll it after
Queue Import Job (`queueFmv1ImportJob`). A completed job can contain failed
attempts, so inspect each result and its source row IDs with List Import
Attempts (`listFmv1ImportAttempts`) filtered by `jobId`.

An unknown, cross-company or unauthorized job returns 404.

**Required permission:** the job entity type's import permission, for example `exposure.import`.




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/imports/jobs/{jobId}
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://go.aiinsurance.io
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/companies/{companyId}/imports/jobs/{jobId}:
    get:
      tags:
        - Imports
      summary: Get Import Job
      description: >
        Returns an import job's definition, status, and result counts. Poll it
        after

        Queue Import Job (`queueFmv1ImportJob`). A completed job can contain
        failed

        attempts, so inspect each result and its source row IDs with List Import

        Attempts (`listFmv1ImportAttempts`) filtered by `jobId`.


        An unknown, cross-company or unauthorized job returns 404.


        **Required permission:** the job entity type's import permission, for
        example `exposure.import`.
      operationId: getFmv1ImportJob
      parameters:
        - $ref: '#/components/parameters/companyId'
        - name: jobId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Job progress and mapping definition.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportJob'
        '400':
          description: Invalid job ID or unknown query parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Job not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
  schemas:
    ImportJob:
      type: object
      required:
        - id
        - entityType
        - definition
        - status
        - totalResults
        - processedResults
        - writtenResults
        - failedResults
        - error
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
        entityType:
          type: string
          enum:
            - Event
            - Exposure
            - Quote
            - Submission
            - Person
            - Organization
            - Policy
        definition:
          $ref: '#/components/schemas/QueueImportJobRequest'
        status:
          type: string
          enum:
            - queued
            - running
            - completed
            - failed
          description: >-
            Completed means every result was attempted; inspect failedResults
            and the attempts for mapping, guard or validation failures. Failed
            means an infrastructure, authorization or configuration error
            stopped the job; prior results remain recorded.
        totalResults:
          type: integer
          minimum: 0
        processedResults:
          type: integer
          minimum: 0
        writtenResults:
          type: integer
          minimum: 0
        failedResults:
          type: integer
          minimum: 0
        error:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    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'
            userMessages:
              type: array
              description: >-
                Clean, verbatim-displayable messages — one entry per failure,
                free of error-code tags, field paths, and internal noise.
                Suitable for showing to end users as-is.
              items:
                type: string
              example:
                - Exposures of type 'company' require an address
            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
                  code:
                    type: string
                    description: Stable problem code for this individual validation failure
                    example: BLANK_LIST_ELEMENT
                  reason:
                    type: string
                    description: Stable reason the value violates its canonical contract
                    example: blank-list-element
                  expected:
                    type: string
                    description: The expected canonical value contract
                    example: nonblank trimmed string
                  message:
                    type: string
                    description: Description of the field error
                    example: Required field is missing
    QueueImportJobRequest:
      oneOf:
        - $ref: '#/components/schemas/QueueEntityImportJobRequest'
        - $ref: '#/components/schemas/QueuePolicyImportJobRequest'
    QueueEntityImportJobRequest:
      type: object
      additionalProperties: false
      required:
        - entityType
        - source
      properties:
        entityType:
          type: string
          enum:
            - Event
            - Exposure
            - Quote
            - Submission
            - Person
            - Organization
          description: The entity type this job writes, independent of its source rows.
        source:
          type: object
          additionalProperties: false
          description: >-
            At least one selector is required. Selectors combine with AND.
            Membership is snapshotted when queued; later rows are excluded.
            Explicit IDs must all exist, be accessible and match the other
            selectors.
          properties:
            importRowIds:
              type: array
              minItems: 1
              maxItems: 1000
              items:
                type: string
                format: uuid
            importBatch:
              type: string
              minLength: 1
            filter:
              type: object
              additionalProperties: true
              description: >-
                PostgreSQL JSON containment filter on the original data. When
                used alone it must be non-empty. For example, {"kind":"policy"}
                selects objects containing that pair.
        groupBy:
          type: array
          minItems: 1
          maxItems: 20
          items:
            type: string
            minLength: 1
          description: >-
            Optional JSON path segments. Rows with equal non-null values at this
            path produce one result together; missing/null values stay separate.
            Maximum 1000 rows per result. Omitted means one result per row.
        quoteMode:
          type: string
          enum:
            - restore-bound
          description: >-
            Quote jobs only, without groupBy. Restore an already bound legacy
            quote from its retained source identity, original
            bound/applied_to_policy status and existing policy. Existing quotes
            retain their identity and parent links; conflicting statuses or
            source evidence are refused. This does not bind a policy or generate
            invoices, recommended forms or lifecycle packets. See the historical
            bound quote contract in the import overview.
        transformations:
          $ref: '#/components/schemas/ImportTransformations'
        guards:
          $ref: '#/components/schemas/ImportGuards'
        attemptBatch:
          type: string
          nullable: true
          minLength: 1
          description: Optional label applied to every attempt created by this job.
    QueuePolicyImportJobRequest:
      type: object
      additionalProperties: false
      required:
        - entityType
        - source
        - policyMode
      properties:
        entityType:
          type: string
          enum:
            - Policy
          description: The entity type this job writes, independent of its source rows.
        source:
          type: object
          additionalProperties: false
          description: >-
            At least one selector is required. Selectors combine with AND.
            Membership is snapshotted when queued; later rows are excluded.
            Explicit IDs must all exist, be accessible and match the other
            selectors.
          properties:
            importRowIds:
              type: array
              minItems: 1
              maxItems: 1000
              items:
                type: string
                format: uuid
            importBatch:
              type: string
              minLength: 1
            filter:
              type: object
              additionalProperties: true
              description: >-
                PostgreSQL JSON containment filter on the original data. When
                used alone it must be non-empty. For example, {"kind":"policy"}
                selects objects containing that pair.
        transformations:
          $ref: '#/components/schemas/ImportTransformations'
        guards:
          $ref: '#/components/schemas/ImportGuards'
        attemptBatch:
          type: string
          nullable: true
          minLength: 1
          description: Optional label applied to every attempt created by this job.
        policyMode:
          type: string
          enum:
            - whole-policy
            - single-transaction
          description: >-
            Selects the schema of the transformed policy command:
            WholePolicyImport or SinglePolicyTransactionImport.
        dryRun:
          type: boolean
          default: false
          description: >-
            Validate every planned policy transaction against the preceding
            simulated state without persisting policy state; retain the import
            job and attempt. Both modes validate without domain persistence;
            save-only calculations and unsupported vendor-tax lifecycle changes
            are refused.
      description: >-
        One row is one policy term or one transaction; groupBy is refused. Both
        modes support execution and dry runs. Single-transaction mode executes
        one command and returns one transaction receipt.
    ImportTransformations:
      type: object
      description: >
        How `data.<entityKey>` becomes an entity in this company's field model:
        one

        entry per field reference id (camelCase). Each value is either a JEXL

        expression string that reads the data's top-level keys by name

        (`submission.name`, `broker.email`), or a mapping for a list of child

        objects:

        `{ "mapOver": "<data path>", "values": { "<childKey>": "<expression>" }
        }`.

        Inside `values`, bare names and `me` are the current element, `parent`
        is

        the object holding the list and `root` is the whole `data`. A child
        value may

        itself be a mapping; its `mapOver` path reads the current scope (for
        example

        `me.locations`). A `{ "values": { ... } }` constructor without `mapOver`
        builds

        one object in the surrounding scope and can contain mapped lists. At
        every

        depth, `root` remains the original data.


        Every field of `data.<entityKey>` without a transformation is kept as
        sent.

        A transformed entity with an `id` updates that entity; otherwise one is

        created. Keys the company's field model does not declare are dropped
        before

        an entity write. Policy jobs instead construct the whole-policy or
        single-transaction

        command envelope; envelope keys are validated by that contract.
      additionalProperties:
        oneOf:
          - type: string
            description: A JEXL expression.
          - type: object
            required:
              - mapOver
              - values
            additionalProperties: false
            properties:
              mapOver:
                type: string
                description: |
                  A dotted path into `data` that resolves to a list, such as
                  `submission.locations`; a numeric segment indexes a list.
              values:
                $ref: '#/components/schemas/ImportTransformations'
                type: object
                description: One expression or nested mapping per child object key.
          - type: object
            required:
              - values
            additionalProperties: false
            properties:
              values:
                $ref: '#/components/schemas/ImportTransformations'
                description: >-
                  Construct one object in the surrounding scope, including
                  nested mappings.
    ImportGuards:
      type: array
      description: >
        Conditions that must hold for the write to proceed, evaluated against
        the

        transformed entity, reading its fields by bare name. Only a strict
        `true`

        passes, and a condition that cannot be evaluated fails. They run in
        addition

        to the company's own entity invariants.
      items:
        type: object
        required:
          - condition
          - errorMessage
        additionalProperties: false
        properties:
          condition:
            type: string
            description: A JEXL condition.
          errorMessage:
            type: string
            description: Reported on the attempt when the condition does not hold.
  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: AuthenticationError
                  message: API key authentication required
                  userMessages:
                    - API key authentication required
            invalidApiKey:
              summary: >-
                Invalid API key (e.g. unknown key, or a Bearer token used
                instead of an API key)
              value:
                error:
                  code: AuthenticationError
                  message: Invalid API key
                  userMessages:
                    - Invalid API key
    Forbidden:
      description: Forbidden - Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientPermissions:
              summary: Insufficient permissions
              value:
                error:
                  code: AuthorizationError
                  message: User is not authorized to perform the requested action
                  userMessages:
                    - User is not authorized to perform the requested action
            companyMismatch:
              summary: A valid API key naming another company in the URL
              value:
                error:
                  code: AuthorizationError
                  message: API key is not scoped to the requested company
                  userMessages:
                    - API key is not scoped to the requested company
    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: UncaughtActionError
                  message: Uncaught error occurred in <actionName>
                  userMessages:
                    - An unexpected error occurred. Please try again later.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Send your raw API key as the `Authorization`
        header value with NO scheme prefix — `Authorization: YOUR-API-KEY`. Do
        NOT prefix it with `Bearer ` or `ApiKey `, and do not use an `X-API-Key`
        header; those are not accepted.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        User-principal OAuth 2.0 Bearer authentication. Send a user-scoped Auth0
        access token (audience = the app API audience) as `Authorization: Bearer
        <jwt>`. The request resolves to the user's identity and is authorized by
        their Role on the `{companyId}` in the path — the same role-based
        permissions the web app enforces. This is the path the MCP connector
        uses to act on a user's behalf; endpoints that accept it list both
        `BearerAuth` and `ApiKeyAuth`.

````

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