---
title: "Create Group"
method: POST
path: "/groups"
tags: ["Groups"]
---

# Create Group

`POST /groups`

## Request

- Base URL: `https://secure.fleetio.com/api`
- URL: `https://secure.fleetio.com/api/groups`
- Auth: API key in header `Authorization` and API key in header `Account-Token`
- TypeScript: <https://skmtc.dev/fleetio/apis/fleetio-developer-api/docs/groups/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new Group

## Request body

- object
  - `name` string, required
  - `default` boolean: Indicates whether this Group is the default Group.
  - `parent_id` integer
  - `hierarchy` string: Create Group(s) from a pipe delimited hierarchy string. Will start from the end of the string and create the necessary Groups to produce the desired hierarchy.

## Response `201`

OK

- GroupCreated, nullable: A Group
  - `id` integer, required
  - `created_at` string, date-time: The date and time at which this record was created.
  - `updated_at` string, date-time: The date and time at which this record was most recently updated.
  - `account_id` integer, required
  - `name` string: The name of the Group.
  - `default` boolean: Indicates whether this Group is the default Group.
  - `ancestry` string, nullable: A pipe delimited list of ancestor Group IDs, starting with the root Group and ending with the immediate parent Group.
  - `ancestry_names` string, nullable, required: A pipe delimited list of ancestor Group names, starting with the root Group and ending with the immediate parent Group.
  - `watched_group_subscriptions_count` integer, required: The count of subscriptions to this Group.
  - `is_sample` boolean, required: Indicates whether this Group is a sample Group.
  - `unarchived_vehicles_count` integer, required: The count of unarchived `Vehicles` within this Group.

## Other responses

- `401`: Request could not be authenticated
- `403`: Insufficient permission to perform this operation
- `422`: Unprocessable Entity
- `500`: Something unexpected happened

---

[API](https://skmtc.dev/fleetio/apis/fleetio-developer-api.md) - [All operations](https://skmtc.dev/fleetio/apis/fleetio-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fleetio/apis/fleetio-developer-api/revisions/49558d744bd7?raw)
