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

# Get v2workspaces

> Fetch a workspace



## OpenAPI

````yaml /api-reference/swagger.yml get /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}:
    get:
      tags:
        - Prisme.ai Workspaces
      description: Fetch a workspace
      operationId: getWorkspace
      parameters:
        - name: workspaceId
          in: path
          description: Workspace id
          required: true
          schema:
            type: string
        - name: version
          in: query
          description: Optional version
          schema:
            type: string
      responses:
        '200':
          description: Success Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DSULReadOnly'
        '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:
    DSULReadOnly:
      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'
        automations:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/AutomationMeta'
        pages:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/PageMeta'
        imports:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DetailedAppInstance'
        createdAt:
          type: string
        updatedAt:
          type: string
        createdBy:
          type: string
    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'
    AutomationMeta:
      type: object
      required:
        - name
      additionalProperties: false
      properties:
        description:
          $ref: '#/components/schemas/LocalizedText'
        private:
          type: boolean
          description: >-
            Set this to true if you don't want your automation to be accessible
            outside of your app. Default is false.
          example: false
        disabled:
          type: boolean
          description: Set this to true if you want to turn off this automation.
          example: true
        name:
          $ref: '#/components/schemas/LocalizedText'
        slug:
          type: string
          description: Unique & human readable id across current workspace's automations
        arguments:
          additionalProperties:
            $ref: '#/components/schemas/TypedArgument'
        validateArguments:
          type: boolean
        when:
          $ref: '#/components/schemas/When'
        labels:
          type: array
          items:
            type: string
            pattern: ^[0-9A-Za-z._:-]{2,60}$
        events:
          $ref: '#/components/schemas/ProcessedEvents'
        updatedAt:
          type: string
        createdAt:
          type: string
        updatedBy:
          type: string
        createdBy:
          type: string
        checksum:
          type: string
    PageMeta:
      type: object
      required:
        - name
      description: Page
      additionalProperties: false
      properties:
        name:
          $ref: '#/components/schemas/LocalizedText'
        description:
          $ref: '#/components/schemas/LocalizedText'
        workspaceId:
          type: string
        workspaceSlug:
          type: string
        id:
          type: string
        slug:
          type: string
        blocks:
          type: array
          items:
            type: object
            properties:
              slug:
                type: string
              appInstance:
                type: string
        labels:
          type: array
          items:
            type: string
            pattern: ^[0-9A-Za-z._:-]{2,60}$
        events:
          $ref: '#/components/schemas/ProcessedEvents'
        createdBy:
          type: string
        updatedBy:
          type: string
        createdAt:
          type: string
        updatedAt:
          type: string
        permissions:
          $ref: '#/components/schemas/PermissionsMap'
        customDomains:
          type: array
          items:
            type: string
        colorScheme:
          type: string
          enum:
            - auto
            - light
            - dark
        checksum:
          type: string
        favicon:
          type: string
    DetailedAppInstance:
      type: object
      required:
        - appSlug
        - slug
        - automations
        - blocks
        - events
      additionalProperties: false
      properties:
        appSlug:
          type: string
          description: App unique id
        appName:
          $ref: '#/components/schemas/LocalizedText'
        appVersion:
          type: string
          description: Defaults to the latest known app version
        slug:
          type: string
          description: >-
            Unique & human readable id across current workspace's appInstances,
            which will be used to call this app automations
        disabled:
          type: boolean
          description: If disabled, this appInstance will be ignored during execution
        labels:
          type: array
          items:
            type: string
            pattern: ^[0-9A-Za-z._:-]{2,60}$
        updatedAt:
          type: string
        createdAt:
          type: string
        updatedBy:
          type: string
        createdBy:
          type: string
        checksum:
          type: string
        photo:
          type: string
        automations:
          $ref: '#/components/schemas/AppAutomations'
        events:
          $ref: '#/components/schemas/ProcessedEvents'
        blocks:
          $ref: '#/components/schemas/AppBlocks'
    AnyValue: {}
    WorkspaceEventConfiguration:
      type: object
      additionalProperties: false
      properties:
        schema:
          additionalProperties:
            $ref: '#/components/schemas/TypedArgument'
    When:
      type: object
      anyOf:
        - required:
            - events
        - required:
            - schedules
        - required:
            - endpoint
        - {}
      properties:
        events:
          type: array
          items:
            type: string
          example:
            - prismeaiMessenger.event
        schedules:
          $ref: '#/components/schemas/Schedules'
        endpoint:
          oneOf:
            - type: boolean
              example: >-
                Set to true in order to activate HTTP endpoint. Slug will be
                trigger name by default
            - type: string
              example: Slug name
    ProcessedEvents:
      type: object
      properties:
        emit:
          type: array
          items:
            type: string
        listen:
          type: array
          items:
            type: string
        autocomplete:
          type: array
          items:
            type: object
            required:
              - event
            properties:
              event:
                type: string
                example: prismeaiMessenger.message
              autocomplete:
                $ref: '#/components/schemas/EmitAutocomplete'
    PermissionsMap:
      type: object
      additionalProperties:
        type: object
        properties:
          role:
            $ref: '#/components/schemas/Role'
          policies:
            $ref: '#/components/schemas/Policies'
    AppAutomations:
      type: array
      items:
        type: object
        required:
          - slug
          - name
          - arguments
        properties:
          slug:
            type: string
          name:
            $ref: '#/components/schemas/LocalizedText'
          description:
            $ref: '#/components/schemas/LocalizedText'
          arguments:
            additionalProperties:
              $ref: '#/components/schemas/TypedArgument'
    AppBlocks:
      type: array
      items:
        type: object
        required:
          - slug
        properties:
          slug:
            type: string
          url:
            type: string
          edit:
            $ref: '#/components/schemas/TypedArgument'
          name:
            $ref: '#/components/schemas/LocalizedText'
          description:
            $ref: '#/components/schemas/LocalizedText'
          arguments:
            additionalProperties:
              $ref: '#/components/schemas/TypedArgument'
    Schedules:
      type: array
      items:
        type: string
      example:
        - 2021-12-25T00:00
        - '* * 1 * *'
    EmitAutocomplete:
      type: object
      additionalProperties:
        type: object
        properties:
          from:
            type: string
          path:
            type: string
          template:
            type: string
    Role:
      type: string
    Policies:
      properties:
        read:
          type: boolean
        write:
          type: boolean
        update:
          type: boolean
        create:
          type: boolean
        manage_permissions:
          type: boolean
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key

````