> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/software-delivery-agent-apis/artifact-registry.md).

# 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](https://developer.harness.io/harness-platform/use-harness-platform/automation/api/add-and-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](https://developer.harness.io/harness-platform/use-harness-platform/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 `/+`:

```bash
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](https://developer.harness.io/artifact-registry/use-artifact-registry/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](https://developer.harness.io/artifact-registry/use-artifact-registry/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](https://developer.harness.io/artifact-registry/use-artifact-registry/manage-registries/ar-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](https://developer.harness.io/artifact-registry/use-artifact-registry/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](https://developer.harness.io/artifact-registry/use-artifact-registry/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](https://developer.harness.io/artifact-registry/use-artifact-registry/signing-keys) to set up signing.
