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

# Update document access (v2)

> Adjust document-level access roles and sharing rules for users or groups using the Velt v2 REST API to manage permissions and collaboration scope.

Use this API to update the access type for a single or multiple documents at once.

<Tip>
  You can update the default access type for all the documents associated with your API Key in [console](https://console.velt.dev/dashboard/config/appconfig).
</Tip>

# Endpoint

`https://api.velt.dev/v2/organizations/documents/access/update`

# 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="organizationId" type="string" required>
      Organization ID
    </ParamField>

    <ParamField body="documentIds" type="string[]" required>
      Array of Document IDs
    </ParamField>

    <ParamField body="accessType" type="string" default="public" required>
      Access type for the documents. Allowed values: `organizationPrivate`, `restricted`, `public`.
      [Learn more](/key-concepts/overview#access-control).
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentIds": ["yourDocumentId1, yourDocumentId2"],
    "accessType": "organizationPrivate"
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Updated access for documents successfully.",
    "data": {
      "yourDocumentId": {
        "success": true,
        "accessType": "organizationPrivate",
        "message": "Document access type updated."
      }
    }
  }
}
```

#### Failure Response

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

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "Updated access for documents successfully.",
      "data": {
        "yourDocumentId": {
          "success": true,
          "accessType": "organizationPrivate",
          "message": "Document access type updated."
        }
      }
    }
  }
  ```
</ResponseExample>
