Actions109
- Activity Actions
- Assets Actions
- Authentication Actions
- Collections Actions
- Extensions Actions
- Fields Actions
- Files Actions
- Folders Actions
- Items Actions
- Permissions Actions
- Presets Actions
- Relations Actions
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
- Webhooks Actions
Permissions → Update Multiple
AI-generatedOverview
The Directus (DrWade) n8n node for the resource Permissions with the operation Update Multiple allows you to update multiple permission records in your Directus instance at once. This is particularly useful when you need to modify access rights or rules for several permissions simultaneously, such as updating roles, collections, or actions for a group of users or system components.
Practical scenarios:
- Bulk updating permissions after a policy change.
- Automating permission adjustments during onboarding/offboarding processes.
- Synchronizing permission settings across environments.
Properties
| Name | Type | Meaning |
|---|---|---|
| Data (JSON) | json | A JSON object containing two keys: - keys: An array of primary keys (IDs) of the permissions you want to update.- data: An object with the fields and values to update for each specified permission.Required. |
Example input:
{
"keys": [34, 65],
"data": {
"fields": ["id", "title", "body"]
}
}
Output
- The output will be an array of objects under the
jsonfield. - Each object represents the updated permission(s) as returned by the Directus API.
- The structure of each object matches the Directus Permission Object, which typically includes fields like
id,role,collection,action,fields,permissions, etc.
Example output:
[
{
"id": 34,
"role": "...",
"collection": "...",
"action": "...",
"fields": ["id", "title", "body"],
...
},
{
"id": 65,
"role": "...",
"collection": "...",
"action": "...",
"fields": ["id", "title", "body"],
...
}
]
Dependencies
- Directus API: You must have a running Directus instance accessible from n8n.
- API Credentials: The node requires valid Directus API credentials configured in n8n under the name
directusApi.
Troubleshooting
Common issues:
- Invalid or missing credentials: Ensure your Directus API credentials are correctly set up in n8n.
- Malformed JSON in "Data (JSON)": If the input is not valid JSON or does not match the expected structure (
keysanddata), the node will throw a parsing error. - Non-existent permission IDs: If any ID in
keysdoes not exist, Directus may return an error or ignore those entries. - Insufficient permissions: The API user must have rights to update permissions; otherwise, you'll receive a permission denied error.
Error messages and resolutions:
"Unexpected token ... in JSON": Check that your JSON input is properly formatted."Request failed with status code 403": Your API user lacks sufficient privileges."Cannot read property 'data' of undefined": The response from Directus was not as expected—check your API endpoint and payload.