---
title: "Add resource group"
method: POST
path: "/api/models/{namespace}/{repo}/resource-group"
tags: ["models"]
---

# Add resource group

`POST /api/models/{namespace}/{repo}/resource-group`

Add the repository to a resource group

## Path parameters

- `namespace` string, required
- `repo` string, required

## Request body

- object
  - `resourceGroupId` string, nullable, required — The resource group to add the repository to, if null, the repository will be removed from the resource group

## Response `200`

Minimal information about the repository

- object
  - `name` string, required
  - `type` 'dataset' | 'model' | 'space' | 'bucket' | 'kernel' | 'container', required
  - `private` boolean, required
  - `addedBy` string, required

## Changes

- **2026-09-18** `74f2b0d17636` — 1 warning
  - added the new `container` enum value to the `type` response property for the response status `200`
- **2026-09-11** `c97a15994a26` — 1 warning
  - changed the pattern of the request property `resourceGroupId/anyOf[subschema #1]/` from `^[0-9a-f]{24}$` to `^[0-9a-fA-F]{24}$`
- **2026-09-08** `bd17546f47b8` — 1 breaking
  - the `type` response's property type changed from no type to `string` for status `200`

[Change history](https://skmtc.dev/huggingface/apis/hub-api-endpoints/changes/api/models/:namespace/:repo/resource-group/post.md)

---

[API](https://skmtc.dev/huggingface/apis/hub-api-endpoints.md) · [All operations](https://skmtc.dev/huggingface/apis/hub-api-endpoints/llms.txt) · [OpenAPI document](https://skmtc.dev/huggingface/apis/hub-api-endpoints/revisions/74f2b0d17636?raw)
