Skip to content

The App Sources API lets you manage the configured package sources that Hoody queries when resolving application packages. Use these endpoints to list, create, update, delete, sync, and diagnose sources across providers like nix, pkgx, appimage, oci, registry, and system.

List every configured package source along with its type, provider, priority, enabled state, and provider-specific configuration.

This endpoint takes no parameters.

Terminal window
curl -X GET https://api.hoody.example/api/v1/run/sources \
-H "Authorization: Bearer <token>"
[
{
"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
Terminal window
curl -X GET https://api.hoody.example/api/v1/run/sources/nixpkgs/diagnostics \
-H "Authorization: Bearer <token>"
{
"source_id": "nixpkgs",
"status": "ok",
"last_success_at": "2025-01-15T10:25:00Z",
"last_error_at": null,
"last_error": null,
"last_search_latency_ms": 142,
"last_sync_job_id": "550e8400-e29b-41d4-a716-446655440000",
"cache_hint": "fresh",
"effective_enabled_reason": null,
"provider_details": {
"channel": "nixos-unstable",
"rev": "abc123def456"
}
}

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

This endpoint takes no parameters.

The request body is a SourceConfig object.

FieldTypeRequiredDescription
source_idstringYesUnique source identifier
enabledbooleanYesWhether this source is active for searches
priorityintegerYesSource priority (higher values are searched first and ranked higher)
providerstringYesProvider kind: nix, pkgx, appimage, oci, registry, system, or any
source_typestringYesImplementation type: 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, or trusted-list-file
pinobjectNoPin configuration (URL and optional integrity verification fields)
configobjectNoProvider-specific configuration (varies by source_type)
Terminal window
curl -X POST https://api.hoody.example/api/v1/run/sources \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"source_id": "nixpkgs-stable",
"enabled": true,
"priority": 90,
"provider": "nix",
"source_type": "nix-flake",
"pin": {
"url": "https://github.com/NixOS/nixpkgs",
"sha256": "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
},
"config": {
"flake": "nixpkgs",
"channel": "nixos-24.05"
}
}'
[
{
"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": "nixpkgs-stable",
"enabled": true,
"priority": 90,
"provider": "nix",
"source_type": "nix-flake",
"pin": {
"url": "https://github.com/NixOS/nixpkgs",
"sha256": "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
},
"config": {
"flake": "nixpkgs",
"channel": "nixos-24.05"
}
}
]

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

NameInTypeRequiredDescription
source_idpathstringYesSource identifier

Send a partial SourceConfig object containing only the fields you want to change. Fields not included are left unchanged. Common mergeable fields include enabled, priority, pin, and config.

Terminal window
curl -X PATCH https://api.hoody.example/api/v1/run/sources/nixpkgs \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"enabled": false,
"priority": 120
}'
{
"source_id": "nixpkgs",
"enabled": false,
"priority": 120,
"provider": "nix",
"source_type": "nix-flake",
"pin": {
"url": "https://github.com/NixOS/nixpkgs"
},
"config": {
"flake": "nixpkgs"
}
}

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

NameInTypeRequiredDescription
source_idpathstringYesSource identifier

This endpoint takes no request body.

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

Source deleted successfully. No content returned.

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 takes no request body.

Terminal window
curl -X POST https://api.hoody.example/api/v1/run/sources/nixpkgs/sync \
-H "Authorization: Bearer <token>"
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"kind": "source-sync",
"status": "queued",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z",
"error": null,
"result_type": null,
"result": null,
"progress": null
}

Trigger a sync operation for all enabled sources. Returns immediately with a job handle.

Poll for completion with GET /api/v1/run/jobs/{job_id}?wait=done&timeout_ms=30000.

This endpoint takes no parameters.

This endpoint takes no request body.

Terminal window
curl -X POST https://api.hoody.example/api/v1/run/sources/sync \
-H "Authorization: Bearer <token>"
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"kind": "source-sync",
"status": "queued",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z",
"error": null,
"result_type": null,
"result": null,
"progress": null
}