> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upsolve.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish Workspace

> Publish the draft as a new version



## OpenAPI

````yaml post /v2/api/projects/{projectId}/workspaces/{workspaceId}/publish
openapi: 3.1.0
info:
  title: Upsolve API
  version: 1.5.0
servers:
  - url: https://api.upsolve.ai
security: []
tags: []
paths:
  /v2/api/projects/{projectId}/workspaces/{workspaceId}/publish:
    post:
      summary: Publish the draft as a new version
      description: Publish the draft as a new version
      operationId: PostV2ApiProjectsProjectIdWorkspacesWorkspaceIdPublish
      parameters:
        - name: projectId
          in: path
          required: true
          description: >-
            POST /v2/api/projects/:projectId/workspaces/:workspaceId/publish
            Parameter
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
        - name: workspaceId
          in: path
          required: true
          description: >-
            POST /v2/api/projects/:projectId/workspaces/:workspaceId/publish
            Parameter
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
      requestBody:
        description: >-
          POST /v2/api/projects/:projectId/workspaces/:workspaceId/publish
          Request body
        content:
          application/json:
            schema:
              type: object
              properties:
                apiKey:
                  type: string
                  minLength: 1
                  description: >-
                    Upsolve API key, generated under Account → Developer
                    settings in the Upsolve Hub. Keys are user-scoped: pass
                    organizationId alongside the key to select which org to act
                    on.
                  examples:
                    - up_embed_************
                organizationId:
                  description: >-
                    Your Upsolve organization's UUID — the org that owns the API
                    key and project. This is NOT a project organization: do not
                    pass a value registered via /projects/register-organization,
                    and do not pass an `externalId` (only
                    `projectOrganizationId` accepts those). Omit it when using
                    an org-bound API key — the org is read from the key and any
                    value sent here is ignored. Required only for user-scoped
                    API keys (created under Account → Developer settings) and
                    for the Supabase JWT path, where the org is ambiguous and
                    membership is verified against it.
                  examples:
                    - 123e4567-e89b-12d3-a456-426614174000
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                message:
                  description: >-
                    An optional message describing this version, like a commit
                    message. Trimmed, capped at 500 characters, and IMMUTABLE
                    once published -- there is no endpoint that changes it. Omit
                    it and readers show 'Version N'.
                  type: string
                  maxLength: 500
                bypassChecks:
                  description: >-
                    Publish WITHOUT running CI: the test cases and the row-level
                    security check are skipped, not overridden. Refused with
                    CI_NOT_ENFORCED when CI is off for this workspace, since
                    there would be nothing to skip. Owner or admin only. Always
                    audited: who, when, and what was failing at the time is
                    recorded on the version. Deprecated for organizations using
                    environments: there a publish runs no checks and this is
                    ignored; skip tests on a deployment instead.
                  type: boolean
                publishWithoutCi:
                  description: >-
                    Required to publish a workspace whose CI is switched off:
                    confirms the caller knows no test cases are replayed and no
                    row-level security is executed. Refused with
                    CI_DISABLED_UNCONFIRMED when omitted, and with
                    CI_ALREADY_ENABLED when CI is on for this workspace. Always
                    audited on the version. Choosing between turning CI on and
                    publishing unverified is the user's decision, not the
                    caller's. Deprecated for organizations using environments:
                    there a publish runs no checks and this is ignored; tests
                    run when a version is deployed.
                  type: boolean
                promote:
                  description: >-
                    Make this version the production one as soon as its publish
                    succeeds, so end users get it without a separate promote
                    call. Production moves only if it is still on the version it
                    was on when this publish was requested, so a release that
                    settled first is never undone. A publish that fails or is
                    stopped is not promoted. Omitted or false leaves production
                    where it is.
                  type: boolean
                rlsConfirmation:
                  description: >-
                    Only after a 409 with code
                    RLS_DESTRUCTIVE_CHANGE_UNCONFIRMED or
                    RLS_PRODUCTION_CHANGE_UNCONFIRMED: that response's
                    details.confirmation, sent back to go ahead with the
                    row-level security changes it listed. Owner or admin only.
                    Show the person the list and ask before sending it.
                  type: string
                  minLength: 1
                  maxLength: 64
              required: []
            examples:
              example1:
                value:
                  apiKey: up_embed_************
                  organizationId: 123e4567-e89b-12d3-a456-426614174000
      responses:
        '201':
          description: >-
            POST /v2/api/projects/:projectId/workspaces/:workspaceId/publish
            Positive response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    type: object
                    properties:
                      version:
                        type: number
                      status:
                        type: string
                        enum:
                          - publishing
                          - published
                          - failed
                      jobId:
                        type:
                          - string
                          - 'null'
                    required:
                      - version
                      - status
                      - jobId
                    additionalProperties: false
                required:
                  - status
                  - data
                additionalProperties: false
        '400':
          description: >-
            POST /v2/api/projects/:projectId/workspaces/:workspaceId/publish
            Negative response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: error
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                    required:
                      - message
                    additionalProperties: false
                required:
                  - status
                  - error
                additionalProperties: false
      security:
        - APIKEY_1: []
components:
  securitySchemes:
    APIKEY_1:
      type: apiKey
      in: query
      name: apiKey
      x-in-actual: body
      description: apiKey MUST be supplied within the request body instead of query

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.