For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Copy to LLMGithubGo to App
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
    • Overview
  • Python SDK
    • Reference
    • REST API Client
  • Typescript SDK
    • Overview
    • Opik TS
    • Prompts
    • Opik Query Language (OQL)
  • Rest API
    • Overview
        • GETGet prompts
        • POSTCreate prompt
        • POSTCreate prompt version
        • PATCHUpdate prompt versions
        • GETGet prompt by id
        • PUTUpdate prompt
        • DELDelete prompt
        • POSTDelete prompts
        • GETGet prompt by commit
        • GETGet prompt version by id
        • GETGet prompt version by sequential number
        • GETGet prompt versions
        • POSTGet prompts by commits
        • POSTRestore prompt version
        • POSTRetrieve prompt version
        • POSTRetrieve prompt versions by ids
        • PATCHSet prompt version environment
LogoLogo
Copy to LLMGithubGo to App
Rest APIAPI ReferencePrompts

Get prompt version by id

GET
/v1/private/prompts/versions/:versionId
GET
/api/v1/private/prompts/versions/:versionId
$curl http://localhost:5173/api/v1/private/prompts/versions/versionId
1{
2 "template": "string",
3 "id": "string",
4 "prompt_id": "string",
5 "commit": "string",
6 "version_number": "string",
7 "metadata": {},
8 "type": "mustache",
9 "version_type": "prompt_version",
10 "environment": "string",
11 "change_description": "string",
12 "tags": [
13 "string"
14 ],
15 "variables": [
16 "string"
17 ],
18 "template_structure": "text",
19 "created_at": "2024-01-15T09:30:00Z",
20 "created_by": "string"
21}
Get prompt version by id
Was this page helpful?
Previous

Get prompt version by sequential number

Next
Built with

Path parameters

versionIdstringRequiredformat: "uuid"

Response

Prompt version resource
templatestring>=1 character
idstringformat: "uuid"
version unique identifier, generated if absent
prompt_idstringRead-onlyformat: "uuid"
commitstringformat: "^[a-zA-Z0-9]{8}$"
version short unique identifier, generated if absent. it must be 8 characters long
version_numberstringRead-only

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

metadataobject
typeenum
Allowed values:
version_typeenum

version type discriminator; defaults to prompt_version

Allowed values:
environmentstringformat: "^[A-Za-z0-9_-]+$"0-150 characters
change_descriptionstring
tagslist of strings
variableslist of stringsRead-only
template_structureenumRead-only
Allowed values:
created_atdatetimeRead-only
created_bystringRead-only

Errors

404
Not Found Error