Enable renaming of groups #1589

Open
opened 2025-11-20 05:33:21 -05:00 by saavagebueno · 6 comments
Owner

Originally created by @Lamera on GitHub (Jan 31, 2025).

Is your feature request related to a problem? Please describe.
I defined a group and gave it a wrong name. Now I have to re-create the whole group with its policies.

Describe the solution you'd like
I simply would like to rename the group name in the Dashboard.

Describe alternatives you've considered
I thought about changing the name in the database. Perhaps I will break something by doing this.

Originally created by @Lamera on GitHub (Jan 31, 2025). **Is your feature request related to a problem? Please describe.** I defined a group and gave it a wrong name. Now I have to re-create the whole group with its policies. **Describe the solution you'd like** I simply would like to rename the group name in the Dashboard. **Describe alternatives you've considered** I thought about changing the name in the database. Perhaps I will break something by doing this.
saavagebueno added the feature-requestdashboard labels 2025-11-20 05:33:21 -05:00
Author
Owner

@bc547 commented on GitHub (May 27, 2025):

This would be a very handy feature! Especially with lots of policies, it is a lot of work currently.

Afaik, the API does support renaming already and it's mainly the dashboard that is missing the UI part? (e.g. Settings->Groups)

@bc547 commented on GitHub (May 27, 2025): This would be a very handy feature! Especially with lots of policies, it is a lot of work currently. Afaik, the API does support renaming already and it's mainly the dashboard that is missing the UI part? (e.g. Settings->Groups)
Author
Owner

@MichalisDBA commented on GitHub (Jun 2, 2025):

Any news about this?

@MichalisDBA commented on GitHub (Jun 2, 2025): Any news about this?
Author
Owner

@mlsmaycon commented on GitHub (Jun 2, 2025):

Hello Folks, early in Q3/2025, we plan to move the group management to a higher level in our dashboard, perhaps replacing setup keys, and then you should be able to rename the groups.

For now, you should be able to use the API to rename, as pointed out by @bc547

@mlsmaycon commented on GitHub (Jun 2, 2025): Hello Folks, early in Q3/2025, we plan to move the group management to a higher level in our dashboard, perhaps replacing setup keys, and then you should be able to rename the groups. For now, you should be able to use the API to rename, as pointed out by @bc547
Author
Owner

@hrvoj3e commented on GitHub (Sep 30, 2025):

I tried the API and to update the name but after that it removed itself from all the peers.
I have a selfhosted Netbird.

Is this a bug or intended?

❯ curl -X PUT https://my-netbird/api/groups/d3dpv47k31bs73abamjg \
      -H 'Accept: application/json' \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token nbp_fCb*************' \
      --data-raw '{
    "name": "my-cloud-network"
  }'

{"id":"d3dpv47k31bs73abamjg","issued":"api","name":"my-cloud-network","peers":null,"peers_count":0,"resources":null,"resources_count":0}

@hrvoj3e commented on GitHub (Sep 30, 2025): I tried the API and to update the name but after that it removed itself from all the peers. I have a selfhosted Netbird. Is this a bug or intended? ```shell ❯ curl -X PUT https://my-netbird/api/groups/d3dpv47k31bs73abamjg \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Token nbp_fCb*************' \ --data-raw '{ "name": "my-cloud-network" }' {"id":"d3dpv47k31bs73abamjg","issued":"api","name":"my-cloud-network","peers":null,"peers_count":0,"resources":null,"resources_count":0} ```
Author
Owner

@nazarewk commented on GitHub (Sep 30, 2025):

@hrvoj3e I'm like 90% sure this endpoint is for a full update of the Group (not a partial update/patch), meaning you need to pass the whole object to it, not just a different group name, otherwise it gets cleared.

@nazarewk commented on GitHub (Sep 30, 2025): @hrvoj3e I'm like 90% sure [this endpoint](https://github.com/netbirdio/netbird/blob/e8d301fdc9357b9ca9ecf9ce40d4d347255d3bf9/management/server/http/handlers/groups/groups_handler.go#L121-L126) is for a full update of the Group (not a partial update/patch), meaning you need to pass the whole object to it, not just a different group name, otherwise it gets cleared.
Author
Owner

