Skip to main content

Version tags from the CLI

A version tag (stable, latest, prod …) is a named pointer to one version of a project. Tags float: promoting a release is moving a tag, not changing a version. apiome tags lists, shows, creates, moves and deletes them.

Every command calls the REST surface under /v1/version-tags/{tenant_slug}/{project_id} with your API key, so a script or CI job can do the same as a person at a terminal.

Use it when you:

  • promote a release in CI by moving stable to the version you just published;
  • check who may be affected before you move a tag consumers follow;
  • see which version each tag of a project points to.

Before you start​

  • Install the CLI and sign in: see Install the CLI and the CLI quick-start. In CI, set APIOME_API_KEY, APIOME_BASE_URL and APIOME_TENANT_ID instead of signing in.
  • A project is named by its slug (payments-api) or UUID. A version is named by its label (2.1.0 or v2.1.0) or revision UUID.
  • Put --json before the command (apiome --json tags show …) to get machine-readable output.

The commands​

CommandWhat it doesREST
apiome tags list <project>A project's tags, the version each points to, its channel and creatorGET /v1/version-tags/{tenant}/{project}
apiome tags show <project> <tag>One tag in full, including whether it is immutable or protectedGET /v1/version-tags/{tenant}/{project}
apiome tags create <project> <tag> --version 2.1.0Point a new tag at a versionPOST /v1/version-tags/{tenant}/{project}
apiome tags update <project> <tag> --version 2.2.0Move a tag, after showing who may be affectedPATCH …/{tag_id}
apiome tags delete <project> <tag>Delete a tag after you type its name; the version is not touchedDELETE …/{tag_id}

Every option is listed in the apiome tags reference, with worked examples on Versions.

Promote a release with a tag​

The usual flow, by hand or in CI, after publishing 2.2.0:

apiome tags list payments-api
apiome tags update payments-api stable --version v2.2.0 --dry-run
apiome tags update payments-api stable --version v2.2.0 --yes
  1. List the tags to see where stable points now.
  2. Dry-run the move. It shows the current version and, best-effort, who may be affected: mock requests in the last 7 days, downloads of its frozen snapshot and the other tags on it. A figure Apiome cannot read shows as unavailable and never stops the move.
  3. Move it. In a script, --yes skips the question.

A tag that does not exist yet is made with apiome tags create payments-api stable --version v2.2.0. Tag names are lower-cased, 2–41 characters: a letter, then letters, digits or hyphens. Creating a name the project already has exits 6 — move it with tags update instead.

Locked tags​

  • An immutable tag can never be moved or deleted; tags update and tags delete exit 6. tags create asks before it makes one (--yes skips the question).
  • A protected tag can be deleted only by a tenant administrator.
  • Apiome keeps only a tag's current pointer and who created it, so there is no move history.

Unpublishing a version moves its tags back to the previous published version, unless you pass --keep-tags.

Exit codes​

ExitWhen
0Done
2A version or tag was not found, or --from-file cannot be read
6A tag name already exists, or an immutable tag was moved or deleted

The full list is on Exit codes.

Where next​