Skip to content

Start a project from a reusable pack

Before you begin

Plan
Included in Free, Pro and Team. How plans and limits work
Role
Viewer or higher to inspect packs, Editor or higher to save, install or delete a pack and Admin or higher to install changes to settings, chaos profiles or webhooks.
You need
  • A project
  • The [MockHub CLI](/guides/cli/install-and-connect/), connected to the project

Install a reusable pack to get working mocks and named fixtures without building every endpoint yourself.

The project dashboard has no tab for packs, so install one with the CLI or an AI assistant. The two that answer as a model’s API are also on the Mocks tab as New AI API endpoints. That adds their mocks beside the project’s own, where installing a pack replaces the project’s configuration; see Mock an LLM API.

  1. Run mockhub pack list --env staging. It prints every pack you can install, each with its id: users-crud, paginated-catalogue, payment-flow, openai-compatible and anthropic-messages for the starter packs, and a UUID for each saved version of your workspace’s own packs.

  2. Stop traffic to the project.

  3. Run mockhub pack apply users-crud --env staging, with the id of the pack you chose. The CLI prints the preview first: under changes, the mocks and other resources it adds, updates or deletes; under fixtureChanges, the saved fixtures it creates, updates or deletes; and a line saying the project’s access stays as it is.

  4. Confirm when asked, or add --yes in a script. Add --fixture <name> to initialise a fixture after installing.

A pack takes its id, never its name: mockhub pack apply "Users CRUD" is refused with Pack not found in this workspace.

A saved fixture the pack keeps under the same name but with other contents counts as replaced: the preview lists it under update, and a saved fixture the pack leaves out under delete.

A pack saved from a project with an OpenAPI contract carries it, and the preview lists the contract as added, updated or deleted like any other change.

A pack saved before contracts could travel, which includes the starter packs, cannot describe a contract or a mock whose Response templating is Serve as written. Installed into a project that has either, the preview says it is saved as config version 1 and lists what installing removes: the contract with all its revisions, and for each mock the pack keeps or deletes, its response served as written, its OpenAPI operation link or its import history. Confirming installs exactly that list; if the project changes first, nothing is installed and you run the command again for a fresh preview.

The CLI prints Pack installed. The project’s address serves the new mocks. Starter packs also apply their starting fixture, so records and scenario states are ready to use.

Starter pack id Try at your project’s address Starting state
Users CRUD users-crud GET /users, GET /users/u1, or POST /users with {"id":"u3","name":"Lin"} Two users, Ada and Grace
Paginated catalogue paginated-catalogue GET /products and GET /products?page=2 Two predictable product pages
Payment flow payment-flow POST /payments, then poll GET /payments/pay-1 Ready to create a payment; polling moves it from pending to settled

If the CLI says Pack definitions were saved, but runtime initialization failed, the definitions are saved but the starting records and scenario states were not set up, and the command exits 2. Read the problem it prints and fix its cause, then apply the pack’s named fixture with mockhub fixture apply. A project changed after the preview requires a fresh preview before installation.

Run mockhub pack save "Checkout API" --description "Orders and payments" --env staging with a personal token. The pack includes the project’s configuration and all saved fixture definitions. Capture runtime data as a fixture first to include particular records or scenario states.

The pack appears in mockhub pack list with "source": "workspace", its version and a UUID as its id. Saving the same name creates another immutable version with its own id. Install the version you want in another project by that id. A private pack has no starting fixture; add --fixture <name> when installing, or apply one with mockhub fixture apply afterwards.

Delete a version you no longer need with mockhub pack delete <id>, using a personal token; confirm when asked, or add --yes in a script. Deleting frees configuration storage. An AI assistant can delete one with the delete_pack tool.

  • Installation replaces the whole configuration and all saved fixture definitions. Resources left out of the pack are deleted.
  • A pack omits project identity, hostnames, logs, version history, deliveries and webhook signing secrets. Existing webhooks keep their signing secrets when updated.
  • A pack saves webhook header values as [REDACTED]. A webhook with headers therefore installs only into a project where a webhook of the same name already has them; anywhere else the preview refuses it with Webhook "Order created": The "X-Api-Key" header has no stored value to keep; send its value.
  • A pack never carries or changes who may call a project. Installing into a private project keeps it private with its keys and allow-list, and the preview says Access stays private: a pack never changes it.
  • Private packs stay in their workspace. Machine tokens can use starter packs and project fixtures; private packs require a human member or their personal token.
  • Deleting a saved pack version removes that version only; projects that installed it keep their configuration. Starter packs cannot be deleted. Saving after deleting the newest version reuses its number, with a new id.
  • Saved pack versions and fixtures count towards configuration storage. An installation can exceed this allowance even after a successful preview. Record and resource limits still apply.
  • Setting up records and scenario states is a separate step from saving the definitions. Stop traffic before installing; a failure in that step can leave records and scenario states partly reset.
  • Installing a pack copies the contract and each mock’s link and import history, so the target’s next import keeps what you customized. Its request logs, captures and checks stay behind.
  • A pack never changes an older pack’s stored content. Installing an older pack into a project with a contract removes what its preview lists.

Report a problem with this page