---
title: "Invite external user"
method: POST
path: "/api/organizations/{name}/resource-groups/{resourceGroupId}/invite"
tags: ["resource-groups"]
---

# Invite external user

`POST /api/organizations/{name}/resource-groups/{resourceGroupId}/invite`

## Request

- Base URL: `https://huggingface.co`
- URL: `https://huggingface.co/api/organizations/{name}/resource-groups/{resourceGroupId}/invite`
- Auth: HTTP bearer

Invite a user who is not yet an organization member into a resource group. On accepting, they only get access to that resource group, with the requested read or write role.

Requires external invites to be enabled in the organization's resource group settings, unless the caller is an organization admin.

## Path parameters

- `name` string, required
- `resourceGroupId` string, required

## Request body

- object
  - `username` string, required: Username of an existing Hugging Face user
  - `role` 'read' | 'write', required: Role the invitee gets inside the resource group

## Response `200`

The created invitation

- object
  - `id` string, required: A hex string of 24 characters representing an ObjectId.
  - `role` 'admin' | 'write' | 'contributor' | 'read' | 'no_access', required: Organization role the invitee joins with
  - `externalCollaborator` boolean: Whether the invitee is exempted from SSO enforcement
  - `expiresAt` string, date-time, required
  - `author` object: The user who issued the invitation
    - `_id` string, required: A hex string of 24 characters representing an ObjectId.
    - `orgs` object[]
      - `id` string, required
      - `name` string, required
      - `fullname` string, required
      - `avatarUrl` string, required
    - `avatarUrl` string, required
    - `fullname` string, required
    - `isPro` boolean, required
    - `user` string, required
    - `numModels` number
    - `numDatasets` number
    - `numSpaces` number
    - `numBuckets` number
    - `numKernels` number
    - `numDiscussions` number
    - `numPapers` number
    - `numUpvotes` number
    - `numLikes` number
    - `numFollowers` number
    - `numFollowing` number
    - `numFollowingOrgs` number
    - `details` string
    - `isFollowing` boolean
    - `reasonToFollow` string
    - `primaryOrgAvatarUrl` string
    - `serviceAccount` object: Set when the user is a service account
      - `id` string, required: A hex string of 24 characters representing an ObjectId.
      - `org` string, required
      - `orgAvatarUrl` string, required
      - `description` string
    - `type` 'user', required
  - `invitee` object, required
    - `_id` string, required: A hex string of 24 characters representing an ObjectId.
    - `orgs` object[]
      - `id` string, required
      - `name` string, required
      - `fullname` string, required
      - `avatarUrl` string, required
    - `avatarUrl` string, required
    - `fullname` string, required
    - `isPro` boolean, required
    - `user` string, required
    - `numModels` number
    - `numDatasets` number
    - `numSpaces` number
    - `numBuckets` number
    - `numKernels` number
    - `numDiscussions` number
    - `numPapers` number
    - `numUpvotes` number
    - `numLikes` number
    - `numFollowers` number
    - `numFollowing` number
    - `numFollowingOrgs` number
    - `details` string
    - `isFollowing` boolean
    - `reasonToFollow` string
    - `primaryOrgAvatarUrl` string
    - `serviceAccount` object: Set when the user is a service account
      - `id` string, required: A hex string of 24 characters representing an ObjectId.
      - `org` string, required
      - `orgAvatarUrl` string, required
      - `description` string
    - `type` 'user', required
  - `resourceGroup` object: Set when the invitation only grants access to one resource group
    - `id` string, required: A hex string of 24 characters representing an ObjectId.
    - `role` 'read' | 'write', required

## Changes

- **2026-10-21** `3284377d6609`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/huggingface/apis/hub-api-endpoints/changes/api/organizations/:name/resource-groups/:resourceGroupId/invite/post.md)

---

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