create_category
4 min
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
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: [email protected]" \
-H "Api-Token: cd2e514f-7gab-3cde-62fg-51abcd4e7362" \
-d '{
"action": "create_category",
"group_id": 100909072,
"doc": {
"cat_name": "Registration Emails"
}
}'Example response
cat_id is the associated category id that was created, and existed returns true if the category already existed.
{
"success": true,
"cat_id": "112481",
"existed": false
}