> ## 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 type (v1)

> Update the access type for one or many documents at once using the v1 REST API. Control public, restricted, or default document permissions.

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/v1/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>
