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

# Unshare document from user

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

This endpoint allows API users to remove sharing access for a specific user from the document.

**Notes**

* The owner can unshare any user except themselves.
* A shared user can unshare only themselves (self-unshare).

## Authorization

bearer

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `document_id` | string | Yes | Document ID. |
| `user_id` | string | Yes | ID of the user to unshare. |

## Responses

### 204

User successfully unshared. No content returned.

### 400

Bad request. Possible errors:

* Document not found.
* User role not found.
* Managing user not found.
* Entity owner can't unshare it from himself.

**Example** (`Example 1`)

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

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

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

**Example** (`User role not found`)

```json
{
  "errors": [
    {
      "code": 12029011,
      "message": "User role not found."
    }
  ]
}
```

**Example** (`Managing user not found`)

```json
{
  "errors": [
    {
      "code": 12029023,
      "message": "Managing user not found."
    }
  ]
}
```

**Example** (`Owner can't unshare themselves`)

```json
{
  "errors": [
    {
      "code": 12029022,
      "message": "Entity owner can't unshare it from himself."
    }
  ]
}
```

### 401

Incorrect or missing bearer token.

**Example** (`Example 1`)

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

**Example** (`Unauthorized`)

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

### 403

You don't have access to the entity.

**Example** (`Example 1`)

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

**Example** (`Forbidden`)

```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/{user_id}" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN"
```

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