Skip to main content

Delete Policy

Sprint 3

Delete a policy (soft delete). Sets deleted_at timestamp but does not permanently remove from database.

Endpoint

DELETE /api/v1/policies/{policy_id}

Headers

HeaderRequiredDescription
AuthorizationYesBearer <access_token>

Path Parameters

ParameterTypeRequiredDescription
policy_idintegerYesPolicy ID

Response

Success (200)

{
"success": true,
"data": {
"policy_id": 1,
"deleted_at": "2024-12-01T11:00:00Z"
},
"message": "Policy deleted successfully"
}

Error Codes

StatusCodeDescription
401UNAUTHORIZEDInvalid or missing authentication token
404NOT_FOUNDPolicy not found

Features

  • Soft delete (sets deleted_at timestamp)
  • Organization-scoped access control
  • Policy is not permanently removed from database

Important Notes

  • This is a soft delete - the policy is marked as deleted but not permanently removed
  • Deleted policies are excluded from normal queries
  • Can be restored if needed (implementation-dependent)

Example

curl -X DELETE "https://api.rivergen.com/api/v1/policies/1" \
-H "Authorization: Bearer <access_token>"