> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mapping.travel/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel an in-progress inventory upload

> Cancel an in-progress upload and mark it CANCELLED. Only PENDING or PROCESSING uploads can be cancelled. Returns the upload ID and a confirmation message.

Use this endpoint to stop an upload that is still in progress. Once cancelled, the upload status changes to `CANCELLED` and processing halts. This is useful if you submitted a file in error or need to replace it with a corrected version.

## Request

**`POST https://api.mapping.travel/api/v1/inventory/{uploadId}/cancel`**

<ParamField path="uploadId" type="string" required>
  The UUID of the upload you want to cancel.
</ParamField>

<Note>
  Only uploads in `PENDING` or `PROCESSING` status can be cancelled. Attempting to cancel an upload that has already reached `COMPLETED`, `FAILED`, or `CANCELLED` will return a `400` error.
</Note>

## Example

```bash theme={null} theme={null}
curl -X POST "https://api.mapping.travel/api/v1/inventory/f47ac10b-58cc-4372-a567-0e02b2c3d479/cancel" \
  -H "Authorization: Bearer <your-token>"
```

## Response

<ResponseField name="uploadId" type="string">
  UUID of the cancelled upload record.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable confirmation message, e.g. `"Upload cancelled successfully"`.
</ResponseField>

## Error codes

| Code | Description                                                                    |
| ---- | ------------------------------------------------------------------------------ |
| 400  | Upload is not in a cancellable state (already completed, failed, or cancelled) |
| 401  | Missing or invalid Bearer token                                                |
| 404  | No upload found for the given `uploadId` in your organization                  |
| 429  | Rate limit exceeded                                                            |
