> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/developers/gitbook-api/api-reference/imports/cancel-an-import-run.md).

# Cancel an import run

```json
{"openapi":"3.1.0","info":{"title":"GitBook API","version":"0.0.1-beta"},"tags":[{"name":"imports","description":"The Imports API provides allows you to import content into GitBook.\n"}],"servers":[{"url":"{host}/v1","variables":{"host":{"default":"https://api.gitbook.com"}}}],"security":[{"user":[]}],"components":{"securitySchemes":{"user":{"type":"http","scheme":"bearer"}},"parameters":{"organizationId":{"name":"organizationId","in":"path","required":true,"description":"The unique id of the organization","schema":{"$ref":"#/components/schemas/EntityId"}},"importRunId":{"name":"importRunId","in":"path","required":true,"description":"The unique id of the import run","schema":{"type":"string"}}},"schemas":{"EntityId":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"A unique entity identifier"},"ContentImportRun":{"type":"object","properties":{"id":{"description":"Unique ID of the import","type":"string"},"startedAt":{"description":"Date when the import has started","$ref":"#/components/schemas/Timestamp"},"completedAt":{"description":"Filled when the imported is in status \"completed\"","$ref":"#/components/schemas/Timestamp"},"status":{"description":"Status of the import","type":"string","enum":["pending","in-progress","completed","failed","cancelled"]},"reason":{"description":"Reason for the import failure when `status` is `failed`.","type":"string"},"pages":{"description":"Pages included in the import","type":"array","items":{"type":"object","properties":{"id":{"description":"ID of page","type":"string"},"sourceURL":{"description":"Source URL where the page has been imported from","type":"string"},"type":{"description":"Type of page","type":"string","enum":["page","folder"]},"status":{"description":"Status of the page","type":"string","enum":["complete","pending"]}},"required":["id","type","status"]}}},"required":["id","status"]},"Timestamp":{"type":"string","format":"date-time"}},"responses":{"BadRequestError":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","enum":[400]},"message":{"type":"string"}},"required":["code","message"]}}}}}},"NotFoundError":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","enum":[404]},"message":{"type":"string"}},"required":["code","message"]}}}}}}}},"paths":{"/org/{organizationId}/imports/{importRunId}/cancel":{"post":{"operationId":"cancelImportRun","summary":"Cancel an import run","tags":["imports"],"parameters":[{"$ref":"#/components/parameters/organizationId"},{"$ref":"#/components/parameters/importRunId"}],"responses":{"201":{"description":"Import run canceled successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentImportRun"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"404":{"$ref":"#/components/responses/NotFoundError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/developers/gitbook-api/api-reference/imports/cancel-an-import-run.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
