---
title: "Get latest Xray sync status for a batch of plans"
method: POST
path: "/tcm/external/sync/executions/plan/{workspace_id}/status"
tags: ["TestCaseManagement"]
---

# Get latest Xray sync status for a batch of plans

`POST /tcm/external/sync/executions/plan/{workspace_id}/status`

Returns the most recent Xray sync AsynchronousJob for each requested plan's latest plan run, keyed by plan_id. Plans with no such run, and plans whose latest run has no sync job, are omitted from the result. Unlike a plan-run-keyed lookup this resolves the latest run server-side, so a plan whose last run was up to 400 days ago still reports its sync outcome. Latest-run resolution sees completed runs only and is updated asynchronously, so shortly after a run finishes this may still report the previous run — each status carries the plan_run_id its job belongs to.

## Path parameters

- `workspace_id` string, required

## Request body

- PlanXraySyncStatusBatchRequest — Request body for batch plan Xray sync status query
  - `plan_ids` string[], required — Array of plan IDs to find the latest Xray sync status for

## Response `200`

Latest Xray sync status per plan

- PlanXraySyncStatusQueryResult — Result envelope for batch plan Xray sync status query results
  - `statuses` PlanXraySyncStatus[], required — Latest Xray sync status per plan. Plans with no completed run, and plans whose latest run has no sync job, are omitted.
    - `plan_id` string, required — Unique identifier for the Plan
    - `plan_run_id` string, required — Unique identifier for the plan's latest PlanRun, which the sync job belongs to
    - `xray_sync_job` AsynchronousJob, required — An AsynchronousJob to track and provide insight into long-running background job
      - `id` string — Unique identifier of the TestCase
      - `workspace_id` string — Unique identifier for the associated Workspace
      - `job_type` 'xray_sync' | 'workspace_copy' — Type of AsynchronousJob
      - `status` 'pending' | 'running' | 'completed' | 'failed' — Current status of the AsynchronousJob
      - `associated_entities` AsynchronousJobAssociatedEntity[] — Type of Entity this AsynchronousJob is associated with
        - `type` 'workspace' | 'plan_run' — Type of Entity this AsynchronousJob is associated with
        - `id` string — Unique identifier for the associated Entity
      - `created_time` integer — Time the AsynchronousJob was created
      - `created_by_id` string — Identifier of the user who created the AsynchronousJob
      - `last_updated_time` integer — Time the AsynchronousJob was last updated
      - `last_updated_by_id` string — Identifier of the user who last updated the AsynchronousJob
      - `error_message` string — If failed, an optional error message associated with the failure
      - `job_source` 'test_run' | 'plan_run' — What triggered this job

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
