API endpoint extraction and enrichment
Learn how Harness IDP automatically extracts endpoints from an OpenAPI spec into Ingested Properties, and how to write custom enrichment metadata to individual endpoints using the Catalog Custom Prope
When you register a catalog entity with kind: API and type: openapi, Harness IDP automatically parses the OpenAPI spec you provide and extracts a structured, trimmed representation of its endpoints. This extracted data appears in the entity's Ingested Properties under metadata.apis and can then be enriched with custom metadata from your own tools, scripts, or external services.
This page explains what gets extracted, how to configure the entity definition so extraction works reliably, and how to write enrichment data to individual endpoints using the Catalog Custom Properties API.
Before you begin
This feature is gated behind the IDP_API_ENDPOINT_EXTRACTION feature flag. Contact Harness Support to enable it for your account.
How endpoint extraction works
After an API entity is saved, IDP parses spec.definition and extracts each endpoint from the spec.

Rather than storing the full specification (which can run to tens of thousands of lines), IDP stores only the operationally relevant fields per endpoint: path, HTTP method, summary, operation ID, and tags. This trimmed representation is stored in the entity's Ingested Properties under metadata.apis (explained in the next section).
Extraction runs each time the entity is created or updated in IDP. For specs provided via a Git placeholder or a bare URL, IDP also re-fetches and re-parses the spec automatically every 6 hours when the source changes. If you use an inline spec, re-save the entity YAML whenever the spec changes to trigger a fresh parse.
The metadata.apis structure
After a successful extraction, the entity's Ingested Properties contain a metadata.apis block. Here is an example for a spec with two endpoints:

Every field in metadata.apis except enrichments is system-managed. IDP writes those fields during extraction and they cannot be modified through the API. Attempting to write to any system-managed path returns HTTP 400. The enrichments: {} block on each endpoint is the only location where you or an external service can write data.
Configure the spec for extraction
Endpoint extraction relies on IDP being able to read the OpenAPI spec. The method you use to provide the spec in spec.definition determines what prerequisites you need.
Method 1: Inline spec definition
You can embed the entire OpenAPI spec (either in JSON or YAML) directly inside the entity YAML using a literal block scalar in spec.definition:
Method 2: Git-hosted spec via placeholders
If your spec lives in a Git repository, reference it using a placeholder in spec.definition. The placeholder tells IDP what file format to expect when it fetches the content:
$yaml
A YAML file (.yaml or .yml)
$json
A JSON file (.json)
$text
Any other text format, or when the file type is ambiguous
Placeholders in Harness IDP support only Git-based URLs (GitHub, GitLab, Bitbucket, Azure Repo). They do not resolve arbitrary public HTTP URLs. If you have a spec hosted at a non-Git HTTP endpoint, use the bare-URL method mentioned in this doc. Users familiar with open-source Backstage may expect any HTTP URL to work here; that is not the case in Harness IDP.
Using a Git placeholder requires two additional prerequisites.
Prerequisite 1: Configure a Git Integration
A Git Integration supplies the credentials IDP uses when fetching the spec. Go to Configure → Git Integrations, select + New Git Integration, and choose your provider. Select an existing Harness connector or create one, validate permissions, and save.

Prerequisite 2: Add the source-location annotation (private repositories only)
For private repositories, add the backstage.io/source-location annotation to your entity YAML, pointing to the repository root. IDP uses this annotation to resolve the correct Git credentials during the fetch:
This annotation is not required for public Git repositories.
Method 3: Bare URL (public HTTP)
If the spec is hosted at a publicly accessible non-Git URL, provide the URL directly as the value of spec.definition, without a $ placeholder prefix:
IDP fetches the URL directly. No Git Integration is needed. However, for the spec to render in the UI, the domain must also be added to the URL Allow List.
Configure the URL Allow List (for UI rendering)
In IDP, go to Configure → URL Allow List and add the host of the URL where your spec is served. You can use a wildcard to cover subdomains (for example, *.swagger.io). Subdirectory matching is supported with a trailing slash (for example, /v2/ matches /v2/swagger.json).

Enrich endpoint data
Once endpoints are extracted, you can attach custom metadata to any endpoint using the Catalog Custom Properties (CCP) API. Enrichments are stored separately from the extracted spec data and are never written to the entity's catalog-info.yaml in Git. Any service or tool that can make an authenticated HTTP request can write enrichments: your own scripts, CI/CD steps, or external integrations.
Go to the Catalog Ingestion API reference to review the general CCP API contract.
The writable path
The property path for any enrichment write is:
The endpoint key (for example, GET /v1/organisations) contains a space, so it must be wrapped in escaped double quotes when used in the dotted property path:
Any depth below enrichments is valid and is created automatically:
Request format
Endpoint: POST /v1/catalog/custom-properties/entity
Headers:
You can get accountId and PAT token as shown below:

Body:
replace (default)
Sets or overwrites the value at the path. Applied if mode is omitted or unrecognized.
append
For arrays, concatenates new items onto the existing list. For objects, merges keys. For scalars, behaves like replace.
Examples
Write a scalar value
Results
Successful Curl Request

Successful Enrichment of API Endpoint

The endpoint key in the property path must match exactly what appears under metadata.apis.paths in Ingested Properties, including the server base path prefix. In this example the spec defines servers.url as https://api.example.com/v1, so IDP prepends /v1 to every endpoint path when building the key. Check Entity Inspector → Ingested Properties for the exact keys on your entity before writing enrichments.
Write multiple properties at once
Multiple properties for the same endpoint (or across different endpoints) can be written in a single request:
Write a list, then extend it
First write (sets the list):
Second write (adds to the list without overwriting):
Result: compliance: [pci, gdpr, soc2]
Write a nested object
Result:
What is blocked
All fields under metadata.apis other than enrichments are system-managed. Writes to these paths return HTTP 400 INVALID_REQUEST:
metadata.apis
System-managed root
metadata.apis.count
Set by the extraction process
metadata.apis.specHash
Set by the extraction process
metadata.apis.paths."GET /v1/organisations".summary
Endpoint field, not under enrichments
metadata.apis.paths."GET /v1/organisations".method
Endpoint field, not under enrichments
Writes to paths outside metadata.apis (for example, metadata.team) are normal custom property writes and are not restricted.
Read enrichments
The merged result is also visible in the Entity Inspector under Ingested Properties.
Delete an enrichment
Enrichment lifecycle
Enrichments are stored separately from the extracted spec data. When the spec re-fetches and extraction runs again, enrichments for endpoints still present in the spec carry forward unchanged. If an endpoint is removed from the spec, all enrichments for that endpoint are deleted along with it.
Avoid writing to a property path that names a non-existent endpoint key. The request will succeed, but the enrichment will never appear in Ingested Properties because no extraction result exists to attach it to.
Frequently asked questions
Last updated
Was this helpful?