Harbor v2.0 REST API
Harbor's complete, first-party v2.0 REST API as published in the project's own repository (api/v2.0/swagger.yaml) — 135 paths, 203 operations and 153 definitions covering projects, repositories, artifacts, tags, labels, accessories, scanning, SBOMs, robot accounts, users and groups, quotas, registries, replication, retention, immutability, webhooks, preheat, garbage collection, audit logs, the Security Hub and system configuration. Authenticates with HTTP Basic; the base URL is the operator's own Harbor instance.
Operations 203
GET
/projects/{project_name_or_id}/metadatas/{meta_name}
Get the specific metadata of the specific project
#
PUT
/projects/{project_name_or_id}/metadatas/{meta_name}
Update the specific metadata for the specific project
#
DELETE
/projects/{project_name_or_id}/metadatas/{meta_name}
Delete the specific metadata for the specific project
#
GET
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}
Get the specific artifact
#
DELETE
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}
Delete the specific artifact
#
POST
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan
Scan the artifact
#
POST
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/stop
Cancelling a scan job for a particular artifact
#
GET
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/{report_id}/log
Get the log of the scan report
#
POST
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags
Create tag
#
DELETE
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags/{tag_name}
Delete tag
#
GET
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/accessories
List accessories
#
GET
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/vulnerabilities
Get the vulnerabilities addition of the specific artifact
#
GET
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/{addition}
Get the addition of the specific artifact
#
POST
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels
Add label to artifact
#
DELETE
/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels/{label_id}
Remove label from artifact
#
GET
/projects/{project_name_or_id}/scanner/candidates
Get scanner registration candidates for configurating project level scanner
#
GET
/audit-logs
Get recent logs of projects which the user is a member with project admin role, or return all audit logs for system admin user (deprecated)
#
GET
/auditlog-exts
Get recent logs of the projects which the user is a member with project_admin role, or return all audit logs for system admin user
#
GET
/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions
List executions for the given policy
#
GET
/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}
Get a execution detail by id
#
PATCH
/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}
Stop a execution
#
GET
/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks
List all the related tasks for the given execution
#
GET
/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks/{task_id}/logs
Get the log text stream of the specified task for the given execution
#
GET
/projects/{project_name_or_id}/immutabletagrules
List all immutable tag rules of current project
#
POST
/projects/{project_name_or_id}/immutabletagrules
Add an immutable tag rule to current project
#
PUT
/projects/{project_name_or_id}/immutabletagrules/{immutable_rule_id}
Update the immutable tag rule or enable or disable the rule
#
DELETE
/projects/{project_name_or_id}/immutabletagrules/{immutable_rule_id}
Delete the immutable tag rule.
#
GET
/projects/{project_name_or_id}/webhook/policies/{webhook_policy_id}
Get project webhook policy
#
PUT
/projects/{project_name_or_id}/webhook/policies/{webhook_policy_id}
Update webhook policy of a project.
#
DELETE
/projects/{project_name_or_id}/webhook/policies/{webhook_policy_id}
Delete webhook policy of a project
#
GET
/projects/{project_name_or_id}/webhook/policies/{webhook_policy_id}/executions
List executions for a specific webhook policy
#
GET
/projects/{project_name_or_id}/webhook/policies/{webhook_policy_id}/executions/{execution_id}/tasks
List tasks for a specific webhook execution
#
GET
/projects/{project_name_or_id}/webhook/policies/{webhook_policy_id}/executions/{execution_id}/tasks/{task_id}/log
Get logs for a specific webhook task
#
GET
/projects/{project_name_or_id}/webhook/lasttrigger
Get project webhook policy last trigger info
#
PUT
/users/{user_id}/sysadmin
Update a registered user to change to be an administrator of Harbor.
#
GET
/export/cve/executions
Get a list of specific scan data export execution jobs for a specified user
#
Documentation
📖
Documentation
https://goharbor.io/docs/2.15.0/
📖
APIReference
https://goharbor.io/docs/2.15.0/working-with-projects/using-api-explorer/
Specifications
Other Resources
🔗
SourceCode
https://github.com/goharbor/harbor
🔗
Overlay
https://raw.githubusercontent.com/api-evangelist/goharbor/refs/heads/main/overlays/goharbor-harbor-api-overlay.yaml
🔗
DataModel
https://raw.githubusercontent.com/api-evangelist/goharbor/refs/heads/main/data-model/goharbor-data-model.yml
🔗
ErrorCatalog
https://raw.githubusercontent.com/api-evangelist/goharbor/refs/heads/main/errors/goharbor-problem-types.yml
🔗
Webhooks
https://raw.githubusercontent.com/api-evangelist/goharbor/refs/heads/main/asyncapi/goharbor-webhooks.yml