Skip to content

Instantly share code, notes, and snippets.

@Vaibhavs10
Created February 8, 2025 10:25
Show Gist options
  • Save Vaibhavs10/c14affe0b84d0114628c3334c114782b to your computer and use it in GitHub Desktop.
Save Vaibhavs10/c14affe0b84d0114628c3334c114782b to your computer and use it in GitHub Desktop.

For information, we shipped APIs for managing organization members that should facilitate your integration with the HF Hub. They all support authentication with User Access Tokens passed as a Bearer token.

The mutating operations require an Enterprise subscription.

HTTP GET /api/organizations/:name/members

Retrieve org member information. Includes the role of the users if the requester is a member of the organization. Includes the primary email address if the requester is an admin of the org and SSO is enabled for the organization.

HTTP DELETE /api/organizations/:name/members/:username

Removes a user from the organization. Requires admin permissions.

HTTP PUT /api/organizations/:name/members/:username/role

Changes the role of an organization member. The role must be passed in the request body (ex JSON: { "role": "contributor" } ).

HTTP POST /api/organizations/:name/members/invite

Sends an invitation to an existing HF user to join the organization. role must be specified in the body, as well as one of username or email. The user can then accept or reject the invitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment