Resources API
Manage agents, skills, rules, and commands via the API.
The Resources API provides a unified interface for managing all resource types (agents, skills, rules, commands) across the three-tier inheritance model.
Effective content (bulk sync)
GET /api/v1/resources/effectiveReturns the effective (merged) content for all resources. This is the primary endpoint used by the CLI during sync.
Query parameters:
| Parameter | Description |
|---|---|
organization_id | Organization scope |
project_id | Project scope (optional) |
resource_type | Filter by type: agent, skill, rule, command |
Single effective content
GET /api/v1/resources/:id/effectiveReturns the merged content for a single resource.
Tiered view
GET /api/v1/resources/:id/tieredReturns the resource content at each tier separately (platform, organization, project), showing how they compose.
Fork a resource
POST /api/v1/resources/:id/forkCreates a snapshot copy of a resource at a lower tier. The forked resource is independent from the original.
Publish
POST /api/v1/resources/:id/publishPublish a resource to make it available to downstream tiers.
Versions
List versions
GET /api/v1/resources/:id/versionsReturns all versions of a resource, ordered by version number.
Show version
GET /api/v1/resources/:id/versions/:hashReturns a specific version by its content hash.
Rollback
POST /api/v1/resources/:id/versions/rollback
Content-Type: application/json
{
"version_hash": "abc123..."
}Roll back to a previous version.
Check for upgrades
GET /api/v1/resources/:id/versions/upgrade_availableCheck if a newer version is available from a parent tier.
Upgrade
POST /api/v1/resources/:id/versions/upgradeUpgrade to the latest parent tier version.
Diff
GET /api/v1/resources/:id/diff/:from_hash/:to_hashCompare two versions of a resource.
Stats
GET /api/v1/resources/:id/statsResource performance statistics (session count, tokens, cost, quality scores).
Compare versions
GET /api/v1/resources/:id/stats/compareStatistical comparison between two resource versions (p-value, significance, recommendation).
Import
POST /:org_id/resources/import
Content-Type: application/json
{
"resources": [
{
"name": "rails-expert",
"resource_type": "agent",
"content": "..."
}
]
}Import local resources to the organization or project level.