Add Project
Developing
Testing Env
Testing Env
POST
/api/v1/projects
Last modified:2025-05-06 10:19:28
API Documentation
Create New Project [POST]
URL
/api/v1/projects
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 | Description | Validation |
---|---|---|---|---|---|
business_id | integer | Yes | 123 | Business ID | Must exist |
workspace_id | integer | Yes | 5 | Workspace ID | Must exist in workspaces |
name | string | Yes | "Project X" | Project name | max:255 |
description | string | No | "Important client project" | Project description | |
project_type | string | Yes | "executive" | Type of project | Must be: executive, consulting, internal, product_development, other |
status | string | Yes | "planning" | Project status | Must be: proposed, planning, active, postponed, completed, cancelled |
start_date | date | No | "2023-01-01" | Project start date | Valid date |
end_date | date | No | "2023-12-31" | Project end date | After or equal to start_date |
client_id | integer | No | 10 | Client ID | Must exist in clients |
branch_department_id | integer | No | 3 | Department ID | Must exist in departments |
manager_id | integer | No | 8 | Manager user ID | Must exist in users |
estimated_budget | numeric | No | 50000.00 | Estimated budget | min:0, max:999999999.99 |
cost_center_id | integer | No | 2 | Cost center ID | Must exist in cost_centers |
Response
Success (201)
{
"status": "success",
"code": 201,
"data": {
"project": {
"id": 1,
"name": "Project X",
"project_code": "PRJ-2023-001",
"description": "Important client project",
"project_type": "executive",
"status": "planning",
"start_date": "2023-01-01",
"end_date": "2023-12-31",
"business_id": 123,
"workspace_id": 5,
"client_id": 10,
"branch_department_id": 3,
"manager_id": 8,
"estimated_budget": 50000.00,
"cost_center_id": 2,
"created_at": "2023-01-01T00:00:00.000000Z",
"updated_at": "2023-01-01T00:00:00.000000Z"
},
"message": "Project created successfully"
}
}
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v1/projects' \
--header 'Accept: application/json' \
--header 'Accept-Language: en' \
--header 'user-token: ' \
--header 'secure-business-key: 4765066450c0bd66325.48403130' \
--form 'name="New Marketing Strategy"' \
--form 'workspace_id="8"' \
--form 'description="Creating a comprehensive strategy for Q3"' \
--form 'project_type="consulting";type=one of: executive' \
--form 'status="planning";type=one of: proposed' \
--form 'start_date="2025-05-10"' \
--form 'end_date="2025-08-15";type=must be after or equal to start_date' \
--form 'client_id="3";type=must exist in clients table' \
--form 'branch_department_id="2";type=must exist in departments table' \
--form 'manager_id="5";type=must exist in users table' \
--form 'estimated_budget="50000";type=must be between 0 and 999999999.99' \
--form 'cost_center_id="1";type=must exist in cost_centers table'
Response Response Example
{
"status_code": 201,
"code": 1021,
"hint": "Resource created successfully",
"success": true,
"data": {
"project": {
"id": 1,
"name": "New Marketing Strategy",
"project_code": "PRJ-202505-HYNM",
"description": "Creating a comprehensive strategy for Q3",
"project_type": "consulting",
"status": "planning",
"start_date": "2025-05-10",
"end_date": "2025-08-15",
"client_id": "3",
"branch_department_id": "2",
"manager_id": "5",
"estimated_budget": "50000.00",
"cost_center_id": "1"
},
"message": "Project 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 Marketing Strategy
workspace_id
integerÂ
required
Example:
8
description
stringÂ
optional
Example:
Creating a comprehensive strategy for Q3
project_type
stringÂ
required
Example:
consulting
status
stringÂ
required
Example:
planning
start_date
stringÂ
optional
Example:
2025-05-10
end_date
stringÂ
optional
Example:
2025-08-15
client_id
integerÂ
optional
Example:
3
branch_department_id
integerÂ
optional
Example:
2
manager_id
integerÂ
optional
Example:
5
estimated_budget
stringÂ
optional
Example:
50000
cost_center_id
integerÂ
optional
Example:
1