> For the complete documentation index, see [llms.txt](https://docs.amitysolutions.com/ekoai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amitysolutions.com/ekoai/api-reference/botv2/botv2-api/task-feature/create-topic.md).

# Create Topic

## Task Projects API — Create Topic

### Overview

Creates a new **topic** in Task Projects.

* **Environment:** `https://sea-staging-h1.ekoapp.com`
* **Endpoint:** `POST /api/v1/task-projects/topics`
* **Auth:** Bearer JWT
* **Content-Type:** `application/json`

***

### Request

#### Headers

| Header          | Required | Value              |
| --------------- | -------- | ------------------ |
| `Content-Type`  | Yes      | `application/json` |
| `Authorization` | Yes      | `Bearer <JWT>`     |

#### Body (JSON)

| Field             | Type               | Required | Description                                        |
| ----------------- | ------------------ | -------- | -------------------------------------------------- |
| `taskTitle`       | string             | Yes      | Topic title (UTF-8; supports Thai).                |
| `taskDescription` | string             | No       | Detailed description/goal (UTF-8).                 |
| `priority`        | integer            | No       | Priority (e.g., `1`=High, `2`=Medium, `3`=Low).    |
| `dueDate`         | string (ISO 8601)  | No       | Due date/time in UTC, e.g. `2025-12-31T23:59:59Z`. |
| `labelIds`        | array\<string>     | No       | Labels to tag the topic.                           |
| `attachments`     | array\<Attachment> | No       | Files/links to attach (see below).                 |

**Example request**

```json
{
  "taskTitle": "แผนการดำเนินการเพื่อเพิ่ม Transaction (จำนวนใบเสร็จ)",
  "taskDescription": "ค่า CSAT อยู่ที่ 85.0 เปอร์เซ็นต์ ต่ำกว่าเป้าที่ตั้งไว้ที่ 87.0 เปอร์เซ็นต์ การพึงพอใจที่ต่ำกว่าทำให้ความถี่การกลับมาใช้บริการลดลง ส่งผลให้จำนวนใบเสร็จเติบโตไม่เต็มที่",
  "priority": 3,
  "dueDate": "2025-12-31T23:59:59Z",
  "labelIds": [],
  "attachments": []
}
```

***

### Responses

#### 201 Created

```json
{
  "id": "top_67a12c3de2e09e162843f949",
  "taskTitle": "แผนการดำเนินการเพื่อเพิ่ม Transaction (จำนวนใบเสร็จ)",
  "taskDescription": "ค่า CSAT อยู่ที่ 85.0 เปอร์เซ็นต์ ต่ำกว่าเป้าที่ตั้งไว้ที่ 87.0 เปอร์เซ็นต์ การพึงพอใจที่ต่ำกว่าทำให้ความถี่การกลับมาใช้บริการลดลง ส่งผลให้จำนวนใบเสร็จเติบโตไม่เต็มที่",
  "priority": 3,
  "dueDate": "2025-12-31T23:59:59Z",
  "labelIds": [],
  "attachments": [],
  "status": "open",
  "createdAt": "2025-08-18T04:10:00Z",
  "updatedAt": "2025-08-18T04:10:00Z"
}
```

#### Error responses (typical)

| Status                     | Meaning                  | Notes                       |
| -------------------------- | ------------------------ | --------------------------- |
| `400 Bad Request`          | Invalid payload          | Wrong types/missing fields. |
| `401 Unauthorized`         | Invalid/missing token    | Check `Authorization`.      |
| `403 Forbidden`            | Insufficient scope       | Requires write access.      |
| `404 Not Found`            | Related resource missing | e.g., unknown `labelIds`.   |
| `422 Unprocessable Entity` | Validation error         | Field-level details.        |
| `429 Too Many Requests`    | Rate limited             | Respect `Retry-After`.      |
| `5xx`                      | Server error             | Retry with backoff.         |

***

### cURL example

```bash
curl --location 'https://sea-staging-h1.ekoapp.com/api/v1/task-projects/topics' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <REDACTED_JWT>' \
  --data '{
    "taskTitle": "แผนการดำเนินการเพื่อเพิ่ม Transaction (จำนวนใบเสร็จ)",
    "taskDescription": "ค่า CSAT อยู่ที่ 85.0 เปอร์เซ็นต์ ต่ำกว่าเป้าที่ตั้งไว้ที่ 87.0 เปอร์เซ็นต์ การพึงพอใจที่ต่ำกว่าทำให้ความถี่การกลับมาใช้บริการลดลง ส่งผลให้จำนวนใบเสร็จเติบโตไม่เต็มที่",
    "priority": 3,
    "dueDate": "2025-12-31T23:59:59Z",
    "labelIds": [],
    "attachments": []
  }'
```

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.amitysolutions.com/ekoai/api-reference/botv2/botv2-api/task-feature/create-topic.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
