Add New Task
Developing
Testing Env
Testing Env
POST
/api/v1/tasks
Last modified:2025-05-14 16:47:55
API Documentation
Create New Task [POST]
URL
/api/v1/tasks
Request Headers
Key | Value | Required |
---|---|---|
Accept | application/json | Yes |
user-token | {{user_token}} | Yes |
secure-business-key | {{secure_business_key}} | Yes |
Accept-Language | en/ar | No |
Content-Type | string | Should be multipart/form-data |
Request Body Parameters
Parameter | Type | Required | Example Value | Validation Rules | Description |
---|---|---|---|---|---|
name | string | Yes | "Complete project proposal" | max:255 | Task name |
group_name | string | No | "Marketing Team" | max:255 | Task group name |
owner_id | integer | No | 5 | min:1 | Task owner user ID |
reviewed_by | integer | No | 8 | min:1 | Reviewer user ID |
status | string | No | "pending" | in:not_started,pending,in_progress,completed,on_hold | Task status |
due_date | date | No | "2023-12-31" | Valid date | Task due date |
priority | string | No | "high" | in:low,normal,medium,high | Task priority |
duration_days | integer | No | 5 | Estimated duration in days | |
description | string | No | "Finalize client deliverables" | Task description | |
note | string | No | "Urgent client request" | Internal notes | |
budget | numeric | No | 5000.00 | Task budget | |
dependent_on | integer | No | 10 | exists:tasks,id | Dependent task ID |
timeline_start | date | No | "2023-11-01" | Valid date | Timeline start date |
timeline_end | date | No | "2023-11-30" | Valid date, after_or_equal:timeline_start | Timeline end date |
project_id | integer | No | 15 | exists:projects,id | Project ID |
bord_id | integer | No | 3 | exists:boards,id | Board ID |
assignments[] | array | No | [{"user_id": 5}, {"user_id": 8}] | Array of objects with required user_id | Task assignments |
files[] | file[] | No | (file binary) | Each file max:10MB | Task attachments |
timeTracking[] | array | No | [{"user_id":5,"started_at":"2023-11-01"}] | user_id required, started_at required, ended_at after_or_equal:started_at | Time tracking entries |
Response
Success (201)
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v1/tasks' \
--header 'Accept: application/json' \
--header 'Accept-Language: en' \
--header 'user-token: ' \
--header 'secure-business-key: 4765066450c0bd66325.48403130' \
--form 'name="New Task Example"' \
--form 'group_name="To-Do"' \
--form 'owner_id="3"' \
--form 'reviewed_by="2"' \
--form 'status="In Progress"' \
--form 'due_date="2025-06-10"' \
--form 'priority="High"' \
--form 'duration_days="7"' \
--form 'description="Detailed task info"' \
--form 'note="Needs follow-up"' \
--form 'budget="5000"' \
--form 'dependent_on="12"' \
--form 'timeline_start="2025-06-01"' \
--form 'timeline_end="2025-06-08"' \
--form 'project_id="1"' \
--form 'board_id="4"' \
--form 'assignments[0][user_id]="850";type=5' \
--form 'assignments[1][user_id]="851";type=6' \
--form 'timeTracking[0][user_id]="5"' \
--form 'timeTracking[0][started_at]="2025-06-01 09:00:00"' \
--form 'timeTracking[0][ended_at]="2025-06-01 11:00:00"' \
--form 'timeTracking[0][duration_minutes]="120"' \
--form 'timeTracking[1][user_id]="6"' \
--form 'timeTracking[1][started_at]="2025-06-02 13:00:00"' \
--form 'timeTracking[1][ended_at]="2025-06-02 14:30:00"' \
--form 'timeTracking[1][duration_minutes]="90"' \
--form 'files[0]=@"[\"file://(file)\",\"file://C:\\Users\\Se7a\\Downloads\\Eng_Marco_Milad_Monthly_Report.pdf\"]"'
Response Response Example
{
"status_code": 201,
"code": 1021,
"hint": "Resource created successfully",
"success": true,
"data": {
"task": {
"id": 7,
"business_id": 259,
"group_name": "To-Do",
"name": "New Task Example",
"task_code": "T00007",
"owner_id": "3",
"reviewed_by": "2",
"status": "In Progress",
"due_date": "2025-06-10",
"duration_days": "7",
"timeline_start": "2025-06-01",
"timeline_end": "2025-06-08",
"description": "Detailed task info",
"note": "Needs follow-up",
"budget": "5000.00",
"dependent_on": "6",
"project_id": "1",
"board_id": null,
"created_at": "2025-05-14 20:21:07",
"updated_at": "2025-05-14 20:21:07",
"deleted_at": null,
"dependent_task": {
"id": 6,
"business_id": 259,
"group_name": "Development",
"name": "Task Title",
"task_code": "T00005",
"owner_id": 123,
"reviewed_by": 456,
"status": "Not Started",
"due_date": "2025-05-20",
"duration_days": 5,
"timeline_start": "2025-05-15",
"timeline_end": "2025-05-25",
"description": "Implement feature X",
"note": "Requires review",
"budget": "1500.00",
"dependent_on": 1,
"project_id": 1,
"board_id": null,
"created_at": "2025-05-14 16:45:03",
"updated_at": "2025-05-14 19:23:37",
"deleted_at": null
},
"dependent_tasks": [],
"assignments": [
{
"id": 5,
"task_id": 7,
"assign_to": 850,
"assigned_at": "2025-05-14 20:21:09"
},
{
"id": 6,
"task_id": 7,
"assign_to": 851,
"assigned_at": "2025-05-14 20:21:09"
}
],
"files": [],
"time_tracking": [
{
"id": 6,
"task_id": 7,
"assign_to": 5,
"started_at": "2025-06-01 09:00:00",
"ended_at": "2025-06-01 11:00:00",
"duration_minutes": 120
},
{
"id": 7,
"task_id": 7,
"assign_to": 6,
"started_at": "2025-06-02 13:00:00",
"ended_at": "2025-06-02 14:30:00",
"duration_minutes": 90
}
]
},
"message": "Task created successfully"
}
}
Request
Header Params
Accept
stringÂ
optional
Example:
application/json
Accept-Language
stringÂ
optional
Example:
en
Content-Type
stringÂ
optional
Example:
application/json
user-token
stringÂ
optional
Example:
{{user_token}}
secure-business-key
stringÂ
optional
Example:
{{secure_business_key}}
Body Params multipart/form-data
name
stringÂ
required
Example:
New Task Example
group_name
stringÂ
optional
Example:
To-Do
owner_id
integerÂ
required
Example:
3
reviewed_by
integerÂ
optional
Example:
2
status
stringÂ
required
Example:
In Progress
due_date
stringÂ
optional
Example:
2025-06-10
priority
stringÂ
optional
Example:
High
duration_days
integerÂ
optional
Example:
7
description
stringÂ
optional
Example:
Detailed task info
note
stringÂ
optional
Example:
Needs follow-up
budget
stringÂ
optional
Example:
5000
dependent_on
integerÂ
optional
Example:
12
timeline_start
stringÂ
optional
Example:
2025-06-01
timeline_end
stringÂ
optional
Example:
2025-06-08
project_id
integerÂ
required
Example:
1
board_id
integerÂ
optional
Example:
4
assignments[0][user_id]
stringÂ
optional
Example:
850
assignments[1][user_id]
stringÂ
optional
Example:
851
timeTracking[0][user_id]
integerÂ
required
Example:
5
timeTracking[0][started_at]
stringÂ
required
Example:
2025-06-01 09:00:00
timeTracking[0][ended_at]
stringÂ
required
Example:
2025-06-01 11:00:00
timeTracking[0][duration_minutes]
integerÂ
required
Example:
120
timeTracking[1][user_id]
integerÂ
required
Example:
6
timeTracking[1][started_at]
stringÂ
required
Example:
2025-06-02 13:00:00
timeTracking[1][ended_at]
stringÂ
required
Example:
2025-06-02 14:30:00
timeTracking[1][duration_minutes]
integerÂ
required
Example:
90
files[0]
fileÂ
optional
Example:
["file://(file)","file://C:\Users\Se7a\Downloads\Eng_Marco_Milad_Monthly_Report.pdf"]