{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aidelly-ai/json-schema/aidelly-ai-workspaces-envelope-schema.json",
  "title": "WorkspacesEnvelope",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aidelly-ai-workspaces-api-openapi.yml#/components/schemas/WorkspacesEnvelope",
  "allOf": [
    {
      "$ref": "#/$defs/EnvelopeBase"
    },
    {
      "type": "object",
      "properties": {
        "success": {
          "const": true
        },
        "data": {
          "type": "object",
          "properties": {
            "workspaces": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/PublicWorkspace"
              }
            },
            "count": {
              "type": "integer"
            },
            "current_workspace_id": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid"
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "EnvelopeBase": {
      "type": "object",
      "required": [
        "success",
        "request_id"
      ],
      "properties": {
        "success": {
          "type": "boolean"
        },
        "request_id": {
          "type": "string",
          "format": "uuid"
        }
      }
    },
    "PublicWorkspace": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Workspace ID to pass as `x-aidelly-workspace-id` or MCP `workspace_id`."
        },
        "slug": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": "string"
        },
        "role": {
          "type": "string",
          "enum": [
            "owner",
            "admin",
            "member"
          ],
          "description": "Caller's role in this workspace. `owner` is the billing owner;\n`admin` can manage members and approve posts; `member` can author\nposts but may require approval before they publish.\n"
        },
        "status": {
          "type": [
            "string",
            "null"
          ]
        },
        "kind": {
          "type": "string",
          "enum": [
            "own",
            "client"
          ]
        },
        "is_owner": {
          "type": "boolean"
        },
        "is_billing_owner": {
          "type": "boolean"
        },
        "is_current": {
          "type": "boolean"
        },
        "created_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}