> ## 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.

# Update Access for Folders

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

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

# Endpoint

`https://api.velt.dev/v2/organizations/folders/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="folderIds" type="string[]" required>
      Array of Folder IDs
    </ParamField>

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

    <ParamField body="inheritFromParent" type="boolean">
      Configure the folder to inherit access permissions from its parent folder. When set to `true`, the folder automatically inherits all access settings from its parent.
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### 1. Update folder access type

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "folderIds": ["yourFolderId1, yourFolderId2"],
    "accessType": "organizationPrivate"
  }
}
```

#### 2. Configure folder to inherit access from parent

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "folderIds": ["yourFolderId1"],
    "inheritFromParent": true
  }
}
```

# Response

#### Success Response

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

#### Success Inherit Access From Parent Response

```JSON theme={null}

{
    "result": {
        "status": "success",
        "message": "Folder access type updated.",
        "data": {
            "folder1": {
                "success": true,
                "accessType": null,
                "inheritFromParent": true,
                "message": "Folder 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 folders successfully.",
      "data": {
        "yourFolderId": {
          "success": true,
          "accessType": "organizationPrivate",
          "message": "Folder access type updated."
        }
      }
    }
  }
  ```
</ResponseExample>
