# Add New Task

`POST /api/tasks`



- **Group:** Tasks
- **Since:** v0.0.0
- **Authentication:** `authtoken` header, created under Setup > API > API Management
- **HTML version:** /apiguide/tasks/post-task/

## Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `authtoken` | String | **required** | Authentication token, generated from admin area |

## Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | String | **required** | Mandatory Task Name. |
| `startdate` | Date | **required** | Mandatory Task Start Date. |
| `is_public` | String | optional | Optional Task public. |
| `billable` | String | optional | Optional Task billable. |
| `hourly_rate` | String | optional | Optional Task hourly rate. |
| `milestone` | String | optional | Optional Task milestone. |
| `duedate` | Date | optional | Optional Task deadline. |
| `priority` | String | optional | Optional Task priority. |
| `repeat_every` | String | optional | Optional Task repeat every. |
| `repeat_every_custom` | Number | optional | Optional Task repeat every custom. |
| `repeat_type_custom` | String | optional | Optional Task repeat type custom. |
| `cycles` | Number | optional | Optional cycles. |
| `rel_type` | string | **required** | Mandatory Task Related. |
| `rel_id` | Number | **required** | Optional Related ID. |
| `tags` | String | optional | Optional Task tags. |
| `description` | String | optional | Optional Task description. |
| `assignees` | Mixed | optional | Optional Task assignees. Can be: array of staff IDs, comma-separated string "1,2,3", or JSON array "[1,2,3]". |

## Example request

```bash
curl -X POST "https://yoursite.com/api/tasks" \
  -H "authtoken: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "...", "startdate": "...", "rel_type": "...", "rel_id": "..." }'
```

## Success response

### Success-Response:

```json
HTTP/1.1 200 OK
{
  "status": true,
  "message": "Task add successful."
}
```

## Error responses

### Error-Response:

```json
HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "Task add fail."
}
```

---

Perfex CRM REST API by Themesic Interactive. Full reference: /apiguide/
