API Documentation

RESTful API for SiFli Package Registry API

Introduction

The SiFli Package Registry API API provides programmatic access to browse packages, trigger synchronization, and manage API tokens. All endpoints return JSON responses.

Base URL: https://your-domain.com/api/v1

Authentication

Some API endpoints require authentication using Bearer tokens

Public Endpoints

The following endpoints do not require authentication:

  • GET /api/v1/packages
  • GET /api/v1/packages/:name
  • GET /api/v1/packages/stats/categories

Protected Endpoints

For protected endpoints, include your API token in the Authorization header:

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
  https://your-domain.com/api/v1/sync

Creating an API Token

To create an API token:

  1. Sign in with GitHub OAuth
  2. Navigate to your profile and click "API Tokens"
  3. Click "Generate New Token"
  4. Copy and save your token (it won't be shown again)

Packages API

Browse and search for packages

GET/api/v1/packages

Get a paginated list of packages with optional filtering.

Query Parameters
page (optional, default: 1) - Page number
limit (optional, default: 20, max: 100) - Items per page
category (optional) - Filter by category
search (optional) - Search query
curl "https://your-domain.com/api/v1/packages?page=1&limit=10&category=AI_ML"
GET/api/v1/packages/:name

Get detailed information about a specific package.

curl "https://your-domain.com/api/v1/packages/package-name"

Synchronization API

Trigger and monitor data synchronization (Requires authentication)

POST/api/v1/syncProtected

Trigger a full synchronization from JFrog Artifactory.

curl -X POST \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  https://your-domain.com/api/v1/sync
GET/api/v1/sync/:idProtected

Get the status of a specific sync operation.

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
  https://your-domain.com/api/v1/sync/sync-uuid

API Tokens Management

Create and manage your API tokens (Requires login)

POST/api/v1/tokensProtected

Create a new API token.

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CI/CD Token",
    "expiresIn": 90
  }' \
  https://your-domain.com/api/v1/tokens
GET/api/v1/tokensProtected

List all your API tokens (token values are not returned).

DELETE/api/v1/tokens/:idProtected

Revoke an API token.

Error Responses

Standard error response format

All errors follow this format:

{
  "error": "Error message",
  "statusCode": 400,
  "details": {} // Optional additional details
}

Common Status Codes

200 - Success
400 - Bad Request
401 - Unauthorized
404 - Not Found
500 - Internal Server Error