Skip to main content
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.

Response Format

All responses use a consistent wrapper:
{
  "succeeded": true,
  "messages": ["Endpoint created successfully"],
  "data": { ... }
}
FieldTypeDescription
succeededbooleanWhether the operation was successful
messagesstring[]Status messages or error details
dataobject/arrayThe response payload

Endpoints

List Endpoints

GET /admin/v1/endpoints
Optional query parameters:
ParameterTypeDescription
searchstringFilter by name
visibilitystringPublic or Private

Get Endpoint

GET /admin/v1/endpoints/{id}
Returns full endpoint details including input and output field definitions.

Create Endpoint

POST /admin/v1/endpoints
{
  "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.

Add Input Field

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}
ParameterTypeDescription
endpointIdguidRequired. The endpoint to list prompts for
statusstringFilter by status: Draft, Live, Archived
searchstringSearch by prompt name

Get Prompt

GET /admin/v1/prompts/{id}
Returns full prompt details including the Liquid template content.

Create Prompt

POST /admin/v1/prompts
{
  "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.
ActionEndpointDescription
PromotePOST /admin/v1/prompts/{id}/promoteDraft → Live
Set DefaultPOST /admin/v1/prompts/{id}/set-defaultMake this the endpoint’s default prompt
ArchivePOST /admin/v1/prompts/{id}/archiveRemove from active use
UnarchivePOST /admin/v1/prompts/{id}/unarchiveRestore to Draft
DuplicatePOST /admin/v1/prompts/{id}/duplicateClone 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

GET /admin/v1/logs
ParameterTypeDescription
endpointIdguidFilter by endpoint
sourcestringApi, TestPage, Internal
pageintPage number (default: 1)
pageSizeintResults per page (default: 20, max: 50)

Get Execution Log

GET /admin/v1/logs/{id}
Returns full execution details including rendered prompt, raw LLM response, and parsed output.