---
title: "Collection resource group"
method: POST
path: "/api/collections/{namespace}/{slug}-{id}/resource-group"
tags: ["collections"]
---

# Collection resource group

`POST /api/collections/{namespace}/{slug}-{id}/resource-group`

Assign, move, or unassign an organization-owned collection to a resource group. Pass null to unassign. User-owned collections are not eligible.

## Path parameters

- `namespace` string, required
- `slug` string, required
- `id` string, required

## Request body

- object
  - `resourceGroupId` string, nullable, required — The resource group to assign the collection to. If null, the collection is removed from any resource group.

## Response `200`

Minimal information about the collection after the assignment

- object
  - `id` string, required
  - `slug` string, required
  - `title` string, required
  - `private` boolean, required
  - `addedBy` string, required

## Changes

- **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}$`

[Change history](https://skmtc.dev/huggingface/apis/hub-api-endpoints/changes/api/collections/:namespace/:slug-:id/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)
