Skip to content

Prompt Assets API

Manage versioned prompt templates used by AI agents. Supports A/B testing groups for optimization.

List Prompt Assets

http
GET /api/v1/prompt-assets?category=coding&language=python
Authorization: Bearer <token>

Query Parameters

ParameterTypeDescription
categorystringFilter by category (e.g., coding, testing, review)
languagestringFilter by programming language
frameworkstringFilter by framework
status_filterstringFilter by active, draft, deprecated

Select Best Prompt

Returns the best matching active prompt version for a given context.

http
GET /api/v1/prompt-assets/select?category=coding&language=python&framework=fastapi
Authorization: Bearer <token>

Get Prompt Asset

http
GET /api/v1/prompt-assets/{asset_id}
Authorization: Bearer <token>

Create Prompt Asset

Requires platform admin.

http
POST /api/v1/prompt-assets
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "FastAPI Coding Prompt",
  "category": "coding",
  "template": "You are an expert FastAPI developer...",
  "language": "python",
  "framework": "fastapi",
  "description": "Prompt for Python FastAPI code generation"
}

Update Prompt Asset

http
PUT /api/v1/prompt-assets/{asset_id}
Authorization: Bearer <token>

Delete Prompt Asset

http
DELETE /api/v1/prompt-assets/{asset_id}
Authorization: Bearer <token>

Versions

Create New Version

http
POST /api/v1/prompt-assets/{asset_id}/versions
Authorization: Bearer <token>
Content-Type: application/json

{
  "template": "Updated prompt template...",
  "change_note": "Improved error handling instructions",
  "ab_group": "B"
}

Deactivate Version

http
POST /api/v1/prompt-assets/versions/{version_id}/deactivate
Authorization: Bearer <token>

A/B Testing

Prompt versions can be assigned to A/B groups (A or B). The system automatically routes agents to different prompt versions for comparison. Use execution metrics to evaluate which version performs better.

Forgexa — AI Software Factory