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

# Import inventory assets from a file.

> Requires esi.inventory.manage or project manager access. Accepts a bounded file upload, durably queues it in PostgreSQL before returning, rejects files with no supported assets, extracts hostnames, single IPv4/IPv6 addresses, and IPv4/IPv6 CIDRs in the API, then processes the import asynchronously as manual inventory additions. Interrupted workers safely reclaim queued or expired jobs; an import authorized when queued may finish after a later access change.



## OpenAPI

````yaml https://api.infrawatch.com/openapi.json?contract=d15375c post /projects/{project_uuid}/esi/inventory/imports
openapi: 3.1.0
info:
  description: >-
    Customer-facing Infrawatch APIs. Authenticate with an API key unless an
    operation documents another supported credential.


    ### Infrawatch Public API


    Public API authenticated exclusively with Infrawatch API keys.


    ### Infrawatch Customer Alerting API


    Project alert rules, destinations, silences, inbox state, and delivery
    history.


    ### Infrawatch Remote Browser API


    Project-scoped interactive browser sessions owned by Platform Core.


    Session admission, lifecycle, RBAC, audit, usage, screenshot history, and

    stream tickets are Platform Core resources. The browser master is private

    infrastructure and its identifiers, proxy routes, process options, and

    credentials are never exposed by this API.


    A session and all of its evidence are private to the credential that created

    it. Project managers may list project session metadata, inspect one
    session's

    metadata, and terminate it, but cannot access its live stream, screenshots,

    or network events.


    Terminal session metadata and screenshots are retained indefinitely. A

    creator can replay a terminal session as a new queued resource while

    preserving a durable link to the source session.


    ### Infrawatch ESI API


    Customer-facing External Surface Intelligence API for project-scoped

    product data authenticated by an Infrawatch API key. API keys

    are constrained to their immutable owner's project ceiling and assigned

    ESI scopes; human project-manager fallback never expands an API key.

    Authorised API-key requests are rate-limited and consume monthly quota.


    ### Infrawatch Reports API


    Threat report discovery API authenticated by an Infrawatch API key.


    ### Infrawatch Public Rules API


    Account-aware rule authoring, taxonomy, catalogue, and runtime observations
    for API clients.


    ### Infrawatch Search API


    Search hosts, services, DNS records, and certificates. Complete
    percent-encoded query strings are limited to 65536 bytes.
  title: Infrawatch Customer API
  version: 1.0.0
servers:
  - description: Infrawatch customer API
    url: https://api.infrawatch.com/api/v1
security: []
tags:
  - name: API Usage
  - name: Projects
  - name: Alert destinations
  - name: Alert rules
  - name: Alert silences
  - name: Alerts
  - name: Browser sessions
  - name: Browser evidence
  - name: Browser streaming
  - name: Access
  - name: Inventory
  - name: Dangling DNS
  - name: Findings
  - name: Secrets
  - name: Typosquatting
  - name: Services
  - name: AI Surface
  - description: Search hosts, services, DNS records, certificates, and open directories.
    name: Search
  - name: Dashboard
  - name: Reports
  - name: Rules
  - name: Rule tags
  - name: Rule observations
