# Retrieve prompt version

**POST** `/v1/private/prompts/versions/retrieve`

Retrieve prompt version. When project_name is supplied the lookup is scoped to that project: a prompt belonging to a different project is never matched, and an unknown project name returns 404. Legacy prompts with no project are still resolved as a deprecated fallback, signalled by the X-Opik-Deprecation response header.

Base URL: `https://www.comet.com/opik/api`

Tags: `Prompts`

## Authorization

This operation requires no authorization.

## Request body

Optional. Media type: `application/json`

### Example request body

```json
{
  "commit": "string",
  "environment": "string",
  "name": "string",
  "project_name": "string",
  "version_number": "string"
}
```

## Responses

| Status | Description | Media type |
| --- | --- | --- |
| `200` | OK | `application/json` |
| `400` | Bad Request | `application/json` |
| `404` | Not Found | `application/json` |
| `422` | Unprocessable Content | `application/json` |

### Example response: 200 — OK

```json
{
  "change_description": "string",
  "commit": "string",
  "created_at": "2026-06-09T00:00:00Z",
  "created_by": "string",
  "environment": "string",
  "environments": [
    "string"
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "metadata": {},
  "prompt_id": "00000000-0000-0000-0000-000000000000",
  "tags": [
    "string"
  ],
  "template": "string",
  "template_structure": "chat",
  "type": "jinja2",
  "variables": [
    "string"
  ],
  "version_number": "string",
  "version_type": "mask"
}
```

### Example response: 400 — Bad Request

```json
{
  "errors": [
    "string"
  ]
}
```

### Example response: 404 — Not Found

```json
{
  "errors": [
    "string"
  ]
}
```

### Example response: 422 — Unprocessable Content

```json
{
  "errors": [
    "string"
  ]
}
```

## Related pages

- [Activate a pairing session](./activatepairingsession.md)
- [Add blueprint to existing config](./updateagentconfig.md)
- [Add items to annotation queue](./additemstoannotationqueue.md)
- [Add span comment](./addspancomment.md)
- [Add span feedback score](./addspanfeedbackscore.md)
- [Add thread comment](./addthreadcomment.md)
- [Add trace comment](./addtracecomment.md)
- [Add trace feedback score](./addtracefeedbackscore.md)
- [Agent Configs](./tags/agent-configs.md)
- [Agent Insights](./tags/agent-insights.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
