The Admin REST API provides full CRUD access to endpoints, prompts, and execution data. It follows standard REST conventions with JSON request/response bodies.
Base URL
https://api.endprompt.app/admin/v1
All admin API routes are prefixed with /admin/v1/.
Authentication
Include your admin API key in every request:
curl -X GET https://api.endprompt.app/admin/v1/endpoints \
-H "x-api-key: epa_your_admin_key_here"
See Admin API Keys for details on creating and managing keys.
All responses use a consistent wrapper:
{
"succeeded": true,
"messages": ["Endpoint created successfully"],
"data": { ... }
}
| Field | Type | Description |
|---|
succeeded | boolean | Whether the operation was successful |
messages | string[] | Status messages or error details |
data | object/array | The response payload |
Endpoints
List Endpoints
Optional query parameters:
| Parameter | Type | Description |
|---|
search | string | Filter by name |
visibility | string | Public or Private |
Get Endpoint
GET /admin/v1/endpoints/{id}
Returns full endpoint details including input and output field definitions.
Create Endpoint
{
"name": "Text Summarizer",
"path": "/api/v1/summarize",
"description": "Summarizes long text into bullet points",
"visibility": "Private"
}
Update Endpoint
PUT /admin/v1/endpoints/{id}
Supports partial updates — only include the fields you want to change:
{
"description": "Updated description"
}
Delete Endpoint
DELETE /admin/v1/endpoints/{id}
Soft-deletes the endpoint. It can be restored later.
POST /admin/v1/endpoints/{id}/input-fields
{
"name": "text",
"dataType": "string",
"isRequired": true,
"description": "The text to summarize",
"maxLength": 10000
}
Add Output Field
POST /admin/v1/endpoints/{id}/output-fields
{
"name": "summary",
"dataType": "string",
"description": "The summarized text"
}
Prompts
List Prompts
GET /admin/v1/prompts?endpointId={endpointId}
| Parameter | Type | Description |
|---|
endpointId | guid | Required. The endpoint to list prompts for |
status | string | Filter by status: Draft, Live, Archived |
search | string | Search by prompt name |
Get Prompt
GET /admin/v1/prompts/{id}
Returns full prompt details including the Liquid template content.
Create Prompt
{
"endpointId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Summarizer v1",
"template": "Summarize the following text:\n\n{{ inputs.text }}\n\nReturn JSON with a 'summary' field.",
"llmModel": "gpt-4o",
"temperature": 30,
"maxTokens": 500
}
New prompts are created in Draft status.
Update Prompt
PUT /admin/v1/prompts/{id}
Supports partial updates. If the template changes, a new version is created automatically:
{
"template": "Updated template with {{ inputs.text }}",
"changeNotes": "Improved output formatting"
}
Prompt Lifecycle
Prompts follow a status workflow: Draft → Live → Archived.
| Action | Endpoint | Description |
|---|
| Promote | POST /admin/v1/prompts/{id}/promote | Draft → Live |
| Set Default | POST /admin/v1/prompts/{id}/set-default | Make this the endpoint’s default prompt |
| Archive | POST /admin/v1/prompts/{id}/archive | Remove from active use |
| Unarchive | POST /admin/v1/prompts/{id}/unarchive | Restore to Draft |
| Duplicate | POST /admin/v1/prompts/{id}/duplicate | Clone as a new Draft |
Only Live prompts can be set as the endpoint default. Promote a Draft prompt before setting it as default.
Prompt Versions
# List all versions
GET /admin/v1/prompts/{id}/versions
# Get specific version
GET /admin/v1/prompts/{id}/versions/{versionNumber}
# Restore a version as a new Draft
POST /admin/v1/prompts/{id}/versions/{versionNumber}/restore
Validate Template
Check a Liquid template for syntax errors and unknown variables:
POST /admin/v1/prompts/validate
{
"endpointId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"template": "Summarize: {{ inputs.text }}"
}
List Available Models
GET /admin/v1/prompts/models
Returns all LLM models with capabilities (reasoning, streaming, tools, JSON mode), context windows, and pricing.
Execution
Execute Endpoint
POST /api/v1/{endpoint-path}
{
"text": "Your content here"
}
Admin keys (epa_) can execute endpoints, so you can use a single key for both management and testing.
Logs & Stats
List Execution Logs
| Parameter | Type | Description |
|---|
endpointId | guid | Filter by endpoint |
source | string | Api, TestPage, Internal |
page | int | Page number (default: 1) |
pageSize | int | Results per page (default: 20, max: 50) |
Get Execution Log
Returns full execution details including rendered prompt, raw LLM response, and parsed output.