Skip to main content

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.

ParamValueType
tenantId{{tenantId}}string
userId{{userId}}string
countryCode{{countryCode}}string (optional)

Query Parameters

NameTypeDescription
byTaskOwnerTypestringFilter by task owner type (LABORATORY, SAMPLER).
byTaskTypestringFilter by task type (PRODUCT_SAMPLING, DATA_COLLECTION).
byPrioritystringFilter by priority (LOW, MEDIUM, HIGH).
byStatusstringFilter by task status (PENDING, ACCEPTED, DECLINED, etc.).
byEntityTypestringFilter by entity type (TRADE, PRODUCT).
byAssignToTypestringFilter by the type of assigned user (LABORATORY, SAMPLER).
byAssignedToIdsstringFilter tasks by assigned user IDs (comma-separated).
byRequestIdsstringFilter tasks by request IDs (comma-separated).
byTenantIdsstringFilter 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

AUTHORIZATION

Bearer

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!