Skip to main content

Endpoint

DELETE /diary/:id

Authentication

This endpoint requires authentication via Bearer token.
Authorization: Bearer <token>

Path Parameters

id
string
required
Entry ID (MongoDB ObjectId - 24 hexadecimal characters)

Response

success
boolean
Indicates if the deletion was successful

Examples

Delete a diary entry

curl -X DELETE "https://api.ceboelha.com/diary/65f1a2b3c4d5e6f7a8b9c0d1" \
  -H "Authorization: Bearer YOUR_TOKEN"

Delete with error handling

curl -X DELETE "https://api.ceboelha.com/diary/65f1a2b3c4d5e6f7a8b9c0d1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -w "\nHTTP Status: %{http_code}\n"
{
  "success": true
}

Error Responses

Entry not found

Status: 404
{
  "success": false,
  "error": "Entry not found"
}

Unauthorized (not the entry owner)

Status: 403
{
  "success": false,
  "error": "Forbidden"
}

Not authenticated

Status: 401
{
  "success": false,
  "error": "Unauthorized"
}

Invalid entry ID format

Status: 400
{
  "success": false,
  "error": "Invalid entry ID format"
}

Notes

  • This action is permanent and cannot be undone
  • You can only delete entries that belong to your user account
  • Deleting an entry will also affect:
    • Daily summaries and statistics
    • Monthly calendar views
    • Symptoms overview and trends
    • Problematic food correlations (if the entry was involved in identifying triggers)
  • Make sure to confirm the deletion action in your application UI before calling this endpoint

Build docs developers (and LLMs) love