Harbor

Harbor API

These APIs provide services for manipulating Harbor project.

Developer tools#openapi

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

These APIs provide services for manipulating Harbor project.

Endpoints 208

health

  • GETCheck the status of Harbor components/healthCheck the status of Harbor components. This path does not require authentication.

search

  • GETSearch for projects and repositories/search?q=stringThe Search endpoint returns information about the projects and repositories offered at public status or related to the current logged in user. The response…

statistic

  • GETGet the statistic information about the projects and repositories/statisticsGet the statistic information about the projects and repositories

Ldap

  • POSTPing available ldap service./ldap/pingThis endpoint ping the available ldap service for test related configuration parameters.
  • GETSearch available ldap users./ldap/users/search?username=stringThis endpoint searches the available ldap users based on related configuration parameters. Support searched by input ldap configuration, load configuration…
  • POSTImport selected available ldap users./ldap/users/importThis endpoint adds the selected available ldap users to harbor based on related configuration parameters from the system. System will try to guess the user…
  • GETSearch available ldap groups./ldap/groups/search?groupname=string&groupdn=stringThis endpoint searches the available ldap groups based on related configuration parameters. support to search by groupname or groupdn.

configure

  • GETGet internal configurations./internalconfigThis endpoint is for retrieving system configurations that only provides for internal api call.
  • GETGet system configurations./configurationsThis endpoint is for retrieving system configurations that only provides for admin user.
  • PUTModify system configurations./configurationsThis endpoint is for modifying system configurations that only provides for admin user.

project

  • GETList projects/projects?q=string&page=1&page_size=10&sort=string&name=string&public=true&owner=string&with_detail=trueThis endpoint returns projects created by Harbor.
  • POSTCreate a new project./projectsThis endpoint is for user to create a new project.
  • HEADCheck if the project name user provided already exists./projects?project_name=stringThis endpoint is used to check if the project name provided already exist.
  • GETReturn specific project detail information/projects/:project_name_or_idThis endpoint returns specific project information by project ID.
  • PUTUpdate properties for a selected project./projects/:project_name_or_idThis endpoint is aimed to update the properties of a project.
  • DELETEDelete project by projectID/projects/:project_name_or_idThis endpoint is aimed to delete project by project ID.
  • GETGet the deletable status of the project/projects/:project_name_or_id/_deletableGet the deletable status of the project
  • GETGet summary of the project./projects/:project_name_or_id/summaryGet summary of the project.
  • GETList artifacts/projects/:project_name_or_id/artifacts?q=string&sort=string&page=1&page_size=10&with_tag=true&with_label=false&with_scan_overview=false&with_sbom_overview=false&with_immutable_status=false&with_accessory=false&with_inherited_accessory=false&latest_in_repository=falseList artifacts of the specified project
  • GETGet project level scanner/projects/:project_name_or_id/scannerGet the scanner registration of the specified project. If no scanner registration is configured for the specified project, the system default scanner…
  • PUTConfigure scanner for the specified project/projects/:project_name_or_id/scannerSet one of the system configured scanner registration as the indepndent scanner of the specified project.
  • GETGet scanner registration candidates for configurating project level scanner/projects/:project_name_or_id/scanner/candidates?q=string&sort=string&page=1&page_size=10Retrieve the system configured scanner registrations as candidates of setting project level scanner.
  • GETGet recent logs of the projects (deprecated)/projects/:project_name/logs?q=string&sort=string&page=1&page_size=10Get recent logs of the projects, it only query the previous version's audit log
  • GETGet recent logs of the projects/projects/:project_name/auditlog-exts?q=string&sort=string&page=1&page_size=10Get recent logs of the projects

member

  • GETGet all project member information/projects/:project_name_or_id/members?page=1&page_size=10&entityname=stringGet all project member information
  • POSTCreate project member/projects/:project_name_or_id/membersCreate project member relationship, the member can be one of the user_member and group_member, The user_member need to specify user_id or username. If the…
  • GETGet the project member information/projects/:project_name_or_id/members/:midGet the project member information
  • PUTUpdate project member/projects/:project_name_or_id/members/:midUpdate project member relationship
  • DELETEDelete project member/projects/:project_name_or_id/members/:midRemove the specified project member from the project.

