Install
API

Relic API

Relic's own API, defined in protobuf and served as REST, Connect, gRPC-Web and gRPC.

The Relic API's schema is the protobuf files in api/proto/relic/v1. Every method is served under /api/ in each protocol, with the same access checks. Generated clients are in SDK.

ProtocolRequest
RESTresource URLs under /api/v1/, such as GET /api/v1/repositories/libs-local. The API reference lists every route.
ConnectPOST /api/relic.v1.<Service>/<Method> with a JSON or binary protobuf body. The web UI and the relic CLI use it.
gRPC-Webthe Connect paths
gRPCthe Connect paths. Needs HTTP/2, which the server offers only when it serves HTTPS itself (not with --no-tls).

In JSON, field names are lowerCamelCase (deploy_to is deployTo), enums are their names (?class=REPOSITORY_CLASS_LOCAL in REST query strings too), and 64-bit integers are strings. An item path in a REST URL (the {path} of /api/v1/repositories/{repository}/items/{path}) keeps its slashes or sends them percent-encoded as %2F; both find the item.

Authentication and access

Send Basic credentials (-u user:password-or-token) or an Authorization: Bearer <token> header. The web UI's session cookie works under /api/ only, and writes made with it need the X-Relic-UI: 1 header.

Every method declares an access level in the proto (option (relic.v1.access)): PUBLIC, AUTHENTICATED (any signed-in user; items are still checked against permissions), VIEWER (viewers and administrators) or ADMIN.

Errors use Connect's codes. Over REST, each maps to an HTTP status:

CodeHTTP status
invalid_argument, failed_precondition, out_of_range400
unauthenticated401
permission_denied403
not_found (also for what the caller may not read)404
already_exists, aborted409
resource_exhausted429
unimplemented501
unavailable503
deadline_exceeded504
internal, data_loss, unknown500

Error bodies are {"code": "...", "message": "..."} over Connect, with a numeric code over REST. The file routes answer like REST, with three more statuses: 405 for a method a route does not serve, 413 for an upload over the size limit or the repository's quota, and 507 when storage is full.

Services

ServiceSigned-in usersViewers and administratorsAdministrators
SystemServiceGetVersion (public), GetDashboardSummaryGetSystemStatus, ListBackgroundJobs, GetUsageReportCheckStorage, CollectGarbage
SessionServiceLogin, Logout, ListSignInProviders, GetSignInNote, ExchangeWorkloadToken, StartWebLogin and PollWebLogin, all public; GetCurrentUser, ApproveLogin
RepositoryServiceListRepositories, GetRepository, GetClientEndpoints, GetRepositorySigningKey, CreateRepository*, UpdateRepository*, DeleteRepository*
ArtifactServiceStatItem, ListChildren, SearchItems, GetItemDetails, Get/Set/DeleteProperties, CopyItem, MoveItem, DeleteItem, ListArchiveEntriesGetEffectivePermissions
PackageServiceGetContainerImage, PromoteContainerImage, GetNpmPackage, GetPythonPackage, GetHelmChart
BuildServiceListBuilds, PublishBuildRun, ListBuildRuns, GetBuildRun, DeleteBuildRuns, ApplyBuildRetention, PromoteBuildRun
ReleaseServiceListReleases, ListReleaseVersions, GetRelease, Create/Update/Finalize/DeleteRelease, SetReleaseTag, PromoteRelease, List/DeleteReleasePromotion(s), ExportRelease
EvidenceServiceListEvidence, CreateEvidenceListTrustedKeysAddTrustedKey, DeleteTrustedKey
SigningKeyServiceGetPublicKeyListKeyPairsDeleteKeyPair
SecurityServiceCreateToken, ListTokens, RevokeTokenListUsers, GetUser, ListGroups, GetGroup, ListPermissions, GetPermissionPut/DeleteUser, Put/DeleteGroup, Put/DeletePermission
ProjectServiceListProjects, GetProject, SetProjectMembers*, AddProjectMember*, RemoveProjectMember*PutProject, DeleteProject
WorkloadIdentityServiceListWorkloadIdentities, GetWorkloadIdentityPut/DeleteWorkloadIdentity
IdentityProviderServiceListIdentityProviders, GetIdentityProviderPut/DeleteIdentityProvider
LdapServiceListLdapServers, ListLdapGroupMappingsPut/DeleteLdapServer, Put/DeleteLdapGroupMapping, TestLdapSignIn
ScanServiceGetItemScan, GetItemSbom, ExplainDownload, CheckPackage, ScanBuildRun, GetBuildRunScan, ScanPackages, GetPackagesScanListFindings, ListOperationalRisks, GetEndOfLifeStatus, ListCves, GetCve, ListPolicies, ListWatches, ListIgnoreRules, ExportVexPut/DeletePolicy, Put/DeleteWatch, Create/DeleteIgnoreRule, ImportVex
PolicyDecisionServiceListPolicyDecisionsPreviewPolicy
QuarantineServiceListQuarantinedReleaseQuarantined, RejectQuarantined
WaiverServiceRequestWaiver, ListWaivers, WithdrawWaiverApproveWaiver, RejectWaiver
PromotionGateServiceListPromotionGates, GetPromotionGatePut/DeletePromotionGate
CleanupServiceListCleanupPolicies, GetCleanupPolicy, PreviewCleanupPolicyPut/DeleteCleanupPolicy, RunCleanupPolicy
HoldServiceListHoldsPutHold, DeleteHold
ReplicationServiceListReplications, GetReplicationPut/DeleteReplication, RunReplication
TrashServiceListTrashRestoreTrash, DeleteTrashEntry, EmptyTrash
AuditServiceListAuditEvents
WebhookServiceListWebhooks, GetWebhook, ListWebhookDeliveriesPut/DeleteWebhook, PingWebhook
AgentRegistryServiceListRegistryEntriesApproveRegistryEntry, RevokeRegistryApproval

