Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Retrieve prompt versions by ids

POST/v1/private/prompts/versions/retrieve-by-idsRetrieve prompt versions by ids

Retrieve a batch of prompt versions by their ids. Typically used by the UI to resolve mask overlays.

Request body

application/json
objectPromptVersionIdsRequest_Detail
idsarray of string · uuidrequired

maxItems 1000 · minItems 1

Show child attributes

maxItems 1000 · minItems 1

Example request
{
  "ids": [
    "00000000-0000-0000-0000-000000000000"
  ]
}

Responses

200OKapplication/json
array of object
Show array items
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"

Example response
[
  {
    "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"
  }
]
400Bad Requestapplication/json
objectErrorMessage_Detail
errorsarray of string
Show child attributes
Example response
{
  "errors": [
    "string"
  ]
}
Documentation menu