---
title: "Cancel a metric collection job"
method: POST
path: "/v1/metric/collection-jobs/{jobId}/cancel"
tags: ["Metric Collection Job"]
---

# Cancel a metric collection job

`POST /v1/metric/collection-jobs/{jobId}/cancel`

## Request

- Base URL: `https://api.roark.ai`
- URL: `https://api.roark.ai/v1/metric/collection-jobs/{jobId}/cancel`
- Auth: HTTP bearer

Stops a metric collection job that has not finished. No further conversations are processed and the job ends in CANCELED.

Items the job had not reached are marked SKIPPED. Metric values already produced are kept, and items that were mid-computation when the cancel arrived may still complete. Only the items that completed are billed.

Safe to call more than once: a job that has already finished (COMPLETED, FAILED, or CANCELED) is returned unchanged.

## Path parameters

- `jobId` string, uuid, required

## Response `200`

The canceled job, or the job unchanged if it had already finished

- object
  - `data` MetricCollectionJobResponse, required: A metric collection job that processes metrics for calls or chats
    - `id` string, uuid, required: Unique identifier of the metric collection job
    - `status` 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED', required: Current status of the job
    - `triggeredBy` 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION', required: What triggered this job
    - `totalItems` integer, required: Total number of call-metric pairs to process
    - `completedItems` integer, required: Number of items that finished without failing: a value was written, or the metric did not apply to the conversation
    - `failedItems` integer, required: Number of items that could not be computed, for example because an artifact the metric reads (such as diarization) failed to generate
    - `startedAt` string, nullable, required: When the job started processing
    - `completedAt` string, nullable, required: When the job completed
    - `errorMessage` string, nullable, required: Why the job failed or, on a COMPLETED job with failedItems above 0, why those items failed
    - `policyIds` string[], required: IDs of the metric policies that triggered this job
    - `createdAt` string, required: When the job was created
    - `updatedAt` string, required: When the job was last updated

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `429`: Too Many Requests
- `500`: Internal Server Error

## Changes

> 187 revisions in range; 1 not diffed.

- **2026-10-22** `dc12dbdf0d53`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/roarkhq/apis/roark-analytics-api/changes/v1/metric/collection-jobs/:jobId/cancel/post.md)

---

[API](https://skmtc.dev/roarkhq/apis/roark-analytics-api.md) - [All operations](https://skmtc.dev/roarkhq/apis/roark-analytics-api/llms.txt) - [OpenAPI document](https://skmtc.dev/roarkhq/apis/roark-analytics-api/revisions/1a91a5c90e44?raw)
