> ## 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.

# Deploy To Environment

> Deploy a published version to an environment: check its tables and columns exist in that environment's database, run the test cases if the environment requires them, warm the caches, then make it the version that environment serves. Returns a deployment to poll.



## OpenAPI

````yaml post /v2/api/projects/{projectId}/workspaces/{workspaceId}/environments/{environment}/deployments
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}/environments/{environment}/deployments:
    post:
      summary: 'Deploy a published version to an environment: che…'
      description: >-
        Deploy a published version to an environment: check its tables and
        columns exist in that environment's database, run the test cases if the
        environment requires them, warm the caches, then make it the version
        that environment serves. Returns a deployment to poll.
      operationId: >-
        PostV2ApiProjectsProjectIdWorkspacesWorkspaceIdEnvironmentsEnvironmentDeployments
      parameters:
        - name: projectId
          in: path
          required: true
          description: The project the workspace belongs to.
          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})$
            description: The project the workspace belongs to.
        - name: workspaceId
          in: path
          required: true
          description: The workspace.
          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})$
            description: The workspace.
        - name: environment
          in: path
          required: true
          description: 'Where to deploy: `production` or a project environment''s slug.'
          schema:
            type: string
            description: 'Where to deploy: `production` or a project environment''s slug.'
      requestBody:
        description: >-
          POST
          /v2/api/projects/:projectId/workspaces/:workspaceId/environments/:environment/deployments
          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})$
                version:
                  type: integer
                  minimum: 1
                  maximum: 9007199254740991
                  description: The published version to deploy.
                message:
                  description: A note recorded with the deployment.
                  type: string
                  maxLength: 500
                bypassChecks:
                  description: >-
                    Skip the test cases and row-level security check this
                    environment requires. Owners and admins only, and recorded
                    on the deployment. The compatibility check always runs. Ask
                    the person before setting this.
                  type: boolean
                deployWithoutTests:
                  description: >-
                    Confirms deploying to production when production does not
                    require tests. Required in that case, refused otherwise. Ask
                    the person before setting this.
                  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:
                - version
            examples:
              example1:
                value:
                  apiKey: up_embed_************
                  organizationId: 123e4567-e89b-12d3-a456-426614174000
        required: true
      responses:
        '201':
          description: >-
            POST
            /v2/api/projects/:projectId/workspaces/:workspaceId/environments/:environment/deployments
            Positive response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    type: object
                    properties:
                      deploymentId:
                        type: string
                        description: >-
                          The deployment's id: poll `GET
                          …/deployments/{deploymentId}`.
                      status:
                        type: string
                        enum:
                          - pending
                          - running
                          - succeeded
                          - failed
                          - cancelled
                        description: >-
                          pending (queued), running, succeeded (the pointer
                          moved), failed, or cancelled.
                    required:
                      - deploymentId
                      - status
                    additionalProperties: false
                required:
                  - status
                  - data
                additionalProperties: false
        '400':
          description: >-
            POST
            /v2/api/projects/:projectId/workspaces/:workspaceId/environments/:environment/deployments
            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.