This API allows you to mark a specific task as completed in a specified list.
API URL
API Endpoint
PATCH /api/v1/tasks/complete
## Important Notes:
- All API requests must be made to this base URL followed by the specific endpoint path
- HTTPS protocol is required for all API calls
- API version v1 is currently supported
- All responses will be returned in JSON format
Request Body
JSON payload:
{
"task_id": "61043"
}
Required Fields
- task_id (long): The ID of the task to be marked as completed. (Available in the Get Lists API response.)
Headers
- Authorization:
Bearer <Access-Token>
(This assumes token-based authentication. Modify as per your actual authentication/authorization method.)
Response
The API will respond with a JSON object containing the following fields:
{
"status": "success",
"message": "Task was found and marked as completed."
}
API Error Handling
403 Forbidden
User permission error
{
"status": "error",
"message": "User does not have permission",
"errors": {
"authorization": "Only the user who is assigned this task can complete this task."
}
}
400 Bad Request
Task Id not matching with URL Task Id
{
"status": "error",
"message": "Bad Request",
"errors": {
"task_id": "URL task_id and Model task_id is not same."
}
}
Request body not provided
{
"status": "error",
"message": "Bad Request",
"errors": {
"list_id": "List ID is required",
"task_id": "Task ID is required"
}
}
404 Not Found
List ID does not exist
{
"error": "Not Found",
"message": "The specified list ID does not exist"
}
Task ID does not exist
{
"error": "Not Found",
"message": "The specified Task ID does not exist"
}
401 Unauthorized
Invalid token
{ "status": "error", "message": "Unauthorized", "errors": { "authorization": "Token is invalid or expired" } }