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

# Update Space

> Update an existing space's name, description, icon, slug, or archive status



## OpenAPI

````yaml api/openapi.json patch /api/spaces/{id}
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/{id}:
    patch:
      tags:
        - Spaces
      summary: Update Space
      description: >-
        Update an existing space's name, description, icon, slug, or archive
        status
      parameters:
        - schema:
            type: string
            example: space_123
          required: true
          name: id
          in: path
      requestBody:
        description: Space update 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
                slug:
                  type: string
                  minLength: 1
                  maxLength: 100
                  pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
                isArchived:
                  type: boolean
                metadata:
                  $ref: '#/components/schemas/SpaceMetadata'
      responses:
        '200':
          description: Space updated 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
        '404':
          description: Space not found
      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.update('space_123', {
              name: 'Updated Name',
              description: 'New description'
            });
components:
  schemas:
    SpaceMetadata:
      type: object
      additionalProperties: {}
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Oai-Api-Key

````