> For the complete documentation index, see [llms.txt](https://docs.umbraco.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umbraco.com/ai-in-umbraco/19.latest/add-ons/prompt/api.md).

# API

Management API endpoints for Prompt add-on.

The Prompt Management API provides endpoints for creating, managing, and executing prompt templates.

## Endpoints

| Method | Endpoint                                                                                 | Description                       |
| ------ | ---------------------------------------------------------------------------------------- | --------------------------------- |
| GET    | [`/prompts`](/ai-in-umbraco/19.latest/add-ons/prompt/api/list.md)                        | List all prompts                  |
| GET    | [`/prompts/{idOrAlias}`](/ai-in-umbraco/19.latest/add-ons/prompt/api/get.md)             | Get a prompt by ID or alias       |
| GET    | [`/prompts/{alias}/exists`](/ai-in-umbraco/19.latest/add-ons/prompt/api/alias-exists.md) | Check if a prompt alias is in use |
| POST   | [`/prompts`](/ai-in-umbraco/19.latest/add-ons/prompt/api/create.md)                      | Create a new prompt               |
| PUT    | [`/prompts/{idOrAlias}`](/ai-in-umbraco/19.latest/add-ons/prompt/api/update.md)          | Update an existing prompt         |
| DELETE | [`/prompts/{idOrAlias}`](/ai-in-umbraco/19.latest/add-ons/prompt/api/delete.md)          | Delete a prompt                   |
| POST   | [`/prompts/{idOrAlias}/execute`](/ai-in-umbraco/19.latest/add-ons/prompt/api/execute.md) | Execute a prompt                  |

## Base URL

```
/umbraco/ai/management/api/v1
```

## Prompt Object

{% code title="Prompt" %}

```json
{
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "alias": "meta-description",
    "name": "Generate Meta Description",
    "description": "Creates SEO-friendly meta descriptions",
    "instructions": "Write a meta description for:\n\nTitle: {{pageTitle}}\nContent: {{bodyText}}",
    "profileId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "contextIds": ["e401f2ff-7d65-5c12-a1f7-e812859a1962"],
    "guardrailIds": [],
    "tags": ["seo", "content"],
    "isActive": true,
    "includeEntityContext": true,
    "optionCount": 1,
    "displayMode": "PropertyAction",
    "scope": {
        "allowRules": [
            {
                "contentTypeAliases": ["article", "blogPost"]
            }
        ],
        "denyRules": []
    },
    "version": 3,
    "dateCreated": "2024-01-15T10:30:00Z",
    "dateModified": "2024-01-20T14:45:00Z"
}
```

{% endcode %}

## Properties

| Property               | Type      | Description                                                  |
| ---------------------- | --------- | ------------------------------------------------------------ |
| `id`                   | guid      | Unique identifier                                            |
| `alias`                | string    | Unique alias for code references                             |
| `name`                 | string    | Display name                                                 |
| `description`          | string    | Optional description                                         |
| `instructions`         | string    | Prompt template with variables                               |
| `profileId`            | guid      | Associated AI profile (optional)                             |
| `contextIds`           | guid\[]   | AI Contexts to inject                                        |
| `guardrailIds`         | guid\[]   | Guardrails evaluated during execution                        |
| `tags`                 | string\[] | Organization tags                                            |
| `isActive`             | bool      | Whether the prompt is available                              |
| `includeEntityContext` | bool      | Include entity in system message                             |
| `optionCount`          | int       | Number of result options (0 = informational, 1 = single, 2+) |
| `displayMode`          | string    | `PropertyAction` or `TipTapTool`                             |
| `scope`                | object    | Scope rules (allow/deny) defining where the prompt can run   |
| `version`              | int       | Current version number                                       |
| `dateCreated`          | string    | Creation timestamp (UTC)                                     |
| `dateModified`         | string    | Last modification timestamp (UTC)                            |

## Related

* [Prompt Concepts](/ai-in-umbraco/19.latest/add-ons/prompt/concepts.md)
* [Template Syntax](/ai-in-umbraco/19.latest/add-ons/prompt/template-syntax.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.umbraco.com/ai-in-umbraco/19.latest/add-ons/prompt/api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
