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

Set prompt version environment

PATCH
/v1/private/prompts/versions/:versionId/environments
PATCH
/api/v1/private/prompts/versions/:versionId/environments
$curl -X PATCH http://localhost:5173/api/v1/private/prompts/versions/versionId/environments \
> -H "Content-Type: application/json" \
> -d '{
> "environments": [
> "string"
> ]
>}'

Set or clear the environment owned by a prompt version. Setting a non-null environment moves ownership atomically: any previous owner of that environment for the same prompt has its environment cleared in the same transaction. Setting null clears the environment from the version. The environment must already exist in the workspace registry; unknown names return 404.

Was this page helpful?
Previous

Find retention rules

Next
Built with

Path parameters

versionIdstringRequiredformat: "uuid"

Request

This endpoint expects an object.
environmentslist of stringsRequired

Errors

400
Bad Request Error
404
Not Found Error