{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/frihet-io/json-schema/frihet-io-activity-create-schema.json",
  "title": "ActivityCreate",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/frihet-io-activities-api-openapi.yml#/components/schemas/ActivityCreate",
  "type": "object",
  "required": [
    "type",
    "title"
  ],
  "properties": {
    "type": {
      "$ref": "#/$defs/ActivityType"
    },
    "title": {
      "type": "string",
      "description": "Descriptive title for the activity"
    },
    "description": {
      "type": "string",
      "description": "Detailed description"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true,
      "description": "Free-form additional data. For `task` activities, use string fields such as `status` and `dueDate` to mirror the client's current next action."
    }
  },
  "$defs": {
    "ActivityType": {
      "type": "string",
      "enum": [
        "call",
        "email",
        "email_sent",
        "meeting",
        "note_added",
        "task",
        "stage_changed",
        "client_created"
      ],
      "description": "CRM activity types accepted for manual/API-created entries. The legacy `email` value is stored as `email_sent`. Invoice, quote and expense system activity types are auto-generated."
    }
  }
}