# Import job status

> Cumulative status of one load — every batch posted under the same `import_id`, combined.

`first_event_time` and `last_event_time` are the check that matters: they report the event-time span your data actually landed in, which is what tells you whether the export went where you thought it did.

Cumulative status of one load — every batch posted under the same `import_id`,
combined. Per-batch counts come back from [the import call](https://docs.vectoral.si/api-reference/import.md)
itself; this is the running total.

```bash theme={null}
curl https://api.vectoral.cloud/v1/import/csv-export-2026-05 \
  -H "Authorization: Bearer vg_live_xxx"
```

## The field that matters

`first_event_time` and `last_event_time` report the event-time span your data actually
landed in. Compare that against the span you meant to send — it is the check that
catches a timezone bug, a misparsed date column, or an export that silently covered a
narrower range than you expected.

Rejected events cover nothing here, since they were never stored. Both fields are
omitted until at least one event has been accepted or found duplicate.

## Rejections

Up to the first **100** rejections are retained per load, oldest first, each with its
`event_id`, `reason`, and when it was recorded. Past that, `rejections_truncated` is
`true` and the list is a sample — but the cumulative `rejected` count stays accurate
regardless. With no rejections, `rejections` is omitted.

An unknown `import_id` is a `404` with `{"error": "unknown import_id"}`. Where import
is not enabled, the route itself is unregistered and the `404` body is plain text.

> [!TIP]
>
> Rejection reasons are a versioned contract: values are added, never renamed or
> removed. Safe to branch on.


## OpenAPI

````yaml openapi.json GET /v1/import/{importId}
openapi: 3.1.0
info:
  title: Vectoral API
  version: 1.0.0
  description: >-
    Fraud and abuse detection for AI app builders. Score the accounts hitting
    your AI features and catch the abuse draining your inference budget.
servers:
  - url: https://api.vectoral.cloud
    description: Hosted
  - url: http://localhost:8080
    description: Self-hosted (default bind)
security:
  - bearerAuth: []
paths:
  /v1/import/{importId}:
    get:
      tags:
        - Integration
      summary: Import job status
      description: >-
        Cumulative status of one load — every batch posted under the same
        `import_id`, combined.


        `first_event_time` and `last_event_time` are the check that matters:
        they report the event-time span your data actually landed in, which is
        what tells you whether the export went where you thought it did.
      operationId: importStatus
      parameters:
        - name: importId
          in: path
          required: true
          schema:
            type: string
          example: csv-export-2026-05
          description: >-
            The `import_id` you supplied on `POST /v1/import`, or the
            server-generated `imp-<hex>` id returned there.
      responses:
        '200':
          description: Job status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportStatus'
              example:
                import_id: csv-export-2026-05
                created_at: '2026-08-18T16:39:58.351951Z'
                updated_at: '2026-08-18T16:41:02.108413Z'
                received: 812
                accepted: 807
                duplicate: 4
                rejected: 1
                first_event_time: '2026-05-01T09:12:00Z'
                last_event_time: '2026-05-09T00:00:00Z'
                rejections:
                  - event_id: evt-004
                    reason: invalid_label
                    at: '2026-08-18T16:41:02.106Z'
                rejections_truncated: false
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: >-
            Either no job with this `import_id` exists for your account — a JSON
            body `{"error": "unknown import_id"}` — or import is not enabled for
            this deployment, in which case the route is unregistered and the
            body is plain text `404 page not found`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: unknown import_id
            text/plain:
              schema:
                $ref: '#/components/schemas/NotEnabledText'
              example: |
                404 page not found
        '500':
          description: Server-side failure reading the job.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: read import job
components:
  schemas:
    ImportStatus:
      type: object
      properties:
        import_id:
          type: string
          example: csv-export-2026-05
        created_at:
          type: string
          format: date-time
          description: When the first batch under this `import_id` was recorded.
        updated_at:
          type: string
          format: date-time
          description: When the most recent batch was recorded.
        received:
          type: integer
          description: Cumulative across **every batch** posted under this `import_id`.
          example: 812
        accepted:
          type: integer
          example: 807
        duplicate:
          type: integer
          example: 4
        rejected:
          type: integer
          example: 1
        first_event_time:
          type: string
          format: date-time
          description: >-
            The earliest `event_time` among accepted plus duplicate events;
            rejected events cover nothing, since they were never stored. Compare
            it against what you meant to send. **Omitted** (not `null`) when
            nothing has been accepted or found duplicate yet.
          example: '2026-05-01T09:12:00Z'
        last_event_time:
          type: string
          format: date-time
          description: >-
            The latest `event_time` among accepted plus duplicate events.
            Omitted under the same condition as `first_event_time`.
          example: '2026-05-09T00:00:00Z'
        rejections:
          type: array
          items:
            $ref: '#/components/schemas/ImportRejection'
          description: >-
            The first 100 rejections stored for this load, oldest first.
            **Omitted** when there are none.
        rejections_truncated:
          type: boolean
          description: >-
            `true` when cumulative `rejected` exceeds 100, so `rejections` is a
            sample rather than the full set.
          example: false
      required:
        - import_id
        - created_at
        - updated_at
        - received
        - accepted
        - duplicate
        - rejected
        - rejections_truncated
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: account_id required
          description: Human-readable message. Not stable — don't parse it.
      required:
        - error
      description: >-
        Uniform error envelope. The message is for humans and is not stable;
        branch on the HTTP status.
    NotEnabledText:
      type: string
      description: Plain-text body of an unregistered route.
      example: |
        404 page not found
    ImportRejection:
      type: object
      properties:
        event_id:
          type: string
          example: evt-004
          description: >-
            The rejected event's `event_id`. Omitted when the rejection was
            `missing_event_id`.
        reason:
          type: string
          example: invalid_label
          description: Same vocabulary as `results[].reason` on a rejected event.
        at:
          type: string
          format: date-time
          description: When the rejection was recorded — not the event's `event_time`.
      required:
        - reason
        - at
  responses:
    Unauthorized:
      description: Missing, malformed, unknown, expired, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missing:
              summary: No or malformed Authorization header
              value:
                error: 'missing or malformed Authorization: Bearer <api key>'
            invalid:
              summary: Unknown, expired, or revoked key
              value:
                error: invalid, expired, or revoked api key
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your secret API key: `vg_live_` followed by 43 base64url characters.
        Send it as `Authorization: Bearer vg_live_…` on every `/v1` request
        (except `POST /v1/sensor/collect`, which uses a publishable site key in
        the body).

````
