> ## 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.

# Get Prompt

> Gets details about a specific prompt including name, description,

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

Gets details about a specific prompt including name, description,
and prompt content.

Use this method to:

* Retrieve prompt details for editing
* Get prompt content for execution

### Examples

* Get prompt details:

  ```yaml theme={null}
  promptId: "07e03a28-65a5-4d98-b532-8ea67b188048"
  ```

## Endpoint

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

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/GetPrompt" \
  --header "Authorization: Bearer $ONA_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "promptId": "<prompt-id>"
}'
```

```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.GetPromptRequest(
    prompt_id="<prompt-id>",
)
response = ona.services.agent.get_prompt(request)
print(response)
```

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

async function main() {
  const ona = createClientFromEnv();
  const request = create(GetPromptRequestSchema, {
    promptId: "<prompt-id>",
  });
  const response = await ona.services.agent.getPrompt(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.GetPromptRequest{
		PromptId: "<prompt-id>",
	})
	response, err := ona.Services.Agent.GetPrompt(context.Background(), request)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(response.Msg)
}
```

```json Request body theme={null}
{
  "promptId": "<prompt-id>"
}
```

## Request

`gitpod.v1.GetPromptRequest`

| Field | Type | Required | Description |
| - | - | - | - |
| `promptId` | string | No | Constraints: `string.uuid=true`. |

## Response

`gitpod.v1.GetPromptResponse`

| 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.