Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Get prompt by commit

GET/v1/private/prompts/by-commit/{commit}Get prompt by commit

Get prompt by commit

Parameters

commitstringpathrequired

pattern ^[a-zA-Z0-9]{8}$

Responses

200OKapplication/json
objectPrompt_Detail
created_atstring · date-time
created_bystring
descriptionstring

maxLength 255 · minLength 0 · pattern (?s)^\s*(\S.*\S|\S)\s*$

idstring · uuid
last_updated_atstring · date-time
last_updated_bystring
latest_versionobject
Show child attributes
change_descriptionstring
commitstring

version short unique identifier, generated if absent. it must be 8 characters long

pattern ^[a-zA-Z0-9]{8}$

created_atstring · date-time
created_bystring
environmentstring

Deprecated: use 'environments' instead

maxLength 150 · minLength 0 · pattern ^[A-Za-z0-9_-]+$

environmentsarray of string

maxItems 100 · minItems 0 · uniqueItems true

Show child attributes

maxItems 100 · minItems 0 · uniqueItems true

idstring · uuid

version unique identifier, generated if absent

metadataobject
prompt_idstring · uuid
tagsarray of string

uniqueItems true

Show child attributes

uniqueItems true

templatestringrequired

minLength 1

template_structurestring

one of "text", "chat"

typestring

one of "mustache", "jinja2", "python"

variablesarray of string

uniqueItems true

Show child attributes

uniqueItems true

version_numberstring

sequential version number in the format v<N>; null for masks

version_typestring

version type discriminator; defaults to prompt_version

one of "prompt_version", "mask"

namestringrequired

minLength 1

project_idstring · uuid

Project ID. Takes precedence over project_name when both are provided.

requested_versionobjectPromptVersion_Detail ↑
tagsarray of string

uniqueItems true

Show child attributes

uniqueItems true

template_structurestring

Template structure type: 'text' or 'chat'. Immutable after creation.

one of "text", "chat" · default "text"

version_countinteger · int64
Example response
{
  "created_at": "2026-06-09T00:00:00Z",
  "created_by": "string",
  "description": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "last_updated_at": "2026-06-09T00:00:00Z",
  "last_updated_by": "string",
  "latest_version": {
    "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"
  },
  "name": "string",
  "project_id": "00000000-0000-0000-0000-000000000000",
  "requested_version": {
    "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"
  },
  "tags": [
    "string"
  ],
  "template_structure": "text",
  "version_count": 0
}
400Bad Requestapplication/json
objectErrorMessage_Detail
errorsarray of string
Show child attributes
Example response
{
  "errors": [
    "string"
  ]
}
404Not Foundapplication/json
objectErrorMessage_Detail
errorsarray of string
Show child attributes
Example response
{
  "errors": [
    "string"
  ]
}
409Conflictapplication/json
objectErrorMessage_Detail
errorsarray of string
Show child attributes
Example response
{
  "errors": [
    "string"
  ]
}
Documentation menu