@mitchplze commented on GitHub (Oct 16, 2025):

@hrvoj3e I'm like 90% sure this endpoint is for a full update of the Group (not a partial update/patch), meaning you need to pass the whole object to it, not just a different group name, otherwise it gets cleared.

@nazarewk: That doesn't seem to work for me either:

TOKEN=xxx
MGMT_URL=https://selfhostedurl.com
clear

# get groups
curl -X GET $MGMT_URL/api/groups \
-H "Accept: application/json" \
-H "Authorization: Token $TOKEN" | jq 

# relevant group output
# {
    # "id": "d3oprnce3knc73dkmbbg",
    # "issued": "api",
    # "name": "Test B",
    # "peers": [
      # {
        # "id": "d3mntjse3knc73e0c7bg",
        # "name": "mitch-macbook"
      # }
    # ],
    # "peers_count": 1,
    # "resources": null,
    # "resources_count": 0
#   }

# set group ID to rename
UPD_GROUP=d3oprnce3knc73dkmbbg

# tried to update it to "Test 3", including sending all peers
curl -X PUT $MGMT_URL/api/groups/$UPD_GROUP \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Token $TOKEN" \
--data-raw '{
  "name": "Test C",
  "peers": [
      {
        "id": "d3mntjse3knc73e0c7bg",
        "name": "mitch-macbook"
      }
    ],
}'

Produces:

{"message":"couldn't parse JSON request","code":400}

I even tried with the other null/empty fields that I believe are auto-generated:

curl -X PUT $MGMT_URL/api/groups/$UPD_GROUP \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Token $TOKEN" \
--data-raw '{
  "name": "Test C",
  "peers": [
      {
        "id": "d3mntjse3knc73e0c7bg",
        "name": "mitch-macbook"
      }
    ],
    "peers_count": 1,
    "resources": null,
    "resources_count": 0
}'

And it produces the same {"message":"couldn't parse JSON request","code":400}

@mitchplze commented on GitHub (Oct 16, 2025): > [@hrvoj3e](https://github.com/hrvoj3e) I'm like 90% sure [this endpoint](https://github.com/netbirdio/netbird/blob/e8d301fdc9357b9ca9ecf9ce40d4d347255d3bf9/management/server/http/handlers/groups/groups_handler.go#L121-L126) is for a full update of the Group (not a partial update/patch), meaning you need to pass the whole object to it, not just a different group name, otherwise it gets cleared. @nazarewk: That doesn't seem to work for me either: ```bash TOKEN=xxx MGMT_URL=https://selfhostedurl.com clear # get groups curl -X GET $MGMT_URL/api/groups \ -H "Accept: application/json" \ -H "Authorization: Token $TOKEN" | jq # relevant group output # { # "id": "d3oprnce3knc73dkmbbg", # "issued": "api", # "name": "Test B", # "peers": [ # { # "id": "d3mntjse3knc73e0c7bg", # "name": "mitch-macbook" # } # ], # "peers_count": 1, # "resources": null, # "resources_count": 0 # } # set group ID to rename UPD_GROUP=d3oprnce3knc73dkmbbg # tried to update it to "Test 3", including sending all peers curl -X PUT $MGMT_URL/api/groups/$UPD_GROUP \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Token $TOKEN" \ --data-raw '{ "name": "Test C", "peers": [ { "id": "d3mntjse3knc73e0c7bg", "name": "mitch-macbook" } ], }' ``` Produces: `{"message":"couldn't parse JSON request","code":400}` I even tried with the other null/empty fields that I believe are auto-generated: ```bash curl -X PUT $MGMT_URL/api/groups/$UPD_GROUP \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Token $TOKEN" \ --data-raw '{ "name": "Test C", "peers": [ { "id": "d3mntjse3knc73e0c7bg", "name": "mitch-macbook" } ], "peers_count": 1, "resources": null, "resources_count": 0 }' ``` And it produces the same `{"message":"couldn't parse JSON request","code":400}`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1589