projectMetadata

  • GETGet the metadata of the specific project/projects/:project_name_or_id/metadatas/Get the metadata of the specific project
  • POSTAdd metadata for the specific project/projects/:project_name_or_id/metadatas/Add metadata for the specific project
  • GETGet the specific metadata of the specific project/projects/:project_name_or_id/metadatas/:meta_nameGet the specific metadata of the specific project
  • PUTUpdate the specific metadata for the specific project/projects/:project_name_or_id/metadatas/:meta_nameUpdate the specific metadata for the specific project
  • DELETEDelete the specific metadata for the specific project/projects/:project_name_or_id/metadatas/:meta_nameDelete the specific metadata for the specific project

repository

  • GETList all authorized repositories/repositories?q=string&sort=string&page=1&page_size=10List all authorized repositories
  • GETList repositories/projects/:project_name/repositories?q=string&sort=string&page=1&page_size=10List repositories of the specified project
  • GETGet repository/projects/:project_name/repositories/:repository_nameGet the repository specified by name
  • PUTUpdate repository/projects/:project_name/repositories/:repository_nameUpdate the repository specified by name
  • DELETEDelete repository/projects/:project_name/repositories/:repository_nameDelete the repository specified by name

artifact

  • GETList artifacts/projects/:project_name/repositories/:repository_name/artifacts?q=string&sort=string&page=1&page_size=10&with_tag=true&with_label=false&with_scan_overview=false&with_sbom_overview=false&with_immutable_status=false&with_accessory=false&with_inherited_accessory=falseList artifacts under the specific project and repository. Except the basic properties, the other supported queries in "q" includes "tags=*" to list only…
  • POSTCopy artifact/projects/:project_name/repositories/:repository_name/artifacts?from=stringCopy the artifact specified in the "from" parameter to the repository.
  • GETGet the specific artifact/projects/:project_name/repositories/:repository_name/artifacts/:reference?page=1&page_size=10&with_tag=true&with_label=false&with_scan_overview=false&with_sbom_overview=false&with_accessory=false&with_inherited_accessory=false&with_signature=false&with_immutable_status=falseGet the artifact specified by the reference under the project and repository. The reference can be digest or tag.
  • DELETEDelete the specific artifact/projects/:project_name/repositories/:repository_name/artifacts/:referenceDelete the artifact specified by the reference under the project and repository. The reference can be digest or tag
  • GETList tags/projects/:project_name/repositories/:repository_name/artifacts/:reference/tags?q=string&sort=string&page=1&page_size=10&with_immutable_status=falseList tags of the specific artifact
  • POSTCreate tag/projects/:project_name/repositories/:repository_name/artifacts/:reference/tagsCreate a tag for the specified artifact
  • DELETEDelete tag/projects/:project_name/repositories/:repository_name/artifacts/:reference/tags/:tag_nameDelete the tag of the specified artifact
  • GETList accessories/projects/:project_name/repositories/:repository_name/artifacts/:reference/accessories?q=string&sort=string&page=1&page_size=10List accessories of the specific artifact
  • GETGet the vulnerabilities addition of the specific artifact/projects/:project_name/repositories/:repository_name/artifacts/:reference/additions/vulnerabilitiesGet the vulnerabilities addition of the artifact specified by the reference under the project and repository.
  • GETGet the addition of the specific artifact/projects/:project_name/repositories/:repository_name/artifacts/:reference/additions/:additionGet the addition of the artifact specified by the reference under the project and repository.
  • POSTAdd label to artifact/projects/:project_name/repositories/:repository_name/artifacts/:reference/labelsAdd label to the specified artiact.
  • DELETERemove label from artifact/projects/:project_name/repositories/:repository_name/artifacts/:reference/labels/:label_idRemove the label from the specified artiact.

scan

  • POSTScan the artifact/projects/:project_name/repositories/:repository_name/artifacts/:reference/scanScan the specified artifact
  • POSTCancelling a scan job for a particular artifact/projects/:project_name/repositories/:repository_name/artifacts/:reference/scan/stopCancelling a scan job for a particular artifact
  • GETGet the log of the scan report/projects/:project_name/repositories/:repository_name/artifacts/:reference/scan/:report_id/logGet the log of the scan report

