Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Artifact Registry

Manage registries, artifacts, webhooks, lifecycle rules, and signing keys with the Harness Artifact Registry API.

The Artifact Registry API manages registries in Harness Artifact Registry and the artifacts, packages, and policies inside them.

Request basics

  • API key token: Send it in the x-api-key header on every request. Go to Manage API keys to create a key and token.

  • Account, organization, and project IDs: Send your account ID as the account_identifier query parameter on almost every request. This API uses snake case, so organization and project IDs are org_identifier and project_identifier. Go to Organizations and projects to find these identifiers.

  • Base URL: Send requests to https://app.harness.io/har/api, followed by the endpoint path.

  • Scope reference: Endpoints that take a space_ref expect the scope as a path, ending in /+: ACCOUNT_ID/+, ACCOUNT_ID/ORG_ID/+, or ACCOUNT_ID/ORG_ID/PROJECT_ID/+.

Example request

List the registries in a project. The scope goes in the path, ending in /+:

curl "https://app.harness.io/har/api/v1/spaces/ACCOUNT_ID/ORG_ID/PROJECT_ID/+/registries" \
  -H "x-api-key: $HARNESS_API_KEY"

Replace ACCOUNT_ID, ORG_ID, and PROJECT_ID with your own values, and set HARNESS_API_KEY to your API key token.

Find an endpoint

Endpoint paths are relative to the base URL.

  • Registries: Containers for one artifact type, either holding your own artifacts or proxying a public source upstream. List registries with GET /v1/spaces/{space_ref}/registries and create one with POST /v1/registry. Go to Manage Registries to create and manage registries.

  • Artifacts, packages, and versions: The images and packages stored in a registry, and every version of each. List a registry's artifacts with GET /v1/registry/{registry_ref}/artifacts, and an artifact's versions with GET /v1/registry/{registry_ref}/artifact/{artifact}/versions. Go to Manage Artifacts to manage artifacts.

  • Webhooks: Calls Harness sends to another system when an artifact is pushed or deleted. List a registry's webhooks with GET /v1/registry/{registry_ref}/webhooks and add one with POST /v1/registry/{registry_ref}/webhooks. Go to Webhooks to configure webhooks.

  • Dependency firewall: Policies that block packages with known vulnerabilities or unwanted licences before they enter a registry. Read scan results with GET /v3/scans, and evaluate an artifact again with POST /v3/scans/evaluate. Go to Dependency Firewall to set up the firewall.

  • Lifecycle rules: Cleanup and retention rules that decide which artifact versions to keep and which to delete. List rules with GET /v3/lifecycle/rules, create one with POST /v3/lifecycle/rules, and try a rule without deleting anything with POST /v3/lifecycle/executions. Go to Lifecycle Rules to create a lifecycle rule.

  • Signing keys: Keys that sign artifacts so consumers can confirm where they came from. List keys with GET /v3/signing-keys and generate one with POST /v3/signing-keys/generate. Go to Signing Keys to set up signing.

Last updated

Was this helpful?