/v1/private/prompts/versions/retrieveRetrieve prompt versionRetrieve 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.
Request body
application/json
commitstringenvironmentstringIf provided, resolves to the version mapped to this environment for the prompt; mutually exclusive with commit and version_number
namestringrequiredproject_namestringIf provided, scopes the search to the specified project; prompts belonging to other projects are never matched, and an unknown project name returns 404. Legacy prompts that are not scoped to any project are still matched as a deprecated fallback, signalled by the X-Opik-Deprecation response header.
version_numberstringIf provided, resolves to the version with this sequential number (e.g. v3); mutually exclusive with commit and environment
{
"commit": "string",
"environment": "string",
"name": "string",
"project_name": "string",
"version_number": "string"
}Responses
Headers
X-Opik-DeprecationPresent only when the prompt was resolved through the deprecated workspace-wide fallback, i.e. it has no project. Absent for project-scoped prompts.
change_descriptionstringcommitstringversion short unique identifier, generated if absent. it must be 8 characters long
created_atstring · date-timecreated_bystringenvironmentstringDeprecated: use 'environments' instead
environmentsarray of stringShow child attributes
idstring · uuidversion unique identifier, generated if absent
metadataobjectprompt_idstring · uuidtagsarray of stringShow child attributes
templatestringrequiredtemplate_structurestringtypestringvariablesarray of stringShow child attributes
version_numberstringsequential version number in the format v<N>; null for masks
version_typestringversion type discriminator; defaults to prompt_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"
}errorsarray of stringShow child attributes
{
"errors": [
"string"
]
}errorsarray of stringShow child attributes
{
"errors": [
"string"
]
}errorsarray of stringShow child attributes
{
"errors": [
"string"
]
}