Skip to main content
POST
Publish a version to an environment

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
resourceType
enum<string>
required

Resource type an environment is attached to. Only canvases (prompt) are supported today.

Available options:
prompt
resourceId
string<uuid>
required

Canvas (prompt) ID

envName
string
required

Environment name. Lowercase letters, digits and single hyphens between segments (no leading, trailing or consecutive hyphens), at most 64 characters. Leading/trailing whitespace is trimmed before validation.

production is the system environment every canvas has; it is the only reserved name you can publish to. The names production, promoted, latest and draft are reserved and cannot be used for custom environments, and a custom name cannot be a UUID.

The same rules apply to the environment_name field of POST /v2/chat/completions, which runs the version currently published to that environment of the given canvas_id (environment_name cannot be combined with version_id or application_id, and returns 404 when the environment does not exist or has no published version).

Maximum string length: 64
Pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
Example:

"staging"

versionId
string<uuid>
required

ID of the prompt version to publish. Must belong to the canvas.

autoCreate
boolean

Create the environment if it does not exist yet. Not needed for production, which is always created on demand.

Response

Version published

environment
object
required

An environment of a canvas. Timestamps are ISO 8601 strings.

Example:
version
object
required

A prompt version as returned by environment operations. variables and configuration follow the prompt-version schemas of the main API; they are typed loosely here.

Example: