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

# Create workspace

> Creates a new workspace. The creator is automatically added as an owner.



## OpenAPI

````yaml /api-reference/openapi.json post /workspaces/
openapi: 3.1.0
info:
  title: Nvisy API
  summary: Document processing and annotation platform
  description: >-
    Nvisy provides intelligent document processing, annotation, and analysis
    capabilities. This API enables document upload, OCR processing, embedding
    generation, and semantic search across your document collections.
  termsOfService: https://nvisy.com/legal/terms-of-service
  contact:
    name: Nvisy Support
    url: https://nvisy.com
    email: hello@nvisy.com
  license:
    name: Proprietary
    url: https://nvisy.com/license
  version: 0.1.0
servers: []
security: []
tags:
  - name: Accounts
    description: Account management and profile operations
  - name: Authentication
    description: Login, signup, and token management
  - name: Workspaces
    description: Workspace creation and management
  - name: Files
    description: File upload, download, and management
  - name: Members
    description: Workspace member management
  - name: Invites
    description: Workspace invitation handling
  - name: API Tokens
    description: API token management
  - name: Connections
    description: External provider connections
  - name: Pipelines
    description: Redaction pipeline configuration
  - name: Pipeline Runs
    description: Pipeline run execution and review
  - name: Policies
    description: Redaction policy configuration
  - name: Webhooks
    description: Webhook configuration
  - name: Notifications
    description: Account notification management
  - name: Health
    description: Service health checks
paths:
  /workspaces/:
    post:
      tags:
        - Workspaces
      summary: Create workspace
      description: Creates a new workspace. The creator is automatically added as an owner.
      requestBody:
        description: >-
          Request payload for creating a new workspace.


          Creates a new workspace with the specified configuration. The creator
          is

          automatically added as an owner of the workspace.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkspace'
        required: true
      responses:
        '201':
          description: Workspace response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workspace'
        '400':
          description: >-
            HTTP error response representation with security-conscious design.


            This struct contains all the information needed to serialize an
            error

            response, including the error name, message, HTTP status code,
            resource

            information, and user-friendly messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            HTTP error response representation with security-conscious design.


            This struct contains all the information needed to serialize an
            error

            response, including the error name, message, HTTP status code,
            resource

            information, and user-friendly messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '415':
          description: 'Expected request with `Content-Type: application/json`'
          content:
            text/plain:
              schema:
                type: string
        '422':
          description: Failed to deserialize the JSON body into the target type
          content:
            text/plain:
              schema:
                type: string
      security:
        - BearerAuth: []
