Skip to content

Fix tokens management doc: token-id revoke API + 50 admin notifications - #2764

Open
Pierrci wants to merge 5 commits into
mainfrom
docs/fix-tokens-management
Open

Fix tokens management doc: token-id revoke API + 50 admin notifications#2764
Pierrci wants to merge 5 commits into
mainfrom
docs/fix-tokens-management

Conversation

@Pierrci

@Pierrci Pierrci commented Sep 4, 2026

Copy link
Copy Markdown
Member

Sections of enterprise-tokens-management drifted from the code:

  • Revoking via API: the endpoint now takes a token id (POST /api/organizations/:name/settings/tokens/:tokenId/revoke); the raw-token-value endpoint (POST .../settings/tokens/revoke with {"token": ...}) was removed in huggingface-internal/moon-landing#19474. Updated the curl example and the self-revoke note (now a 403 when the id matches the token used for auth).
  • Pending-token notifications: sent to up to 50 org admins, not 5 (huggingface-internal/moon-landing#19496).
  • New — Listing Tokens via API: documents GET /api/organizations/:name/settings/tokens (curl example, OpenAPI link for the schema, status:all vs revoked-hidden default). The endpoint existed in the code but was undocumented.

Everything else on the page was verified against the codebase and is accurate.

Note

Generated with Claude Code (GLM 5.3 Flash), agent acting for @Pierrci.


Note

Low Risk
Documentation-only updates to enterprise token management; no application code or runtime behavior changes.

Overview
Updates enterprise tokens management docs so they match current Hub behavior.

Pending-token emails now say up to 50 org admins are notified (was 5).

Adds Listing Tokens via API: GET /api/organizations/{name}/settings/tokens, with a curl example, OpenAPI link, and q=status:all to mirror the UI’s revoked-token toggle.

Revoking via API is rewritten for the token-id route POST .../settings/tokens/{TOKEN_ID}/revoke instead of posting the raw token to .../tokens/revoke. The self-revoke case is documented as a 403 when the id matches the bearer token; the shell-history tip for raw tokens is removed.

Reviewed by Cursor Bugbot for commit 99b328e. Bugbot is set up for automated code reviews on this repo. Configure here.

…ions

Two sections drifted from the code:

- The org revoke API now takes a token id (POST .../settings/tokens/:tokenId/revoke)
  instead of the raw token value in the body; the raw-value endpoint was removed
  in huggingface-internal/moon-landing#19474. Also: self-revoke now means "the
  token used for auth", stated as a 403.
- Pending-token notifications go to up to 50 admins, not 5
  (huggingface-internal/moon-landing#19496).

Generated with Claude Code (GLM 5.3 Flash), agent acting for @Pierrci
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Add a "Listing Tokens via API" section: GET /api/organizations/:name/settings/tokens
(auth, response fields, Link-header pagination, q filter with status:all),
matching GET /api/organizations/:name/settings/tokens in moon-landing.

Generated with Claude Code (GLM 5.3 Flash), agent acting for @Pierrci
Generated with Claude Code (GLM 5.3 Flash), agent acting for @Pierrci
@Pierrci
Pierrci marked this pull request as ready for review September 4, 2026 20:01
Listing is a standalone feature; it was nested under Revoking Tokens.

Generated with Claude Code (GLM 5.3 Flash), agent acting for @Pierrci
Page-top warning already covers the feature; per-section warnings only
mark the Enterprise-only pieces (revocation).

Generated with Claude Code (GLM 5.3 Flash), agent acting for @Pierrci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants