Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Set prompt version environment

PATCH/v1/private/prompts/versions/{versionId}/environmentsSet prompt version environment

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.

Parameters

versionIdstring · uuidpathrequired

Request body

application/json
objectPromptVersionEnvironmentUpdate

Replace the full set of environments assigned to a prompt version. The provided set becomes the new complete set of environments for this version. - Non-empty set: assigns each environment to this version; if another version of the same prompt currently owns any of those environments, ownership is moved atomically. - Empty set: clears all environments from this version. All environments must already exist in the workspace registry; unknown names return 404.

environmentsarray of stringrequired

maxItems 100 · minItems 0 · uniqueItems true

Show child attributes

maxItems 100 · minItems 0 · uniqueItems true

Example request
{
  "environments": [
    "string"
  ]
}

Responses

204No Content
400Bad Requestapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
404Not Foundapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
Documentation menu