Buckets:

hf-doc-build/doc-dev / hub /pr_2521 /en /programmatic-user-access-control.html
HuggingFaceDocBuilder's picture
download
raw
87.3 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Programmatic User Access Control Management&quot;,&quot;local&quot;:&quot;programmatic-user-access-control-management&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Change member role via API&quot;,&quot;local&quot;:&quot;change-member-role-via-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Prerequisites&quot;,&quot;local&quot;:&quot;prerequisites&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Base URL and authentication&quot;,&quot;local&quot;:&quot;base-url-and-authentication&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Change member role endpoint&quot;,&quot;local&quot;:&quot;change-member-role-endpoint&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Updating multiple members&quot;,&quot;local&quot;:&quot;updating-multiple-members&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Resource Groups API&quot;,&quot;local&quot;:&quot;resource-groups-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Base URL and authentication&quot;,&quot;local&quot;:&quot;base-url-and-authentication&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;List resource groups&quot;,&quot;local&quot;:&quot;list-resource-groups&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Add users to a resource group&quot;,&quot;local&quot;:&quot;add-users-to-a-resource-group&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Adding members via email (workaround)&quot;,&quot;local&quot;:&quot;adding-members-via-email-workaround&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Batch-add by looping over the API&quot;,&quot;local&quot;:&quot;batch-add-by-looping-over-the-api&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Important notes&quot;,&quot;local&quot;:&quot;important-notes&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Configure auto-join via API&quot;,&quot;local&quot;:&quot;configure-auto-join-via-api&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}">
<link href="/docs/hub/pr_2521/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/entry/start.d19e5ca7.js">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/chunks/scheduler.409792a1.js">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/chunks/singletons.1ece723a.js">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/chunks/index.0f0d9f26.js">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/chunks/paths.a67d9216.js">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/entry/app.98ab229a.js">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/chunks/preload-helper.78e52d9f.js">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/chunks/index.92d389ff.js">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/nodes/0.7799902b.js">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/chunks/each.e59479a4.js">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/nodes/149.02979127.js">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/chunks/CopyLLMTxtMenu.dcf7fb47.js">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/chunks/MermaidChart.svelte_svelte_type_style_lang.0c189c7e.js">
<link rel="modulepreload" href="/docs/hub/pr_2521/en/_app/immutable/chunks/CodeBlock.5ed269c1.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Programmatic User Access Control Management&quot;,&quot;local&quot;:&quot;programmatic-user-access-control-management&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Change member role via API&quot;,&quot;local&quot;:&quot;change-member-role-via-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Prerequisites&quot;,&quot;local&quot;:&quot;prerequisites&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Base URL and authentication&quot;,&quot;local&quot;:&quot;base-url-and-authentication&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Change member role endpoint&quot;,&quot;local&quot;:&quot;change-member-role-endpoint&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Updating multiple members&quot;,&quot;local&quot;:&quot;updating-multiple-members&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Resource Groups API&quot;,&quot;local&quot;:&quot;resource-groups-api&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Base URL and authentication&quot;,&quot;local&quot;:&quot;base-url-and-authentication&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;List resource groups&quot;,&quot;local&quot;:&quot;list-resource-groups&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Add users to a resource group&quot;,&quot;local&quot;:&quot;add-users-to-a-resource-group&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Adding members via email (workaround)&quot;,&quot;local&quot;:&quot;adding-members-via-email-workaround&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Batch-add by looping over the API&quot;,&quot;local&quot;:&quot;batch-add-by-looping-over-the-api&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Important notes&quot;,&quot;local&quot;:&quot;important-notes&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Configure auto-join via API&quot;,&quot;local&quot;:&quot;configure-auto-join-via-api&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"><div class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg></span> <span>Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg></button></div> </div> <h1 class="relative group"><a id="programmatic-user-access-control-management" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#programmatic-user-access-control-management"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Programmatic User Access Control Management</span></h1> <p data-svelte-h="svelte-srte00">This guide describes how to manage organization member roles and resource group membership via the Hub API: changing a member’s organization role and resource group assignments, listing resource groups, adding users to groups, and batch workflows.</p> <p data-svelte-h="svelte-3ysk0q"><strong>Table of contents:</strong></p> <ul data-svelte-h="svelte-1tzpno"><li><a href="#change-member-role-via-api">Change member role via API</a> — Set a member’s org role and resource group assignments (one member per request).</li> <li><a href="#resource-groups-api">Resource Groups API</a> — List resource groups and add users to them.</li> <li><a href="#configure-auto-join-via-api">Configure auto-join via API</a> — Enable or disable auto-join on a Resource Group.</li></ul> <hr> <h2 class="relative group"><a id="change-member-role-via-api" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#change-member-role-via-api"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Change member role via API</span></h2> <p data-svelte-h="svelte-hv65q4">You can change a member’s <strong>organization role</strong> (No Access / Read / Contributor / Write / Admin) and, optionally, their roles in <strong>resource groups</strong> using the Hub API. The API updates <strong>one member per request</strong>. To change roles for multiple members, call the API in a loop (examples below).</p> <p data-svelte-h="svelte-1xb4l2e"><strong>OpenAPI reference:</strong> <a href="https://huggingface.co/spaces/huggingface/openapi#tag/orgs/PUT/api/organizations/{name}/members/{username}/role" rel="nofollow">PUT /api/organizations/{name}/members/{username}/role</a></p> <h3 class="relative group"><a id="prerequisites" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#prerequisites"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Prerequisites</span></h3> <ul data-svelte-h="svelte-3ym87c"><li>Your organization must have a <strong>subscription plan</strong> (e.g. Team or Enterprise). The endpoint returns 402 otherwise.</li> <li>You must be authenticated as an organization member with <strong>Write</strong> (or Admin) permission on the organization.</li> <li>The target user must already be a <strong>member</strong> of the organization.</li></ul> <h3 class="relative group"><a id="base-url-and-authentication" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#base-url-and-authentication"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Base URL and authentication</span></h3> <ul><li data-svelte-h="svelte-18tpnan"><strong>Base URL:</strong> <code>https://huggingface.co</code></li> <li><strong data-svelte-h="svelte-1bhtzw8">Authentication:</strong> Send your token in the request header:
<div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-http "><!-- HTML_TAG_START --><span class="hljs-attribute">Authorization</span><span class="hljs-punctuation">: </span>Bearer &lt;your_access_token&gt;<!-- HTML_TAG_END --></pre></div>
Create a fine-grained token with the “Write access to organizations settings / member management” permission scoped to your org at <a href="https://huggingface.co/settings/tokens" rel="nofollow" data-svelte-h="svelte-w72yay">https://huggingface.co/settings/tokens</a>.</li></ul> <h3 class="relative group"><a id="change-member-role-endpoint" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#change-member-role-endpoint"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Change member role endpoint</span></h3> <p data-svelte-h="svelte-1bknlbw"><strong>Request</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-http "><!-- HTML_TAG_START -->PUT /api/organizations/{org_name}/members/{username}/role
<span class="hljs-attribute">Authorization</span><span class="hljs-punctuation">: </span>Bearer &lt;your_access_token&gt;
<span class="hljs-attribute">Content-Type</span><span class="hljs-punctuation">: </span>application/json
{
&quot;role&quot;: &quot;read&quot;,
&quot;resourceGroups&quot;: []
}<!-- HTML_TAG_END --></pre></div> <ul data-svelte-h="svelte-1f7ryej"><li><strong>Path parameters</strong> <ul><li><code>org_name</code>: Organization slug (e.g. <code>my-org</code>).</li> <li><code>username</code>: Hugging Face <strong>username</strong> of the member whose role you are changing.</li></ul></li> <li><strong>Body</strong> <ul><li><code>role</code> (required): The member’s <strong>organization-level</strong> role. One of: <code>&quot;no_access&quot;</code>, <code>&quot;read&quot;</code>, <code>&quot;contributor&quot;</code>, <code>&quot;write&quot;</code>, or <code>&quot;admin&quot;</code>.</li> <li><code>resourceGroups</code> (optional): Array of resource group assignments for this user. Each item:
<ul><li><code>id</code>: Resource group ID (24-character hex string; get IDs from the <a href="#list-resource-groups">resource groups list API</a>).</li> <li><code>role</code>: Role in that resource group: <code>&quot;read&quot;</code>, <code>&quot;contributor&quot;</code>, <code>&quot;write&quot;</code>, or <code>&quot;admin&quot;</code>.</li></ul></li> <li>If you omit <code>resourceGroups</code> or pass <code>[]</code>, the user is removed from all resource groups. To only change org role and leave resource groups unchanged, pass their current resource group memberships (the body always sets both org role and resource group list).</li></ul></li></ul> <p data-svelte-h="svelte-1lnlbbs"><strong>Example (curl) – set org role to “read”, no resource groups (removes any the user was previously in)</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->curl -s -X PUT \
-H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \
-H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \
-d <span class="hljs-string">&#x27;{&quot;role&quot;:&quot;read&quot;,&quot;resourceGroups&quot;:[]}&#x27;</span> \
<span class="hljs-string">&quot;https://huggingface.co/api/organizations/my-org/members/member1/role&quot;</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1ekc7tz"><strong>Example (curl) – set org role and resource group roles (overrides any current groups)</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->curl -s -X PUT \
-H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \
-H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \
-d <span class="hljs-string">&#x27;{&quot;role&quot;:&quot;write&quot;,&quot;resourceGroups&quot;:[{&quot;id&quot;:&quot;507f1f77bcf86cd799439011&quot;,&quot;role&quot;:&quot;read&quot;}]}&#x27;</span> \
<span class="hljs-string">&quot;https://huggingface.co/api/organizations/my-org/members/member2/role&quot;</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-qp26dr"><strong>Success response:</strong> Status <code>200 OK</code>; body: <code>{ &quot;success&quot;: true }</code>.</p> <p data-svelte-h="svelte-gm8qi4"><strong>Typical errors</strong></p> <ul data-svelte-h="svelte-395kcj"><li><code>400</code> — Invalid body (e.g. invalid role or resource group <code>id</code>).</li> <li><code>402</code> — Organization does not have a subscription plan.</li> <li><code>403</code> — Not allowed (e.g. you lack Write on the org, or a resource group is not in the org).</li> <li><code>404</code> — Organization or user not found.</li></ul> <h3 class="relative group"><a id="updating-multiple-members" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#updating-multiple-members"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Updating multiple members</span></h3> <p data-svelte-h="svelte-orhh56">The API changes <strong>one member per request</strong>. There is no bulk endpoint. To update many members, call the endpoint once per username (e.g. from a list or CSV).</p> <p data-svelte-h="svelte-l6l16h"><strong>Example: Bash – loop over usernames, same role for all</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->ORG_NAME=<span class="hljs-string">&quot;my-org&quot;</span>
ROLE=<span class="hljs-string">&quot;read&quot;</span>
<span class="hljs-keyword">for</span> username <span class="hljs-keyword">in</span> member1 member2 member3 member4; <span class="hljs-keyword">do</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;Setting <span class="hljs-variable">$username</span> to <span class="hljs-variable">$ROLE</span> ...&quot;</span>
curl -s -w <span class="hljs-string">&quot;\n%{http_code}&quot;</span> -X PUT \
-H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \
-H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \
-d <span class="hljs-string">&quot;{\&quot;role\&quot;:\&quot;<span class="hljs-variable">$ROLE</span>\&quot;,\&quot;resourceGroups\&quot;:[]}&quot;</span> \
<span class="hljs-string">&quot;https://huggingface.co/api/organizations/<span class="hljs-variable">$ORG_NAME</span>/members/<span class="hljs-variable">$username</span>/role&quot;</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;&quot;</span>
<span class="hljs-keyword">done</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-zwivtj"><strong>Example: Python – loop over usernames</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-python "><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> os
<span class="hljs-keyword">import</span> requests
BASE_URL = <span class="hljs-string">&quot;https://huggingface.co&quot;</span>
HF_TOKEN = os.environ.get(<span class="hljs-string">&quot;HF_TOKEN&quot;</span>, <span class="hljs-string">&quot;&quot;</span>)
<span class="hljs-keyword">def</span> <span class="hljs-title function_">change_member_role</span>(<span class="hljs-params">org_name: <span class="hljs-built_in">str</span>, username: <span class="hljs-built_in">str</span>, role: <span class="hljs-built_in">str</span>, resource_groups: <span class="hljs-built_in">list</span> | <span class="hljs-literal">None</span> = <span class="hljs-literal">None</span></span>):
payload = {<span class="hljs-string">&quot;role&quot;</span>: role, <span class="hljs-string">&quot;resourceGroups&quot;</span>: resource_groups <span class="hljs-keyword">or</span> []}
r = requests.put(
<span class="hljs-string">f&quot;<span class="hljs-subst">{BASE_URL}</span>/api/organizations/<span class="hljs-subst">{org_name}</span>/members/<span class="hljs-subst">{username}</span>/role&quot;</span>,
headers={<span class="hljs-string">&quot;Authorization&quot;</span>: <span class="hljs-string">f&quot;Bearer <span class="hljs-subst">{HF_TOKEN}</span>&quot;</span>, <span class="hljs-string">&quot;Content-Type&quot;</span>: <span class="hljs-string">&quot;application/json&quot;</span>},
json=payload,
)
<span class="hljs-keyword">if</span> r.status_code != <span class="hljs-number">200</span>:
<span class="hljs-keyword">raise</span> RuntimeError(<span class="hljs-string">f&quot;<span class="hljs-subst">{r.status_code}</span>: <span class="hljs-subst">{r.text}</span>&quot;</span>)
<span class="hljs-keyword">return</span> r.json()
org_name = <span class="hljs-string">&quot;my-org&quot;</span>
role = <span class="hljs-string">&quot;read&quot;</span>
<span class="hljs-keyword">for</span> username <span class="hljs-keyword">in</span> [<span class="hljs-string">&quot;member1&quot;</span>, <span class="hljs-string">&quot;member2&quot;</span>, <span class="hljs-string">&quot;member3&quot;</span>, <span class="hljs-string">&quot;member4&quot;</span>]:
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Setting <span class="hljs-subst">{username}</span> to <span class="hljs-subst">{role}</span> ... &quot;</span>, end=<span class="hljs-string">&quot;&quot;</span>)
<span class="hljs-keyword">try</span>:
change_member_role(org_name, username, role)
<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;OK&quot;</span>)
<span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Failed: <span class="hljs-subst">{e}</span>&quot;</span>)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1if35ss">For different roles per user, loop over <code>(username, role)</code> pairs (e.g. from a CSV) and call <code>change_member_role</code> for each.</p> <hr> <h2 class="relative group"><a id="resource-groups-api" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#resource-groups-api"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Resource Groups API</span></h2> <p data-svelte-h="svelte-cmfjcv">The following endpoints let you <strong>list</strong> resource groups and <strong>add</strong> users to them. To <strong>change</strong> an existing member’s organization-level role or their resource group assignments, see <a href="#change-member-role-via-api">Change member role via API</a> above.</p> <p data-svelte-h="svelte-1yekhpp"><strong>OpenAPI reference:</strong> <a href="https://huggingface.co/spaces/huggingface/openapi#tag/resource-groups" rel="nofollow">Resource groups</a></p> <p data-svelte-h="svelte-17ylcem"><strong>Table of contents — API approaches:</strong></p> <table data-svelte-h="svelte-1wasfs9"><thead><tr><th>Goal</th> <th>Section</th></tr></thead> <tbody><tr><td>Add many users to <strong>one</strong> resource group</td> <td><a href="#add-users-to-a-resource-group">Add users to a resource group</a></td></tr> <tr><td>Add the <strong>same</strong> users to <strong>many</strong> resource groups</td> <td><a href="#batch-add-by-looping-over-the-api">Batch-add by looping over the API</a></td></tr> <tr><td>Add <strong>different</strong> users per group</td> <td><a href="#batch-add-by-looping-over-the-api">Batch-add by looping over the API</a></td></tr></tbody></table> <h3 class="relative group"><a id="base-url-and-authentication" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#base-url-and-authentication"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Base URL and authentication</span></h3> <ul><li data-svelte-h="svelte-18tpnan"><strong>Base URL:</strong> <code>https://huggingface.co</code></li> <li><strong data-svelte-h="svelte-1bhtzw8">Authentication:</strong> Use one of:
<ul><li><strong data-svelte-h="svelte-sf8ei0">Access token (recommended for scripts):</strong> Create a fine-grained token with the “Write access to organizations settings / member management” permission scoped to your org at <a href="https://huggingface.co/settings/tokens" rel="nofollow" data-svelte-h="svelte-w72yay">https://huggingface.co/settings/tokens</a>. Send it in the request header:
<div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-http "><!-- HTML_TAG_START --><span class="hljs-attribute">Authorization</span><span class="hljs-punctuation">: </span>Bearer &lt;your_access_token&gt;<!-- HTML_TAG_END --></pre></div></li> <li data-svelte-h="svelte-1xd4q0u"><strong>Session cookie:</strong> If calling from a browser or tool that shares the same session as the Hub UI, the cookie is sent automatically.</li></ul></li></ul> <h3 class="relative group"><a id="list-resource-groups" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#list-resource-groups"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>List resource groups</span></h3> <p data-svelte-h="svelte-1x9jbje">Get all resource groups you can manage for the organization. Use this to obtain each group’s <code>id</code> for the add-users calls.</p> <p data-svelte-h="svelte-1bknlbw"><strong>Request</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-http "><!-- HTML_TAG_START -->GET /api/organizations/{org_name}/resource-groups
<span class="hljs-attribute">Authorization</span><span class="hljs-punctuation">: </span>Bearer &lt;your_access_token&gt;<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-qgzl6s"><strong>Example (curl)</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->curl -s -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \
<span class="hljs-string">&quot;https://huggingface.co/api/organizations/my-org/resource-groups&quot;</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1rc9xnt"><strong>Example response (trimmed)</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-json "><!-- HTML_TAG_START --><span class="hljs-punctuation">[</span>
<span class="hljs-punctuation">{</span>
<span class="hljs-attr">&quot;id&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;507f1f77bcf86cd799439011&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;name&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;Cohort 2024&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;description&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;Members in this group&quot;</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;users&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>...<span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
<span class="hljs-attr">&quot;repos&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>...<span class="hljs-punctuation">]</span>
<span class="hljs-punctuation">}</span>
<span class="hljs-punctuation">]</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1lcwki0">Use the <code>id</code> of each resource group when adding users.</p> <h3 class="relative group"><a id="add-users-to-a-resource-group" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#add-users-to-a-resource-group"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Add users to a resource group</span></h3> <p data-svelte-h="svelte-k89vs8">Add one or more users to a single resource group in one request. You can send multiple users in the same request.</p> <p data-svelte-h="svelte-1bknlbw"><strong>Request</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-http "><!-- HTML_TAG_START -->POST /api/organizations/{org_name}/resource-groups/{resource_group_id}/users
<span class="hljs-attribute">Authorization</span><span class="hljs-punctuation">: </span>Bearer &lt;your_access_token&gt;
<span class="hljs-attribute">Content-Type</span><span class="hljs-punctuation">: </span>application/json
{
&quot;users&quot;: [
{ &quot;user&quot;: &quot;member1&quot;, &quot;role&quot;: &quot;read&quot; },
{ &quot;user&quot;: &quot;member2&quot;, &quot;role&quot;: &quot;read&quot; },
{ &quot;user&quot;: &quot;member3&quot;, &quot;role&quot;: &quot;write&quot; }
]
}<!-- HTML_TAG_END --></pre></div> <ul data-svelte-h="svelte-15dn0qt"><li><strong>Path parameters</strong> <ul><li><code>org_name</code>: Organization slug (e.g. <code>my-org</code>).</li> <li><code>resource_group_id</code>: The resource group’s <code>id</code> (24-character hex string from the list endpoint).</li></ul></li> <li><strong>Body</strong> <ul><li><code>users</code>: Array of objects. Each object must have:
<ul><li><code>user</code>: Hugging Face <strong>username</strong> (required).</li> <li><code>role</code>: One of <code>&quot;read&quot;</code>, <code>&quot;contributor&quot;</code>, <code>&quot;write&quot;</code>, <code>&quot;admin&quot;</code>.</li></ul></li></ul></li></ul> <p data-svelte-h="svelte-qgzl6s"><strong>Example (curl)</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->curl -s -X POST \
-H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \
-H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \
-d <span class="hljs-string">&#x27;{&quot;users&quot;:[{&quot;user&quot;:&quot;member1&quot;,&quot;role&quot;:&quot;read&quot;},{&quot;user&quot;:&quot;member2&quot;,&quot;role&quot;:&quot;read&quot;}]}&#x27;</span> \
<span class="hljs-string">&quot;https://huggingface.co/api/organizations/my-org/resource-groups/507f1f77bcf86cd799439011/users&quot;</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-zy43qn"><strong>Success:</strong> Status <code>200 OK</code>; body is the updated resource group object (includes the new users in <code>users</code>).</p> <p data-svelte-h="svelte-1hh1f9i"><strong>Typical errors:</strong></p> <ul data-svelte-h="svelte-l4rjs3"><li><code>400</code> — e.g. user not found, duplicate usernames, or invalid body.</li> <li><code>403</code> — Not allowed (e.g. not in org, or already in the resource group). The message will indicate whether users are not in the organization or already in the group.</li></ul> <h3 class="relative group"><a id="adding-members-via-email-workaround" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#adding-members-via-email-workaround"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Adding members via email (workaround)</span></h3> <p data-svelte-h="svelte-h4m4ws">The add-users endpoint only accepts <strong>Hugging Face usernames</strong>, not emails. If you have a list of <strong>emails</strong> (e.g. member emails), you can resolve email → username first, then call the add-users API.</p> <p data-svelte-h="svelte-m8bh97">Note that email filtering <strong>only</strong> works when the email’s domain matches one of the organization’s allowed domains: the <strong>Organization email domain</strong> (Settings → Account → Organization email domain) and/or the org’s <strong>SSO allowed domains</strong> (if SSO is configured).</p> <p data-svelte-h="svelte-1lnox7s"><strong>Step 1 – Resolve email to username</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-http "><!-- HTML_TAG_START -->GET /api/organizations/{org_name}/members?email={email}&amp;limit=1
<span class="hljs-attribute">Authorization</span><span class="hljs-punctuation">: </span>Bearer &lt;your_access_token&gt;<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1y6um0d">Response is an array of members; each member has <code>user</code> (username). Use <code>user</code> for the add-users call.</p> <p data-svelte-h="svelte-1g507u7"><strong>Step 2 – Add to resource group</strong></p> <p data-svelte-h="svelte-mo0buh">Use the username from step 1 in a normal add-users request:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-http "><!-- HTML_TAG_START -->POST /api/organizations/{org_name}/resource-groups/{resource_group_id}/users
<span class="hljs-attribute">Content-Type</span><span class="hljs-punctuation">: </span>application/json
<span class="hljs-attribute">Body</span><span class="hljs-punctuation">: </span>{ &quot;users&quot;: [{ &quot;user&quot;: &quot;&lt;username from step 1&gt;&quot;, &quot;role&quot;: &quot;read&quot; }] }<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-h50uvw"><strong>Example: one email (bash)</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->ORG_NAME=<span class="hljs-string">&quot;my-org&quot;</span>
RG_ID=<span class="hljs-string">&quot;507f1f77bcf86cd799439011&quot;</span>
EMAIL=<span class="hljs-string">&quot;member@org.com&quot;</span>
<span class="hljs-comment"># Step 1: look up member by email (domain must match org&#x27;s Organization email domain or SSO allowed domains)</span>
MEMBERS=$(curl -s -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \
<span class="hljs-string">&quot;https://huggingface.co/api/organizations/<span class="hljs-variable">$ORG_NAME</span>/members?email=<span class="hljs-variable">$EMAIL</span>&amp;limit=1&quot;</span>)
USERNAME=$(<span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;<span class="hljs-variable">$MEMBERS</span>&quot;</span> | jq -r <span class="hljs-string">&#x27;(.[0] // {} | .user // &quot;&quot;)&#x27;</span>)
<span class="hljs-keyword">if</span> [ -z <span class="hljs-string">&quot;<span class="hljs-variable">$USERNAME</span>&quot;</span> ]; <span class="hljs-keyword">then</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;No member found for <span class="hljs-variable">$EMAIL</span>&quot;</span>
<span class="hljs-built_in">exit</span> 1
<span class="hljs-keyword">fi</span>
<span class="hljs-comment"># Step 2: add to resource group</span>
curl -s -X POST -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \
-d <span class="hljs-string">&quot;{\&quot;users\&quot;:[{\&quot;user\&quot;:\&quot;<span class="hljs-variable">$USERNAME</span>\&quot;,\&quot;role\&quot;:\&quot;read\&quot;}]}&quot;</span> \
<span class="hljs-string">&quot;https://huggingface.co/api/organizations/<span class="hljs-variable">$ORG_NAME</span>/resource-groups/<span class="hljs-variable">$RG_ID</span>/users&quot;</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-frbxbt"><strong>Example: multiple emails in a loop (Python)</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-python "><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> os
<span class="hljs-keyword">import</span> requests
BASE = <span class="hljs-string">&quot;https://huggingface.co&quot;</span>
ORG = <span class="hljs-string">&quot;my-org&quot;</span>
RG_ID = <span class="hljs-string">&quot;507f1f77bcf86cd799439011&quot;</span>
ROLE = <span class="hljs-string">&quot;read&quot;</span>
headers = {<span class="hljs-string">&quot;Authorization&quot;</span>: <span class="hljs-string">f&quot;Bearer <span class="hljs-subst">{os.environ[<span class="hljs-string">&#x27;HF_TOKEN&#x27;</span>]}</span>&quot;</span>, <span class="hljs-string">&quot;Content-Type&quot;</span>: <span class="hljs-string">&quot;application/json&quot;</span>}
emails = [<span class="hljs-string">&quot;member1@org.com&quot;</span>, <span class="hljs-string">&quot;member2@org.com&quot;</span>]
<span class="hljs-keyword">for</span> email <span class="hljs-keyword">in</span> emails:
<span class="hljs-comment"># Step 1: resolve email → username (email domain must match org&#x27;s Organization email domain or SSO allowed domains)</span>
r = requests.get(<span class="hljs-string">f&quot;<span class="hljs-subst">{BASE}</span>/api/organizations/<span class="hljs-subst">{ORG}</span>/members&quot;</span>, params={<span class="hljs-string">&quot;email&quot;</span>: email, <span class="hljs-string">&quot;limit&quot;</span>: <span class="hljs-number">1</span>}, headers=headers)
r.raise_for_status()
members = r.json()
<span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> members:
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;No member found for <span class="hljs-subst">{email}</span>&quot;</span>)
<span class="hljs-keyword">continue</span>
username = members[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;user&quot;</span>]
<span class="hljs-comment"># Step 2: add that user to the resource group</span>
add_r = requests.post(
<span class="hljs-string">f&quot;<span class="hljs-subst">{BASE}</span>/api/organizations/<span class="hljs-subst">{ORG}</span>/resource-groups/<span class="hljs-subst">{RG_ID}</span>/users&quot;</span>,
headers=headers,
json={<span class="hljs-string">&quot;users&quot;</span>: [{<span class="hljs-string">&quot;user&quot;</span>: username, <span class="hljs-string">&quot;role&quot;</span>: ROLE}]},
)
<span class="hljs-keyword">if</span> add_r.status_code == <span class="hljs-number">200</span>:
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Added <span class="hljs-subst">{username}</span> (<span class="hljs-subst">{email}</span>)&quot;</span>)
<span class="hljs-keyword">else</span>:
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Failed <span class="hljs-subst">{email}</span>: <span class="hljs-subst">{add_r.status_code}</span> <span class="hljs-subst">{add_r.text}</span>&quot;</span>)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1ed700w">If a user is already in the resource group, the add call returns <code>403</code>; the script reports it as a failure and you can skip or ignore that case if you prefer.</p> <p data-svelte-h="svelte-oolr2u"><strong>Limitation:</strong> The email filter only applies when the org has an <strong>Organization email domain</strong> and/or <strong>SSO allowed domains</strong> set, and the email’s domain matches one of them. Otherwise you cannot look up by email via the members API; you’d need another source for email → username (e.g. your own directory).</p> <h3 class="relative group"><a id="batch-add-by-looping-over-the-api" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#batch-add-by-looping-over-the-api"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Batch-add by looping over the API</span></h3> <p data-svelte-h="svelte-oswlta">You can add many users to <strong>one</strong> resource group in one or a few requests (e.g. chunk your list of usernames), or add users to <strong>several</strong> resource groups by looping over groups and calling the add-users endpoint for each.</p> <p data-svelte-h="svelte-17shy8v"><strong>Example: Bash – one group, multiple users in one request</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START --><span class="hljs-meta">#!/bin/bash</span>
<span class="hljs-comment"># Add a list of users to a single resource group.</span>
<span class="hljs-comment"># Usage: ./add-users-to-rg.sh &lt;org_name&gt; &lt;resource_group_id&gt; &lt;role&gt;</span>
ORG_NAME=<span class="hljs-string">&quot;<span class="hljs-variable">${1:-my-org}</span>&quot;</span>
RG_ID=<span class="hljs-string">&quot;<span class="hljs-variable">${2:-507f1f77bcf86cd799439011}</span>&quot;</span>
ROLE=<span class="hljs-string">&quot;<span class="hljs-variable">${3:-read}</span>&quot;</span>
USERS=<span class="hljs-string">&quot;member1 member2 member3 member4&quot;</span>
USERS_JSON=$(<span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;<span class="hljs-variable">$USERS</span>&quot;</span> | <span class="hljs-built_in">tr</span> <span class="hljs-string">&#x27; &#x27;</span> <span class="hljs-string">&#x27;\n&#x27;</span> | <span class="hljs-keyword">while</span> <span class="hljs-built_in">read</span> u; <span class="hljs-keyword">do</span>
[ -n <span class="hljs-string">&quot;<span class="hljs-variable">$u</span>&quot;</span> ] &amp;&amp; <span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;{\&quot;user\&quot;:\&quot;<span class="hljs-variable">$u</span>\&quot;,\&quot;role\&quot;:\&quot;<span class="hljs-variable">$ROLE</span>\&quot;}&quot;</span>
<span class="hljs-keyword">done</span> | <span class="hljs-built_in">paste</span> -sd <span class="hljs-string">&#x27;,&#x27;</span> -)
curl -s -w <span class="hljs-string">&quot;\nHTTP_STATUS:%{http_code}&quot;</span> -X POST \
-H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \
-H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \
-d <span class="hljs-string">&quot;{\&quot;users\&quot;:[<span class="hljs-variable">$USERS_JSON</span>]}&quot;</span> \
<span class="hljs-string">&quot;https://huggingface.co/api/organizations/<span class="hljs-variable">$ORG_NAME</span>/resource-groups/<span class="hljs-variable">$RG_ID</span>/users&quot;</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1s1t7yu"><strong>Example: Bash – loop over multiple groups</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START --><span class="hljs-comment"># Get group IDs and add users to each</span>
curl -s -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \
<span class="hljs-string">&quot;https://huggingface.co/api/organizations/my-org/resource-groups&quot;</span> \
| jq -r <span class="hljs-string">&#x27;.[].id&#x27;</span> \
| <span class="hljs-keyword">while</span> <span class="hljs-built_in">read</span> -r RG_ID; <span class="hljs-keyword">do</span>
[ -z <span class="hljs-string">&quot;<span class="hljs-variable">$RG_ID</span>&quot;</span> ] &amp;&amp; <span class="hljs-built_in">continue</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;Adding users to resource group <span class="hljs-variable">$RG_ID</span> ...&quot;</span>
curl -s -X POST -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \
-d <span class="hljs-string">&quot;{\&quot;users\&quot;:[<span class="hljs-variable">$USERS_JSON</span>]}&quot;</span> \
<span class="hljs-string">&quot;https://huggingface.co/api/organizations/my-org/resource-groups/<span class="hljs-variable">$RG_ID</span>/users&quot;</span>
<span class="hljs-keyword">done</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-tsom77"><strong>Example: Python – batch-add to one or many groups</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-python "><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> os
<span class="hljs-keyword">import</span> requests
BASE_URL = <span class="hljs-string">&quot;https://huggingface.co&quot;</span>
HF_TOKEN = os.environ.get(<span class="hljs-string">&quot;HF_TOKEN&quot;</span>, <span class="hljs-string">&quot;&quot;</span>)
<span class="hljs-keyword">def</span> <span class="hljs-title function_">list_resource_groups</span>(<span class="hljs-params">org_name: <span class="hljs-built_in">str</span></span>):
r = requests.get(
<span class="hljs-string">f&quot;<span class="hljs-subst">{BASE_URL}</span>/api/organizations/<span class="hljs-subst">{org_name}</span>/resource-groups&quot;</span>,
headers={<span class="hljs-string">&quot;Authorization&quot;</span>: <span class="hljs-string">f&quot;Bearer <span class="hljs-subst">{HF_TOKEN}</span>&quot;</span>},
)
r.raise_for_status()
<span class="hljs-keyword">return</span> r.json()
<span class="hljs-keyword">def</span> <span class="hljs-title function_">add_users_to_resource_group</span>(<span class="hljs-params">org_name: <span class="hljs-built_in">str</span>, resource_group_id: <span class="hljs-built_in">str</span>, users_with_roles: <span class="hljs-built_in">list</span></span>):
<span class="hljs-string">&quot;&quot;&quot;users_with_roles: list of {&quot;user&quot;: &quot;username&quot;, &quot;role&quot;: &quot;read&quot;|&quot;write&quot;|&quot;contributor&quot;|&quot;admin&quot;}&quot;&quot;&quot;</span>
r = requests.post(
<span class="hljs-string">f&quot;<span class="hljs-subst">{BASE_URL}</span>/api/organizations/<span class="hljs-subst">{org_name}</span>/resource-groups/<span class="hljs-subst">{resource_group_id}</span>/users&quot;</span>,
headers={<span class="hljs-string">&quot;Authorization&quot;</span>: <span class="hljs-string">f&quot;Bearer <span class="hljs-subst">{HF_TOKEN}</span>&quot;</span>, <span class="hljs-string">&quot;Content-Type&quot;</span>: <span class="hljs-string">&quot;application/json&quot;</span>},
json={<span class="hljs-string">&quot;users&quot;</span>: users_with_roles},
)
<span class="hljs-keyword">if</span> r.status_code != <span class="hljs-number">200</span>:
<span class="hljs-keyword">raise</span> RuntimeError(<span class="hljs-string">f&quot;Add users failed <span class="hljs-subst">{r.status_code}</span>: <span class="hljs-subst">{r.text}</span>&quot;</span>)
<span class="hljs-keyword">return</span> r.json()
<span class="hljs-comment"># Example: same users added to every resource group</span>
org_name = <span class="hljs-string">&quot;my-org&quot;</span>
role = <span class="hljs-string">&quot;read&quot;</span>
usernames = [<span class="hljs-string">&quot;member1&quot;</span>, <span class="hljs-string">&quot;member2&quot;</span>, <span class="hljs-string">&quot;member3&quot;</span>]
users_with_roles = [{<span class="hljs-string">&quot;user&quot;</span>: u, <span class="hljs-string">&quot;role&quot;</span>: role} <span class="hljs-keyword">for</span> u <span class="hljs-keyword">in</span> usernames]
<span class="hljs-keyword">for</span> rg <span class="hljs-keyword">in</span> list_resource_groups(org_name):
add_users_to_resource_group(org_name, rg[<span class="hljs-string">&quot;id&quot;</span>], users_with_roles)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-ivj66x">For a long list of usernames, chunk them (e.g. 50 per request) and call the API once per chunk to avoid large request bodies or timeouts.</p> <h3 class="relative group"><a id="important-notes" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#important-notes"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Important notes</span></h3> <ol data-svelte-h="svelte-16bh56t"><li><strong>Usernames only</strong> — The API accepts Hugging Face <strong>usernames</strong>, not emails. You need a mapping from email → username (e.g. from your directory or the org members list) before calling the API.</li> <li><strong>Users must be in the organization</strong> — Every user in the request must already be a member of the organization. Otherwise the request returns <code>403</code> with a message that some users are not in the org.</li> <li><strong>Idempotency</strong> — If a user is already in the resource group, the backend may return <code>403</code> for that request. Your script can catch errors and continue, or skip users already in the group if you first fetch the group’s <code>users</code> list.</li> <li><strong>Rate limits</strong> — For large batches, consider adding a short delay between requests (e.g. 0.5–1 second) to avoid hitting rate limits.</li> <li><strong>Token scope</strong> — The access token must have sufficient permissions for the organization (typically at least “Write access to organizations settings / member management”). Create and store the token securely; do not commit it to version control.</li></ol> <hr> <h2 class="relative group"><a id="configure-auto-join-via-api" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#configure-auto-join-via-api"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Configure auto-join via API</span></h2> <p data-svelte-h="svelte-qizcv9"><a href="./security-resource-groups#auto-join">Auto-join</a> automatically adds every org member to a Resource Group at a specified role. You can enable or disable it via the API.</p> <p data-svelte-h="svelte-1vs9tv6"><strong>Enable auto-join</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-http "><!-- HTML_TAG_START -->POST /api/organizations/{org_name}/resource-groups/{resource_group_id}/settings
<span class="hljs-attribute">Authorization</span><span class="hljs-punctuation">: </span>Bearer &lt;your_access_token&gt;
<span class="hljs-attribute">Content-Type</span><span class="hljs-punctuation">: </span>application/json
{
&quot;autoJoin&quot;: {
&quot;enabled&quot;: true,
&quot;role&quot;: &quot;read&quot;
}
}<!-- HTML_TAG_END --></pre></div> <ul data-svelte-h="svelte-hwa6zo"><li><strong>Path parameters</strong> <ul><li><code>org_name</code>: Organization slug (e.g. <code>my-org</code>).</li> <li><code>resource_group_id</code>: The Resource Group’s ID (24-character hex string; get IDs from the <a href="#list-resource-groups">list resource groups endpoint</a>).</li></ul></li> <li><strong>Body</strong> <ul><li><code>role</code>: The role to assign to all org members. One of <code>&quot;read&quot;</code>, <code>&quot;contributor&quot;</code>, <code>&quot;write&quot;</code>, or <code>&quot;admin&quot;</code>.</li></ul></li></ul> <p data-svelte-h="svelte-10i0amq">Enabling auto-join on an existing Resource Group immediately adds all current org members (backfill).</p> <p data-svelte-h="svelte-sp0syz"><strong>Disable auto-join</strong></p> <p data-svelte-h="svelte-1bt1qbi">Send the same request with <code>&quot;enabled&quot;: false</code>. The <code>role</code> field is not required when disabling:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-http "><!-- HTML_TAG_START -->POST /api/organizations/{org_name}/resource-groups/{resource_group_id}/settings
<span class="hljs-attribute">Authorization</span><span class="hljs-punctuation">: </span>Bearer &lt;your_access_token&gt;
<span class="hljs-attribute">Content-Type</span><span class="hljs-punctuation">: </span>application/json
{
&quot;autoJoin&quot;: {
&quot;enabled&quot;: false
}
}<!-- HTML_TAG_END --></pre></div> <blockquote class="note" data-svelte-h="svelte-1yxazvu"><p>Disabling auto-join does <strong>not</strong> remove members who were previously auto-joined. It only stops future org members from being added automatically. Existing members remain in the Resource Group.</p></blockquote> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/hub-docs/blob/main/docs/hub/programmatic-user-access-control.md" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg> <span data-svelte-h="svelte-zjs2n5"><span class="underline">Update</span> on GitHub</span></a> <p></p>
<script>
{
__sveltekit_1bollga = {
assets: "/docs/hub/pr_2521/en",
base: "/docs/hub/pr_2521/en",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/hub/pr_2521/en/_app/immutable/entry/start.d19e5ca7.js"),
import("/docs/hub/pr_2521/en/_app/immutable/entry/app.98ab229a.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 149],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
87.3 kB
·
Xet hash:
c7152c3de64c2f5086f21669d50e7146709e18bcdb8519d5d598ac211ba25f03

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.