---
title: create_category
slug: docs/aU7p-createcategory
docTags: 
createdAt: 2026-07-07T18:19:09.666Z
---

Creates an email category in a project - the folder that templates are grouped under.

If a category with the same title already exists in that project, the existing one is returned and no duplicate is create.

## Basic structure

Each call to the API requires `action` and a `group_id`.

| Name       | Type    | Required | Description                                                                                                                             |
| ---------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `action`   | string  | true     | For this call, `create_category`.                                                                                                       |
| `group_id` | integer | true     | This designates which project the category belongs to. The `Api-Id` in the header must be part of the organization that owns the group. |
| `doc`      | array   | true     | see doc parameters below                                                                                                                |
| `cat_name` | string  | true     | The category title.                                                                                                                     |

## Doc Parameters

| Name       | Type   | Required | Description         |
| ---------- | ------ | -------- | ------------------- |
| `cat_name` | string | true     | The category title. |





## Example call

:::CodeblockTabs
```curl
curl -X POST "https://www.regpack.com/reg/api2/emails/" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -H "Api-Id: 15263" \
     -H "Api-user: api_admin@regpacks.com" \
     -H "Api-Token: cd2e514f-7gab-3cde-62fg-51abcd4e7362" \
     -d '{
    "action": "create_category",
    "group_id": 100909072,
    "doc": {
        "cat_name": "Registration Emails"
    }
}'
```

```python
import requests
import json
emails_endpoint = "https://www.regpack.com/reg/api2/emails/"
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Api-Id": "15263",
    "Api-user": "api_admin@regpacks.com",
    "Api-Token": "cd2e514f-7gab-3cde-62fg-51abcd4e7362",
}
payload = {
    "action": "create_category",
    "group_id": 100909072,
    "doc": {
        "cat_name": "Registration Emails",
    },
}
create_category_json = json.dumps(payload)
create_category_response = requests.post(url=emails_endpoint, 
                                         data=create_category_json, 
                                         headers=headers, 
                                         timeout=10)
```
:::

## Example response

`cat_id` is the associated category id that was created, and `existed` returns `true` if the category already existed.&#x20;

```json
{
    "success": true,
    "cat_id": "112481",
    "existed": false
}
```

