Publish collection module version

Publish a collection module version with the Workbench CLI or direct API access.

Use rp publish from the Workbench CLI to publish a collection module version. The CLI command wraps the publish endpoint, handles auth from your .root-auth file, and prints the resulting live version. Direct API access is also supported for CI pipelines or scripts that don't run the CLI.

Prerequisites

Before you publish the collection module version:

  1. Push your local changes with rp push. Publishing promotes the current draft, so you can't publish changes that have not been pushed.
  2. Confirm your local collection module directory contains the .root-auth and .root-config.json files created by rp clone -cm.
  3. Confirm your API key has the publishProductModules permission.

Publish with the Workbench CLI

Run rp publish from the collection module directory:

rp publish

Publishing promotes the current draft to a new live version and bumps the sandbox version automatically.

To publish without an interactive confirmation prompt, pass --force:

rp publish --force

See the rp publish command reference for the full command details. To understand the sandbox and live version distinction, see Collection module environments.

Optional: Publish with the API

Send a POST request to the publish endpoint:

curl -XPOST -u '{{api_key}}:' '{{host}}/v1/apps/{{org_id}}/insurance/collection-modules/{{cm_key}}/publish?bumpSandbox=true'
KeyTypeDescription
api_keyAuth valueThe Root Platform API key used for Basic Auth. See Workbench CLI commands for how the CLI stores this in .root-auth.
hostURLThe Root Platform URL
org_idPath valueThe Root organisation ID
cm_keyPath valueThe collection module key. See Collection module settings for local module configuration.
bumpSandboxQuery valueWhen true, Root also bumps the sandbox version after publishing the live version.

This endpoint uses Basic Auth. Pass the Root Platform API key as the username and an empty password. The request requires the publishProductModules permission.

Verify the publish request

When the request succeeds, the collection module version is published and Root returns the same result used by rp publish. If the request fails, check that the Root Platform API key, Root organisation ID, collection module key, Root Platform URL, and publishProductModules permission are correct.