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

# Create Prompt

> Creates a new prompt.

`Unary` · [`Agents`](https://ona.com/docs/api-reference/generated/agent/overview)

Creates a new prompt.

Use this method to:

* Define new prompts for templates or commands
* Set up organization-wide prompt libraries

## Endpoint

```text theme={null}
POST /api/gitpod.v1.AgentService/CreatePrompt
```

Send a Bearer token as described in [Authentication](https://ona.com/docs/api-reference.md#authenticate-requests). If your organization uses a custom management-plane domain, replace `https://app.ona.com` with that domain.

## Request example

```bash cURL theme={null}
export ONA_HOST=https://app.ona.com
export ONA_API_KEY=<your-token>

curl --request POST \
  --url "$ONA_HOST/api/gitpod.v1.AgentService/CreatePrompt" \
  --header "Authorization: Bearer $ONA_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "name": "<name>"
}'
```

```python Python theme={null}
import gitpod.v1.agent_pb2 as agent_pb2
from ona_sdk import create_client_from_env

ona = create_client_from_env()
request = agent_pb2.CreatePromptRequest(
    name="<name>",
)
response = ona.services.agent.create_prompt(request)
print(response)
```

```typescript TypeScript theme={null}
import { create } from "@bufbuild/protobuf";
import { createClientFromEnv } from "@gitpod/sdk";
import { CreatePromptRequestSchema } from "@gitpod/sdk/gitpod/v1/agent_pb";

async function main() {
  const ona = createClientFromEnv();
  const request = create(CreatePromptRequestSchema, {
    name: "<name>",
  });
  const response = await ona.services.agent.createPrompt(request);
  console.log(response);
}

main().catch(console.error);
```

```go Go theme={null}
package main

import (
	"context"
	"fmt"
	"log"

	"connectrpc.com/connect"
	"github.com/gitpod-io/gitpod-sdk-go/sdk"
	gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
)

func main() {
	ona, err := sdk.NewFromEnv()
	if err != nil {
		log.Fatal(err)
	}

	request := connect.NewRequest(&gitpodpb.CreatePromptRequest{
		Name: "<name>",
	})
	response, err := ona.Services.Agent.CreatePrompt(context.Background(), request)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(response.Msg)
}
```

```json Request body theme={null}
{
  "name": "<name>"
}
```

## Request

`gitpod.v1.CreatePromptRequest`

| Field | Type | Required | Description |
| - | - | - | - |
| `name` | string | No | Constraints: `string.max_len=255, string.min_len=1`. |
| `description` | string | No | Constraints: `string.max_len=500, string.min_len=1`. |
| `prompt` | string | No | Constraints: `string.max_len=20000, string.min_len=1`. |
| `isTemplate` | boolean | No | |
| `isCommand` | boolean | No | |
| `command` | string | No | Constraints: `string.max_len=50, string.pattern=^[a-zA-Z0-9_-]*$`. |
| `isSkill` | boolean | No | |

## Response

`gitpod.v1.CreatePromptResponse`

| Field | Type | Required | Description |
| - | - | - | - |
| `prompt` | [Prompt](#type-gitpod-v1-prompt) | No | |

## Related types

> [accordion] Prompt
>
> `gitpod.v1.Prompt`
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `id` | string | No | |
> | `metadata` | [PromptMetadata](#type-gitpod-v1-prompt-metadata) | No | |
> | `spec` | [PromptSpec](#type-gitpod-v1-prompt-spec) | No | |

> [accordion] PromptMetadata
>
> `gitpod.v1.PromptMetadata`
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `organizationId` | string | No | organization\_id is the ID of the organization that contains the prompt Constraints: `string.uuid=true`. |
> | `name` | string | No | name is the human readable name of the prompt |
> | `description` | string | No | description is a description of what the prompt does |
> | `creator` | Subject | No | creator is the identity of the prompt creator |
> | `createdAt` | RFC 3339 timestamp | No | |
> | `updatedAt` | RFC 3339 timestamp | No | |

> [accordion] PromptSpec
>
> `gitpod.v1.PromptSpec`
>
> | Field | Type | Required | Description |
> | - | - | - | - |
> | `prompt` | string | No | prompt is the content of the prompt Constraints: `string.max_len=20000`. |
> | `isTemplate` | boolean | No | is\_template indicates if this prompt is a template |
> | `isCommand` | boolean | No | is\_command indicates if this prompt is a command |
> | `command` | string | No | command is the unique command string within the organization Constraints: `string.max_len=50, string.pattern=^[a-zA-Z0-9_-]*$`. |
> | `isSkill` | boolean | No | is\_skill indicates if this prompt is a skill (workflow instructions for agents) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.