# Insert Record into Custom Table

`POST /api/thirdparty/customtable/{table_name}`

Inserts a new record into the specified custom table. All columns in the request body must exist in the table, otherwise an error will be returned.

- **Group:** Thirdparty
- **Since:** v0.3.0
- **Authentication:** `authtoken` header, created under Setup > API > API Management
- **HTML version:** /apiguide/thirdparty/post-custom-table-record/

## Headers

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

## Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `table_name` | String | **required** | Name of the custom database table (exact table name as it exists in the database) |

## Example request

```bash
curl -X POST "https://yoursite.com/api/thirdparty/customtable/TABLE_NAME" \
  -H "authtoken: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "field": "value" }'
```

## Success response

### Success-Response:

```json
HTTP/1.1 201 Created
{
  "status": true,
  "message": "Record created successfully",
  "id": 5
}
```

## Error responses

### Error-Response (Column Not Found):

```json
HTTP/1.1 400 Bad Request
{
  "status": false,
  "message": "Column 'invalid_column' does not exist in table 'george'"
}
```

---

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