{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/copper-financial/main/json-schema/copper-financial-task-schema.json",
  "title": "Task",
  "x-generated": "2026-10-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/copper-financial-openapi.json#/components/schemas/Task",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Unique identifier for the task"
    },
    "name": {
      "type": "string",
      "description": "The name of the task"
    },
    "related_resource": {
      "type": [
        "object",
        "null"
      ],
      "description": "The primary related resource for the task",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The ID of the related resource"
        },
        "type": {
          "type": "string",
          "description": "The type of the related resource"
        }
      }
    },
    "assignee_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Unique identifier of the user that will be the owner of the task"
    },
    "due_date": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The date on which the task is due (Unix timestamp)"
    },
    "reminder_date": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The date on which to receive a reminder about the task (Unix timestamp)"
    },
    "completed_date": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The date on which the task was completed (Unix timestamp). This is automatically set when the status changes from Open to Completed, and cannot be set directly."
    },
    "priority": {
      "type": "string",
      "description": "The priority of the task",
      "enum": [
        "None",
        "Low",
        "Medium",
        "High"
      ]
    },
    "status": {
      "type": "string",
      "description": "The status of the task",
      "enum": [
        "Open",
        "Completed"
      ]
    },
    "details": {
      "type": [
        "string",
        "null"
      ],
      "description": "Description of the task"
    },
    "tags": {
      "type": "array",
      "description": "An array of the tags associated with the task",
      "items": {
        "type": "string"
      }
    },
    "custom_fields": {
      "type": "array",
      "description": "An array of custom field values belonging to the task. When custom_field_computed_values query parameter is true, each field will include a computed_value with human-readable labels for Dropdown and Multi-select fields.",
      "items": {
        "type": "object",
        "properties": {
          "custom_field_definition_id": {
            "type": "integer",
            "description": "The id of the custom field definition for which this custom field stores a value"
          },
          "value": {
            "description": "The value (number, string, option id, or timestamp) of this custom field",
            "nullable": true
          },
          "computed_value": {
            "description": "The human-readable value of this custom field. For Dropdown/Multi-select fields, this contains the option label(s) instead of IDs. Only present when custom_field_computed_values=true is specified.",
            "nullable": true
          }
        }
      }
    },
    "custom_activity_type_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The custom activity type ID associated with this task"
    },
    "date_created": {
      "type": "integer",
      "description": "A Unix timestamp representing the time at which this task was created"
    },
    "date_modified": {
      "type": "integer",
      "description": "A Unix timestamp representing the time at which this task was last modified"
    }
  },
  "required": [
    "id",
    "name"
  ]
}