# Method: projects.subscriptions.detach

- [HTTP request](https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/detach#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/detach#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/detach#body.request_body)
- [Response body](https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/detach#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/detach#body.aspect)
- [Try it!](https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/detach#try-it)

Detaches a subscription from this topic. All messages retained in the subscription are dropped. Subsequent `subscriptions.pull` and `StreamingPull` requests will return FAILED_PRECONDITION. If the subscription is a push subscription, pushes to the endpoint will stop.

### HTTP request

Choose a location:
<button value="global" default="">global</button>   
`POST https://pubsub.googleapis.com/v1/{subscription}:detach`

<br />

### Path parameters

| Parameters ||
|---|---|
| `subscription` | `string` Required. The subscription to detach. Format is `projects/{project}/subscriptions/{subscription}`. |

### Request body

The request body must be empty.

### Response body

If successful, the response body is empty.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/pubsub`
- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).