API for group-management #3038

Closed
opened 2025-11-11 15:20:21 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @ill-yes on GitHub (Dec 18, 2024).

Is your feature request related to a problem? Please describe.
Currently, it is not possible to create new groups via the existing API. Attempting to use a corresponding POST endpoint (e.g., /groups/create) results in a 405 - Method Not Allowed error, even though this should be the correct method. This indicates that the functionality for creating groups on the server side is either not implemented or incomplete. For users who want to manage groups dynamically through an API, this leads to additional manual steps or workarounds.

Describe the solution you'd like
I would like to have an officially supported, documented API route for creating groups (e.g., POST /groups), providing the following features:

  • The ability to create a group with a name and optional description
  • Input data validation (e.g., required fields, length restrictions)
  • Clear response and error codes (HTTP status 201 on success, informative error messages on failure)
  • Corresponding documentation in the API references or README, so users can easily understand how to create a group via script or automation tool

Describe alternatives you've considered
Alternative approaches so far include:

  • Manually creating groups through the web interface, which interrupts automation or CI/CD workflows
  • Attempting to reverse-engineer undocumented endpoints or the frontend behavior, which is unreliable and not future-proof

Additional context
A properly implemented and documented endpoint would facilitate integration with external tools (e.g., scripts, CI/CD jobs, or automation solutions). This would benefit users who need a scalable and reproducible way to manage groups programmatically.

Originally created by @ill-yes on GitHub (Dec 18, 2024). **Is your feature request related to a problem? Please describe.** Currently, it is not possible to create new groups via the existing API. Attempting to use a corresponding POST endpoint (e.g., `/groups/create`) results in a `405 - Method Not Allowed` error, even though this should be the correct method. This indicates that the functionality for creating groups on the server side is either not implemented or incomplete. For users who want to manage groups dynamically through an API, this leads to additional manual steps or workarounds. **Describe the solution you'd like** I would like to have an officially supported, documented API route for creating groups (e.g., `POST /groups`), providing the following features: - The ability to create a group with a name and optional description - Input data validation (e.g., required fields, length restrictions) - Clear response and error codes (HTTP status 201 on success, informative error messages on failure) - Corresponding documentation in the API references or README, so users can easily understand how to create a group via script or automation tool **Describe alternatives you've considered** Alternative approaches so far include: - Manually creating groups through the web interface, which interrupts automation or CI/CD workflows - Attempting to reverse-engineer undocumented endpoints or the frontend behavior, which is unreliable and not future-proof **Additional context** A properly implemented and documented endpoint would facilitate integration with external tools (e.g., scripts, CI/CD jobs, or automation solutions). This would benefit users who need a scalable and reproducible way to manage groups programmatically.
Author
Owner

@Peter-De-Ath commented on GitHub (Dec 18, 2024):

The entire Open WebUI front end uses the API endpoints, so if you can do it in the front end you can do with the API.

You can access all the endpoints docs from here http://localhost:8080/docs on your local install.

Here is an example curl request creating a new group

curl -X 'POST' \
  'http://localhost:8080/api/v1/groups/create' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "my new group",
  "description": "this is my groups description"
}'

Links for API docs are also on the OWUI Docs site https://docs.openwebui.com/getting-started/advanced-topics/api-endpoints

PS: based on dev branch as of this comment

@Peter-De-Ath commented on GitHub (Dec 18, 2024): The entire Open WebUI front end uses the API endpoints, so if you can do it in the front end you can do with the API. You can access all the endpoints docs from here http://localhost:8080/docs on your local install. Here is an example curl request creating a new group ```bash curl -X 'POST' \ 'http://localhost:8080/api/v1/groups/create' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "my new group", "description": "this is my groups description" }' ``` Links for API docs are also on the OWUI Docs site https://docs.openwebui.com/getting-started/advanced-topics/api-endpoints PS: based on dev branch as of this comment
Author
Owner

@ill-yes commented on GitHub (Dec 18, 2024):

Well, my mistake - I had a look at the first endpoint examples: /api/models

So I missed the v1 in the route, unfortunately only visible in routes documented below.
Source: https://docs.openwebui.com/getting-started/advanced-topics/api-endpoints/

Thank you!

@ill-yes commented on GitHub (Dec 18, 2024): Well, my mistake - I had a look at the first endpoint examples: `/api/models` So I missed the `v1` in the route, unfortunately only visible in routes documented below. Source: https://docs.openwebui.com/getting-started/advanced-topics/api-endpoints/ Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#3038