# Add New Article

`POST /api/knowledge_base`



- **Group:** Knowledge Base
- **Since:** v3.0.0
- **Authentication:** `authtoken` header, created under Setup > API > API Management
- **HTML version:** /apiguide/knowledge-base/post-kb-article/

## Headers

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

## Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `subject` | String | **required** | Article subject (slug auto-generated, unique). |
| `articlegroup` | Number | **required** | Existing knowledge base group id. |
| `description` | String | optional | Article body (HTML allowed). |
| `active` | Number | optional | 1 published / 0 hidden. (default: `1`) |
| `staff_article` | Number | optional | 1 = internal (staff only). (default: `0`) |

## Example request

```bash
curl -X POST "https://yoursite.com/api/knowledge_base" \
  -H "authtoken: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "subject": "...", "articlegroup": "..." }'
```

## Success response

### Success-Response:

```json
HTTP/1.1 200 OK
{
  "status": true,
  "message": "Article added successfully",
  "record_id": 12
}
```

## Error responses

### Error-Response:

```json
HTTP/1.1 422 Unprocessable Entity
{
  "status": false,
  "error": "validation_failed",
  "message": "Article validation failed",
  "errors": {
    "subject": "The subject field is required.",
    "articlegroup": "A valid articlegroup id is required."
  }
}
```

---

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