{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/copper-financial/main/json-schema/copper-financial-activity-schema.json",
  "title": "Activity",
  "description": "Copper keeps a record of activities for People, Leads, Opportunities, and Companies. Only 'User' type Activities can be created or modified using the developer API. 'System' type Activities are read-only.",
  "x-generated": "2026-10-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/copper-financial-openapi.json#/components/schemas/Activity",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Unique identifier for the activity"
    },
    "parent": {
      "type": "object",
      "description": "The identifier of the resource to which this activity belongs",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The ID of the parent resource"
        },
        "type": {
          "type": "string",
          "description": "The type of the parent resource",
          "enum": [
            "lead",
            "person",
            "company",
            "opportunity"
          ]
        }
      },
      "required": [
        "id",
        "type"
      ]
    },
    "type": {
      "type": "object",
      "description": "The activity type of this activity",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The ID of the activity type"
        },
        "category": {
          "type": "string",
          "description": "The category of the activity type",
          "enum": [
            "user",
            "system"
          ]
        }
      },
      "required": [
        "id",
        "category"
      ]
    },
    "user_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "When applicable, the id of the user who performed this activity"
    },
    "details": {
      "type": [
        "string",
        "null"
      ],
      "description": "When applicable, the text body of this activity"
    },
    "activity_date": {
      "type": [
        "integer",
        "null"
      ],
      "description": "A Unix timestamp representing the time at which this activity took place"
    },
    "old_value": {
      "nullable": true,
      "description": "When applicable, the value of a resource's property before this activity took place"
    },
    "new_value": {
      "nullable": true,
      "description": "When applicable, the value of a resource's property after this activity took place"
    },
    "date_created": {
      "type": "integer",
      "description": "A Unix timestamp representing the time at which this activity was created"
    },
    "date_modified": {
      "type": "integer",
      "description": "A Unix timestamp representing the time at which this activity was last modified"
    }
  },
  "required": [
    "id",
    "parent",
    "type",
    "details"
  ]
}