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

# Get import status

> Poll GET /dn/contacts/import/{id} to check whether a contact import has completed, how many contacts it added, and which rows failed.

After you start an import with [Import contacts](https://detrack.mintlify.site/api-reference/contacts/import.md), poll this endpoint with the import's `id`.

## Polling

* Poll every 5 to 10 seconds. Small files finish within seconds, but a file with a few thousand rows can take a couple of minutes.
* Stop polling when `status` is `completed` or `failed`.
* A `failed` import lists the reasons in `errors`. With `invalid_contact`, the rows in `invalid_contacts` weren't saved but the file's other rows were. See [Import errors](https://detrack.mintlify.site/api-reference/contacts/import.md#import-errors).

To check the most recent import without its `id`, use [Get the last import](https://detrack.mintlify.site/api-reference/contacts/get-last-import.md).


## OpenAPI

````yaml GET /dn/contacts/import/{id}
openapi: 3.0.3
info:
  title: Detrack REST API v2
  version: '2.0'
  description: >-
    Detrack REST API v2. Checked against detrack-webapp origin/main (production)
    on 2026-09-29: dn_jobs.rb @ d246ad006, dn_depots.rb @ 2a5f387, dn_routes.rb
    @ 50a73a9, app_helper.rb @ d745ad2, dn_jobs_helper.rb @ d296e30,
    job_decorator.rb @ 3041da7, run_location_decorator.rb @ 0f0274d,
    vehicle_route_plan_decorator.rb and tsp_route_decorator.rb @ 7d1f3ef,
    data_export.rb @ ed4e135. Vehicle check submissions checked against
    origin/main on 2026-11-03: dn_vehicle_checklist_submissions.rb @ 3071523d1,
    vehicle_checklist_submission_decorator.rb @ f4002c957,
    vehicle_checklist_submission.rb @ b80aea03c,
    vehicle_checklist_submission_rules.rb @ e55194ed7. Contacts checked against
    origin/main on 2026-11-04: dn_contacts.rb, contacts_helper.rb and contact.rb
    @ a1b3694a0, contact_decorator.rb @ a51f1eab7.
servers:
  - url: https://app.detrack.com/api/v2
security:
  - apiKey: []
tags:
  - name: Jobs
    description: Deliveries and collections.
  - name: Depots
    description: Saved warehouse and pickup locations.
  - name: Contacts
    description: Your address book of saved recipients.
  - name: Routes
    description: Optimized multi-stop plans across vehicles.
  - name: Vehicle checks
    description: >-
      Checklists your drivers submit for a vehicle, such as start-of-day and
      end-of-day checks.
  - name: Contact imports
    description: Add contacts in bulk from a CSV or Excel file.
paths:
  /dn/contacts/import/{id}:
    get:
      tags:
        - Contact imports
      summary: Get import status
      description: >-
        Returns a contact import your API key's user started, with its status,
        the number of contacts added, and the rows that failed. Poll it after
        [Import contacts](/api-reference/contacts/import) until `status` is
        `completed` or `failed`.
      operationId: getContactImport
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            example: 6ae1949608fe77f3f222fa08
          description: >-
            The `id` returned by [Import
            contacts](/api-reference/contacts/import).
      responses:
        '200':
          description: The import.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ContactImport'
              example:
                data:
                  id: 6ae1949608fe77f3f222fa08
                  status: completed
                  import_count: 2
                  invalid_count: 0
                  invalid_contacts: []
                  errors: []
                  imported_at: '2026-10-28T14:22:14.255+08:00'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: >-
            No import has that `id` in your account, or your API key's user
            didn't start it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: not_found
                message: Contact import not found
        default:
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    ContactImport:
      type: object
      properties:
        id:
          type: string
          example: 6ae1949608fe77f3f222fa08
        status:
          type: string
          enum:
            - processing
            - completed
            - failed
          description: >-
            `processing` until Detrack has read the file, then `completed`, or
            `failed` with the reasons in `errors`.
          example: completed
        import_count:
          type: integer
          description: >-
            Number of rows read from the file, including rows that couldn't be
            saved. Rows with no values aren't counted. The contacts saved are
            `import_count` minus `invalid_count`. Set when `status` is
            `completed`, or `failed` with `invalid_contact`.
          example: 2
        invalid_count:
          type: integer
          description: Number of rows that couldn't be saved.
          example: 0
        invalid_contacts:
          type: array
          description: >-
            The rows that couldn't be saved, each as contact fields with an
            `errors` array. The file's other rows are still saved.
          items:
            type: object
            additionalProperties: true
        errors:
          type: array
          description: >-
            Why the import failed. See [Import
            errors](/api-reference/contacts/import#import-errors).
          items:
            type: string
            enum:
              - file_too_large
              - too_many_rows
              - invalid_file
              - invalid_csv_file
              - missing_required_headers
              - invalid_contact
          example: []
        imported_at:
          type: string
          format: date-time
          description: When the import was requested, in your account's time zone.
          example: '2026-10-28T14:22:14.255+08:00'
    Error:
      type: object
      properties:
        code:
          type: string
          example: not_found
        message:
          type: string
          example: Could not find job with this DO number
  responses:
    Unauthorized:
      description: >-
        The API key is missing or invalid. A missing `X-API-KEY` returns `{
        "error": "Missing Authorization header" }`; an invalid key returns `{
        "code": "invalid_key", "message": "Invalid key" }`.
      content:
        application/json:
          schema:
            oneOf:
              - type: object
                title: Missing key
                required:
                  - error
                properties:
                  error:
                    type: string
                    example: Missing Authorization header
              - type: object
                title: Invalid key
                required:
                  - code
                properties:
                  code:
                    type: string
                    example: invalid_key
                  message:
                    type: string
                    example: Invalid key
          example:
            code: invalid_key
            message: Invalid key
    Forbidden:
      description: Your API key's user doesn't have permission for this action.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                example: forbidden
          example:
            code: forbidden
    ServerError:
      description: >-
        Unexpected server error. Retry with exponential backoff, and contact
        Detrack support if it persists.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Your Detrack API key, from **Integrations > API Key** in the dashboard.

````

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