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

# Create Space

> Create a new space (knowledge base) in your organization



## OpenAPI

````yaml api/openapi.json post /api/spaces
openapi: 3.1.0
info:
  version: '0.1'
  title: Orchata API
servers:
  - url: https://api.orchata.ai
    description: Orchata API Server
security:
  - ApiKey: []
paths:
  /api/spaces:
    post:
      tags:
        - Spaces
      summary: Create Space
      description: Create a new space (knowledge base) in your organization
      requestBody:
        description: Space creation data
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                icon:
                  type: string
                  enum:
                    - folder
                    - book
                    - file-text
                    - database
                    - package
                    - archive
                    - briefcase
                    - inbox
                    - layers
                    - box
                description:
                  type: string
                  minLength: 1
                  maxLength: 500
                isArchived:
                  type: boolean
                archivedAt:
                  type:
                    - string
                    - 'null'
                  format: date-time
                metadata:
                  allOf:
                    - $ref: '#/components/schemas/SpaceMetadata'
                  default: {}
              required:
                - name
                - icon
                - description
      responses:
        '201':
          description: Space created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  space:
                    type: object
                    properties:
                      id:
                        type: string
                      orgId:
                        type: string
                      name:
                        type: string
                      slug:
                        type: string
                      icon:
                        type: string
                        enum:
                          - folder
                          - book
                          - file-text
                          - database
                          - package
                          - archive
                          - briefcase
                          - inbox
                          - layers
                          - box
                      description:
                        type: string
                      isArchived:
                        type: boolean
                      archivedAt:
                        type:
                          - string
                          - 'null'
                        format: date-time
                      metadata:
                        $ref: '#/components/schemas/SpaceMetadata'
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - id
                      - orgId
                      - name
                      - slug
                      - icon
                      - description
                      - isArchived
                      - archivedAt
                      - createdAt
                      - updatedAt
                required:
                  - space
        '403':
          description: Only organization owners can create spaces
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: |-
            import { Orchata } from '@orchata-ai/sdk';

            const client = new Orchata({ apiKey: 'oai_your_api_key' });

            const { space } = await client.spaces.create({
              name: 'Documentation',
              description: 'Product documentation and guides',
              icon: 'book'
            });
components:
  schemas:
    SpaceMetadata:
      type: object
      additionalProperties: {}
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Oai-Api-Key

````