{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nudg3-ai/json-schema/nudg3-ai-company-workspace-detail-response-schema.json",
  "title": "CompanyWorkspaceDetailResponse",
  "description": "Detailed workspace information.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nudg3-ai-openapi.json#/components/schemas/CompanyWorkspaceDetailResponse",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "brand_name": {
      "type": "string",
      "title": "Brand Name"
    },
    "brand_domain": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Brand Domain"
    },
    "brand_keywords": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Brand Keywords"
    },
    "brand_aliases": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Brand Aliases",
      "description": "Alternative brand names"
    },
    "industry": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Industry"
    },
    "brand_description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Brand Description"
    },
    "target_market": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Target Market"
    },
    "provider_configs": {
      "additionalProperties": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "object",
      "title": "Provider Configs",
      "description": "Provider configurations"
    },
    "max_prompts": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Prompts",
      "description": "DEPRECATED: Use unified quota system (WorkspaceQuota) instead.",
      "deprecated": true
    },
    "settings": {
      "additionalProperties": true,
      "type": "object",
      "title": "Settings"
    },
    "is_active": {
      "type": "boolean",
      "title": "Is Active"
    },
    "is_pitch": {
      "type": "boolean",
      "title": "Is Pitch",
      "default": false
    },
    "pitch_locked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pitch Locked At"
    },
    "default_location_country": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Default Location Country"
    },
    "default_location_city": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Default Location City"
    },
    "default_location_region": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Default Location Region"
    },
    "company_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Company Id"
    },
    "company_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Company Name"
    },
    "agency_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agency Id"
    },
    "agency_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agency Name"
    },
    "subscription_status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Subscription Status",
      "description": "Subscription status: ACTIVE, PENDING, CANCELLED, EXPIRED, SUSPENDED, or null"
    },
    "is_trial": {
      "type": "boolean",
      "title": "Is Trial",
      "description": "Whether workspace is currently on an active trial",
      "default": false
    },
    "trial_end_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Trial End Date",
      "description": "Trial end date if applicable"
    },
    "brands_count": {
      "type": "integer",
      "title": "Brands Count",
      "default": 0
    },
    "collection_runs_count": {
      "type": "integer",
      "title": "Collection Runs Count",
      "default": 0
    },
    "last_collection_run": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Collection Run"
    },
    "brands": {
      "items": {
        "$ref": "#/$defs/BrandReference"
      },
      "type": "array",
      "title": "Brands"
    },
    "recent_collection_runs": {
      "items": {
        "$ref": "#/$defs/CollectionRunReference"
      },
      "type": "array",
      "title": "Recent Collection Runs"
    },
    "recent_activity": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Recent Activity"
    }
  },
  "type": "object",
  "required": [
    "id",
    "created_at",
    "updated_at",
    "name",
    "brand_name",
    "is_active"
  ],
  "$defs": {
    "BrandReference": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "domain": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Domain"
        },
        "keywords": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Keywords"
        },
        "is_active": {
          "type": "boolean",
          "title": "Is Active"
        },
        "aliases": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Aliases"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "is_active",
        "created_at"
      ],
      "title": "BrandReference",
      "description": "Reference to a brand."
    },
    "CollectionRunReference": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "initiated_by": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Initiated By"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        },
        "completed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Completed At"
        },
        "mentions_found": {
          "type": "integer",
          "title": "Mentions Found",
          "default": 0
        }
      },
      "type": "object",
      "required": [
        "id",
        "status"
      ],
      "title": "CollectionRunReference",
      "description": "Reference to a collection run."
    }
  }
}