Skip to main content

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.

ParamTypeDescription
countryCodestringThe country code associated with the request.
userIdstringThe ID of the user making the request.
tenantIdstringThe 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​

NameTypeDescription
requestIdstringThe unique ID associated with the task request.
entitystringThe ID of the entity that the task is linked to (e.g., a trade ID).
entityTypestringThe type of entity associated with the task (e.g., TRADE).
assignToTypestringThe type of assignee (e.g., LABORATORY, USER).
assignedToIdstringThe ID of the user or entity the task is assigned to.
descriptionstringA description of the task.
assignedBystringThe ID of the user who assigned the task.
assignedDatestringThe date the task was assigned.
dueDatestringThe task’s due date.
prioritystringThe priority level of the task (LOW, MEDIUM, or HIGH).
taskTypestringThe type of task (e.g., PRODUCT_SAMPLING).
tenantIdstringThe 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

AUTHORIZATION

Bearer

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!