Irreversible: Deleted comments cannot be recovered. For moderation workflows where audit trails are required, use
comment/hide (reversible) instead of delete. Log the comment content via
comment/get before deleting if a record is needed.
When to Use
- Spam removal: Automatically detect and permanently remove spam comments — bot-generated content, repetitive promotional messages, or phishing links — that have no business value when preserved.
- Policy violations: Remove comments that clearly violate Instagram's Community Guidelines (hate speech, harassment, explicit content) after the automated moderation pipeline has confirmed the violation.
- Misinformation correction: Delete your own incorrectly posted first-comment (e.g. a wrong link or typo in an auto-posted promotional comment) immediately after detecting the error.
- Post-campaign cleanup: After a time-limited promotion, delete promotional first-comments that are no longer relevant to avoid confusing future visitors.
- GDPR deletion requests: When a user requests deletion of their personal data, remove their comments from your media as part of the fulfilment workflow.
Configuration
Connection
| Field | Required | Description |
accessToken | Required | Long-lived Instagram access token stored in BizFirst Credentials Manager. |
igUserId | Required | Your Instagram Business/Creator account ID. |
Operation
| Field | Required | Description |
resource | Required | Must be comments. |
operation | Required | Must be delete. |
commentId | Required | ID of the comment to permanently delete. |
Sample Configuration JSON
{
"resource": "comments",
"operation": "delete",
"accessToken": "{{ $credential.instagram.accessToken }}",
"igUserId": "17841400000000000",
"commentId": "{{ $trigger.body.value.commentId }}"
}
Validation Errors
| Error | Cause |
accessToken is required | accessToken field is missing or empty. |
commentId is required | commentId field is missing or empty. |
| Graph API error 200 | You do not have permission to delete this comment (not on your media and not authored by you). |
| Graph API error 100 | Comment does not exist or was already deleted. |
Output
Success Port
| Field | Type | Description |
status | string | "success" |
deleted | boolean | true when the comment was successfully deleted. |
commentId | string | The ID of the deleted comment (for audit logging). |
payload | string | Raw JSON response from the Graph API. |
Error Port
| Field | Type | Description |
status | string | "error" |
errorCode | string | Graph API error code. |
errorMessage | string | Error description. |
payload | string | Raw error response. |
Sample Output JSON
{
"status": "success",
"deleted": true,
"commentId": "17858893269000001",
"payload": "{\"success\":true}"
}
Expression Reference
| Expression | Value |
{{ $output.instagram.deleted }} | Boolean deletion confirmation |
{{ $output.instagram.commentId }} | Deleted comment ID for audit log |
Node Policies & GuardRails
- Audit before deleting: For compliance, always call comment/get before
comment/delete to log the original comment content, author, and timestamp to your audit trail.
- Prefer hide for borderline cases: Use comment/hide for comments requiring human review. Delete only when the violation is certain — deletion cannot be undone.
- Permission boundary: You can only delete comments on your own media or your own authored comments. Attempting to delete another user's comment on someone else's media will fail with error 200.
- GDPR compliance: When processing GDPR deletion requests, document the deletion action in your compliance log with the requestor ID, comment ID, and deletion timestamp.
Examples
Automated spam deletion pipeline
// Step 1: Get comment details
{
"resource": "comments",
"operation": "get",
"commentId": "{{ $trigger.body.value.commentId }}"
}
// Step 2: Log to audit DB (custom DB node)
// Step 3: Delete if spam score > 0.9
{
"resource": "comments",
"operation": "delete",
"accessToken": "{{ $credential.instagram.accessToken }}",
"igUserId": "17841400000000000",
"commentId": "{{ $trigger.body.value.commentId }}"
}
Delete own erroneous first comment
{
"resource": "comments",
"operation": "delete",
"accessToken": "{{ $credential.instagram.accessToken }}",
"igUserId": "17841400000000000",
"commentId": "{{ $db.recentPosts.where(mediaId=$input.mediaId).firstCommentId }}"
}
Removes an auto-posted first comment that contained an incorrect promotion code, retrieved from the internal post tracking database.