> For the complete documentation index, see [llms.txt](https://wiki.datadike.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.datadike.com/pam/administration/access/bulk-authorizations.md).

# Bulk authorizations

Creating, updating, and exporting authorization rules in bulk with a CSV or XLSX file, and the account codes the file uses.

## What this is and when to use it

The authorization list can be driven from a file. You download a template, fill it in, and upload it; the console creates or updates one rule per row. The same screen exports the rules you already have.

Reach for it when the work does not fit the form:

| Situation                   | Why the file is better                                          |
| --------------------------- | --------------------------------------------------------------- |
| First rollout               | Hundreds of rules built from a spreadsheet you already maintain |
| Moving between environments | Export from one, import into the next                           |
| Reorganisation              | Shifting many rules to new groups in one pass                   |
| Expiry sweep                | Pushing a new `Date expired` across a whole set                 |
| Audit evidence              | A dated file showing exactly who had access to what             |

For a handful of rules the form on [Authorizations](https://wiki.datadike.com/pam/administration/access/authorizations.md) is faster and validates as you type.

## Before you start

* The **SYSADMIN** profile.
* The users, groups, and assets already registered. The file references them by internal id, so it cannot create them.
* A spreadsheet tool that saves UTF-8. Accented names come back corrupted otherwise.

{% hint style="warning" %}
Export before you update. An update import overwrites the rules it names, and there is no undo inside the console. The exported file is the rollback.
{% endhint %}

## Steps

The controls sit at the top right of the authorization list: one icon imports, the other exports.

### Export for reading

1. Open **Console › Policies › Authorization**.
2. Optionally tick the rules you want. Leaving everything unticked exports the whole list.
3. Use the export icon. The **Export** dialog opens.
4. Choose **CSV** or **Excel**, then **Export all** or **Export only selected items**.
5. Confirm. The file downloads.

{% hint style="danger" %}
This file is for reading, not for round-tripping. It carries no ids, so it cannot be imported back. To change rules through a file, download the update template described below instead.
{% endhint %}

### Create new rules

1. Use the import icon. The **Upload & Update** dialog opens.
2. Choose **Create**, then **Download created template**.
3. Fill the file in:
   * row 1 holds the column headers
   * row 2 holds filling instructions and can be deleted
   * row 3 onwards holds one authorization per row
4. Leave **ID** empty. The console assigns it.
5. Save, return to the dialog, choose **Create**, upload the file, and confirm.

### Update existing rules

1. Optionally tick the rules you want to change in the list first.
2. Use the import icon, choose **Update**, then **Download updated template**.
3. The file arrives already filled with the current values of those rules, or of every rule if you ticked none.
4. Change only the cells you mean to change, and **keep the ID column untouched**. The id is how the console recognises the rule; blank it and the row is treated as new.
5. Save, choose **Update**, upload, and confirm.

## What you should see

A per-row result. Rows that validate are applied; rows that fail are reported with their reason and skipped, so a partial file still does useful work. Reload the list to see the rules that landed.

## How to verify it worked

1. Reload the authorization list and confirm the count moved by what you expected.
2. Open one imported rule in the form and check its users, accounts, protocols, and dates against the row you wrote.
3. Sign in as one of the granted users and confirm the asset is now visible. An imported rule with `Active` set to `No`, or a start date in the future, grants nothing yet, which looks identical to a failed import from the list alone.

## Common errors

| What you see                            | Cause                           | Fix                                                                      |
| --------------------------------------- | ------------------------------- | ------------------------------------------------------------------------ |
| Row rejected on the date                | Wrong date shape                | Use `2025/07/12 22:03:07 +0800`, including the offset                    |
| Row rejected on a user, group, or asset | The id does not exist here      | Ids are per environment. Re-export from *this* console to get valid ones |
| Row rejected on a list field            | Array syntax                    | Double quotes and JSON shape: `["ssh", "rdp"]`, and `[]` for empty       |
| Row rejected with no name               | `Name` is required              | Fill it; 128 characters maximum                                          |
| Accents come back as mojibake           | The file was not saved as UTF-8 | Re-save as UTF-8 and upload again                                        |
| Upload refused outright                 | Over 10 MB, or not CSV/XLSX     | Split the file                                                           |
| An export will not import               | It is the audit export          | Download the update template instead                                     |

## Field reference

One row is one authorization. The names match the columns of the template.

| Column       | Shape                       | Notes                                                               |
| ------------ | --------------------------- | ------------------------------------------------------------------- |
| ID           | internal id                 | Empty when creating. Required, and unchanged, when updating         |
| Name         | text                        | Required, up to 128 characters                                      |
| Users        | `["name(id)", ...]`         | For example `["John(b8903cab-63a1-406b-8ba3-7eead1b5c592)"]`        |
| Groups       | `["name(id)", ...]`         | `[]` when none                                                      |
| Assets       | `["name(id)", ...]`         | For example `["vmTestes(1c086d8a-1222-4c59-9402-0bde1d413b87)"]`    |
| Nodes        | `["name(id)", ...]`         | Asset-tree folders, same shape                                      |
| Tags         | `[]`                        | Leave empty                                                         |
| Accounts     | `["name", "@CODE", ...]`    | Real account names, the codes below, or both                        |
| Protocols    | `["all"]` or a list         | For example `["ssh", "rdp", "vnc"]`                                 |
| Action       | list                        | `connect`, `upload`, `download`, `copy`, `paste`, `delete`, `share` |
| Active       | `Yes` or `No`               |                                                                     |
| Date start   | `2025/07/12 22:03:07 +0800` | Offset included                                                     |
| Date expired | same shape                  |                                                                     |
| Description  | text                        | Free                                                                |

### Account codes

The form offers the account options by name. The file uses a code for each, and the two are the same thing:

| Code     | Option on the form    | What the session uses                                       |
| -------- | --------------------- | ----------------------------------------------------------- |
| `@ALL`   | All existing accounts | Every account registered on the asset                       |
| `@SPEC`  | Specified accounts    | The named list you also put in the cell                     |
| `@USER`  | Same account          | The account whose name matches the console user             |
| `@ANON`  | Anonymous account     | No credential. Web and custom assets only                   |
| `@INPUT` | Manual account        | The user types the username and password at connection time |

Real names and codes mix in one cell: `["root", "admin", "@SPEC", "@USER"]`.

## Related pages

* [Authorizations](https://wiki.datadike.com/pam/administration/access/authorizations.md): the same rule built one at a time in the form, and what each field means.
* [Users and groups](https://wiki.datadike.com/pam/administration/identities/users-and-groups.md): the users and groups the file references.
* [Folders and tags](https://wiki.datadike.com/pam/administration/assets/folders-and-tags.md): the asset-tree folders that the `Nodes` column points at.
