---
title: "Get Perforce import state"
method: GET
path: "/repos/{repo_id}/p4-import-state"
tags: ["Perforce Repository Import"]
---

# Get Perforce import state

`GET /repos/{repo_id}/p4-import-state`

Retrieve the current state of the continuous Perforce import job for this repository, including the last imported changelist, error information, and running status.

## Query parameters

- `branch_ref` string
- `p4_import_path` string

## Response `200`

Import state retrieved successfully

- P4ImportState — Current state of the Perforce continuous import job
  - `last_changelist` integer, required — Last Perforce changelist number that was imported
  - `last_import_unix` integer, nullable — Unix timestamp of the last successful import
  - `running_job_id` string, nullable — ID of the currently running import job, if any
  - `error_count` integer, required — Number of consecutive errors encountered
  - `last_error` string, nullable — Last error message encountered during import
  - `last_error_unix` integer, nullable — Unix timestamp of the last error
  - `branch_ref` string, required — reference name of the branch being synced
  - `p4_import_path` string, required — Perforce depot path being imported (e.g., //depot/main/...)
  - `started_unix` integer, nullable — Unix timestamp when the current job started running

## Other responses

- `400` — The request does not meet the required conditions
- `404` — The specified resource was not found
- `default` — An error occurred

---

[API](https://skmtc.net/diversion/apis/diversion-core-api.md) · [All operations](https://skmtc.net/diversion/apis/diversion-core-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/diversion/diversion-core-api/versions/38a18aba804b/schema)
