Skip to main content

Clear Prompt History

Sprint 3

Clear prompt history by soft deleting all matching prompts.

Endpoint

DELETE /api/v1/prompts/history/clear

Headers

HeaderRequiredDescription
AuthorizationYesBearer <access_token>

Query Parameters

ParameterTypeRequiredDescription
workspace_idintegerNoFilter by workspace
time_periodstringNoFilter by time period (last_7_days, last_30_days, last_90_days, all) (default: all)
user_idintegerNoFilter 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

StatusCodeDescription
401UNAUTHORIZEDInvalid or missing authentication token
500INTERNAL_SERVER_ERRORInternal 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_id is not specified, defaults to current user
  • If time_period is 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>"