Actions40
- Book Actions
- Page Actions
- Chapter Actions
- Shelf Actions
- User Actions
- Role Actions
- Attachment Actions
- Tag Actions
Overview
This node integrates with the BookStack API to manage various BookStack resources, including Attachments. Specifically, for the Attachment - Delete operation, it allows users to delete an attachment resource by specifying its ID. This is useful in scenarios where you want to programmatically remove files or attachments from your BookStack instance, such as cleaning up outdated or incorrect attachments.
Practical examples include:
- Automatically deleting attachments linked to deleted pages or chapters.
- Removing obsolete files during content updates or maintenance workflows.
- Managing storage by removing large or unnecessary attachments via automation.
Properties
| Name | Meaning |
|---|---|
| Tool Description | Choose how to determine the resource and operation: - Set Automatically - Set Manually |
| Request Description | (Shown if "Set Automatically" is chosen) Describe your request in natural language; the system will infer the resource and operation automatically. Example: "Delete attachment with ID 123". |
| ID | The unique identifier of the attachment resource to delete. This is required for the delete operation. |
Output
The output JSON contains the response from the BookStack API after attempting to delete the specified attachment. Typically, a successful delete operation returns confirmation data or an empty object indicating the resource was removed.
Example output structure:
{
"json": {
// API response confirming deletion, often empty or status message
},
"pairedItem": {
"item": 0 // Index of the input item this output corresponds to
}
}
No binary data is output by this node for the delete operation.
Dependencies
- Requires connection to a BookStack instance via its API.
- Needs an API authentication token credential configured in n8n with:
- Base URL of the BookStack API.
- Token and token secret for authorization.
- The node uses HTTP DELETE requests to the endpoint
/attachments/{id}to perform deletions.
Troubleshooting
Common issues:
- Invalid or missing attachment ID: Ensure the ID property is provided and correct.
- Authentication errors: Verify that the API token credentials are valid and have sufficient permissions.
- Network or connectivity problems: Confirm the BookStack base URL is reachable from the n8n environment.
Error messages:
"error": "Resource not found": The specified attachment ID does not exist. Check the ID value."error": "Unauthorized"or similar: Authentication failed. Recheck API credentials.- HTTP 4xx or 5xx errors: Review API endpoint availability and parameters.
To resolve errors, verify all inputs, credentials, and network access, then retry the operation.