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

# Create workspace

> Create a custom workspace for your organization. Callers provide a display name and use the returned stable workspace ID for references.



## OpenAPI

````yaml /api-reference/v1/workspaces-v1.yaml post /workspaces
openapi: 3.0.3
info:
  title: Coval Workspaces API
  version: 1.0.0
  description: Manage workspaces for your organization.
  contact:
    name: Coval API Support
    email: support@coval.dev
    url: https://docs.coval.ai
  license:
    name: Proprietary
    url: https://coval.dev/terms
servers:
  - url: https://api.coval.dev/v1
    description: Production API
security:
  - ApiKeyAuth: []
tags:
  - name: Workspaces
    description: Workspace lifecycle operations
paths:
  /workspaces:
    post:
      tags:
        - Workspaces
      summary: Create workspace
      description: >-
        Create a custom workspace for your organization. Callers provide a
        display name and use the returned stable workspace ID for references.
      operationId: createWorkspace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkspaceRequest'
      responses:
        '201':
          description: Workspace created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceResponse'
        '400':
          $ref: '#/components/responses/InvalidArgument'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/PermissionDenied'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateWorkspaceRequest:
      type: object
      required:
        - display_name
      additionalProperties: false
      properties:
        slug:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          pattern: ^[a-z0-9]+(-[a-z0-9]+)*$
          deprecated: true
          description: >-
            Deprecated and ignored, including when null. Use the returned id to
            identify the workspace.
        display_name:
          type: string
          minLength: 1
          maxLength: 200
    WorkspaceResponse:
      type: object
      required:
        - workspace
      properties:
        workspace:
          $ref: '#/components/schemas/WorkspaceResource'
    WorkspaceResource:
      type: object
      required:
        - id
        - slug
        - display_name
        - status
        - workspace_type
        - created_at
        - last_updated_at
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 26
        slug:
          type: string
          deprecated: true
          description: Deprecated compatibility identifier. Use id to identify a workspace.
        display_name:
          type: string
        status:
          type: string
          enum:
            - ACTIVE
            - ARCHIVED
            - DELETED
        workspace_type:
          type: string
          enum:
            - DEFAULT
            - CUSTOM
        created_at:
          type: string
          format: date-time
        last_updated_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              enum:
                - INVALID_ARGUMENT
                - UNAUTHENTICATED
                - PERMISSION_DENIED
                - NOT_FOUND
                - ALREADY_EXISTS
                - INTERNAL
            message:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                    nullable: true
                  description:
                    type: string
  responses:
    InvalidArgument:
      description: Invalid request body or validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    PermissionDenied:
      description: API key lacks the required permission scope
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Conflict:
      description: Workspace lifecycle operation conflicts with the current state
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: >-
        Service temporarily unavailable (transient organization DB routing
        outage; retryable)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.