auditlog

  • GETGet recent logs of projects which the user is a member with project admin role, or return all audit logs for system admin user (deprecated)/audit-logs?q=string&sort=string&page=1&page_size=10This endpoint let the user see the recent operation logs of projects which the user is a member with project admin role,, or return all audit logs for system…
  • GETGet recent logs of the projects which the user is a member with project_admin role, or return all audit logs for system admin user/auditlog-exts?q=string&sort=string&page=1&page_size=10This endpoint let user see the recent operation logs of the projects which he is member with project_admin role, or return all audit logs for system admin user.
  • GETGet all event types of audit log/auditlog-exts/eventsGet all event types of audit log

preheat

  • GETList P2P providers/p2p/preheat/providersList P2P providers
  • POSTPing status of a instance./p2p/preheat/instances/pingThis endpoint checks status of a instance, the instance can be given by ID or Endpoint URL (together with credential)
  • GETList P2P provider instances/p2p/preheat/instances?page=1&page_size=10&q=string&sort=stringList P2P provider instances
  • POSTCreate p2p provider instances/p2p/preheat/instancesCreate p2p provider instances
  • GETGet a P2P provider instance/p2p/preheat/instances/:preheat_instance_nameGet a P2P provider instance
  • PUTUpdate the specified P2P provider instance/p2p/preheat/instances/:preheat_instance_nameUpdate the specified P2P provider instance. If auth_info is omitted or empty in the request body and the effective auth_mode is not NONE (either sent in the…
  • DELETEDelete the specified P2P provider instance/p2p/preheat/instances/:preheat_instance_nameDelete the specified P2P provider instance
  • GETList preheat policies/projects/:project_name/preheat/policies?page=1&page_size=10&q=string&sort=stringList preheat policies
  • POSTCreate a preheat policy under a project/projects/:project_name/preheat/policiesCreate a preheat policy under a project
  • GETGet a preheat policy/projects/:project_name/preheat/policies/:preheat_policy_nameGet a preheat policy
  • PUTUpdate preheat policy/projects/:project_name/preheat/policies/:preheat_policy_nameUpdate preheat policy
  • POSTManual preheat/projects/:project_name/preheat/policies/:preheat_policy_nameManual preheat
  • DELETEDelete a preheat policy/projects/:project_name/preheat/policies/:preheat_policy_nameDelete a preheat policy
  • GETList executions for the given policy/projects/:project_name/preheat/policies/:preheat_policy_name/executions?page=1&page_size=10&q=string&sort=stringList executions for the given policy
  • GETGet a execution detail by id/projects/:project_name/preheat/policies/:preheat_policy_name/executions/:execution_idGet a execution detail by id
  • PATCHStop a execution/projects/:project_name/preheat/policies/:preheat_policy_name/executions/:execution_idStop a execution
  • GETList all the related tasks for the given execution/projects/:project_name/preheat/policies/:preheat_policy_name/executions/:execution_id/tasks?page=1&page_size=10&q=string&sort=stringList all the related tasks for the given execution
  • GETGet the log text stream of the specified task for the given execution/projects/:project_name/preheat/policies/:preheat_policy_name/executions/:execution_id/tasks/:task_id/logsGet the log text stream of the specified task for the given execution
  • GETGet all providers at project level/projects/:project_name/preheat/providersGet all providers at project level

immutable

  • GETList all immutable tag rules of current project/projects/:project_name_or_id/immutabletagrules?page=1&page_size=10&q=string&sort=stringThis endpoint returns the immutable tag rules of a project
  • POSTAdd an immutable tag rule to current project/projects/:project_name_or_id/immutabletagrulesThis endpoint add an immutable tag rule to the project
  • PUTUpdate the immutable tag rule or enable or disable the rule/projects/:project_name_or_id/immutabletagrules/:immutable_rule_idUpdate or toggle the specified immutable tag rule within the project. Returns 404 if the project or rule is not found.
  • DELETEDelete the immutable tag rule./projects/:project_name_or_id/immutabletagrules/:immutable_rule_idDelete the specified immutable tag rule from the project. Returns 404 if the project or rule is not found.

webhook

  • GETList project webhook policies./projects/:project_name_or_id/webhook/policies?sort=string&q=string&page=1&page_size=10This endpoint returns webhook policies of a project.
  • POSTCreate project webhook policy./projects/:project_name_or_id/webhook/policiesThis endpoint create a webhook policy if the project does not have one.
  • GETGet project webhook policy/projects/:project_name_or_id/webhook/policies/:webhook_policy_idThis endpoint returns specified webhook policy of a project.
  • PUTUpdate webhook policy of a project./projects/:project_name_or_id/webhook/policies/:webhook_policy_idThis endpoint is aimed to update the webhook policy of a project.
  • DELETEDelete webhook policy of a project/projects/:project_name_or_id/webhook/policies/:webhook_policy_idThis endpoint is aimed to delete webhookpolicy of a project.
  • GETList executions for a specific webhook policy/projects/:project_name_or_id/webhook/policies/:webhook_policy_id/executions?page=1&page_size=10&q=string&sort=stringThis endpoint returns the executions of a specific webhook policy.
  • GETList tasks for a specific webhook execution/projects/:project_name_or_id/webhook/policies/:webhook_policy_id/executions/:execution_id/tasks?page=1&page_size=10&q=string&sort=stringThis endpoint returns the tasks of a specific webhook execution.
  • GETGet logs for a specific webhook task/projects/:project_name_or_id/webhook/policies/:webhook_policy_id/executions/:execution_id/tasks/:task_id/logThis endpoint returns the logs of a specific webhook task.
  • GETGet project webhook policy last trigger info/projects/:project_name_or_id/webhook/lasttriggerDeprecated. This endpoint returns last trigger information of project webhook policy.
  • GETGet supported event types and notify types./projects/:project_name_or_id/webhook/eventsGet supported event types and notify types.

webhookjob

  • GETList project webhook jobs/projects/:project_name_or_id/webhook/jobs?q=string&sort=string&page=1&page_size=10&policy_id=0&status=stringDeprecated. This endpoint returns webhook jobs of a project.

usergroup

  • GETGet all user groups information/usergroups?page=1&page_size=10&ldap_group_dn=string&group_name=stringGet all user groups information, it is open for system admin
  • POSTCreate user group/usergroupsCreate user group information
  • GETSearch groups by groupname/usergroups/search?page=1&page_size=10&groupname=stringThis endpoint is to search groups by group name. It's open for all authenticated requests.
  • GETGet user group information/usergroups/:group_idGet user group information
  • PUTUpdate group information/usergroups/:group_idUpdate user group information
  • DELETEDelete user group/usergroups/:group_idDelete user group

icon

  • GETGet artifact icon/icons/:digestGet the artifact icon with the specified digest. As the original icon image is resized and encoded before returning, the parameter "digest" in the path…

robot

  • GETGet robot account/robots?q=string&sort=string&page=1&page_size=10List the robot accounts with the specified level and project.
  • POSTCreate a robot account/robotsCreate a robot account
  • GETGet a robot account/robots/:robot_idThis endpoint returns specific robot account information by robot ID.
  • PUTUpdate a robot account/robots/:robot_idThis endpoint updates specific robot account information by robot ID.
  • DELETEDelete a robot account/robots/:robot_idThis endpoint deletes specific robot account information by robot ID.
  • PATCHRefresh the robot secret/robots/:robot_idRefresh the robot secret

role

  • GETGet roles/roles?q=string&sort=string&page=1&page_size=10List the roles (built-in and custom) with their permissions. Readable by any authenticated user (e.g. to populate member-role pickers), whereas creating,…
  • POSTCreate a role/rolesCreate a role
  • GETGet a role/roles/:role_idReturns a role (built-in or custom) with its permissions by role ID. Readable by any authenticated user; creating, updating and deleting roles is restricted…
  • PUTUpdate a role account/roles/:role_idThis endpoint updates specific role information by role ID.
  • DELETEDelete a role account/roles/:role_idThis endpoint deletes specific role information by role ID.

quota

  • GETList quotas/quotas?page=1&page_size=10&reference=string&reference_id=string&sort=stringList quotas
  • GETGet the specified quota/quotas/:idGet the specified quota
  • PUTUpdate the specified quota/quotas/:idUpdate hard limits of the specified quota

replication

  • GETList replication policies/replication/policies?q=string&sort=string&page=1&page_size=10&name=stringList replication policies
  • POSTCreate a replication policy/replication/policiesCreate a replication policy
  • GETGet the specific replication policy/replication/policies/:idGet the specific replication policy
  • PUTUpdate the replication policy/replication/policies/:idUpdate the replication policy
  • DELETEDelete the specific replication policy/replication/policies/:idDelete the specific replication policy
  • GETList replication executions/replication/executions?sort=string&page=1&page_size=10&policy_id=0&status=string&trigger=stringList replication executions
  • POSTStart one replication execution/replication/executionsStart one replication execution according to the policy
  • GETGet the specific replication execution/replication/executions/:idGet the replication execution specified by ID
  • PUTStop the specific replication execution/replication/executions/:idStop the replication execution specified by ID
  • GETList replication tasks for a specific execution/replication/executions/:id/tasks?sort=string&page=1&page_size=10&status=string&resource_type=stringList replication tasks for a specific execution
  • GETGet the log of the specific replication task/replication/executions/:id/tasks/:task_id/logGet the log of the specific replication task

registry

  • GETList registry adapters/replication/adaptersList registry adapters
  • GETList all registered registry provider information/replication/adapterinfosList all registered registry provider information
  • GETList the registries/registries?q=string&sort=string&page=1&page_size=10&name=stringList the registries
  • POSTCreate a registry/registriesCreate a registry
  • POSTCheck status of a registry/registries/pingCheck status of a registry
  • GETGet the specific registry/registries/:idGet the specific registry
  • PUTUpdate the registry/registries/:idUpdate the registry
  • DELETEDelete the specific registry/registries/:idDelete the specific registry
  • GETGet the registry info/registries/:id/infoGet the registry info

scanAll

  • GETGet the metrics of the latest scan all process/scans/all/metricsGet the metrics of the latest scan all process
  • GETGet the metrics of the latest scheduled scan all process/scans/schedule/metricsDeprecated. Get the metrics of the latest scheduled scan all process
  • GETGet scan all's schedule./system/scanAll/scheduleThis endpoint is for getting a schedule for the scan all job, which scans all of images in Harbor.
  • PUTUpdate scan all's schedule./system/scanAll/scheduleThis endpoint is for updating the schedule of scan all job, which scans all of images in Harbor.
  • POSTCreate a schedule or a manual trigger for the scan all job./system/scanAll/scheduleThis endpoint is for creating a schedule or a manual trigger for the scan all job, which scans all of images in Harbor.
  • POSTStop scanAll job execution/system/scanAll/stopStop scanAll job execution

systeminfo

  • GETGet general system info/systeminfoThis API is for retrieving general system info, this can be called by anonymous request. Some attributes will be omitted in the response when this API is…
  • GETGet system volume info (total/free size)./systeminfo/volumesThis endpoint is for retrieving system volume info that only provides for admin user. Note that the response only reflects the storage status of local disk.
  • GETGet default root certificate./systeminfo/getcertThis endpoint is for downloading a default root certificate.

oidc

  • POSTTest the OIDC endpoint./system/oidc/pingTest the OIDC endpoint, the setting of the endpoint is provided in the request. This API can only be called by system admin.

gc

  • GETGet gc results./system/gc?q=string&sort=string&page=1&page_size=10This endpoint let user get gc execution history.
  • GETGet gc status./system/gc/:gc_idThis endpoint let user get gc status filtered by specific ID.
  • PUTStop the specific GC execution/system/gc/:gc_idStop the GC execution specified by ID
  • GETGet gc job log./system/gc/:gc_id/logThis endpoint let user get gc job logs filtered by specific ID.
  • GETGet gc's schedule./system/gc/scheduleThis endpoint is for get schedule of gc job.
  • PUTUpdate gc's schedule./system/gc/scheduleThis endpoint is for update gc schedule.
  • POSTCreate a gc schedule./system/gc/scheduleThis endpoint is for update gc schedule.

purge

  • GETGet purge job results./system/purgeaudit?q=string&sort=string&page=1&page_size=10get purge job execution history.
  • GETGet purge job status./system/purgeaudit/:purge_idThis endpoint let user get purge job status filtered by specific ID.
  • PUTStop the specific purge audit log execution/system/purgeaudit/:purge_idStop the purge audit log execution specified by ID
  • GETGet purge job log./system/purgeaudit/:purge_id/logThis endpoint let user get purge job logs filtered by specific ID.
  • GETGet purge's schedule./system/purgeaudit/scheduleThis endpoint is for get schedule of purge job.
  • PUTUpdate purge job's schedule./system/purgeaudit/scheduleThis endpoint is for update purge job schedule.
  • POSTCreate a purge job schedule./system/purgeaudit/scheduleThis endpoint is for update purge job schedule.

SystemCVEAllowlist

  • GETGet the system level allowlist of CVE./system/CVEAllowlistGet the system level allowlist of CVE. This API can be called by all authenticated users.
  • PUTUpdate the system level allowlist of CVE./system/CVEAllowlistThis API overwrites the system level allowlist of CVE with the list in request body. Only system Admin has permission to call this API.

jobservice

  • GETGet worker pools/jobservice/poolsGet worker pools
  • GETGet workers/jobservice/pools/:pool_id/workersGet workers in current pool
  • PUTStop running job/jobservice/jobs/:job_idStop running job
  • GETGet job log by job id/jobservice/jobs/:job_id/logGet job log by job id, it is only used by administrator
  • GETlist job queues/jobservice/queueslist job queue
  • PUTstop and clean, pause, resume pending jobs in the queue/jobservice/queues/:job_typestop and clean, pause, resume pending jobs in the queue

schedule

  • GETList schedules/schedules?page=1&page_size=10List schedules
  • GETGet scheduler paused status/schedules/:job_type/pausedGet scheduler paused status

ping

  • GETPing Harbor to check if the API server is alive./pingThis API simply replies a pong to indicate the process to handle API is up, disregarding the health status of dependent components. This path does not require…

Retention

  • GETGet Retention Metadatas/retentions/metadatasGet Retention Metadatas.
  • POSTCreate Retention Policy/retentionsCreate Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already…
  • GETGet Retention Policy/retentions/:idGet Retention Policy.
  • PUTUpdate Retention Policy/retentions/:idUpdate Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already…
  • DELETEDelete Retention Policy/retentions/:idDelete Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already…
  • GETGet Retention executions/retentions/:id/executions?page=0&page_size=0Get Retention executions, execution status may be delayed before job service schedule it up.
  • POSTTrigger a Retention Execution/retentions/:id/executionsTrigger a Retention Execution, if dry_run is True, nothing would be deleted actually.
  • PATCHStop a Retention execution/retentions/:id/executions/:eidStop a Retention execution, only support "stop" action now.
  • GETGet Retention tasks/retentions/:id/executions/:eid/tasks?page=0&page_size=0Get Retention tasks, each repository as a task.
  • GETGet Retention job task log/retentions/:id/executions/:eid/tasks/:tidGet Retention job task log, tags ratain or deletion detail will be shown in a table.

scanner

  • GETList scanner registrations/scanners?q=string&sort=string&page=1&page_size=10Returns a list of currently configured scanner registrations.
  • POSTCreate a scanner registration/scannersCreats a new scanner registration with the given data.
  • POSTTests scanner registration settings/scanners/pingPings scanner adapter to test endpoint URL and authorization settings.
  • GETGet a scanner registration details/scanners/:registration_idRetruns the details of the specified scanner registration.
  • PUTUpdate a scanner registration/scanners/:registration_idUpdates the specified scanner registration. If access_credential is omitted or empty in the request body and the registration still uses an authentication…
  • DELETEDelete a scanner registration/scanners/:registration_idDeletes the specified scanner registration.
  • PATCHSet system default scanner registration/scanners/:registration_idSet the specified scanner registration as the system default one.
  • GETGet the metadata of the specified scanner registration/scanners/:registration_id/metadataGet the metadata of the specified scanner registration, including the capabilities and customized properties.

user

  • GETList users/users?q=string&sort=string&page=1&page_size=10List users registered in Harbor. Requires system admin privileges.
  • POSTCreate a local user./usersThis API can be used only when the authentication mode is for local DB. When self registration is disabled.
  • GETGet current user info./users/currentGet the profile of the currently authenticated user. Returns 412 if the caller is authenticated via a non-local context such as a robot account.
  • GETSearch users by username/users/search?page=1&page_size=10&username=stringThis endpoint is to search the users by username. It's open for all authenticated requests.
  • GETGet a user's profile./users/:user_idGet profile information for the specified user. System admins can access any user; regular users can only access their own profile.
  • PUTUpdate user's profile./users/:user_idUpdate profile fields (email, realname, comment) of a user. Regular users can only update their own profile.
  • DELETEMark a registered user as be removed./users/:user_idThis endpoint let administrator of Harbor mark a registered user as removed.It actually won't be deleted from DB.
  • PUTUpdate a registered user to change to be an administrator of Harbor./users/:user_id/sysadminPromote or demote a registered user to/from Harbor system administrator. Requires system admin privileges.
  • PUTChange the password on a user that already exists./users/:user_id/passwordThis endpoint is for user to update password. Users with the admin role can change any user's password. Regular users can change only their own password.
  • GETGet current user permissions./users/current/permissions?scope=string&relative=trueGet the RBAC permission list for the currently authenticated user, optionally filtered by scope.
  • PUTSet CLI secret for a user./users/:user_id/cli_secretThis endpoint let user generate a new CLI secret for himself. This API only works when auth mode is set to 'OIDC'. Once this API returns with successful…

label

  • GETList labels according to the query strings./labels?q=string&sort=string&page=1&page_size=10&name=string&scope=string&project_id=0This endpoint let user list labels by name, scope and project_id
  • POSTPost creates a label/labelsThis endpoint let user creates a label.
  • GETGet the label specified by ID./labels/:label_idThis endpoint let user get the label by specific ID.
  • PUTUpdate the label properties./labels/:label_idThis endpoint let user update label properties.
  • DELETEDelete the label specified by ID./labels/:label_idDelete the label specified by ID.

scan data export

  • POSTExport scan data for selected projects/export/cveExport scan data for selected projects
  • GETGet the specific scan data export execution/export/cve/execution/:execution_idGet the scan data export execution specified by ID
  • GETGet a list of specific scan data export execution jobs for a specified user/export/cve/executionsGet a list of specific scan data export execution jobs for a specified user
  • GETDownload the scan data export file/export/cve/download/:execution_id?format=stringDownload the scan data report. Default format is CSV

securityhub

  • GETGet vulnerability system summary/security/summary?with_dangerous_cve=false&with_dangerous_artifact=falseRetrieve the vulnerability summary of the system
  • GETGet the vulnerability list./security/vul?q=string&page=1&page_size=10&tune_count=false&with_tag=falseGet the vulnerability list. use q to pass the query condition, supported conditions: cve_id(exact match) cvss_score_v3(range condition) severity(exact match)…

permissions

  • GETGet system or project level permissions info./permissionsThis endpoint is for retrieving resource and action info that only provides for admin user(system admin and project admin).

API details

Base URL
https://localhost/api/v2.0
Authentication
HTTP Basic authentication (username and password)
Operations
208 operations on 137 pathsGET 116POST 35PUT 32DELETE 20PATCH 4HEAD 1
3 marked deprecated
Main resources
preheat 19project 14artifact 12replication 11user 11Retention 10webhook 10registry 9scanner 8gc 7
Response formats
application/json
Description format
Swagger 2.0, API version 2.0

How to test the Harbor API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Harbor API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses HTTP Basic authentication (username and password). Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Check the status of Harbor components” (GET /health), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Harbor API?

These APIs provide services for manipulating Harbor project. It is listed under Developer tools and has 208 endpoints.

Who publishes the Harbor API?

It is listed from Harbor's public API description (an OpenAPI document), not published by Harbor on Swastik Codes. Anyone who controls goharbor.io can claim the profile by adding a DNS TXT record.

What is the base URL of the Harbor API?

Requests go to https://localhost/api/v2.0. Endpoint paths are added to this base URL.

How do I authenticate with the Harbor API?

With HTTP Basic authentication (username and password).

How many endpoints does the Harbor API have?

208 operations on 137 paths (116 GET, 35 POST, 32 PUT, 20 DELETE, 4 PATCH, 1 HEAD). The largest groups are preheat, project, artifact, replication.

Is forking the Harbor API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.