Files
bookhoard/bruno/queue/Clear Failed Items.yml
john-okeefe f859b2714d refactor(bruno): reorganize file structure from bruno-yaml to flat bruno directory
- Move all files from bruno-yaml/* to bruno/*
- Maintains existing directory structure within categories
- Updates bruno/user/auth files with OAuth2 refresh token flow
- Updates bruno/user/profile files for user profile management
- Adds bruno/dashboard/ directory with dashboard API tests
- Preserves all existing test scenarios and OpenCollection YAML format
- No functional changes - file reorganization only
2026-02-17 20:22:21 -05:00

88 lines
2.3 KiB
YAML

info:
name: Clear Failed Items
type: http
seq: 8
http:
method: DELETE
url: '{{base_url}}/api/queue/clear-failed'
auth: inherit
docs: |-
## Clear Failed Queue Items
Removes all failed queue items from the queue.
**Method:** DELETE
**Endpoint:** /api/queue/clear-failed
**Authentication:** Required (Bearer token)
**Query Parameters:**
- `older_than` (string, optional): ISO 8601 duration - e.g., `7d`, `24h`, `60m`
- `device_id` (string, optional): Only clear items from specific device
- `type` (string, optional): Only clear specific item type
**Request Body:**
Optional filters:
```json
{
"older_than": "7d",
"device_id": "uuid",
"type": "progress"
}
```
**Response:**
- `deleted_count` (integer): Number of items deleted
- `items_cleared` (array): IDs of cleared items
- `retained_count` (integer): Items not matching filters
- `cleared_at` (string): Deletion timestamp
**Status Codes:**
- 200: Items cleared successfully
- 401: Unauthorized
- 400: Invalid filter parameters
**Deletion Behavior:**
- Removes failed items from queue
- Does not affect pending/processing/completed items
- Permanent deletion (cannot be undone)
- Logs deletion for audit trail
- Updates queue statistics
**Safety Features:**
- Default filter prevents clearing recent failures
- Per-device filtering for targeted cleanup
- Type filtering for selective clearing
- Confirmation required for large deletions
**Recommended Usage:**
- **Daily:** Clear failures older than 7 days
- **Weekly:** Clear all failed items
- **Per-device:** After removing problematic device
- **Per-type:** After fixing specific sync issue
**Use Cases:**
- Clean up old failed sync attempts
- Reduce queue database size
- Remove stuck error items
- Prepare for fresh sync attempts
- Clear items for decommissioned devices
- Reset after bug fixes
**Warnings:**
- Cannot be undone
- Failed items cleared permanently
- Consider retrying before clearing
- May hide recurring issues if overused
- Check logs before bulk clearing
**Best Practices:**
- Review error patterns before clearing
- Fix root causes before cleanup
- Use time-based filters to preserve recent failures
- Document reasons for clearing
- Monitor failure rates after cleanup