> ## Documentation Index
> Fetch the complete documentation index at: https://prismeai-legacy.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Patch v2workspaces

> Update a workspace



## OpenAPI

````yaml /api-reference/swagger.yml patch /v2/workspaces/{workspaceId}
openapi: 3.0.0
info:
  version: 1.0.0
  title: Prisme.ai APIs
  description: Prisme.ai APIs specifications
  termsOfService: https://www.prisme.ai/mentions-legales
  contact:
    name: Prisme.ai Support Team
    email: support@prisme.ai
    url: https://www.prisme.ai
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.eda.prisme.ai
  - url: http://localhost:3001
security:
  - BearerAuth: []
  - WorkspaceApiKeyAuth: []
  - BearerAuth: []
    WorkspaceApiKeyAuth: []
paths:
  /v2/workspaces/{workspaceId}:
    patch:
      tags:
        - Prisme.ai Workspaces
      description: Update a workspace
      operationId: updateWorkspace
      parameters:
        - name: workspaceId
          in: path
          description: Workspace id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DSULPatch'
      responses:
        '200':
          description: Success Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workspace'
        '400':
          description: Bad parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadParametersError'
        '401':
          description: AuthenticationError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '403':
          description: Bad permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Object not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectNotFoundError'
components:
  schemas:
    DSULPatch:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          pattern: "^[0-9A-Za-zÀ-ÖØ-öø-ÿ ,.'-\_]{1,60}$"
        description:
          $ref: '#/components/schemas/LocalizedText'
        photo:
          type: string
        config:
          $ref: '#/components/schemas/Config'
        blocks:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Block'
        slug:
          type: string
        id:
          type: string
        labels:
          type: array
          items:
            type: string
            pattern: ^[0-9A-Za-z._:-]{2,60}$
        customDomains:
          type: array
          items:
            type: string
        registerWorkspace:
          type: boolean
          description: >-
            If true, make this workspace metadata available to all workspaces
            with this variable : {{global.workspacesRegistry[WORKSPACE_SLUG]}}
        repositories:
          type: object
          description: Remote versioning repositories
          additionalProperties:
            $ref: '#/components/schemas/WorkspaceRepository'
        secrets:
          type: object
          additionalProperties: false
          properties:
            schema:
              additionalProperties:
                $ref: '#/components/schemas/TypedArgument'
        events:
          $ref: '#/components/schemas/WorkspaceEventsConfiguration'
    Workspace:
      $ref: '#/components/schemas/DSUL'
    BadParametersError:
      type: object
      properties:
        error:
          type: string
          example: BadParameters
        message:
          type: string
        details: {}
    AuthenticationError:
      type: object
      properties:
        error:
          type: string
          example: AuthenticationError
        message:
          type: string
          example: Unauthenticated
    ForbiddenError:
      type: object
      properties:
        error:
          type: string
          example: ForbiddenError
        message:
          type: string
          example: Forbidden
    ObjectNotFoundError:
      type: object
      properties:
        error:
          type: string
          example: ObjectNotFound
        message:
          type: string
    LocalizedText:
      oneOf:
        - type: object
          additionalProperties:
            type: string
          example:
            fr: Bonjour
            en: Hello
        - type: string
          example: Bonjour
    Config:
      type: object
      additionalProperties: false
      properties:
        schema:
          additionalProperties:
            $ref: '#/components/schemas/TypedArgument'
        block:
          type: string
        value: {}
    Block:
      type: object
      description: Block
      additionalProperties: false
      properties:
        description:
          $ref: '#/components/schemas/LocalizedText'
        name:
          $ref: '#/components/schemas/LocalizedText'
        photo:
          type: string
        url:
          type: string
          description: >-
            A block can be a javascript bundled file. Host it on the internet
            and put its url here.
          deprecated: true
        edit:
          $ref: '#/components/schemas/TypedArgument'
          deprecated: true
        block:
          type: string
          description: A block can extends another one by giving its name here
          deprecated: true
        config:
          $ref: '#/components/schemas/AnyValue'
          description: default config applied to the Block. Usefull for extended Blocks.
          deprecated: true
        automation:
          oneOf:
            - type: string
            - type: object
              properties:
                slug:
                  type: string
                payload:
                  $ref: '#/components/schemas/AnyValue'
        blocks:
          type: array
          items:
            type: object
            required:
              - slug
            properties:
              slug:
                type: string
              appInstance:
                type: string
              onInit:
                oneOf:
                  - type: string
                  - type: object
                    properties:
                      event:
                        type: string
                      payload:
                        $ref: '#/components/schemas/AnyValue'
              updateOn:
                type: string
              automation:
                oneOf:
                  - type: string
                  - type: object
                    properties:
                      slug:
                        type: string
                      payload:
                        $ref: '#/components/schemas/AnyValue'
            additionalProperties: true
        css:
          type: string
          description: Css applied to Block
        schema:
          $ref: '#/components/schemas/TypedArgument'
    WorkspaceRepository:
      type: object
      required:
        - name
        - config
      additionalProperties: false
      properties:
        name:
          type: string
        type:
          type: string
          enum:
            - git
            - archive
        mode:
          type: string
          enum:
            - read-write
            - read-only
        config:
          anyOf:
            - type: object
              required:
                - url
                - branch
              properties:
                url:
                  type: string
                branch:
                  type: string
                auth:
                  type: object
                  properties:
                    user:
                      type: string
                    password:
                      type: string
                    sshkey:
                      type: string
            - type: object
        pull:
          type: object
          properties:
            exclude:
              type: array
              items:
                type: object
                required:
                  - path
                properties:
                  path:
                    type: string
    TypedArgument:
      type: object
      properties:
        type:
          type: string
          enum:
            - string
            - number
            - object
            - array
            - boolean
            - localized:string
            - localized:number
            - localized:boolean
        format:
          type: string
        properties:
          additionalProperties:
            $ref: '#/components/schemas/TypedArgument'
        title:
          $ref: '#/components/schemas/LocalizedText'
        description:
          $ref: '#/components/schemas/LocalizedText'
        items:
          $ref: '#/components/schemas/TypedArgument'
        ui:widget:
          type: string
        ui:options:
          type: object
        secret:
          type: boolean
        event:
          type: boolean
    WorkspaceEventsConfiguration:
      type: object
      additionalProperties: false
      properties:
        mapping:
          type: object
          additionalProperties: true
          description: >-
            Custom mapping which will be directly sent to underlying database
            (Elasticsearch/Opensearch)
        types:
          description: Custom configuration per event type
          additionalProperties:
            $ref: '#/components/schemas/WorkspaceEventConfiguration'
    DSUL:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          pattern: "^[0-9A-Za-zÀ-ÖØ-öø-ÿ ,.'-\_]{1,60}$"
        description:
          $ref: '#/components/schemas/LocalizedText'
        photo:
          type: string
        config:
          $ref: '#/components/schemas/Config'
        blocks:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Block'
        slug:
          type: string
        id:
          type: string
        labels:
          type: array
          items:
            type: string
            pattern: ^[0-9A-Za-z._:-]{2,60}$
        customDomains:
          type: array
          items:
            type: string
        registerWorkspace:
          type: boolean
          description: >-
            If true, make this workspace metadata available to all workspaces
            with this variable : {{global.workspacesRegistry[WORKSPACE_SLUG]}}
        repositories:
          type: object
          description: Remote versioning repositories
          additionalProperties:
            $ref: '#/components/schemas/WorkspaceRepository'
        secrets:
          type: object
          additionalProperties: false
          properties:
            schema:
              additionalProperties:
                $ref: '#/components/schemas/TypedArgument'
        events:
          $ref: '#/components/schemas/WorkspaceEventsConfiguration'
    AnyValue: {}
    WorkspaceEventConfiguration:
      type: object
      additionalProperties: false
      properties:
        schema:
          additionalProperties:
            $ref: '#/components/schemas/TypedArgument'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key

````