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

# Create a new namespace

> Create a new namespace owned by the authenticated user or an organization. This endpoint is idempotent - if the namespace already exists and is owned by the user/org, returns success. Pass organizationId in the request body to create an org-owned namespace.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml put /namespaces/{name}
openapi: 3.1.0
info:
  title: Smithery Platform API
  description: >-
    API for the Smithery platform — discover, deploy, and manage MCP (Model
    Context Protocol) servers. Provides endpoints for browsing the server
    registry, managing deployments, creating scoped access tokens, and
    connecting to MCP servers.
  version: 1.0.0
servers:
  - url: https://api.smithery.ai
security:
  - bearerAuth: []
tags:
  - name: servers
    description: >-
      Browse the MCP server registry, manage server configuration, and handle
      deployments
  - name: skills
    description: Discover and search reusable prompt-based skills for MCP servers
  - name: tools
    description: Search for MCP tools across all registered servers
paths:
  /namespaces/{name}:
    put:
      tags:
        - namespaces
      summary: Create a new namespace
      description: >-
        Create a new namespace owned by the authenticated user or an
        organization. This endpoint is idempotent - if the namespace already
        exists and is owned by the user/org, returns success. Pass
        organizationId in the request body to create an org-owned namespace.
      operationId: putNamespaces:name
      parameters:
        - in: path
          name: name
          schema:
            type: string
            minLength: 3
            maxLength: 39
          required: true
      responses:
        '201':
          description: Namespace created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateNamespaceResponse'
        '400':
          description: Bad request (invalid name format or user already has a namespace)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NamespacesError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NamespacesError'
        '403':
          description: Forbidden - missing namespaces:write permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NamespacesError'
        '409':
          description: Conflict (namespace already exists)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NamespacesError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Smithery from '@smithery/api';

            const client = new Smithery({
              apiKey: process.env['SMITHERY_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.namespaces.set('xxx');

            console.log(response.createdAt);
components:
  schemas:
    CreateNamespaceResponse:
      type: object
      properties:
        name:
          type: string
          example: myorg
        createdAt:
          type: string
          example: '2024-01-01T00:00:00.000Z'
      required:
        - name
        - createdAt
      additionalProperties: false
    NamespacesError:
      type: object
      properties:
        error:
          type: string
          example: Unauthorized
      required:
        - error
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Smithery API key as Bearer token

````