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

Retrieve prompt versions by ids

POST
/v1/private/prompts/versions/retrieve-by-ids
POST
/api/v1/private/prompts/versions/retrieve-by-ids
$curl -X POST http://localhost:5173/api/v1/private/prompts/versions/retrieve-by-ids \
> -H "Content-Type: application/json" \
> -d '{
> "ids": [
> "string"
> ]
>}'
1[
2 {
3 "template": "string",
4 "id": "string",
5 "prompt_id": "string",
6 "commit": "string",
7 "version_number": "string",
8 "metadata": {},
9 "type": "mustache",
10 "version_type": "prompt_version",
11 "environments": [
12 "string"
13 ],
14 "change_description": "string",
15 "tags": [
16 "string"
17 ],
18 "variables": [
19 "string"
20 ],
21 "template_structure": "text",
22 "created_at": "2024-01-15T09:30:00Z",
23 "created_by": "string",
24 "environment": "string"
25 }
26]
Retrieve a batch of prompt versions by their ids. Typically used by the UI to resolve mask overlays.
Was this page helpful?
Previous

Set prompt version environment

Next
Built with

Request

This endpoint expects an object.
idslist of stringsRequired

Response

OK
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:
environmentslist of strings
change_descriptionstring
tagslist of strings
variableslist of stringsRead-only
template_structureenumRead-only
Allowed values:
created_atdatetimeRead-only
created_bystringRead-only
environmentstringformat: "^[A-Za-z0-9_-]+$"0-150 charactersDeprecated

Deprecated: use ‘environments’ instead

Errors

400
Bad Request Error