[GH-ISSUE #1060] API lowercases setup key group names #1652

Closed
opened 2026-08-05 00:43:24 -04:00 by saavagebueno · 2 comments
Owner

Originally created by @clarkmcc on GitHub (Aug 7, 2023).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/1060

Describe the problem
When creating setup keys through the API, group names are lowercased, but are still case sensitive -- title cased group names are not found.

To Reproduce
When I POST to the endpoint /api/setup-keys with the following payload

{
  "name": "Testing key",
  "type": "one-off",
  "expires_in": 86400,
  "revoked": false,
  "auto_groups": [
    "Foobars"
  ],
  "usage_limit": 1
}

I get this error

{"message":"group foobars doesn't exist","code":404}

But I can create a setup key with "Foobars" through the UI.

Expected behavior
The setup key should be properly created

Originally created by @clarkmcc on GitHub (Aug 7, 2023). Original GitHub issue: https://github.com/netbirdio/netbird/issues/1060 **Describe the problem** When creating setup keys through the API, group names are lowercased, but are still case sensitive -- title cased group names are not found. **To Reproduce** When I POST to the endpoint `/api/setup-keys` with the following payload ```json { "name": "Testing key", "type": "one-off", "expires_in": 86400, "revoked": false, "auto_groups": [ "Foobars" ], "usage_limit": 1 } ``` I get this error ```json {"message":"group foobars doesn't exist","code":404} ``` But I can create a setup key with "Foobars" through the UI. **Expected behavior** The setup key should be properly created
Author
Owner

@mlsmaycon commented on GitHub (Aug 8, 2023):

Hello @clarkmcc the auto_groups expect group IDs instead of names. You can get that with

GET /api/groups

<!-- gh-comment-id:1669013540 --> @mlsmaycon commented on GitHub (Aug 8, 2023): Hello @clarkmcc the auto_groups expect group IDs instead of names. You can get that with GET /api/groups
Author
Owner

@clarkmcc commented on GitHub (Aug 8, 2023):

Ah, thanks

<!-- gh-comment-id:1669817722 --> @clarkmcc commented on GitHub (Aug 8, 2023): Ah, thanks
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#1652