---
updatedAt: 2025-11-11T22:56:11.000Z
agentTools:
  projectIndex: https://pegasus.digitalcomtech.com/llms.txt
---

# Create a group

Create a group

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Pegasus Cloud IoT API",
    "description": "Pegasus IoT Cloud API reference documentation. [Github Repo](https://github.com/dctdevelop/pegasus) / [Release notes](https://github.com/dctdevelop/pegasus/tree/master/releases)",
    "contact": {
      "email": "developer@digitalcomtech.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.0.12"
  },
  "servers": [
    {
      "url": "https://api.pegasusgateway.com",
      "description": "Production server"
    },
    {
      "url": "https://auth.pegasusgateway.com",
      "description": "Authentication server"
    }
  ],
  "tags": [
    {
      "name": "Groups"
    }
  ],
  "paths": {
    "/groups": {
      "post": {
        "tags": [
          "Groups"
        ],
        "summary": "Create a group",
        "description": "Create a group",
        "operationId": "addGroup",
        "requestBody": {
          "description": "Information of the asset",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/requestBodyGroup"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "aplication/json": {
                "schema": {
                  "$ref": "#/components/schemas/responseGroup200"
                }
              }
            }
          },
          "400": {
            "description": "invalid input, object invalid"
          },
          "409": {
            "description": "an existing item already exists"
          }
        },
        "security": [
          {
            "apikeyAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "requestBodyGroup": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the group",
            "example": "ABC Trucks"
          },
          "vehicles": {
            "type": "array",
            "description": "List of vehicles that belong to the group",
            "items": {
              "type": "number",
              "example": 1
            }
          },
          "assets": {
            "type": "array",
            "description": "List of assets that belong to the group",
            "items": {
              "type": "number",
              "example": 1
            }
          },
          "users": {
            "type": "array",
            "description": "List of users that belong to the group",
            "items": {
              "type": "number",
              "example": 1
            }
          },
          "company_name": {
            "type": "string",
            "description": "Company name",
            "example": "ABC Trucking LLC"
          },
          "city": {
            "type": "string",
            "description": "City",
            "example": "Miami"
          },
          "country": {
            "type": "string",
            "description": "Country",
            "example": "USA"
          },
          "contact_name": {
            "type": "string",
            "description": "Contact name",
            "example": "Bob Smith"
          },
          "contact_email": {
            "type": "string",
            "description": "Contact email",
            "example": "bob@abctrucks.com"
          },
          "address_1": {
            "type": "string",
            "description": "Address 1",
            "example": "5835 Blue Lagoon Dr"
          },
          "address_2": {
            "type": "string",
            "description": "Address 2",
            "example": "Suite 202"
          }
        }
      },
      "responseGroup200": {
        "type": "object",
        "properties": {
          "__updated": {
            "type": "number",
            "description": "Epoch of last modification done on group",
            "example": 1649865610.294368
          },
          "__created": {
            "type": "number",
            "description": "Epoch of creation",
            "example": 1592351212.609387
          },
          "city": {
            "type": "string",
            "description": "City",
            "example": "Miami"
          },
          "users": {
            "type": "array",
            "description": "Users associated to the group",
            "items": {
              "type": "number",
              "example": 12
            }
          },
          "logo": {
            "type": "boolean",
            "description": "True if group has a logo (use images api to obtain)",
            "example": true
          },
          "country": {
            "type": "string",
            "description": "Country",
            "example": "USA"
          },
          "vehicles": {
            "type": "array",
            "description": "Vehicles associated to the group",
            "items": {
              "type": "number",
              "example": 23
            }
          },
          "contact_email": {
            "type": "string",
            "description": "Contact email",
            "example": "bob@abctrucks.com"
          },
          "company_name": {
            "type": "number",
            "description": "Company name"
          },
          "address_1": {
            "type": "string",
            "description": "Address 1",
            "example": "5835 Blue Lagoon Dr"
          },
          "address_2": {
            "type": "string",
            "description": "Address 2",
            "example": "Suite 202"
          },
          "contact_name": {
            "type": "string",
            "description": "Contact name",
            "example": "Bob Smith"
          },
          "assets": {
            "type": "array",
            "description": "Assets associated to the group",
            "items": {
              "type": "number",
              "example": 45
            }
          },
          "id": {
            "type": "number",
            "description": "Vehicle ID",
            "example": 123
          },
          "name": {
            "type": "string",
            "description": "Name of vehicle",
            "example": "Blue Truck"
          },
          "__version": {
            "type": "string",
            "description": "API version info",
            "example": "7.0.0"
          }
        }
      }
    },
    "securitySchemes": {
      "apikeyAuth": {
        "type": "apiKey",
        "name": "authenticate",
        "in": "header"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```