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

Ingest Artifacts with the Webhook Signal API

Ingest CI-produced container images into the artifact tracker using the webhook signal API.

For a multi-component release, each component is often built by its own pipeline, and some of those pipelines run outside Harness or need to report an artifact asynchronously. The webhook signal API lets any such build system report a container image directly to Artifact Tracker, as an alternative to the Publish Events step described in Get started with Artifact Tracker and Changesets.

What you will learn from this topic

  • How the required headers authenticate a signal request

  • How the request body is structured for pipeline scope, event metadata, and images

  • How Release Management matches an ingested image to a service mapping, described under request body

  • How to interpret each response

  • How to call the API using the cURL examples

Before you begin

You need the following before you call the webhook signal API:

  • Service mapping: Create a service mapping for each component before you call the API. Release Management uses the mapping to match the ingested artifact to a Harness CD service, and a signal with no matching mapping does not get ingested. Go to Map your services to create one.

  • Account identifier: You need your Harness account identifier to send as the Harness-Account header. To find your Harness Account ID, navigate to Account Settings, then select Overview. Your account ID is also visible in your browser URL: app.harness.io/ng/account/<YOUR_ACCOUNT_ID>/....

  • Authentication: You need a bearer token or an x-api-key, depending on how your gateway authenticates requests.


Endpoint

The webhook signal API exposes the following endpoint:

Method

Path

eventType

POST

/api/v1/webhook/signal

ARTIFACT_TRACKER_SIGNAL


Headers

Every signal request requires the following headers:

Header
Required
Description

Harness-Account

Yes

Account identifier.

X-Idempotency-Key

Yes

Unique key per signal (max 512 characters). Reuse returns the existing signal instead of creating a duplicate.

Content-Type

Yes

application/json

Authorization

Env-dependent

Bearer token when calling through an authenticated gateway. Some gateways accept x-api-key instead, following the standard Harness API authentication header.


Request body

The request body has the following top-level fields:

Field
Type
Required
Description

eventType

string

Yes

Must be "ARTIFACT_TRACKER_SIGNAL".

pipeline

object

Yes*

Pipeline scope used to resolve org/project and match releases. *Required for successful ingest.

metadata

object

Yes

Event metadata. May be {}. Max 10 KiB.

artifacts

object

Yes†

Images to ingest. †Or provide metadata.artifacts_json instead.

pipeline

All fields are required when a pipeline is present.

Field
Type
Description

orgId

string

Organization identifier.

projectId

string

Project identifier.

identifier

string

Pipeline identifier.

executionId

string

Pipeline execution identifier.

Find these values in the pipeline's URL and YAML, or resolve them automatically when a Harness pipeline triggers the signal, using the expressions <+org.identifier>, <+project.identifier>, <+pipeline.identifier>, and <+pipeline.executionId>. Go to Harness variables.

Scope resolution

orgId and projectId must resolve to the same scope as the service mapping, or to a scope nested under it. Harness resolves scope using standard inheritance: a project inherits from its organization, and an organization inherits from its account. For example, a service mapping created at the organization scope matches a signal reported from a pipeline in any project within that organization.

metadata

Key
Required
Description

commit_sha

No

Latest Git commit SHA for the build.

repo_name

No

Repository name, for example acme/api.

branch

No

Git branch.

git_connector_ref

No

Git connector override for changeset resolution.

git_provider_type

No

Git provider type.

artifacts_json

No

JSON string of an artifacts payload when the top-level artifacts field is not set.

artifacts.images[]

Field
Type
Required
Description

imageName

string

Yes

Image reference, for example gcr.io/acme/api. The registry and path must match a service mapping when one exists.

tag

string

Yes

Image tag, for example v1.0.0.

url

string

No

Full image URL. Helps recover the registry when imageName has no host.

digest

string

No

Image digest.

Service mapping matching

imageName gcr.io/acme/api is matched to the registry gcr.io and path acme/api, using the account, organization, and project resolved from the headers and pipeline. If a mapping exists, Release Management links the artifact to it and may compute a changeset when a Git resolution is available. Without a mapping, Release Management still stores the artifact.


Responses

The API returns one of the following responses:

HTTP

status

Meaning

202

accepted

Signal accepted and queued.

200

already_processing

Same X-Idempotency-Key already used.

400

None

Invalid request.

413

None

Payload too large.

A successful response returns:


Verify the ingested artifact

A successful signal adds a new row to Artifact Explorer, with the artifact path, tag, registry, mapped service, and triggering build execution.

Artifact Explorer showing an artifact ingested through the webhook signal API
Artifact Explorer after a successful signal

Go to View artifact catalog and changesets to filter and inspect ingested artifacts in detail.


cURL examples

Set the following variables before running either example:

Ingest an image

Use metadata artifacts instead of top-level artifacts


Troubleshooting

These entries map each non-success response from the Responses table to the part of the request to check.

The request returns 400 Invalid request

Check that every required header is present, including Harness-Account and X-Idempotency-Key, that Content-Type is application/json, and that eventType is "ARTIFACT_TRACKER_SIGNAL". The body must include metadata and either artifacts or metadata.artifacts_json.

The request returns 413 Payload too large

The metadata object is limited to 10 KiB. Reduce what you send in metadata, or split the artifacts across separate signals, each with its own X-Idempotency-Key.

The request returns 200 already_processing

The X-Idempotency-Key was already used, so the API returned the existing signal instead of creating a new one. Send a new, unique key for each new signal.


Next steps

Last updated

Was this helpful?