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

# File a case under its client folder

> Finds or creates the space's base-record entity folder, then opens a case folder under it. Safe to repeat: an existing case marker is never rewritten. Client users get 403.



## OpenAPI

````yaml /api-reference/endpoint/workspaces/openapi.json post /workspaces/case-folder
openapi: 3.1.0
info:
  title: Workspaces API
  version: 1.1.0
  description: >-
    Spaces, tasks, task actions, comments, folders and the task-sync routes.
    Task-sync routes also accept an integration token (`oauth2`); every other
    route needs a user session or API key.
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Tasks
  - name: Files
  - name: Folders
  - name: Task Schedules
  - name: Distribution
paths:
  /workspaces/case-folder:
    post:
      tags:
        - Folders
      summary: File a case under its client folder
      description: >-
        Finds or creates the space's base-record entity folder, then opens a
        case folder under it. Safe to repeat: an existing case marker is never
        rewritten. Client users get 403.
      operationId: createCaseFolder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - space_id
                - case_key
                - case_config_id
              properties:
                space_id:
                  type: string
                entity_folder:
                  type: string
                  description: >-
                    File under this existing client folder instead of resolving
                    identity.
                identity:
                  type: object
                  additionalProperties:
                    type: string
                name:
                  type: string
                email:
                  type: string
                display:
                  type: object
                  additionalProperties:
                    type: string
                  description: >-
                    Values for the base record's display fields, written only
                    when this call creates the entity.
                address:
                  description: >-
                    Text or an object, as the base record's address field takes
                    it.
                case_key:
                  type: object
                  required:
                    - field
                    - value
                  properties:
                    field:
                      type: string
                    value:
                      type: string
                case_config_id:
                  type: string
                primary_config:
                  type: string
                primary_record_id:
                  type: string
                metadata:
                  type: object
                  additionalProperties:
                    type: string
                  description: >-
                    At most 20 entries, values up to 512 characters. Reserved
                    marker keys are ignored.
      responses:
        '200':
          description: Folder tokens, not paths
          content:
            application/json:
              schema:
                type: object
                properties:
                  entity_folder:
                    type: string
                  case_folder:
                    type: string
                  created_entity:
                    type: boolean
                  created_case:
                    type: boolean
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: The case is already being filed (`code` is `case_being_filed`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine code. Branch on this, not on `error`.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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