Overview
Delete a task by its ID. This is a soft delete operation - the task is marked as deleted but not permanently removed from the database. Associated interactive notes will also be deleted. Use this endpoint to remove tasks that are no longer needed, clean up completed tasks, or manage task lifecycle.Use Cases
- Task Cleanup: Remove old or irrelevant tasks
- Error Correction: Delete tasks created by mistake
- Workflow Management: Remove tasks that are no longer applicable
- Data Management: Clean up test or duplicate tasks
- User Requests: Allow users to delete their own tasks
- Automated Cleanup: Periodically delete old completed tasks
Authentication
This endpoint requires authentication using an API key. Include your API key in the request header:Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string (UUID) | Yes | The UUID of the task to delete |
Response Structure
Returns a success status object:| Field | Type | Description |
|---|---|---|
status | string | Always returns “success” |
Example Request
Example Response
Common Use Cases
1. Delete a Single Task
2. Delete with Confirmation
3. Bulk Delete Tasks
4. Delete Old Completed Tasks
5. Delete with UI Update
6. Delete with Undo Capability
7. Conditional Delete
Validation Rules
Task ID
- Required: Yes (in URL path)
- Format: Valid UUID
- Note: Task must exist and belong to your organization
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid task ID format |
| 401 | Unauthorized - Invalid or missing API key |
| 404 | Not Found - Task not found or already deleted |
| 500 | Internal Server Error - Something went wrong |
Common Error Examples
Important Notes
Soft Delete
- Tasks are soft deleted, not permanently removed from the database
- The task is marked as deleted but data is retained for audit purposes
- Soft deleted tasks will not appear in normal queries
- Database administrators may be able to recover soft deleted tasks
Associated Data
- Interactive Notes: Any interactive notes associated with the task will also be deleted
- Task Responsibles: Responsible user associations are removed
- Contact/Customer Links: The task-to-contact/customer associations are removed
- Audit Trail: Deletion is logged for compliance and auditing
Permissions
- Users may need appropriate permissions to delete tasks
- Some organizations may restrict deletion to task creators or administrators
- Deleted tasks may trigger notifications to assigned users
Best Practices
- User Confirmation: Always ask for confirmation before deleting
- Permission Checks: Verify user has permission to delete the task
- Status Check: Consider only allowing deletion of completed or cancelled tasks
- Audit Logging: Log all deletions for compliance and troubleshooting
- UI Feedback: Provide clear feedback on successful/failed deletion
- Undo Capability: Consider implementing an undo feature
- Batch Operations: Use bulk delete for multiple tasks to reduce API calls
- Error Handling: Handle cases where task is already deleted or doesn’t exist
Performance Tips
- Batch Deletion: Group multiple deletions to reduce API overhead
- Optimistic UI: Remove from UI immediately, rollback on error
- Background Processing: For bulk operations, consider background processing
- Rate Limiting: Be mindful of rate limits when deleting many tasks
Alternatives to Deletion
Before deleting a task, consider these alternatives:- Archive Status: Move task to an “archived” or “cancelled” status instead
- Hide from View: Filter out old tasks in the UI without deleting
- Mark as Inactive: Use a custom status to indicate the task is no longer active
- Export First: Export task data before deletion for records
Related Endpoints
- GET /api/public/tasks - Get tasks by filters
- POST /api/public/tasks - Create a new task
- PUT /api/public/tasks/ - Update a task
Webhook Events
Deleting a task may trigger webhook events such as:task.deleted- When a task is deletedtask.archived- If your system treats deletion as archival
Recovery
Since this is a soft delete:- Contact support or your database administrator if you need to recover a deleted task
- Implement your own recovery API if needed
- Consider implementing a “trash” or “recently deleted” feature for user-initiated recovery
Path Parameters
The UUID of the task to delete
Response
Task deleted successfully
Example:
"success"
