---
title: "Create or overwrite a group"
method: POST
path: "/v1/groups/{groupId}"
tags: ["Groups"]
---

# Create or overwrite a group

`POST /v1/groups/{groupId}`

Creates a new group with the specified groupId. If a group with the same groupId already exists, it will be overwritten.

## Path parameters

- `groupId` string, required

## Request body

- object
  - `children` string[] — An array of tracked sources (derivation schemes or other groups) to be included in the group.

## Response `200`

Group created or overwritten successfully.

- Group
  - `trackedSource` string, required — The tracked source identifier for the group, formatted as 'GROUP:{groupId}'. Used to reference the group within NBXplorer.
  - `groupId` string, required — The unique identifier of the group.
  - `children` object[] — An array of child tracked sources that are part of this group. Each child can be another group (nested groups) or a derivation scheme.
    - `trackedSource` string, required — The tracked source identifier of the child, which can be a group or a derivation scheme.
    - `cryptoCode` string — The cryptocurrency code associated with the child tracked source, e.g., 'BTC'. Present if the child is a derivation scheme.

## Other responses

- `400` — Bad Request. Invalid groupId or children.

## Changes

- **2024-11-25** `cfaf4efd4ea8` — 2 breaking, 3 info
  - the `code` response's property type/format changed from `integer`/`` to `string`/`` for status `400`
  - removed the required property `error` from the response with the `400` status
  - added the optional property `httpCode` to the response with the `400` status
  - added the optional property `message` to the response with the `400` status
  - …1 more
- **2024-11-25** `de4c3fa16384` — 1 info
  - api operation id `Create` was added
- **2024-11-25** `72a2dfa26976` — 1 info
  - endpoint added
- **2024-11-18** `b5092f204599` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/btcpayserver/apis/nbxplorer-api/changes/v1/groups/:groupId/post.md)

---

[API](https://skmtc.dev/btcpayserver/apis/nbxplorer-api.md) · [All operations](https://skmtc.dev/btcpayserver/apis/nbxplorer-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/btcpayserver/nbxplorer-api/revisions/208cac39e31a/schema)
