Clear Prompt History
Sprint 3
Clear prompt history by soft deleting all matching prompts.
Endpoint
DELETE /api/v1/prompts/history/clear
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspace_id | integer | No | Filter by workspace |
time_period | string | No | Filter by time period (last_7_days, last_30_days, last_90_days, all) (default: all) |
user_id | integer | No | Filter by user ID (defaults to current user) |
Response
Success (200)
{
"success": true,
"data": {
"deleted_count": 25,
"filters_applied": {
"workspace_id": 1,
"time_period": "last_30_days",
"user_id": 5
}
},
"message": "Successfully cleared 25 prompt(s) from history"
}
Error Codes
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Invalid or missing authentication token |
| 500 | INTERNAL_SERVER_ERROR | Internal server error |
Features
- Soft delete matching prompts
- Filter by workspace, time period, and user
- Returns count of deleted prompts
- Organization-scoped access control
Important Notes
- This is a soft delete - prompts are marked as deleted but not permanently removed
- If
user_idis not specified, defaults to current user - If
time_periodis not specified, defaults to "all"
Example
curl -X DELETE "https://api.rivergen.com/api/v1/prompts/history/clear?time_period=last_30_days&workspace_id=1" \
-H "Authorization: Bearer <access_token>"
Related Endpoints
- Get Prompt History - View prompt history
- Delete Prompt - Delete single prompt