---
title: "How to provide anonymous user access to Confluence space(s) using CLI"
canonical: "https://support.appfire.com/space/SUPPORT/89142622/How%20to%20provide%20anonymous%20user%20access%20to%20Confluence%20space(s)%20using%20CLI"
format: markdown
---
<span style="color: #333333">This article presents step by step instructions on how to give access to anonymous users in Confluence space(s) using the </span>*<span style="color: #333333">Confluence CLI</span>*<span style="color: #333333"> app.</span>

## <span style="color: #333333">Instructions</span>

<span style="color: #333333">Use </span>*<span style="color: #333333">addPermissions</span>*<span style="color: #333333"> action to add permissions to the Confluence space along with userId parameter. </span>

### <span style="color: #333333">For anonymous user access to a single space:</span>

<span style="color: #333333">Ensure that the CLI client file is updated with the required information. Run the following CLI action to add the view space permissions for anonymous users in a space: </span>

```
--action addPermissions --space ZCLI --permissions VIEWSPACE --userId anonymous
```

### <span style="color: #333333">For anonymous user access to multiple spaces:</span>

<span style="color: #333333">In order to add permissions to multiple spaces, you need to create a CSV file with a single column named </span>*<span style="color: #333333">space</span>*<span style="color: #333333"> as follows: </span>  
> Macro (inline-media-image)

  
<span style="color: #333333">Once you have the CSV file, run the following CLI command to add permissions for multiple spaces:</span>

```
--action runfromCSV --file "addpermissionspace.csv" --common "--action addPermissions --permissions VIEWSPACE --userId anonymous --continue"
```

<span style="color: #333333">This command results in:</span>  
  
> Macro (inline-media-image)

  
  
<span style="color: #333333">The parameters used in the above actions are:</span>

- *<span style="color: #333333">space</span>*<span style="color: #333333"> value refers to the space key.</span>
- *<span style="color: #333333">permissions</span>*<span style="color: #333333"> value refers to comma separated list of space permissions.</span>
- *<span style="color: #333333">userId</span>*<span style="color: #333333"> value refers to user id of the user whom you want to assign the permissions. </span>
- *<span style="color: #333333">file</span>*<span style="color: #333333"> value refers to path to file based content.</span>

> ℹ️ <span style="color: #333333">Valid space permissions are: [VIEWSPACE, REMOVEOWNCONTENT, EDITSPACE, REMOVEPAGE, EDITBLOG, REMOVEBLOG, CREATEATTACHMENT, REMOVEATTACHMENT, COMMENT, REMOVECOMMENT, SETPAGEPERMISSIONS, REMOVEMAIL, EXPORTSPACE, SETSPACEPERMISSIONS]. Group or userId can also be a comma separated list of groups and userIds. Space permission support is not available for Cloud.</span>