Tasks
Tasks are a way to communicate tasks that need to be done in a warehouse. Tasks can be assigned to a user and can
have a deadline.
| Name |
Type |
Required |
Description |
| idtask |
integer |
generated |
Unique identifier for the task |
| title |
string |
required |
Title of the task |
| description |
string |
optional |
Detailed description of the task, can be null |
| assigned_to_iduser |
integer |
optional |
ID of the user to whom the task is assigned |
| is_seen_by_assignee |
boolean |
optional |
Indicates whether the assignee has seen the task |
| deadline_date |
datetime |
optional |
Deadline date for the task (e.g., "2025-03-04 00:00:00") |
| deadline_time |
time |
optional |
Specific deadline time for the task (e.g., "23:59:00") |
| completed_at |
datetime |
optional |
Date and time when the task was completed, null if not completed |
| completed_by_iduser |
integer |
optional |
ID of the user who completed the task, null if not completed |
| created_by_iduser |
integer |
optional |
ID of the user who created the task |
| created_at |
datetime |
required |
Date and time when the task was created |
| updated_at |
datetime |
required |
Date and time when the task was last updated |
Retrieve a list of all tasks.
GET
https://example.com/api/v1/tasks
HTTP/1.1 200 OK
[
{
"idtask": 24,
"title": "Restock Shelf A-12",
"description": null,
"assigned_to_iduser": 2,
"is_seen_by_assignee": false,
"deadline_date": "2025-03-04 00:00:00",
"deadline_time": "23:59:00",
"completed_at": null,
"completed_by_iduser": null,
"created_by_iduser": 2,
"created_at": "2025-02-25 08:56:45",
"updated_at": "2025-02-25 08:56:45"
},
{
"idtask": 25,
"title": "Review Code",
"description": "Check new endpoint",
"assigned_to_iduser": 3,
"is_seen_by_assignee": true,
"deadline_date": "2025-03-05 00:00:00",
"deadline_time": "17:00:00",
"completed_at": null,
"completed_by_iduser": null,
"created_by_iduser": 1,
"created_at": "2025-02-25 09:00:00",
"updated_at": "2025-02-25 09:00:00"
}
]
You can filter the tasks with the following parameter. Add this filter as a querystring parameter to the URL.
| Attribute |
Description |
Example |
| completed |
Get tasks that are completed (true) or not completed (false) |
true, false |
Retrieve details of a specific task by its ID.
GET
https://example.com/api/v1/tasks/{id}
HTTP/1.1 200 OK
{
"idtask": 24,
"title": "Restock Shelf A-12",
"description": null,
"assigned_to_iduser": 2,
"is_seen_by_assignee": false,
"deadline_date": "2025-03-04 00:00:00",
"deadline_time": "23:59:00",
"completed_at": null,
"completed_by_iduser": null,
"created_by_iduser": 2,
"created_at": "2025-02-25 08:56:45",
"updated_at": "2025-02-25 08:56:45"
}
Create a new task. Only the listed fields can be provided; other fields like idtask, created_at, etc., are automatically generated by the system.
| Name |
Type |
Required |
Description |
| title |
string |
required |
Title of the task |
| description |
string |
optional |
Detailed description of the task |
| deadline_date |
date |
optional |
Deadline date for the task (e.g., "2025-03-04") |
| deadline_time |
time |
optional |
Specific deadline time for the task (e.g., "23:59:00") |
| assigned_to_iduser |
integer |
optional |
ID of the user to whom the task is assigned |
POST
https://example.com/api/v1/tasks
{
"title": "Restock Shelf A-12",
"description": "Refill with 50 units of product XYZ",
"deadline_date": "2025-03-04",
"deadline_time": "23:59:00",
"assigned_to_iduser": 2
}
HTTP/1.1 201 Created
{
"idtask": 26,
"title": "Restock Shelf A-12",
"description": "Refill with 50 units of product XYZ",
"assigned_to_iduser": 2,
"is_seen_by_assignee": false,
"deadline_date": "2025-03-04 00:00:00",
"deadline_time": "23:59:00",
"completed_at": null,
"completed_by_iduser": null,
"created_by_iduser": 2,
"created_at": "2025-02-25 10:00:00",
"updated_at": "2025-02-25 10:00:00"
}
Update an existing task. Only the listed fields can be modified. Note that deadline_date is required if deadline_time is provided.
| Name |
Type |
Required |
Description |
| title |
string |
optional |
Title of the task |
| description |
string |
optional |
Detailed description of the task |
| deadline_date |
date |
required if deadline_time is provided |
Deadline date for the task (e.g., "2025-03-05") |
| deadline_time |
time |
optional |
Specific deadline time for the task (e.g., "17:00:00") |
| assigned_to_iduser |
integer |
optional |
ID of the user to whom the task is assigned |
PUT
https://example.com/api/v1/tasks/{id}
{
"title": "Restock Shelf A-12",
"description": "Refill with 75 units of product XYZ",
"deadline_date": "2025-03-05",
"deadline_time": "17:00:00",
"assigned_to_iduser": 3
}
HTTP/1.1 200 OK
{
"idtask": 24,
"title": "Restock Shelf A-12",
"description": "Refill with 75 units of product XYZ",
"assigned_to_iduser": 3,
"is_seen_by_assignee": false,
"deadline_date": "2025-03-05 00:00:00",
"deadline_time": "17:00:00",
"completed_at": null,
"completed_by_iduser": null,
"created_by_iduser": 2,
"created_at": "2025-02-25 08:56:45",
"updated_at": "2025-02-25 10:05:00"
}
Delete a specific task by its ID.
DELETE
https://example.com/api/v1/tasks/{id}
HTTP/1.1 204 No Content
Mark a task as completed. This sets completed_at to the current timestamp and completed_by_iduser to the user performing the action (assumed from authentication context). No request body is required.
POST
https://example.com/api/v1/tasks/{id}/complete
HTTP/1.1 200 OK
{
"idtask": 24,
"title": "Restock Shelf A-12",
"description": null,
"assigned_to_iduser": 2,
"is_seen_by_assignee": false,
"deadline_date": "2025-03-04 00:00:00",
"deadline_time": "23:59:00",
"completed_at": "2025-02-25 10:10:00",
"completed_by_iduser": 2,
"created_by_iduser": 2,
"created_at": "2025-02-25 08:56:45",
"updated_at": "2025-02-25 10:10:00"
}
Revert a task’s completion status. This sets completed_at and completed_by_iduser back to null. No request body is required.
POST
https://example.com/api/v1/tasks/{id}/uncomplete
HTTP/1.1 200 OK
{
"idtask": 24,
"title": "Restock Shelf A-12",
"description": null,
"assigned_to_iduser": 2,
"is_seen_by_assignee": false,
"deadline_date": "2025-03-04 00:00:00",
"deadline_time": "23:59:00",
"completed_at": null,
"completed_by_iduser": null,
"created_by_iduser": 2,
"created_at": "2025-02-25 08:56:45",
"updated_at": "2025-02-25 10:15:00"
}