# IRPCExternalLocationsAdmin.RemoveExternalLocation

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [External locations](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCExternalLocationsAdmin/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCExternalLocationsAdmin/RemoveExternalLocation/

Badges: `Administration API / specialized` `admin` `session`

Deletes an external location, optionally destroying the documents whose files are linked to it.

- **Service:** [External locations](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCExternalLocationsAdmin/index.md) `MFiles.IRPCExternalLocationsAdmin`
- **gRPC method:** `/MFiles.IRPCExternalLocationsAdmin/RemoveExternalLocation`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/remove-external-location`
- **Request:** [`RemoveExternalLocationRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCExternalLocationsAdmin/RemoveExternalLocation/index.md#request)
- **Response:** [`RemoveExternalLocationResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCExternalLocationsAdmin/RemoveExternalLocation/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- With `destroy_docs_with_linked_files` true, **destroys every document that has a file linked to
  the location** before deleting it. This cannot be undone.
- With it false, the call fails while documents with files linked to the location exist.
- Requires `manage_external_locations`.

<a id="request"></a>

## Request: RemoveExternalLocationRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `id` | `int32` | The ID of the external location to remove. |
| `destroy_docs_with_linked_files` | `bool` | True to destroy all documents that contain files linked to the external location being removed. |

<a id="response"></a>

## Response: RemoveExternalLocationResponse

No fields.
