{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/wakatime/json-schema/wakatime-external-duration-schema.json",
  "title": "ExternalDuration",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/wakatime-external-durations-api-openapi.yml#/components/schemas/ExternalDuration",
  "allOf": [
    {
      "$ref": "#/$defs/ExternalDurationInput"
    },
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "user_id": {
          "type": "string"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "modified_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  ],
  "$defs": {
    "ExternalDurationInput": {
      "type": "object",
      "required": [
        "external_id",
        "entity",
        "type",
        "start_time",
        "end_time"
      ],
      "properties": {
        "external_id": {
          "type": "string",
          "description": "Caller-supplied identifier; used as the dedupe key."
        },
        "entity": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "file",
            "domain",
            "app"
          ]
        },
        "category": {
          "type": "string"
        },
        "start_time": {
          "type": "number",
          "format": "float",
          "description": "Unix epoch seconds."
        },
        "end_time": {
          "type": "number",
          "format": "float",
          "description": "Unix epoch seconds."
        },
        "project": {
          "type": [
            "string",
            "null"
          ]
        },
        "branch": {
          "type": [
            "string",
            "null"
          ]
        },
        "language": {
          "type": [
            "string",
            "null"
          ]
        },
        "meta": {
          "type": "object",
          "additionalProperties": true
        }
      }
    }
  }
}