Skip to content

The Sources API lets you manage the package sources Hoody uses to resolve application candidates. Use these endpoints to list, create, update, delete, sync, and diagnose individual sources. Sources can be providers like nix, pkgx, appimage, oci, registry, or system, and each source has a specific implementation type that determines how it resolves and syncs candidates.

List all configured package sources with their type, provider, priority, enabled state, and provider-specific configuration.

This endpoint takes no parameters.

Terminal window
curl -X GET https://api.hoody.com/api/v1/run/sources \
-H "Authorization: Bearer <token>"

Array of source configurations.

[
{
"source_id": "nixpkgs",
"enabled": true,
"priority": 100,
"provider": "nix",
"source_type": "nix-flake",
"pin": {
"url": "https://github.com/NixOS/nixpkgs"
},
"config": {
"flake": "nixpkgs"
}
},
{
"source_id": "pkgx-default",
"enabled": true,
"priority": 80,
"provider": "pkgx",
"source_type": "pkgx"
}
]

GET /api/v1/run/sources/{source_id}/diagnostics

Section titled “GET /api/v1/run/sources/{source_id}/diagnostics”

Return runtime-only health and observability data for a configured source, including recent search or sync failures.

NameInTypeRequiredDescription
source_idpathstringYesSource identifier

This endpoint accepts no request body.

Terminal window
curl -X GET https://api.hoody.com/api/v1/run/sources/nixpkgs/diagnostics \
-H "Authorization: Bearer <token>"
{
"source_id": "nixpkgs",
"status": "ok",
"last_success_at": "2025-01-15T10:30:00Z",
"last_error_at": null,
"last_error": null,
"last_search_latency_ms": 142,
"last_sync_job_id": "550e8400-e29b-41d4-a716-446655440000",
"cache_hint": "warm",
"effective_enabled_reason": "configured and enabled",
"provider_details": {
"flake_rev": "abc123def456"
}
}

Source not found.

{
"error": "Source not found",
"code": 404
}

Add a new package source configuration. The source will be appended to the existing list and immediately available for searches if enabled.

This endpoint takes no parameters.

Source configuration object.

NameTypeRequiredDescription
source_idstringYesUnique source identifier (e.g. nixpkgs)
enabledbooleanYesWhether this source is active for searches
priorityintegerYesSource priority (higher values are searched first and ranked higher)
providerstringYesPackage source provider kind. One of: nix, pkgx, appimage, oci, registry, system, any
source_typestringYesSpecific source implementation type. One of: nix-pkgs, nix-flake, pkgx, app-image-pinned, app-image-git-hub-releases, app-image-catalog, oci-local-images, manifest-registry, manifest-remote-index, system-path, trusted-list-file
pinobjectNoPin configuration (URL plus optional integrity fields)
configobjectNoProvider-specific configuration (varies by source_type)

The pin object accepts the following fields:

NameTypeRequiredDescription
urlstringYesPinned URL for the source
sha256stringNoSHA-256 hash for integrity verification
author_pubkey_ed25519stringNoEd25519 public key of the source author (base64)
sig_ed25519stringNoEd25519 signature for provenance verification (base64)
Terminal window
curl -X POST https://api.hoody.com/api/v1/run/sources \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"source_id": "nixpkgs",
"enabled": true,
"priority": 100,
"provider": "nix",
"source_type": "nix-flake",
"pin": {
"url": "https://github.com/NixOS/nixpkgs"
},
"config": {
"flake": "nixpkgs"
}
}'

Updated list of all sources.

[
{
"source_id": "nixpkgs",
"enabled": true,
"priority": 100,
"provider": "nix",
"source_type": "nix-flake",
"pin": {
"url": "https://github.com/NixOS/nixpkgs"
},
"config": {
"flake": "nixpkgs"
}
}
]

Missing source_id.

