## Cancel Parse Job

`parsing.cancel(strjob_id, ParsingCancelParams**kwargs)  -> ParsingCancelResponse`

**post** `/api/v2/parse/{job_id}/cancel`

Cancel a running parse job.

Stops processing and marks the job as CANCELLED. Returns the updated job. Jobs already in a terminal state (COMPLETED, FAILED, CANCELLED) cannot be cancelled.

### Parameters

- `job_id: str`

- `organization_id: Optional[str]`

- `project_id: Optional[str]`

### Returns

- `class ParsingCancelResponse: …`

  A parse job.

  - `id: str`

    Unique parse job identifier

  - `project_id: str`

    Project this job belongs to

  - `status: Literal["CANCELLED", "COMPLETED", "FAILED", 2 more]`

    Current job status: PENDING, RUNNING, COMPLETED, FAILED, or CANCELLED

    - `"CANCELLED"`

    - `"COMPLETED"`

    - `"FAILED"`

    - `"PENDING"`

    - `"RUNNING"`

  - `created_at: Optional[datetime]`

    Creation datetime

  - `error_message: Optional[str]`

    Error details when status is FAILED

  - `name: Optional[str]`

    Optional display name for this parse job

  - `tier: Optional[str]`

    Parsing tier used for this job

  - `updated_at: Optional[datetime]`

    Update datetime

  - `usage: Optional[Usage]`

    Usage recorded against a job.

    - `credits: Optional[float]`

      Total credits billed against this job. Null until billing has recorded it.

  - `user_metadata: Optional[Dict[str, str]]`

    Key/value tags associated with this job.

### Example

```python
import os
from llama_cloud import LlamaCloud

client = LlamaCloud(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)
response = client.parsing.cancel(
    job_id="job_id",
)
print(response.id)
```

#### Response

```json
{
  "id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "project_id": "prj-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "status": "CANCELLED",
  "created_at": "2019-12-27T18:11:19.117Z",
  "error_message": "error_message",
  "name": "Q4 Financial Report",
  "tier": "fast",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "usage": {
    "credits": 30
  },
  "user_metadata": {
    "owner": "jerry",
    "team": "research"
  }
}
```
