Get Tasks
Method: GET
/api/v1/tasks
Description
This endpoint retrieves a list of tasks based on various filtering options such as task type, priority, status, assigned user, and tenant information.
🔑 Authentication
This endpoint requires authentication via headers.
| Param | Value | Type |
|---|---|---|
tenantId | {{tenantId}} | string |
userId | {{userId}} | string |
countryCode | {{countryCode}} | string (optional) |
Query Parameters
| Name | Type | Description |
|---|---|---|
byTaskOwnerType | string | Filter by task owner type (LABORATORY, SAMPLER). |
byTaskType | string | Filter by task type (PRODUCT_SAMPLING, DATA_COLLECTION). |
byPriority | string | Filter by priority (LOW, MEDIUM, HIGH). |
byStatus | string | Filter by task status (PENDING, ACCEPTED, DECLINED, etc.). |
byEntityType | string | Filter by entity type (TRADE, PRODUCT). |
byAssignToType | string | Filter by the type of assigned user (LABORATORY, SAMPLER). |
byAssignedToIds | string | Filter tasks by assigned user IDs (comma-separated). |
byRequestIds | string | Filter tasks by request IDs (comma-separated). |
byTenantIds | string | Filter tasks by tenant IDs (comma-separated). |
Response: 200 OK
A successful response returns a list of tasks that match the filtering criteria.
Example Response:
[
{
"taskId": "task123",
"taskType": "PRODUCT_SAMPLING",
"priority": "HIGH",
"status": "PENDING",
"ownerType": "SAMPLER",
"assignedTo": {
"id": "user456",
"type": "LABORATORY"
},
"entityType": "PRODUCT",
"createdAt": "2025-02-12T04:04:39.986Z"
},
{
"taskId": "task789",
"taskType": "DATA_COLLECTION",
"priority": "MEDIUM",
"status": "ACCEPTED",
"ownerType": "LABORATORY",
"assignedTo": {
"id": "user789",
"type": "SAMPLER"
},
"entityType": "TRADE",
"createdAt": "2025-02-10T11:22:30.000Z"
}
]
LANGUAGE
CURL REQUEST
curl --request GET \
--url /api/v1/tasks \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!