{
"error": "Missing source identifier",
"code": 400
}
Error CodeTitleDescriptionResolution
MISSING_SOURCE_IDMissing source identifierThe source configuration did not include a non-empty source_idSet source_id before creating the source

Source already exists.

{
"error": "Source already exists",
"code": 409
}
Error CodeTitleDescriptionResolution
SOURCE_ALREADY_EXISTSSource already existsA source with the same source_id already existsChoose a unique source_id or update the existing source instead

Configuration persistence failed.

{
"error": "Configuration save failed",
"code": 503
}
Error CodeTitleDescriptionResolution
CONFIG_SAVE_FAILEDConfiguration save failedThe updated source configuration could not be persistedCheck storage health and retry

Trigger a sync operation for a specific source. Returns immediately with a job handle for tracking progress via the jobs endpoint.

NameInTypeRequiredDescription
source_idpathstringYesSource identifier

This endpoint accepts no request body.

Terminal window
curl -X POST https://api.hoody.com/api/v1/run/sources/nixpkgs/sync \
-H "Authorization: Bearer <token>"

Sync job accepted.

{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"kind": "source-sync",
"status": "running",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:05Z"
}

Sync could not be started.

{
"error": "Sync start failed",
"code": 503
}
Error CodeTitleDescriptionResolution
SYNC_START_FAILEDSync start failedThe source sync job could not be startedRetry or inspect source/provider health

Trigger a sync operation for all enabled sources. Returns immediately with a job handle. Use GET /api/v1/run/jobs/{job_id}?wait=done&timeout_ms=30000 to poll for completion.

This endpoint takes no parameters.

This endpoint accepts no request body.

Terminal window
curl -X POST https://api.hoody.com/api/v1/run/sources/sync \
-H "Authorization: Bearer <token>"

Sync job accepted.

{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"kind": "source-sync",
"status": "running",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:05Z"
}

Sync could not be started.

{
"error": "Sync start failed",
"code": 503
}
Error CodeTitleDescriptionResolution
SYNC_START_FAILEDSync start failedThe all-sources sync job could not be startedRetry or inspect source/provider health

Partially update a source configuration. Supports merging enabled, priority, pin, and config fields.

NameInTypeRequiredDescription
source_idpathstringYesSource identifier

The body is an open-ended partial source configuration object. Any fields provided are merged into the existing configuration. Common fields include enabled, priority, pin, and config.

Terminal window
curl -X PATCH https://api.hoody.com/api/v1/run/sources/nixpkgs \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"priority": 150
}'

Updated source configuration.

{
"source_id": "nixpkgs",
"enabled": true,
"priority": 150,
"provider": "nix",
"source_type": "nix-flake"
}

Source not found.

{
"error": "Source not found",
"code": 404
}
Error CodeTitleDescriptionResolution
SOURCE_NOT_FOUNDSource not foundNo source exists with the requested source_idCall list() and choose a valid source_id

Configuration persistence failed.

{
"error": "Configuration save failed",
"code": 503
}
Error CodeTitleDescriptionResolution
CONFIG_SAVE_FAILEDConfiguration save failedThe updated source configuration could not be persistedCheck storage health and retry

Remove a package source by its ID. Returns 204 on success.

NameInTypeRequiredDescription
source_idpathstringYesSource identifier

This endpoint accepts no request body.

Terminal window
curl -X DELETE https://api.hoody.com/api/v1/run/sources/nixpkgs \
-H "Authorization: Bearer <token>"

Source deleted successfully. No content returned.

Source not found.

{
"error": "Source not found",
"code": 404
}
Error CodeTitleDescriptionResolution
SOURCE_NOT_FOUNDSource not foundNo source exists with the requested source_idCall list() and choose a valid source_id

Configuration persistence failed.

{
"error": "Configuration save failed",
"code": 503
}
Error CodeTitleDescriptionResolution
CONFIG_SAVE_FAILEDConfiguration save failedThe updated source configuration could not be persistedCheck storage health and retry