Create Task
Method: POST
/api/v1/tasks
Descriptionβ
This endpoint creates a new task associated with a specific entity (e.g., a trade). Tasks can be assigned to users or entities such as laboratories, and they include details such as priority, due date, and description.
π Authenticationβ
This endpoint requires authentication via headers.
| Param | Type | Description |
|---|---|---|
countryCode | string | The country code associated with the request. |
userId | string | The ID of the user making the request. |
tenantId | string | The tenant ID associated with the request. |
Request Bodyβ
{
"requestId": "string",
"entity": "string",
"entityType": "TRADE",
"assignToType": "LABORATORY",
"assignedToId": "string",
"description": "string",
"assignedBy": "string",
"assignedDate": "string",
"dueDate": "string",
"priority": "LOW",
"taskType": "PRODUCT_SAMPLING",
"tenantId": "string"
}
Request Body Explanationβ
| Name | Type | Description |
|---|---|---|
requestId | string | The unique ID associated with the task request. |
entity | string | The ID of the entity that the task is linked to (e.g., a trade ID). |
entityType | string | The type of entity associated with the task (e.g., TRADE). |
assignToType | string | The type of assignee (e.g., LABORATORY, USER). |
assignedToId | string | The ID of the user or entity the task is assigned to. |
description | string | A description of the task. |
assignedBy | string | The ID of the user who assigned the task. |
assignedDate | string | The date the task was assigned. |
dueDate | string | The taskβs due date. |
priority | string | The priority level of the task (LOW, MEDIUM, or HIGH). |
taskType | string | The type of task (e.g., PRODUCT_SAMPLING). |
tenantId | string | The tenant ID associated with the task. |
Response: 201β
{
"message": "Task created successfully.",
"taskId": "12345",
"requestId": "67890",
"entity": "trade123",
"assignedToId": "user456",
"priority": "LOW",
"status": "CREATED"
}
LANGUAGE
CURL REQUEST
curl --request POST \
--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!