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

# Update Draft

> Patch several draft tables and columns together, under one optimistic lock



## OpenAPI

````yaml patch /v2/api/projects/{projectId}/workspaces/{workspaceId}/draft
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}/draft:
    patch:
      summary: Patch several draft tables and columns together, …
      description: >-
        Patch several draft tables and columns together, under one optimistic
        lock
      operationId: PatchV2ApiProjectsProjectIdWorkspacesWorkspaceIdDraft
      parameters:
        - name: projectId
          in: path
          required: true
          description: >-
            PATCH /v2/api/projects/:projectId/workspaces/:workspaceId/draft
            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: >-
            PATCH /v2/api/projects/:projectId/workspaces/:workspaceId/draft
            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: >-
          PATCH /v2/api/projects/:projectId/workspaces/:workspaceId/draft
          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})$
                tables:
                  maxItems: 5000
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        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})$
                      lockVersion:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        description: >-
                          The lockVersion of the row being edited; stale values
                          yield 412
                      displayName:
                        description: >-
                          Human-readable label shown in place of the real name.
                          Presentation only: queries keep using the real name.
                          Send null or an empty string to clear it.
                        type:
                          - string
                          - 'null'
                        maxLength: 255
                      description:
                        type:
                          - string
                          - 'null'
                      enabled:
                        type: boolean
                      rlsOverride:
                        type:
                          - string
                          - 'null'
                      tableNameOverride:
                        type:
                          - string
                          - 'null'
                    required:
                      - id
                      - lockVersion
                columns:
                  maxItems: 5000
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        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})$
                      lockVersion:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        description: >-
                          The lockVersion of the row being edited; stale values
                          yield 412
                      displayName:
                        description: >-
                          Human-readable label shown in place of the real name.
                          Presentation only: queries keep using the real name.
                          Send null or an empty string to clear it.
                        type:
                          - string
                          - 'null'
                        maxLength: 255
                      comment:
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                        enum:
                          - string
                          - number
                          - boolean
                          - date
                          - mixed
                          - json
                      selectable:
                        type: boolean
                      jsonParsed:
                        type: boolean
                      enabled:
                        type: boolean
                    required:
                      - id
                      - lockVersion
              required: []
            examples:
              example1:
                value:
                  apiKey: up_embed_************
                  organizationId: 123e4567-e89b-12d3-a456-426614174000
      responses:
        '200':
          description: >-
            PATCH /v2/api/projects/:projectId/workspaces/:workspaceId/draft
            Positive response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    type: object
                    properties:
                      tables:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            lockVersion:
                              type: number
                          required:
                            - id
                            - lockVersion
                          additionalProperties: false
                      columns:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            lockVersion:
                              type: number
                          required:
                            - id
                            - lockVersion
                          additionalProperties: false
                      draft:
                        type: object
                        properties:
                          hasDraft:
                            type: boolean
                          hasUnpublishedChanges:
                            type: boolean
                          updatedBy:
                            type:
                              - string
                              - 'null'
                          updatedAt:
                            type:
                              - string
                              - 'null'
                          baseVersion:
                            type:
                              - number
                              - 'null'
                        required:
                          - hasDraft
                          - hasUnpublishedChanges
                          - updatedBy
                          - updatedAt
                          - baseVersion
                        additionalProperties: false
                    required:
                      - tables
                      - columns
                      - draft
                    additionalProperties: false
                required:
                  - status
                  - data
                additionalProperties: false
        '400':
          description: >-
            PATCH /v2/api/projects/:projectId/workspaces/:workspaceId/draft
            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.