Actions100
- Activity Actions
- Asset Actions
- Authentication Actions
- Collection Actions
- Extension Actions
- Field Actions
- File Actions
- Folder Actions
- Item Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revision Actions
- Role Actions
- Setting Actions
- User Actions
- Utility Actions
Overview
This node is designed to update a Role resource in a Directus system via its API. It allows users to modify properties of an existing role by specifying the role's unique identifier and providing partial data representing the fields to update. This is useful for managing user permissions and roles dynamically within an application or workflow, such as changing role icons, names, or other attributes without manually editing them in the Directus admin interface.
Practical examples include:
- Updating the icon associated with a role to better reflect its purpose.
- Changing role metadata or permissions by sending partial updates.
- Automating role adjustments based on external triggers or business logic.
Properties
Name | Meaning |
---|---|
ID | The primary key (unique identifier) of the role to update. This is required to specify which role will be modified. |
Data (JSON) | A JSON object containing the partial role data to update. This should follow the structure of a role object as defined in the Directus API. For example, updating the "icon" field: { "icon": "attractions" } . |
Output
The node outputs the updated role object in the json
output field. This object reflects the current state of the role after the update operation has been applied. It typically includes all standard role properties such as id, name, icon, and any other relevant metadata.
No binary data output is expected from this node.
Dependencies
- Requires access to a Directus instance with appropriate API credentials that allow updating roles.
- The node depends on the Directus API endpoint for roles and requires proper authentication (e.g., an API key or token).
- No additional external services are needed beyond the Directus API.
Troubleshooting
- Invalid ID: If the provided role ID does not exist, the node will likely return an error indicating the role was not found. Verify the ID is correct.
- Malformed JSON Data: Providing invalid JSON in the Data property can cause parsing errors. Ensure the JSON is well-formed and matches the expected role object schema.
- Insufficient Permissions: If the API credentials do not have permission to update roles, the request will fail with an authorization error. Check the API key or token permissions.
- API Connectivity Issues: Network problems or incorrect Directus API URL configuration can cause failures. Confirm connectivity and endpoint correctness.