* administrators, and the project's admins: for a repository, the admins of the project it belongs to.

  • Builds, releases and evidence check the caller's build, release and item permissions on each call.
  • ListTokens and RevokeToken cover the caller's own tokens. Administrators cover everyone's; viewers list everyone's.
  • Members see their projects in ListProjects and GetProject, and their own waivers in ListWaivers; administrators and viewers see all. ListRegistryEntries shows unapproved entries to administrators and viewers only.
  • Put… methods create or replace.
  • Secrets (passwords, webhook and client secrets) are write-only; an update without one keeps the stored value. A stored password stays only while the URL it is sent to keeps its scheme, host and port; URLs cannot hold a user or password.

File contents

Messages never carry file bytes. File contents use plain HTTP with the same credentials and permissions:

RequestDoes
GET/HEAD /api/v1/files/<repo>/<path>download (ranges supported)
PUT /api/v1/files/<repo>/<path>upload; query parameters set properties (?build.name=app), which needs annotate permission. Overwriting needs delete permission.
GET /api/v1/archive/<repo>/<path>?entry=<entry>one entry of a zip or tar file
GET /api/v1/sbom/<repo>/<path>?format=cyclonedx|spdx|syftthe item's SBOM as CycloneDX 1.6 (default), SPDX 2.3 or Syft JSON
PUT /api/v1/sbom/<repo>/<path>replace the item's SBOM (write permission on every file with the item's content)
POST /api/v1/releases/importimport a release archive (administrators)
PUT /api/v1/vulnerability-databaseimport a vulnerability database archive (administrators)
PUT /api/v1/end-of-life-dataimport endoflife.date's product data (administrators)

Examples

Create a local Maven repository (administrators):

curl -s -u <user>:<token> -H 'Content-Type: application/json' \
  https://relic.example.com/api/v1/repositories \
  -d '{"name":"libs-local","class":"REPOSITORY_CLASS_LOCAL","format":"FORMAT_MAVEN"}'

Get the repository over Connect:

curl -s -u <user>:<token> -H 'Content-Type: application/json' -d '{"name":"libs-local"}' \
  https://relic.example.com/api/relic.v1.RepositoryService/GetRepository

Upload a file:

curl -s -u <user>:<token> -T app-1.0.jar https://relic.example.com/api/v1/files/libs-local/org/app/1.0/app-1.0.jar