# Delete a subscription

URL: https://docs.fxapis.com/api-reference/copy-trading/delete-a-subscription

> Delete a subscription. closePositions is required.

`DELETE https://api.fxapis.com/v1/copy/subscriptions/{id}`

`closePositions` is required.

- `true`: the subscription stops at once (`stopped`, `stopReason` `deleted`, `deleting` true) and every position it holds on the follower is closed, by ticket — including one whose copied open is still in flight, once it fills. The closes are recorded before any is sent, so they go even if this request is cut off, and a follower that is offline gets them when it is back. The subscription is removed once they are all closed: 200 with `deleted` true when that happens within this request, otherwise 202 with what is still `pending`. A close the broker refuses (`failed`) keeps the subscription until it is closed: delete again to retry, or with `false` to keep the rest.
- `false`: the subscription is removed now, and its links with it: the positions stay open on the follower as the account's own, no longer copied, closed or corrected by copy trading (`released` counts them).

Either way the executions log is kept, with `subscriptionId` null.

Authentication: `Authorization: Bearer <API key>`.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `closePositions` | query | "true" \| "false" | no |  |
| `id` | path | string (uuid) | yes |  |

#### Responses

- `200`
- `202`
- `400`
- `401`
- `403`
- `404`

Failures return `{ "error": { "code", "message" } }`; every code is listed at https://docs.fxapis.com/errors.

#### 200 response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | object | no |  |
| `data.id` | string (uuid) | no |  |
| `data.deleted` | boolean | no | True once the subscription is gone; false while its positions are still being closed (202). |
| `data.deleting` | boolean | no | True (with 202) while the subscription stays, stopped, closing its positions; it is removed once they are closed. |
| `data.closed` | integer | no | Positions closed (or found already closed) by this call. |
| `data.pending` | integer | no | Closes still waiting: for the follower to come online, or for a copied open still in flight. They go when they can. |
| `data.failed` | integer | no | Closes the broker refused. The subscription stays, stopped, until they are closed: delete again to retry, or with closePositions=false to keep them. |
| `data.released` | integer | no | With closePositions=false: positions left open on the follower as its own, no longer copied. |