---
title: "Unshare document from all users"
url: "https://docs.signnow.com/docs/document/operations/unshare-document-all"
type: "endpoint"
section: "document"
slug: "document/operations/unshare-document-all"
method: "DELETE"
path: "/v2/documents/{document_id}/roles"
operation_id: "unshare-document-all"
authorization: "bearer"
---

# Unshare document from all users

`DELETE /v2/documents/{document_id}/roles`

This endpoint allows API users to remove sharing access for all users from the document.

**Notes**

* Only the owner of the document can perform this action.
* All shared users are removed.

## Authorization

bearer

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `document_id` | string | Yes | Document ID. |

## Responses

### 204

All users successfully unshared. No content returned.

### 400

Bad request. Possible errors:

* Document not found.

**Example** (`Example 1`)

```json
{
  "code": 12029021,
  "message": "Document not found."
}
```

**Example** (`Document not found`)

```json
{
  "code": 12029021,
  "message": "Document not found."
}
```

### 401

Incorrect or missing bearer token.

**Example** (`Example 1`)

```json
{
  "code": 1537,
  "error": "invalid_token"
}
```

**Example** (`Unauthorized`)

```json
{
  "code": 1537,
  "error": "invalid_token"
}
```

### 403

User is not the document owner.

**Example** (`Example 1`)

```json
{
  "code": 12029012,
  "message": "You don't have access to the entity."
}
```

**Example** (`Not an owner`)

```json
{
  "code": 12029012,
  "message": "You don't have access to the entity."
}
```

## Code Examples

> Replace `$SIGNNOW_ACCESS_TOKEN` and any `{placeholder}` values before running.

### cURL

```bash
curl -X DELETE \
  "https://api.signnow.com/v2/documents/{document_id}/roles" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN"
```

---
*Full reference: https://docs.signnow.com/docs/document/operations/unshare-document-all*