paths:
  /projects/{project_uuid}/esi/inventory/imports:
    servers:
      - url: https://api.infrawatch.com/api/v1
    parameters:
      - $ref: '#/components/parameters/esi_v1_ProjectUUID'
    post:
      tags:
        - Inventory
      summary: Import inventory assets from a file.
      description: >-
        Requires esi.inventory.manage or project manager access. Accepts a
        bounded file upload, durably queues it in PostgreSQL before returning,
        rejects files with no supported assets, extracts hostnames, single
        IPv4/IPv6 addresses, and IPv4/IPv6 CIDRs in the API, then processes the
        import asynchronously as manual inventory additions. Interrupted workers
        safely reclaim queued or expired jobs; an import authorized when queued
        may finish after a later access change.
      operationId: importInventoryAssets
      parameters:
        - description: >-
            Optional file name for a non-multipart upload. Takes precedence over
            X-File-Name.
          in: query
          name: file_name
          schema:
            maxLength: 240
            type: string
        - description: >-
            Optional file name for a non-multipart upload when file_name is
            omitted.
          in: header
          name: X-File-Name
          schema:
            maxLength: 240
            type: string
      requestBody:
        content:
          application/json:
            schema:
              description: >-
                Any JSON object or array whose serialized upload is at most 5
                MB; values are scanned as opaque inventory source content.
              oneOf:
                - additionalProperties: true
                  type: object
                - items: {}
                  type: array
          application/octet-stream:
            schema:
              format: binary
              type: string
          multipart/form-data:
            schema:
              properties:
                file:
                  description: >-
                    Any text-like file up to 5 MB. CSV, JSON, logs, exports, and
                    plain text are supported by content extraction.
                  format: binary
                  type: string
              required:
                - file
              type: object
          text/csv:
            schema:
              maxLength: 5242880
              type: string
          text/plain:
            schema:
              maxLength: 5242880
              type: string
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                properties:
                  import:
                    $ref: '#/components/schemas/esi_v1_InventoryImportJob'
                required:
                  - import
                type: object
          description: Inventory import accepted.
        '400':
          $ref: '#/components/responses/esi_v1_BadRequest'
        '401':
          $ref: '#/components/responses/esi_v1_Unauthorized'
        '403':
          $ref: '#/components/responses/esi_v1_Forbidden'
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/esi_v1_ErrorResponse'
          description: The inventory upload exceeds 5 MB.
      security:
        - apiKeyAuth: []
components:
  parameters:
    esi_v1_ProjectUUID:
      in: path
      name: project_uuid
      required: true
      schema:
        format: uuid
        type: string
  schemas:
    esi_v1_InventoryImportJob:
      properties:
        completed_at:
          format: date-time
          type: string
        conflict_count:
          minimum: 0
          type: integer
        content_sha256:
          pattern: ^[0-9a-f]{64}$
          type: string
        content_type:
          type: string
        created_at:
          format: date-time
          type: string
        created_count:
          minimum: 0
          type: integer
        error_message:
          type: string
        errors:
          items:
            $ref: '#/components/schemas/esi_v1_InventoryAssetBulkCreateError'
          type: array
        extracted_count:
          minimum: 0
          type: integer
        failed_count:
          minimum: 0
          type: integer
        file_name:
          maxLength: 240
          type: string
        file_size_bytes:
          maximum: 5242880
          type: integer
        started_at:
          format: date-time
          type: string
        status:
          $ref: '#/components/schemas/esi_v1_InventoryImportJobStatus'
        updated_at:
          format: date-time
          type: string
        uuid:
          format: uuid
          type: string
      required:
        - uuid
        - status
        - file_name
        - file_size_bytes
        - content_sha256
        - extracted_count
        - created_count
        - conflict_count
        - failed_count
        - errors
        - created_at
        - updated_at
      type: object
    esi_v1_ErrorResponse:
      properties:
        error:
          properties:
            code:
              type: string
            field_errors:
              items:
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - field
                  - code
                  - message
                type: object
              type: array
            message:
              type: string
            request_id:
              type: string
          required:
            - code
            - message
          type: object
      required:
        - error
      type: object
    esi_v1_InventoryAssetBulkCreateError:
      properties:
        code:
          type: string
        index:
          description: Row index. Import jobs may use -1 for job-level warnings.
          minimum: -1
          type: integer
        message:
          type: string
        value:
          type: string
      required:
        - index
        - code
        - message
      type: object
    esi_v1_InventoryImportJobStatus:
      enum:
        - queued
        - running
        - completed
        - failed
      type: string
  responses:
    esi_v1_BadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/esi_v1_ErrorResponse'
      description: Invalid request.
    esi_v1_Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/esi_v1_ErrorResponse'
      description: Authentication required.
    esi_v1_Forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/esi_v1_ErrorResponse'
      description: Required scope or project access missing.
  securitySchemes:
    apiKeyAuth:
      description: >-
        Infrawatch API key. Supply the complete key directly as the header
        value.
      in: header
      name: X-API-Key
      type: apiKey

````