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.