> 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/17.latest/add-ons/prompt/api.md).

# API

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

## Endpoints

| Method | Endpoint                                                                                 | Description                       |
| ------ | ---------------------------------------------------------------------------------------- | --------------------------------- |
| GET    | [`/prompts`](/ai-in-umbraco/17.latest/add-ons/prompt/api/list.md)                        | List all prompts                  |
| GET    | [`/prompts/{idOrAlias}`](/ai-in-umbraco/17.latest/add-ons/prompt/api/get.md)             | Get a prompt by ID or alias       |
| GET    | [`/prompts/{alias}/exists`](/ai-in-umbraco/17.latest/add-ons/prompt/api/alias-exists.md) | Check if a prompt alias is in use |
| POST   | [`/prompts`](/ai-in-umbraco/17.latest/add-ons/prompt/api/create.md)                      | Create a new prompt               |
| PUT    | [`/prompts/{idOrAlias}`](/ai-in-umbraco/17.latest/add-ons/prompt/api/update.md)          | Update an existing prompt         |
| DELETE | [`/prompts/{idOrAlias}`](/ai-in-umbraco/17.latest/add-ons/prompt/api/delete.md)          | Delete a prompt                   |
| POST   | [`/prompts/{idOrAlias}/execute`](/ai-in-umbraco/17.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/17.latest/add-ons/prompt/concepts.md)
* [Template Syntax](/ai-in-umbraco/17.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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
