> ## Documentation Index
> Fetch the complete documentation index at: https://docs.endprompt.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Admin API Overview

> Manage endpoints, prompts, and executions programmatically

The Admin API gives you full programmatic access to manage your Endprompt resources. Use it to automate workflows, integrate with CI/CD pipelines, or connect AI coding tools directly to your Endprompt workspace.

## What Can You Do?

<CardGroup cols={2}>
  <Card title="Manage Endpoints" icon="plug">
    Create, update, and delete endpoints. Define input and output schemas programmatically.
  </Card>

  <Card title="Manage Prompts" icon="wand-magic-sparkles">
    Create prompts, update templates, promote to Live, and manage the full prompt lifecycle.
  </Card>

  <Card title="Execute & Test" icon="play">
    Execute endpoints with inputs and get LLM outputs — ideal for automated testing.
  </Card>

  <Card title="Monitor & Analyze" icon="chart-line">
    Query execution stats, browse logs, and compare prompt performance.
  </Card>
</CardGroup>

## Two Ways to Access

The Admin API is available through two interfaces:

| Interface                           | Best For                                  | Protocol               |
| ----------------------------------- | ----------------------------------------- | ---------------------- |
| [REST API](/admin-api/rest-api)     | Scripts, CI/CD, backend integrations      | Standard HTTP/JSON     |
| [MCP Server](/admin-api/mcp-server) | AI coding tools (VS Code, Claude, Cursor) | Model Context Protocol |

Both interfaces use the same authentication and provide the same capabilities.

## Quick Start

<Steps>
  <Step title="Create an Admin API Key">
    Go to **API Keys** in your dashboard and create a key with the **Admin** type. [Learn more →](/admin-api/authentication)
  </Step>

  <Step title="Choose Your Interface">
    Use the [REST API](/admin-api/rest-api) for scripts and integrations, or the [MCP Server](/admin-api/mcp-server) to connect your AI coding tool.
  </Step>

  <Step title="Start Building">
    Create an endpoint, add fields, write a prompt, promote it to Live, and execute it — all without touching the dashboard.
  </Step>
</Steps>

## Example: Create and Deploy an Endpoint

Here's the typical workflow using the Admin API:

```
1. Create an endpoint         POST /admin/v1/endpoints
2. Add input fields           POST /admin/v1/endpoints/{id}/input-fields
3. Add output fields          POST /admin/v1/endpoints/{id}/output-fields
4. Create a prompt            POST /admin/v1/prompts
5. Promote to Live            POST /admin/v1/prompts/{id}/promote
6. Set as default             POST /admin/v1/prompts/{id}/set-default
7. Execute                    POST /api/v1/{endpoint-path}
```

<Tip>
  The same workflow works with MCP tools — AI coding assistants can execute these steps conversationally.
</Tip>

## Resources

The Admin API manages these resources:

| Resource            | Description                                                        |
| ------------------- | ------------------------------------------------------------------ |
| **Endpoints**       | API paths with input/output schemas, cache and rate-limit policies |
| **Prompts**         | Liquid templates with LLM configuration, versioning, and lifecycle |
| **Prompt Versions** | Immutable snapshots created automatically when templates change    |
| **Snippets**        | Reusable template fragments included via `{% include 'slug' %}`    |
| **Execution Logs**  | Read-only history with inputs, outputs, latency, tokens, and cost  |
| **Stats**           | Aggregated execution metrics per endpoint, prompt, or tenant       |
| **Models**          | Available LLM models with capabilities and pricing                 |
