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

# Create a workspace

> Creates a workspace — a router-mode MCP server scoped to an optional set of integrations. An empty/omitted `integrations` list exposes all integrations. The environment (sandbox/production) is derived from the API key, not the request body.



## OpenAPI

````yaml /api-reference/openapi.json post /mcp/workspaces
openapi: 3.0.0
info:
  title: RouteMCP API
  description: >-
    Unified API for integrations. Connect to multiple providers through a single
    API.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.routemcp.io/api/v1
    description: Production
security:
  - bearerAuth: []
tags: []
paths:
  /mcp/workspaces:
    post:
      tags:
        - MCP Workspaces
      summary: Create a workspace
      description: >-
        Creates a workspace — a router-mode MCP server scoped to an optional set
        of integrations. An empty/omitted `integrations` list exposes all
        integrations. The environment (sandbox/production) is derived from the
        API key, not the request body.
      operationId: WorkspaceController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkspaceDto'
            example:
              name: Support Bot
              environment: sandbox
              integrations:
                - github
                - gmail
              openRouterApiKey: sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxx
              model: anthropic/claude-sonnet-4-6
              statelessMode: false
      responses:
        '201':
          description: Workspace created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Workspace'
                required:
                  - data
              example:
                data:
                  id: 0191e6a2-1c4d-7a3b-9f10-2b3c4d5e6f70
                  organizationId: 0191e6a2-0000-7000-8000-000000000001
                  name: Support Bot
                  mode: router
                  environment: sandbox
                  allowedTools: null
                  toolkitFilter:
                    - github
                    - gmail
                  settings: {}
                  statelessMode: false
                  status: active
                  llm:
                    configured: true
                    model: anthropic/claude-sonnet-4-6
                    verificationStatus: verified
                    verifiedAt: '2026-05-29T10:05:00.000Z'
                    updatedAt: '2026-05-29T10:05:00.000Z'
                  createdAt: '2026-05-29T10:00:00.000Z'
                  updatedAt: '2026-05-29T10:00:00.000Z'
        '422':
          description: Validation Errors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    example: false
                  statusCode:
                    type: integer
                    example: 400
                    default: 400
                  message:
                    type: string
                    example: Validation Errors.
                    default: Validation Errors.
                  errors:
                    type: object
                    additionalProperties:
                      type: string
                    example:
                      email: email should not be empty
                  timestamp:
                    type: string
                    format: date-time
                    example: '2026-02-06T12:00:00.000Z'
                  path:
                    type: string
                    example: /api/v1/example
                required:
                  - success
                  - statusCode
                  - message
                  - errors
                  - timestamp
                  - path
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    example: false
                  statusCode:
                    type: integer
                    example: 429
                    default: 429
                  message:
                    type: string
                    example: Too Many Requests
                    default: Too Many Requests
                  timestamp:
                    type: string
                    format: date-time
                    example: '2026-02-06T12:00:00.000Z'
                  path:
                    type: string
                    example: /api/v1/example
                required:
                  - success
                  - statusCode
                  - message
                  - timestamp
                  - path
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    example: false
                  statusCode:
                    type: integer
                    example: 500
                    default: 500
                  message:
                    type: string
                    example: Internal server error.
                    default: Internal server error.
                  timestamp:
                    type: string
                    format: date-time
                    example: '2026-02-06T12:00:00.000Z'
                  path:
                    type: string
                    example: /api/v1/example
                required:
                  - success
                  - statusCode
                  - message
                  - timestamp
                  - path
      security:
        - bearerAuth: []
