> ## Documentation Index
> Fetch the complete documentation index at: https://velt.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove Permissions

Use this API to remove permissions from a user for specific resources like organizations or documents.

<Info>
  This endpoint allows you to revoke access for a user from one or more resources.
</Info>

# Endpoint

`POST https://api.velt.dev/v2/auth/permissions/remove`

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="userId" type="string" required>
      The ID of the user from whom to remove permissions.
    </ParamField>

    <ParamField body="permissions" type="object" required>
      <Expandable title="properties">
        <ParamField body="resources" type="object[]" required>
          An array of resource objects from which to remove user permissions.

          <Expandable title="Resource object">
            <ParamField body="type" type="string" required>
              The type of resource. Must be one of: `organization`, `document`, or `folder`.
            </ParamField>

            <ParamField body="id" type="string" required>
              The ID of the resource.
            </ParamField>

            <ParamField body="organizationId" type="string">
              The ID of the organization. Required if `type` is `document`.
            </ParamField>
          </Expandable>
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### Remove permissions from an organization and a document

```JSON theme={null}
{
  "data": {
    "userId": "USER_ID",
    "permissions": {
      "resources": [
        {
          "type": "organization",
          "id": "ORGANIZATION_ID"
        },
        {
          "type": "document",
          "id": "DOCUMENT_ID",
          "organizationId": "ORGANIZATION_ID"
        }
      ]
    }
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Permissions removed successfully."
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "Permissions removed successfully."
    }
  }
  ```
</ResponseExample>
