API Reference¶
Repod exposes a REST API at http://YOUR_HOST:8000. All endpoints (except
public ones listed below) require a bearer token.
Base URL
Every path on this page is relative to /api/v1, except the health endpoints
(/health, /health/live, /health/ready) and /metrics, which sit at the
root. Example: GET /artifacts/ is GET http://YOUR_HOST:8000/api/v1/artifacts/.
The web interface's Nginx forwards /api/ to the backend, so the same call is
GET https://repo.example.com/api/v1/artifacts/ through it.
Authentication¶
JWT (interactive sessions)¶
# Obtain a JWT token
TOKEN=$(curl -s -X POST http://localhost:8000/api/v1/auth/token \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"Admin1234!"}' \
| jq -r .access_token)
# Use the token
curl -H "Authorization: Bearer $TOKEN" http://localhost:8000/api/v1/packages/
Tokens expire after 60 minutes (JWT_EXPIRE_MINUTES in backend.env).
API tokens (CI/CD)¶
For non-interactive pipelines, use a long-lived API token (an Enterprise feature):
API tokens are created via POST /auth/api-tokens (admin only), with a fixed
role and an optional expires_days. The plaintext token is returned exactly once.
Public endpoints (no authentication required)¶
| Endpoint | Description |
|---|---|
POST /auth/token |
Log in — obtain a JWT |
POST /auth/forgot-password |
Request a password reset |
POST /auth/reset-password |
Reset a password with a one-time token |
POST /auth/mfa/authenticate |
Second step of a login with MFA |
GET /auth/roles |
List available roles |
GET /setup/status |
Whether the first-run setup is done, and whether it needs a setup token |
POST /setup/ |
Create the first admin (needs the X-Setup-Token header, see Environment variables); 409 once done |
GET /health |
Full health check (root path, no /api/v1) |
GET /health/live |
Liveness probe |
GET /health/ready |
Readiness probe |
HTTP status codes¶
| Code | Meaning |
|---|---|
200 OK |
Success |
201 Created |
Resource created |
400 Bad Request |
Invalid parameters or body |
401 Unauthorized |
Token missing, invalid, or expired |
402 Payment Required |
Subscription suspended for non-payment (hosted service) |
403 Forbidden |
Insufficient role, an Enterprise-only feature, or a licence quota reached |
404 Not Found |
Resource not found |
409 Conflict |
Resource already exists |
424 Failed Dependency |
Index not yet populated — run a sync first |
429 Too Many Requests |
Rate limit exceeded |
500 Internal Server Error |
Server-side error |
Auth (/auth)¶
POST /auth/token¶
Public. Authenticate and obtain a JWT. Tries local accounts first, then LDAP if enabled.
curl -s -X POST http://localhost:8000/api/v1/auth/token \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"Admin1234!"}'
Response:
GET /auth/me¶
Return the currently authenticated user's profile.
Response:
{
"username": "admin",
"role": "admin",
"full_name": "Administrator",
"email": "[email protected]",
"active": true,
"last_login": "2026-05-15T10:23:41+00:00"
}
POST /auth/change-password¶
Change the currently authenticated user's own password.
curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
http://localhost:8000/api/v1/auth/change-password \
-d '{"current_password":"Admin1234!","new_password":"NewPass5678!"}'
Password policy: minimum 8 characters, at least one uppercase letter, at least one digit or special character.
GET /auth/users¶
Admin only. List all users (password hashes are never included).
POST /auth/users¶
Admin only. Create a new user.
{
"username": "jsmith",
"password": "SecurePass1!",
"role": "uploader",
"full_name": "John Smith",
"email": "[email protected]"
}
Roles: admin | maintainer | uploader | auditor | reader
PATCH /auth/users/{username}¶
Admin only. Update a user's role, full name, email, or active status.
curl -X PATCH -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
http://localhost:8000/api/v1/auth/users/jsmith \
-d '{"role":"maintainer","active":true}'
An admin cannot change their own role.
DELETE /auth/users/{username}¶
Admin only. Delete a user. An admin cannot delete their own account.
POST /auth/users/{username}/reset-password¶
Admin only. Force-set a new password for another user.
curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
http://localhost:8000/api/v1/auth/users/jsmith/reset-password \
-d '{"new_password":"TempPass9!"}'
POST /auth/api-tokens¶
Admin only. Create a permanent API token. The plaintext token is returned only in this response.
curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
http://localhost:8000/api/v1/auth/api-tokens \
-d '{"name":"gitlab-ci","role":"uploader","expires_days":365}'
Response:
{
"token": "repod_xxxxxxxxxx",
"message": "Copy this token now — it will not be shown again.",
"prefix": "repod_"
}
expires_days is optional — omit for a non-expiring token.
DELETE /auth/api-tokens/{token_id}¶
Admin only. Revoke an API token immediately.
Packages & Artifacts (/packages, /artifacts)¶
GET /packages/¶
List packages from the internal pool (raw pool format).
GET /artifacts/¶
List all artifacts with enriched metadata (version history, security status).
GET /artifacts/{name}¶
Full detail for a package: all versions, last validation results, CVE findings.
GET /artifacts/{name}/dependencies¶
Resolve a package's declared dependencies against the internal pool.
Response includes all_satisfied, missing list, and install_blocked flag.
DELETE /artifacts/{name}¶
Maintainer+. Delete all versions of a package.
DELETE /artifacts/{name}/{version}¶
Maintainer+. Delete a specific version.
GET /artifacts/audit/logs¶
Auditor+. Retrieve audit log entries.
| Parameter | Type | Description |
|---|---|---|
page |
int | Page number (default: 1) |
per_page |
int | Entries per page (default: 100) |
package |
string | Filter by package name |
action |
string | UPLOAD, DELETE, LOGIN, SECURITY_DECISION, etc. |
result |
string | SUCCESS, FAILURE, WARNING |
q |
string | Free-text search across package, user, and detail fields |
curl -H "Authorization: Bearer $TOKEN" \
"http://localhost:8000/api/v1/artifacts/audit/logs?action=UPLOAD&q=nginx"
POST /artifacts/admin/sync-index¶
Maintainer+. Rebuild the package index from manifests on disk.
curl -X POST -H "Authorization: Bearer $TOKEN" \
http://localhost:8000/api/v1/artifacts/admin/sync-index
Upload (/upload)¶
POST /upload/¶
Uploader+. Upload a package. Triggers the full security pipeline (antivirus → CVE scan → GPG verification → distribution publish).
curl -X POST -H "Authorization: Bearer $TOKEN" \
-F "[email protected]_64.rpm" \
-F "distribution=almalinux9" \
http://localhost:8000/api/v1/upload/
The endpoint returns a pipeline result summary:
{
"status": "published",
"package": "mypackage",
"version": "1.0.0",
"distribution": "jammy",
"pipeline": {
"antivirus": "clean",
"cve_scan": "no_findings",
"gpg": "signed",
"dependencies": "satisfied"
}
}
Possible status values: published, pending_review, quarantined, rejected.
Import (/import)¶
How the import works, with worked examples, is in the import guide. This section lists the endpoints.
| Endpoint | Role | Purpose |
|---|---|---|
GET /import/sync-status |
any | State of every source: source_id, label, last_sync, pkg_count, status, error, format |
POST /import/sync/start |
maintainer | Sync every enabled source. Returns {job_id, label, status, total, already_running} |
POST /import/sync/start/{target} |
maintainer | Sync a group (apt, rpm, apk) or one source_id |
GET /import/sync/jobs |
any | Active jobs and the last hour of history |
GET /import/sync/jobs/{job_id} |
any | State of one job: status, total, done_count, error_count |
GET /import/sync/jobs/{job_id}/stream |
any | Server-Sent Events log, resumable with ?from_index=N |
POST /import/sync/jobs/{job_id}/cancel |
maintainer | Stop a sync: the source in progress finishes, the next ones are skipped |
GET /import/search |
any | Search the local catalog (q, limit, source_id, format, distro, arch). 424 if the catalog is empty |
GET /import/resolve/{package_name} |
any | Dependencies of a package and which ones are already in the repository (distro, arch) |
POST /import/fetch |
uploader | Import one package and its missing dependencies. Body: package (required), group, distribution, version, arch. Server-Sent Events |
POST /import/batch |
uploader | Import up to 50 packages in a row, streamed. Body: packages, group, distribution, arch |
POST /import/bulk |
uploader | Import up to 50 packages in the background. Body: items (package, distribution, version, arch). Returns bulk_id |
GET /import/bulk/{bulk_id} |
any | State of the jobs of a bulk import, kept for two hours |
POST /import/bulk/{bulk_id}/cancel |
uploader | Cancel the jobs that have not started |
Custom sources have their own endpoints:
| Endpoint | Role | Purpose |
|---|---|---|
GET /import/custom-sources |
any | List the custom APT sources |
POST /import/custom-sources |
admin | Add one: id, label, base_url, codename, components, archs, target_distribution, gpg_key_url or gpg_key_armored, enabled. Answers 201 |
POST /import/custom-sources/discover-components |
maintainer | Components offered by a repository: base_url, codename |
POST /import/custom-sources/preview-key |
maintainer | Fingerprints of a signing key: gpg_key_url or gpg_key_armored |
PATCH /import/custom-sources/{id} |
admin | Enable or disable: {"enabled": false} |
DELETE /import/custom-sources/{id} |
admin | Remove. Answers 204 |
POST /import/custom-sources/{id}/sync |
maintainer | Sync this source now and return the result of each repository |
The RPM equivalents are under /import/custom-rpm-sources (same verbs; the
body takes repo_url, arch and target_distribution instead of
base_url, codename, components and archs, and
discover-metadata replaces discover-components).
Security (/security)¶
GET /security/review-queue¶
Any signed-in user. Packages waiting for a decision: those in
pending_review or blocked, with their enriched CVEs (EPSS, KEV).
curl -H "Authorization: Bearer $TOKEN" \
"http://localhost:8000/api/v1/security/review-queue?page=1&per_page=50"
Parameters: page, per_page (default 50, maximum 200). The answer holds
total, blocked_count, review_count and the paginated packages
(items, with name, version, arch, distribution, pkg_format,
status, imported_by…).
GET /security/vulnerabilities¶
Any signed-in user. Consolidated view of the CVEs across every package in the repository, one row per CVE with the list of affected packages.
curl -H "Authorization: Bearer $TOKEN" \
"http://localhost:8000/api/v1/security/vulnerabilities?severity=critical&fix_state=fixed"
Parameters: severity (critical, high, medium, low), fix_state
(fixed, not-fixed, unknown), distribution, page, per_page
(default 50, maximum 500).
POST /security/packages/{name}/{version}/decide¶
Maintainer+. Record a decision on a package in the CVE review queue.
curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
http://localhost:8000/api/v1/security/packages/nginx/1.24.0/decide \
-d '{
"action": "accept_risk",
"justification": "CVE-2024-1234 does not apply to our deployment (no affected feature used)",
"expires_in_days": 90
}'
action is one of accept_risk, exception, reject or upgrade_required.
justification is required. expires_in_days applies to accept_risk and
exception (the package returns to review when it ends), target_version to
upgrade_required, and cve_ids limits the decision to some CVEs (empty means
all). arch defaults to amd64; send the package's own architecture for any
other. The call is limited to 5 per minute.
POST /security/packages/{name}/{version}/rescan¶
Maintainer+. Re-run the CVE scan against the current Grype database.
curl -X POST -H "Authorization: Bearer $TOKEN" \
http://localhost:8000/api/v1/security/packages/nginx/1.24.0/rescan
GET /security/clamav/status¶
Any signed-in user. Check ClamAV daemon status and signature database version.
POST /security/clamav/update¶
Admin only. Force an immediate ClamAV signature database update.
curl -X POST -H "Authorization: Bearer $TOKEN" \
http://localhost:8000/api/v1/security/clamav/update
CVE and EPSS policy¶
There is no separate policy endpoint: the policies are the cve_policy and
epss_policy sections of the settings, read with GET /settings/ and changed
with PATCH /settings/ (admin only, see Settings).
curl -X PATCH -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
http://localhost:8000/api/v1/settings/ \
-d '{"cve_policy": {"critical": "block", "high": "review", "medium": "warn", "low": "allow"}}'
Each severity (critical, high, medium, low, negligible) takes
block, review, warn or allow. cve_policy also holds the decision
deadlines (sla_critical_days, sla_high_days, sla_medium_days) and
auto_enrich. epss_policy holds enabled, block_threshold and
review_threshold. Only the keys you send are changed. See
Set your security policy.
SBOM (/sbom)¶
GET /sbom/{name}/{version}¶
Any signed-in user. Download the SBOM for a specific package version.
# CycloneDX JSON
curl -H "Authorization: Bearer $TOKEN" \
"http://localhost:8000/api/v1/sbom/nginx/1.24.0?format=cyclonedx&arch=amd64" \
-o nginx-sbom.cdx.json
# SPDX JSON
curl -H "Authorization: Bearer $TOKEN" \
"http://localhost:8000/api/v1/sbom/nginx/1.24.0?format=spdx" \
-o nginx-sbom.spdx.json
format: cyclonedx | spdx
GET /sbom/export¶
Any signed-in user. Export the full repository SBOM.
curl -H "Authorization: Bearer $TOKEN" \
"http://localhost:8000/api/v1/sbom/export?format=cyclonedx" \
-o repod-full.sbom.cdx.json
Distributions (/distributions)¶
POST /distributions/init¶
Admin only. Initialize or re-initialize all distributions.
POST /distributions/promote¶
Maintainer+. Promote a package from one distribution to another without
re-uploading. The promotion goes through the CVE and EPSS policy, like
POST /artifacts/{name}/promote:
| HTTP | status |
Meaning |
|---|---|---|
| 200 | ok |
Promoted (or already present in the target) |
| 202 | pending_review |
A review-level CVE needs a security officer's approval; nothing was copied |
| 409 | blocked |
A block-level CVE; never bypassable |
Optional body fields: version (default: the version currently published in
from_dist), force (admin only, bypasses review) and justification.
curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
http://localhost:8000/api/v1/distributions/promote \
-d '{"package":"nginx","from_dist":"jammy","to_dist":"noble"}'
from_dist and to_dist: one of jammy, noble, focal, bookworm
from_dist and to_dist: one of almalinux9, rocky9, fedora, etc.
POST /distributions/migrate¶
Maintainer+. Migrate all packages from one distribution to another.
curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
http://localhost:8000/api/v1/distributions/migrate \
-d '{"from_dist":"focal","to_dist":"jammy"}'
Warning
The source distribution is not removed — packages exist in both after migration.
Downloads (/downloads)¶
GET /downloads/stats¶
Auditor+ (auditor, maintainer, admin). Package download statistics parsed from Nginx access logs.
Dashboard (/dashboard)¶
GET /dashboard/stats¶
Any signed-in user. Aggregated dashboard metrics.
The answer holds packages (total, total_size_bytes,
deps_missing_count, imports_today), activity (imports and failures per
day), recent_imports, alerts, clamav, security_posture and
security_review. packages.total counts every package of every format,
the same number as the licence quota. GET /dashboard/stats/enriched and
GET /dashboard/history exist as well.
Settings (/settings)¶
GET /settings/¶
Admin only. Retrieve all runtime settings. Sensitive values (LDAP bind
password, SMTP password) are masked. The settings are grouped in sections
(ldap, email, retention, cve_policy, epss_policy, sync, backup,
oidc…).
Trailing slash
The path ends with a slash: /api/v1/settings/.
PATCH /settings/¶
Admin only. Update runtime settings by deep merge: send only the sections and keys you want to change.
curl -X PATCH -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
http://localhost:8000/api/v1/settings/ \
-d '{
"ldap": {
"host": "dc.example.com",
"port": 636,
"use_ssl": true,
"bind_dn": "CN=repod-svc,OU=ServiceAccounts,DC=example,DC=com",
"bind_password": "service-account-password",
"base_dn": "OU=Users,DC=example,DC=com"
}
}'
Check the result with GET /settings/ after a change.
Related endpoints: POST /settings/test-ldap, POST /settings/test-email,
POST /settings/test-webhook, POST /settings/run-retention,
GET /settings/gpg, POST /settings/gpg/generate, POST /settings/gpg/activate (body {"key_id"}), POST /settings/gpg/export, GET /settings/next-sync.
Health (/health)¶
These three endpoints are public and live at the root, not under /api/v1.
| Endpoint | Purpose |
|---|---|
GET /health/live |
Liveness probe: {"alive": true, "timestamp": "..."} while the process runs. Used by Docker health checks and load balancers. |
GET /health/ready |
Readiness probe: 200 with "ready": true, or 503 when a critical check fails (manifests, pool, database). |
GET /health |
Full report: status (healthy, degraded or unhealthy), version, and every check grouped as critical, non_critical and info. |
The full response, every check and the exact degraded rules are in
Health endpoint reference.
Rate limiting¶
Most endpoints are limited per role and per category of action, and the
limits are editable in Administration → Paramètres, section Limites de débit (rate_limits in the
settings). The category depends on the endpoint: upload for uploads and
imports, write for actions that change something, read for the rest.
Defaults:
| Role | upload |
write |
read |
|---|---|---|---|
admin |
200/min | 500/min | 2000/min |
maintainer |
100/min | 200/min | 1000/min |
uploader |
30/min | 30/min | 300/min |
auditor |
5/min | 5/min | 500/min |
reader |
5/min | 5/min | 200/min |
| anonymous (no valid token) | 5/min | 5/min | 60/min |
Some endpoints have their own limit: POST /auth/token (auth_per_minute,
default 10 per minute), POST /artifacts/{name}/promote (20 per minute), and
the approval or rejection of a pending promotion (5 per minute per user).
When a rate limit is exceeded, the API returns 429 Too Many Requests with a
Retry-After header indicating the seconds until the next request is allowed.
CI/CD integration examples¶
#!/usr/bin/env bash
set -euo pipefail
REPOD_URL="${REPOD_URL:-http://repod:8000}"
# Authenticate
TOKEN=$(curl -sf -X POST "$REPOD_URL/api/v1/auth/token" \
-H "Content-Type: application/json" \
-d "{\"username\":\"$REPOD_USER\",\"password\":\"$REPOD_PASSWORD\"}" \
| jq -r .access_token)
# Upload
curl -sf -X POST "$REPOD_URL/api/v1/upload/" \
-H "Authorization: Bearer $TOKEN" \
-F "file=@dist/mypackage_1.0.0_amd64.deb" \
-F "distribution=jammy" \
| jq .
- name: Publish package to Repod
env:
REPOD_URL: ${{ secrets.REPOD_URL }}
REPOD_USER: ci-uploader
REPOD_PASSWORD: ${{ secrets.REPOD_API_TOKEN }}
run: |
TOKEN=$(curl -sf -X POST "$REPOD_URL/api/v1/auth/token" \
-H "Content-Type: application/json" \
-d "{\"username\":\"$REPOD_USER\",\"password\":\"$REPOD_PASSWORD\"}" \
| jq -r .access_token)
curl -sf -X POST "$REPOD_URL/api/v1/upload/" \
-H "Authorization: Bearer $TOKEN" \
-F "file=@dist/mypackage_1.0.0_amd64.deb" \
-F "distribution=jammy"