components:
  schemas:
    CreateWorkspaceDto:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: Workspace display name.
          example: Support Bot
        integrations:
          type: array
          items:
            type: string
            enum:
              - github
              - gmail
              - hubspot
              - jira
              - monday-crm
              - notion
              - pipedrive
              - quickbooks-online
              - salesforce
              - slack
              - xero
              - zoho-books
              - zoho-crm
            example: github
          description: >-
            Toolkit slugs to expose (e.g. `github`, `gmail`). Omit or pass `[]`
            to expose all integrations.
          example:
            - github
            - gmail
        openRouterApiKey:
          type: string
          minLength: 8
          writeOnly: true
          description: >-
            Optional per-workspace OpenRouter API key (bring-your-own LLM key).
            Input-only: it is validated, encrypted at rest, and NEVER returned
            in any response. Setting it routes this workspace's chat through
            OpenRouter; when omitted, the platform default model is used. Use
            `DELETE /mcp/workspaces/{id}/llm-key` to remove it later.
          example: sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxx
        model:
          type: string
          description: >-
            Optional OpenRouter model id in `vendor/model` format. Only
            meaningful alongside (or after) an `openRouterApiKey`.
          example: anthropic/claude-sonnet-4-6
        statelessMode:
          type: boolean
          default: false
          description: >-
            When `true`, `POST /mcp/{workspaceId}/chat` for this workspace
            persists NOTHING (no session, messages, tool I/O, or end-user
            context) and the caller must supply prior turns via the `history`
            field on each chat request. Usage metadata (token/request counts) is
            still recorded for billing; analytics events are content-free.
            Default `false`.
          example: false
      required:
        - name
    Workspace:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 0191e6a2-1c4d-7a3b-9f10-2b3c4d5e6f70
        organizationId:
          type: string
          format: uuid
          example: 0191e6a2-0000-7000-8000-000000000001
        name:
          type: string
          example: Support Bot
        mode:
          type: string
          enum:
            - router
          example: router
        environment:
          type: string
          enum:
            - sandbox
            - production
          example: sandbox
        allowedTools:
          type: array
          items:
            type: string
          nullable: true
          example: null
        toolkitFilter:
          type: array
          items:
            type: string
          nullable: true
          example:
            - github
            - gmail
        settings:
          type: object
          additionalProperties: true
          example: {}
        statelessMode:
          type: boolean
          description: >-
            Whether this workspace runs in stateless chat mode. When `true`,
            `POST /mcp/{workspaceId}/chat` persists nothing and callers must
            supply prior turns via `history`.
          example: false
        status:
          type: string
          enum:
            - active
            - archived
          example: active
        llm:
          type: object
          description: >-
            Bring-your-own LLM (OpenRouter) status for the workspace.
            `openRouterApiKey` is never echoed here. When no key is configured,
            the platform falls back to its default model.
          properties:
            configured:
              type: boolean
              description: Whether a per-workspace OpenRouter key is set.
              example: true
            model:
              type: string
              nullable: true
              description: >-
                The configured OpenRouter model id (`vendor/model`), or `null`
                when none is set.
              example: anthropic/claude-sonnet-4-6
            verificationStatus:
              type: string
              enum:
                - verified
                - invalid
                - unverified
              nullable: true
              description: >-
                Result of validating the configured key: `verified` (key works),
                `invalid` (key rejected), `unverified` (not yet checked), or
                `null` when no key is configured.
              example: verified
            verifiedAt:
              type: string
              format: date-time
              nullable: true
              description: When the key was last successfully verified, if ever.
              example: '2026-05-29T10:05:00.000Z'
            updatedAt:
              type: string
              format: date-time
              nullable: true
              description: When the LLM key/model was last changed.
              example: '2026-05-29T10:05:00.000Z'
          required:
            - configured
            - model
            - verificationStatus
        createdAt:
          type: string
          format: date-time
          example: '2026-05-29T10:00:00.000Z'
        updatedAt:
          type: string
          format: date-time
          example: '2026-05-29T10:00:00.000Z'
      required:
        - id
        - organizationId
        - name
        - mode
        - environment
        - settings
        - statelessMode
        - status
        - createdAt
        - updatedAt
  securitySchemes:
    bearerAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Enter your API key with the Bearer prefix — e.g. Bearer sk_live_xxx
        (production) or Bearer sk_test_xxx (sandbox)

````