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

# Create Workspace

> Create a new workspace.

Creator automatically receives ADMIN permissions on the workspace.



## OpenAPI

````yaml /api-reference/openapi.json post /workspaces
openapi: 3.1.0
info:
  title: Aspect Platform API
  description: A FastAPI application for Aspect Platform functionality
  version: 0.0.0
servers:
  - url: https://api.aspect.inc
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /workspaces:
    post:
      tags:
        - Workspaces
      summary: Create Workspace
      description: |-
        Create a new workspace.

        Creator automatically receives ADMIN permissions on the workspace.
      operationId: post_Workspaces_workspaces
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkspaceCreateRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WorkspaceCreateRequest:
      properties:
        name:
          type: string
          title: Name
          description: Name of the workspace
        icon:
          anyOf:
            - $ref: '#/components/schemas/CustomIconUpdateRequest'
            - type: 'null'
          description: Initial icon for the workspace
      type: object
      required:
        - name
      title: WorkspaceCreateRequest
      description: API request schema for creating a workspace
    WorkspaceCreateResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Workspace ID
        name:
          type: string
          title: Name
          description: Workspace name
        icon:
          anyOf:
            - $ref: '#/components/schemas/CustomIconData'
            - type: 'null'
          description: Workspace icon data
        actions:
          type: integer
          title: Actions
          description: User's permission bitmap on this workspace
        created_by_user_id:
          type: string
          format: uuid
          title: Created By User Id
          description: ID of the user that created the workspace
        created:
          type: string
          format: date-time
          title: Created
          description: Creation timestamp
        updated:
          type: string
          format: date-time
          title: Updated
          description: Last update timestamp
      type: object
      required:
        - id
        - name
        - actions
        - created_by_user_id
        - created
        - updated
      title: WorkspaceCreateResponse
      description: API response schema for creating a workspace
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CustomIconUpdateRequest:
      properties:
        type:
          anyOf:
            - $ref: '#/components/schemas/CustomIconType'
            - type: 'null'
          description: Type of icon to set
        emoji:
          anyOf:
            - type: string
            - type: 'null'
          title: Emoji
          description: Emoji character to use (if type is emoji)
        attachment_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Attachment Id
          description: Attachment ID for uploaded image (if type is upload)
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
          description: Hex color code (if type is color, e.g., '#3B82F6')
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: External URL for image (if type is url)
        clear:
          type: boolean
          title: Clear
          description: Set to true to remove the icon entirely
          default: false
      type: object
      title: CustomIconUpdateRequest
      description: >-
        API request format for updating a custom icon.


        Used when updating icon via API. Supports:

        - Setting an emoji icon (type=emoji, emoji=<value>)

        - Setting an upload icon (type=upload, attachment_id=<uuid>)

        - Setting a color icon (type=color, color=<hex>)

        - Setting a URL icon (type=url, url=<value>)

        - Clearing the icon (clear=true)


        Only one type can be set at a time. Setting any type clears the
        previous.
    CustomIconData:
      properties:
        type:
          $ref: '#/components/schemas/CustomIconType'
          description: Type of icon (emoji, upload, color, or url)
        emoji:
          anyOf:
            - type: string
            - type: 'null'
          title: Emoji
          description: Emoji character (if type is emoji)
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
          description: Hex color code (if type is color)
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: External URL (if type is url)
        upload:
          anyOf:
            - $ref: '#/components/schemas/AttachmentResponse'
            - type: 'null'
          description: >-
            Full attachment object (if type is upload, populated by service
            layer)
      type: object
      required:
        - type
      title: CustomIconData
      description: |-
        Icon data for storage and API responses.

        Stored in JSONB `icon` column. For upload type icons:
        - The `upload` field is None in the database
        - The actual attachment is stored via `icon_attachment_id` FK
        - Service layer populates `upload` from the attachment when loading
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CustomIconType:
      type: string
      enum:
        - emoji
        - upload
        - color
        - url
      title: CustomIconType
      description: Type of custom icon
    AttachmentResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Resource identifier
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: Signed download URL
        url_expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Url Expires At
          description: When the URL expires
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
          description: User who uploaded. None if deleted.
        filename:
          type: string
          title: Filename
          description: Original filename
        mime_type:
          type: string
          title: Mime Type
          description: MIME type of the file
        size_bytes:
          type: integer
          title: Size Bytes
          description: File size in bytes
        uploaded:
          type: boolean
          title: Uploaded
          description: Whether the file has been uploaded
        created:
          type: string
          format: date-time
          title: Created
          description: Created timestamp
        updated:
          type: string
          format: date-time
          title: Updated
          description: Updated timestamp
      type: object
      required:
        - id
        - user_id
        - filename
        - mime_type
        - size_bytes
        - uploaded
        - created
        - updated
      title: AttachmentResponse
      description: |-
        API response schema for an attachment.

        Inherits id, url, url_expires_at from SignedUrlData.
        Overrides url and url_expires_at as Optional since attachments
        may not be uploaded yet.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT in Authorization header. 'Bearer ' prefix optional.
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Aspect API key (sk_...) in Authorization header. 'Bearer ' optional.

````