---
title: "Get prompt by commit"
method: GET
path: "/v1/private/prompts/by-commit/{commit}"
tags: ["Prompts"]
---

# Get prompt by commit

`GET /v1/private/prompts/by-commit/{commit}`

Get prompt by commit

## Path parameters

- `commit` string, required

## Response `200`

OK

- PromptDetail
  - `id` string, uuid
  - `name` string, required
  - `project_id` string, uuid — Project ID. Takes precedence over project_name when both are provided.
  - `description` string
  - `template_structure` 'text' | 'chat' — Template structure type: 'text' or 'chat'. Immutable after creation.
  - `tags` string[]
  - `created_at` string, date-time
  - `created_by` string
  - `last_updated_at` string, date-time
  - `last_updated_by` string
  - `version_count` integer
  - `latest_version` PromptVersionDetail
    - `id` string, uuid — version unique identifier, generated if absent
    - `prompt_id` string, uuid
    - `commit` string — version short unique identifier, generated if absent. it must be 8 characters long
    - `version_number` string — sequential version number in the format v<N>; null for masks
    - `template` string, required
    - `metadata` JsonNodeDetail
    - `type` 'mustache' | 'jinja2' | 'python'
    - `version_type` 'prompt_version' | 'mask' — version type discriminator; defaults to prompt_version
    - `environment` string — Deprecated: use 'environments' instead
    - `environments` string[]
    - `change_description` string
    - `tags` string[]
    - `variables` string[]
    - `template_structure` 'text' | 'chat'
    - `created_at` string, date-time
    - `created_by` string
  - `requested_version` PromptVersionDetail
    - `id` string, uuid — version unique identifier, generated if absent
    - `prompt_id` string, uuid
    - `commit` string — version short unique identifier, generated if absent. it must be 8 characters long
    - `version_number` string — sequential version number in the format v<N>; null for masks
    - `template` string, required
    - `metadata` JsonNodeDetail
    - `type` 'mustache' | 'jinja2' | 'python'
    - `version_type` 'prompt_version' | 'mask' — version type discriminator; defaults to prompt_version
    - `environment` string — Deprecated: use 'environments' instead
    - `environments` string[]
    - `change_description` string
    - `tags` string[]
    - `variables` string[]
    - `template_structure` 'text' | 'chat'
    - `created_at` string, date-time
    - `created_by` string

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `409` — Conflict

---

[API](https://skmtc.net/comet-ml/apis/opik-rest-api.md) · [All operations](https://skmtc.net/comet-ml/apis/opik-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/comet-ml/opik-rest-api/versions/4ed2fbc97cc3/schema)
