[POST] .../v1/partnergroup/add
Creates a new group partners. Use this method to create a partner group before creating partners inside it or building a partner hierarchy. The method validates the required name, checks parent_id when a parent group is supplied, inserts the group, writes an action log record, invalidates partner and partner-group caches, sends the PartnerGroupAdded webhook and returns new_id. The request body is required; name must be non-empty and no longer than 150 characters, while parent_id can be 0 for a root group. The current request user must have partner group add permission. Missing body, missing name, name length violations, invalid parent_id, denied access, transaction failures and storage errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | String | Required | Group name. |
| parent_id | Int64 | Optional | Parent group ID. |
Request Example
{
"parent_id": 0,
"name": "Suppliers"
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 2
}
}