# Cancel Refresh

Launch stage: Public Preview

`POST /api/data-quality/v1/monitors/{object_type}/{object_id}/refreshes/{refresh_id}/cancel`

Cancels a data quality monitor refresh. Currently only supported for the `table` `object_type`.
 The call must be made in the same workspace as where the monitor was created.

 The caller must have either of the following sets of permissions:
 1. **MANAGE** and **USE_CATALOG** on the table's parent catalog.
 2. **USE_CATALOG** on the table's parent catalog, and **MANAGE** and **USE_SCHEMA** on the table's parent schema.
 3. **USE_CATALOG** on the table's parent catalog, **USE_SCHEMA** on the table's parent schema, and **MANAGE** on the table.

API scopes: dataquality

## Path parameters

- `object_type` (string, optional)
  The type of the monitored object. Can be one of the following: `schema` or `table`.
- `object_id` (string, optional)
  The UUID of the request object. It is `schema_id` for `schema`, and `table_id` for `table`.
  
   Find the `schema_id` from either:
   1. The [schema_id](https://docs.databricks.com/api/workspace/schemas/get#schema_id) of the `Schemas` resource.
   2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `schema` > go to the `Details` tab > the `Schema ID` field.
  
   Find the `table_id` from either:
   1. The [table_id](https://docs.databricks.com/api/workspace/tables/get#table_id) of the `Tables` resource.
   2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `table` > go to the `Details` tab > the `Table ID` field.
- `refresh_id` (int64, optional)
  Unique id of the refresh operation.

## Returns

- `refresh` (object, optional)
  The refresh to cancel.
  - `object_type` (string, optional)
    The type of the monitored object. Can be one of the following: `schema` or `table`.
  - `object_id` (string, optional)
    The UUID of the request object. It is `schema_id` for `schema`, and `table_id` for `table`.
    
     Find the `schema_id` from either:
     1. The [schema_id](https://docs.databricks.com/api/workspace/schemas/get#schema_id) of the `Schemas` resource.
     2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `schema` > go to the `Details` tab > the `Schema ID` field.
    
     Find the `table_id` from either:
     1. The [table_id](https://docs.databricks.com/api/workspace/tables/get#table_id) of the `Tables` resource.
     2. In [Catalog Explorer](https://docs.databricks.com/aws/en/catalog-explorer/) > select the `table` > go to the `Details` tab > the `Table ID` field.
  - `refresh_id` (int64, optional)
    Unique id of the refresh operation.
  - `state` (string, optional)
    The current state of the refresh.
    Possible values: `MONITOR_REFRESH_STATE_UNKNOWN`, `MONITOR_REFRESH_STATE_PENDING`, `MONITOR_REFRESH_STATE_RUNNING`, `MONITOR_REFRESH_STATE_SUCCESS`, `MONITOR_REFRESH_STATE_FAILED`, `MONITOR_REFRESH_STATE_CANCELED`
  - `message` (string, optional)
    An optional message to give insight into the current state of the refresh (e.g. FAILURE messages).
  - `start_time_ms` (int64, optional)
    Time when the refresh started (milliseconds since 1/1/1970 UTC).
  - `end_time_ms` (int64, optional)
    Time when the refresh ended (milliseconds since 1/1/1970 UTC).
  - `trigger` (string, optional)
    What triggered the refresh.
    Possible values: `MONITOR_REFRESH_TRIGGER_UNKNOWN`, `MONITOR_REFRESH_TRIGGER_MANUAL`, `MONITOR_REFRESH_TRIGGER_SCHEDULE`, `MONITOR_REFRESH_TRIGGER_DATA_CHANGE`

## Response

```json
{
  "refresh": {
    "object_type": "string",
    "object_id": "string",
    "refresh_id": 0,
    "state": "string",
    "message": "string",
    "start_time_ms": 0,
    "end_time_ms": 0,
    "trigger": "string"
  }
}
```