components:
  schemas:
    CreateWorkspace:
      description: |-
        Request payload for creating a new workspace.

        Creates a new workspace with the specified configuration. The creator is
        automatically added as an owner of the workspace.
      type: object
      properties:
        description:
          description: Optional description of the workspace (max 500 characters).
          type: string
          maxLength: 500
        displayName:
          description: Display name of the workspace (2-32 characters).
          type: string
          maxLength: 32
          minLength: 2
        settings:
          $ref: '#/components/schemas/WorkspaceSettings'
          description: >-
            Workspace settings (approval requirement, data-retention rules).
            Defaults

            to requiring approval and keeping everything when omitted.
        slug:
          $ref: '#/components/schemas/Handle'
          description: Optional URL slug. Derived from the display name when omitted.
      required:
        - displayName
    Workspace:
      description: Workspace response.
      type: object
      properties:
        avatarUrl:
          description: Serve path of the workspace's avatar (logo), when set.
          type: string
        createdAt:
          description: Timestamp when the workspace was created.
          type: string
          format: date-time
        createdBy:
          description: Account that created this workspace.
          allOf:
            - $ref: '#/components/schemas/AccountRef'
        description:
          description: Description of the workspace.
          type: string
        displayName:
          description: Display name of the workspace.
          type: string
        memberRole:
          description: Role of the member in the workspace.
          allOf:
            - $ref: '#/components/schemas/WorkspaceRole'
        settings:
          description: Workspace settings (approval requirement, data-retention rules).
          allOf:
            - $ref: '#/components/schemas/WorkspaceSettings'
        slug:
          description: URL-safe workspace identifier.
          allOf:
            - $ref: '#/components/schemas/Handle'
        updatedAt:
          description: Timestamp when the workspace was last updated.
          type: string
          format: date-time
      required:
        - slug
        - displayName
        - settings
        - createdBy
        - memberRole
        - createdAt
        - updatedAt
    ErrorResponse:
      description: |-
        HTTP error response representation with security-conscious design.

        This struct contains all the information needed to serialize an error
        response, including the error name, message, HTTP status code, resource
        information, and user-friendly messages.
      type: object
      properties:
        message:
          description: User-friendly error message safe for client display
          type: string
        name:
          description: The error name/type identifier
          type: string
        resource:
          description: The resource that the error relates to (optional, set by handler)
          type: string
        suggestion:
          description: Helpful suggestion for resolving the error (optional)
          type: string
        validation:
          description: Validation error details for field-specific errors
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorDetail'
      required:
        - name
        - message
    WorkspaceSettings:
      description: >-
        Typed workspace settings, the JSON stored in the `workspaces.settings`
        column.
      type: object
      properties:
        ocr:
          description: How documents are rendered for OCR during detection.
          allOf:
            - $ref: '#/components/schemas/OcrPolicy'
          default: auto
        requireApproval:
          description: Whether approval is required before processed files become visible.
          type: boolean
          default: true
        retention:
          description: Data-retention rules for the workspace.
          allOf:
            - $ref: '#/components/schemas/RetentionSettings'
          default:
            auditLogs:
              mode: forever
            originalDocuments:
              mode: forever
            redactedDocuments:
              mode: forever
    Handle:
      description: >-
        Lowercase, dash-separated identifier used in URLs and as account
        handles.
      type: string
      maxLength: 32
      minLength: 3
      pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
    AccountRef:
      description: >-
        Public reference to the account behind a resource — whoever created it,

        uploaded it, triggered it, or performed it.


        Reused across resource responses so an account is always presented the
        same

        way: a handle plus an optional avatar.
      type: object
      properties:
        avatarUrl:
          description: Serve path of the account's avatar, when set.
          type: string
        displayName:
          description: Human-readable display name, when set.
          type: string
        username:
          description: Handle of the account.
          allOf:
            - $ref: '#/components/schemas/Handle'
      required:
        - username
    WorkspaceRole:
      description: >-
        Defines the role and permission level of a workspace member.


        This enumeration corresponds to the `WORKSPACE_ROLE` PostgreSQL enum and
        provides

        hierarchical access control for workspace members with clearly defined
        capabilities.
      oneOf:
        - description: Full workspace ownership and management capabilities
          type: string
          const: owner
        - description: >-
            Can manage members, integrations, and settings, but cannot delete
            workspace or transfer ownership
          type: string
          const: admin
        - description: >-
            Can edit content and manage files, but cannot manage members or
            workspace settings
          type: string
          const: member
        - description: Read-only access to workspace content
          type: string
          const: guest
    ValidationErrorDetail:
      description: Validation error details for field-specific errors.
      type: object
      properties:
        code:
          description: Error code for the validation failure
          type: string
        field:
          description: Field name that failed validation
          type: string
        message:
          description: Human-readable error message
          type: string
        params:
          description: Additional parameters related to the validation error
          type: object
          additionalProperties: true
      required:
        - field
        - code
        - message
    OcrPolicy:
      description: >-
        How a workspace's documents are turned into images for OCR during
        detection.


        A workspace-level policy over the engine's per-run OCR mode: `Auto` lets
        the

        engine decide from the text layer, `Force` always renders every page
        (for

        documents with unreliable text layers — scans, watermarks), and `Never`

        relies on the text layer only.
      oneOf:
        - description: >-
            Extract the text layer where present and OCR only pages that lack
            it.
          type: string
          const: auto
        - description: Always render every page to images for OCR, ignoring any text layer.
          type: string
          const: force
        - description: Rely on the text layer only; never render pages for OCR.
          type: string
          const: never
    RetentionSettings:
      description: >-
        Retention for every scope. Missing fields default to
        [`Retention::Forever`],

        so an empty settings blob keeps everything.
      type: object
      properties:
        auditLogs:
          description: Retention for audit blobs.
          allOf:
            - $ref: '#/components/schemas/Retention'
          default:
            mode: forever
        originalDocuments:
          description: Retention for uploaded/imported source documents.
          allOf:
            - $ref: '#/components/schemas/Retention'
          default:
            mode: forever
        redactedDocuments:
          description: Retention for generated redacted documents.
          allOf:
            - $ref: '#/components/schemas/Retention'
          default:
            mode: forever
    Retention:
      description: |-
        How long a class of data is retained.

        Wire shape is internally tagged on `mode`: `{ "mode": "forever" }`,
        `{ "mode": "zeroDays" }`, `{ "mode": "days", "days": 30 }`.
      oneOf:
        - description: Keep data indefinitely (the default).
          type: object
          properties:
            mode:
              type: string
              const: forever
          required:
            - mode
        - description: Delete data as soon as it has been processed.
          type: object
          properties:
            mode:
              type: string
              const: zeroDays
          required:
            - mode
        - description: Keep data for a fixed number of days, then delete it.
          type: object
          properties:
            days:
              description: Number of days to retain data.
              type: integer
              format: uint32
              minimum: 0
            mode:
              type: string
              const: days
          required:
            - mode
            - days

````