capabilities.work

Create Repository and Configure

A 3-step recipe with Hugging Face. We can help you get access.

Recipe · 3 steps

Create Repository and Configure

Create a Hub repository and apply visibility and gating settings.

  1. Confirm the authenticated user and capture their name to use as the default owning namespace.
  2. Create the new repository. A 200 returns the repository URL; a 409 means a repository with this name already exists.
  3. Apply the visibility and access gating settings to the newly created repository using its owning namespace and name.
What you'll need to have ready
  • hfToken: Hugging Face access token used as a Bearer credential.
  • name: The repository name to create (without the namespace prefix).
  • type: Repository type to create (singular form used by createRepo).
  • repoTypePlural: Repository type in the plural form required by the settings path segment (models, datasets, or spaces).
  • organization: Optional organization namespace to create the repo under.
  • private: Whether the repository should be private.
  • gated: Access gating configuration to apply after creation.
For your developer

Arazzo workflow hugging-face:create-repo-and-configure, 3 operations: whoami → createRepo → updateRepoSettings. Specs on APIs.io.