openapi: 3.1.0 info: title: Hub API Endpoints agentic-provisioning resource-groups API version: 0.0.1 description: 'We have open endpoints that you can use to retrieve information from the Hub as well as perform certain actions such as creating model, dataset or Space repos. We offer a wrapper Python client, [`huggingface_hub`](https://github.com/huggingface/huggingface_hub), and a JS client, [`huggingface.js`](https://github.com/huggingface/huggingface.js), that allow easy access to these endpoints. We also provide [webhooks](https://huggingface.co/docs/hub/webhooks) to receive real-time incremental info about repos. Enjoy! The base URL for those endpoints below is `https://huggingface.co`. For example, to construct the `/api/models` call below, one can call the URL [https://huggingface.co/api/models](https://huggingface.co/api/models). If you''re an Agent, you might prefer the [markdown version OpenAPI spec](https://huggingface.co/.well-known/openapi.md). ' servers: - url: https://huggingface.co description: Hub security: - bearerAuth: [] tags: - name: resource-groups x-displayName: Resource groups description: The following endpoints manage resource groups. Resource groups are a Team or Enterprise feature. paths: /api/organizations/{name}/resource-groups: get: description: 'Retrieve accessible resource groups. Get all resource groups the user has access to. Requires the org to be Enterprise' summary: Get resource groups tags: - resource-groups responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: array items: type: object properties: id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ name: type: string description: anyOf: - type: string - type: 'null' autoJoin: anyOf: - type: object properties: enabled: const: true role: anyOf: - enum: - admin - write - contributor - read - no_access - description: Custom role name type: string required: - enabled - role additionalProperties: false - type: object properties: enabled: const: false required: - enabled additionalProperties: false users: type: array items: type: object properties: type: const: user _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ fullname: type: string name: type: string avatarUrl: type: string role: anyOf: - enum: - admin - write - contributor - read - no_access - description: Custom role name type: string addedBy: type: string required: - type - _id - fullname - name - avatarUrl - role additionalProperties: false repos: type: array items: type: object properties: name: type: string type: enum: - dataset - model - space - bucket - kernel addedBy: type: string private: type: boolean required: - name - type - private additionalProperties: false required: - id - name - users - repos additionalProperties: false description: Resource groups the user has access to parameters: - name: name in: path required: true schema: type: string post: description: 'Create a new resource group in the organization. Requires the org to be Enterprise' summary: Create a resource group tags: - resource-groups requestBody: content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: name: type: string minLength: 1 maxLength: 200 description: type: string maxLength: 500 users: default: [] type: array items: type: object properties: user: type: string role: anyOf: - enum: - admin - write - contributor - read - no_access - description: Custom role name type: string required: - user - role repos: default: [] type: array items: $ref: '#/components/schemas/RepoId' autoJoin: anyOf: - type: object properties: enabled: const: true role: anyOf: - enum: - admin - write - contributor - read - no_access - description: Custom role name type: string required: - enabled - role - type: object properties: enabled: const: false required: - enabled required: - name responses: '200': content: application/json: schema: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ name: type: string description: anyOf: - type: string - type: 'null' autoJoin: anyOf: - type: object properties: enabled: const: true role: anyOf: - enum: - admin - write - contributor - read - no_access - description: Custom role name type: string required: - enabled - role additionalProperties: false - type: object properties: enabled: const: false required: - enabled additionalProperties: false users: type: array items: type: object properties: type: const: user _id: type: string minLength: 24 maxLength: 24 pattern: ^[0-9a-f]{24}$ fullname: type: string name: type: string avatarUrl: type: string role: anyOf: - enum: - admin - write - contributor - read - no_access - description: Custom role name type: string addedBy: type: string required: - type - _id - fullname - name - avatarUrl - role additionalProperties: false repos: type: array items: type: object properties: name: type: string type: enum: - dataset - model - space - bucket - kernel addedBy: type: string private: type: boolean required: - name - type - private additionalProperties: false required: - id - name - users - repos additionalProperties: false description: The created resource group parameters: - name: name in: path required: true schema: type: string components: schemas: RepoId: $schema: https://json-schema.org/draft/2020-12/schema type: object properties: name: examples: - deepseek-ai/DeepSeek-R1 - black-forest-labs/FLUX.1-dev type: string type: enum: - dataset - model - space - bucket - kernel required: - name - type additionalProperties: false id: RepoId securitySchemes: bearerAuth: type: http scheme: bearer