---
updatedAt: 2026-04-21T21:18:33.000Z
agentTools:
  projectIndex: https://docs.gospidr.com/llms.txt
---

# Create Group

Create a root group or a child group. Omit parentGroupId for a root group.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Unified API",
    "version": "0.0.1"
  },
  "paths": {
    "/v1/group/create": {
      "post": {
        "operationId": "PostV1GroupCreate",
        "summary": "Create Group",
        "description": "Create a root group or a child group. Omit parentGroupId for a root group.",
        "tags": [
          "Groups"
        ],
        "requestBody": {
          "description": "POST /v1/group/create Request body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostV1GroupCreateRequestBody"
              }
            }
          }
        },
        "security": [
          {
            "APIKEY_1": [],
            "APIKEY_2": []
          }
        ],
        "responses": {
          "200": {
            "description": "POST /v1/group/create Positive response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostV1GroupCreatePositiveResponse"
                }
              }
            }
          },
          "400": {
            "description": "POST /v1/group/create Negative response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostV1GroupCreateNegativeResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PostV1GroupCreatePositiveResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "success"
          },
          "data": {
            "type": "object",
            "properties": {
              "groupId": {
                "type": "string",
                "description": "The group's unique ID within Spidr. The account is assigned to this hierarchical group."
              },
              "name": {
                "type": "string",
                "description": "Name of the group"
              },
              "description": {
                "type": "string",
                "description": "Optional description of the group"
              },
              "parentGroupId": {
                "type": "string",
                "description": "The parent group's unique ID. Omit for a root group."
              },
              "rootGroupId": {
                "type": "string",
                "description": "The root group's unique ID. Used to filter groups in a hierarchy."
              },
              "level": {
                "type": "number",
                "format": "double",
                "minimum": 0,
                "maximum": 100,
                "description": "Hierarchy level (0 = root)"
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "closed"
                ],
                "description": "Group status"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
              },
              "lastUpdatedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
              }
            },
            "required": [
              "groupId",
              "name",
              "rootGroupId",
              "level",
              "status",
              "createdAt",
              "lastUpdatedAt"
            ]
          }
        },
        "required": [
          "status",
          "data"
        ]
      },
      "PostV1GroupCreateNegativeResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "error"
          },
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "errorType": {
                "type": "string"
              },
              "errorCode": {
                "type": "string",
                "description": "Specific error code for programmatic handling. See the [Error Code Reference](https://docs.gospidr.com/docs/spidr-errors#/) for details on all possible error codes."
              },
              "errorData": {
                "format": "any"
              }
            },
            "required": [
              "message",
              "errorType",
              "errorCode"
            ],
            "description": "Error details. For a complete list of error codes and their meanings, see the [Error Code Reference](https://docs.gospidr.com/docs/spidr-errors#/)."
          }
        },
        "required": [
          "status",
          "error"
        ]
      },
      "PostV1GroupCreateRequestBody": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Name of the group"
          },
          "description": {
            "type": "string",
            "maxLength": 1000,
            "description": "Optional description of the group"
          },
          "parentGroupId": {
            "type": "string",
            "description": "The parent group's unique ID. Omit for a root group."
          }
        },
        "required": [
          "name"
        ]
      }
    },
    "securitySchemes": {
      "APIKEY_1": {
        "type": "apiKey",
        "in": "header",
        "name": "apikey"
      },
      "APIKEY_2": {
        "type": "apiKey",
        "in": "header",
        "name": "x-client-request-id"
      }
    }
  },
  "tags": [
    {
      "name": "Groups",
      "description": "Hierarchical groups and account assignment"
    }
  ],
  "servers": [
    {
      "url": "https://api.sb.spidrsrv.com"
    }
  ]
}
```