{
    "$id": "https://splits.io/schema/run_v1.0.1.json",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "additionalProperties": false,
    "definitions": {
        "duration": {
            "additionalProperties": false,
            "description": "Duration holds a realtime duration and a gametime duration.",
            "properties": {
                "gametimeMS": {
                    "description": "Gametime (Milliseconds) is a duration of milliseconds in game-world time.",
                    "examples": [
                        123456,
                        36000000
                    ],
                    "minimum": 0,
                    "multipleOf": 1,
                    "title": "Gametime (Milliseconds)",
                    "type": "number"
                },
                "realtimeMS": {
                    "description": "Realtime (Milliseconds) is a duration of milliseconds in real-world time.",
                    "examples": [
                        123456,
                        36000000
                    ],
                    "minimum": 0,
                    "multipleOf": 1,
                    "title": "Realtime (Milliseconds)",
                    "type": "number"
                }
            },
            "title": "Duration",
            "type": "object"
        },
        "runTime": {
            "additionalProperties": false,
            "description": "Run Time represents a moment inside a run, and indicates the duration of the run so far at that moment. It holds a realtime run duration so far and a gametime run duration so far.",
            "properties": {
                "gametimeMS": {
                    "description": "Gametime (Milliseconds) is a duration a run so far in milliseconds.",
                    "examples": [
                        123456,
                        36000000
                    ],
                    "minimum": 0,
                    "multipleOf": 1,
                    "title": "Gametime (Milliseconds)",
                    "type": "number"
                },
                "realtimeMS": {
                    "description": "Realtime (Milliseconds) is a duration of a run so far in milliseconds.",
                    "examples": [
                        123456,
                        36000000
                    ],
                    "minimum": 0,
                    "multipleOf": 1,
                    "title": "Realtime (Milliseconds)",
                    "type": "number"
                }
            },
            "title": "Run Time",
            "type": "object"
        }
    },
    "description": "The Splits.io Exchange Format is a specification for the transmission of runs between services and programs.",
    "properties": {
        "_schemaVersion": {
            "description": "Specifies which version of the Splits.io Exchange Format the run was produced for. If you try to parse a run and this field doesn't validate, you probably need to update your Splits.io Exchange Format schema. All schemas accept any patch of an equivalent major-minor version, and any lesser minor version of an equivalent major version (e.g. v1.1.1 accepts v1.0.0, v1.1.0, and v1.1.2, but not v1.2.0 or v2.0.0). The exception is definition v1.0.0, which only accepts v1.0.0 runs.",
            "examples": [
                "v1.0.0",
                "v1.0.1"
            ],
            "pattern": "v1\\.0\\.\\d+",
            "title": "Splits.io Exchange Format Version",
            "type": "string"
        },
        "attempts": {
            "additionalProperties": false,
            "description": "Attempts contains historical information about previous runs by this runner in this category.",
            "properties": {
                "histories": {
                    "default": [],
                    "description": "Histories is an array of previous attempts by this runner of this category.",
                    "items": {
                        "additionalProperties": false,
                        "description": "History is a single recorded attempt of this category by this runner.",
                        "properties": {
                            "attemptNumber": {
                                "description": "Attempt Number is the number of lifetime attempts the runner will have made after this one. The Attempt Number for an attempt is a label, not an index; the first attempt for a category has an Attempt Number of 1 (not 0).",
                                "title": "Attempt Number",
                                "type": "integer"
                            },
                            "duration": {
                                "$ref": "#/definitions/duration"
                            }
                        },
                        "required": [
                            "attemptNumber"
                        ],
                        "title": "History",
                        "type": "object"
                    },
                    "title": "Histories",
                    "type": "array"
                },
                "total": {
                    "description": "Total holds the total number of attempts for this category.",
                    "examples": [
                        1,
                        12,
                        241,
                        1023
                    ],
                    "minimum": 0,
                    "multipleOf": 1,
                    "title": "Total",
                    "type": "integer"
                }
            },
            "title": "Attempts",
            "type": "object"
        },
        "category": {
            "additionalProperties": false,
            "description": "Category specifies information about the category being run.",
            "properties": {
                "links": {
                    "additionalProperties": false,
                    "default": {},
                    "description": "Links specifies the category's identity in other services.",
                    "properties": {
                        "speedruncomID": {
                            "description": "Speedrun.com ID specifies the category's Speedrun.com ID.",
                            "examples": [
                                "kjpdr4jq"
                            ],
                            "title": "Speedrun.com ID",
                            "type": "string"
                        },
                        "splitsioID": {
                            "description": "Splits.io ID specifies the category's Splits.io ID.",
                            "examples": [
                                "234"
                            ],
                            "title": "Splits.io ID",
                            "type": "string"
                        }
                    },
                    "title": "Links",
                    "type": "object"
                },
                "longname": {
                    "description": "Longname is a human-readable category name, intended for display to users.",
                    "examples": [
                        "Any%",
                        "100%",
                        "Any% Hoverless"
                    ],
                    "title": "Longname",
                    "type": "string"
                },
                "shortname": {
                    "description": "Shortname is a machine-readable category name, intended for use in APIs, databases, URLs, and filenames.",
                    "examples": [
                        "anypct",
                        "100pct",
                        "anypct-hoverless"
                    ],
                    "title": "Shortname",
                    "type": "string"
                }
            },
            "required": [
                "longname"
            ],
            "title": "Category",
            "type": "object"
        },
        "endedAt": {
            "_format": "date-time",
            "description": "Ended At is the date and time at which the run was ended, specified in RFC 3339 format.",
            "examples": [
                "2002-10-02T11:00:00-05:00",
                "2002-10-02T16:00:00Z",
                "2002-10-02T16:00:00.05Z"
            ],
            "title": "Ended At",
            "type": "string"
        },
        "game": {
            "additionalProperties": false,
            "description": "Game specifies information about the game being run.",
            "properties": {
                "links": {
                    "additionalProperties": false,
                    "default": {},
                    "description": "Links specifies the game's identity in other services.",
                    "properties": {
                        "speedruncomID": {
                            "description": "Speedrun.com ID specifies the game's Speedrun.com ID.",
                            "examples": [
                                "kjpdr4jq"
                            ],
                            "title": "Speedrun.com ID",
                            "type": "string"
                        },
                        "splitsioID": {
                            "description": "Splits.io ID specifies the game's Splits.io ID.",
                            "examples": [
                                "234"
                            ],
                            "title": "Splits.io ID",
                            "type": "string"
                        }
                    },
                    "title": "Links",
                    "type": "object"
                },
                "longname": {
                    "description": "Longname is a human-readable game name, intended for display to users.",
                    "examples": [
                        "Super Mario Sunshine",
                        "The Legend of Zelda: Ocarina of Time",
                        "Portal"
                    ],
                    "title": "Longname",
                    "type": "string"
                },
                "shortname": {
                    "description": "Shortname is a machine-readable game name, intended for use in APIs, databases, URLs, and filenames.",
                    "examples": [
                        "sms",
                        "oot",
                        "portal"
                    ],
                    "title": "Shortname",
                    "type": "string"
                }
            },
            "required": [
                "longname"
            ],
            "title": "Game",
            "type": "object"
        },
        "imageURL": {
            "_format": "uri",
            "description": "Image URL is the location of an image associated with this run. Often this is a screenshot of the timer at run completion, but can be anything the runner wants displayed alongside the run.",
            "examples": [
                "https://i.imgur.com/ebyjwLJ.jpg"
            ],
            "title": "Image URL",
            "type": "string"
        },
        "links": {
            "additionalProperties": false,
            "description": "Links specifies the run's identity in other services.",
            "properties": {
                "speedruncomID": {
                    "description": "Speedrun.com ID is the run's ID on Speedrun.com. This can be used to communicate with the Speedrun.com API.",
                    "examples": [
                        "8y8dronz"
                    ],
                    "title": "Speedrun.com ID",
                    "type": "string"
                },
                "splitsioID": {
                    "description": "Splits.io ID is the run's ID on Splits.io. This can be used to communicate with the Splits.io API.",
                    "examples": [
                        "oqt"
                    ],
                    "title": "Splits.io ID",
                    "type": "string"
                }
            },
            "title": "Links",
            "type": "object"
        },
        "pauses": {
            "description": "Pauses holds runner-caused pauses that took place during the run.",
            "items": {
                "additionalProperties": false,
                "description": "Pause is a single pause that took place during the run.",
                "properties": {
                    "endedAt": {
                        "_format": "date-time",
                        "description": "Ended At is the date and time at which the pause was ended, specified in RFC 3339 format.",
                        "examples": [
                            "2002-10-02T11:00:00-05:00",
                            "2002-10-02T16:00:00Z",
                            "2002-10-02T16:00:00.05Z"
                        ],
                        "title": "Ended At",
                        "type": "string"
                    },
                    "startedAt": {
                        "_format": "date-time",
                        "description": "Started At is the date and time at which the pause was started, specified in RFC 3339 format.",
                        "examples": [
                            "2002-10-02T10:00:00-05:00",
                            "2002-10-02T15:00:00Z",
                            "2002-10-02T15:00:00.05Z"
                        ],
                        "title": "Started At",
                        "type": "string"
                    }
                },
                "required": [
                    "startedAt"
                ],
                "title": "Pause",
                "type": "object"
            },
            "title": "Pauses",
            "type": "array"
        },
        "runners": {
            "default": [],
            "description": "Runners is an array of people who participated in this run. Some games and categories call for cooperative play, but otherwise this will usually be just one person.",
            "items": {
                "additionalProperties": false,
                "description": "Runner describes one participant in the recorded run.",
                "properties": {
                    "links": {
                        "additionalProperties": false,
                        "default": {},
                        "description": "Links specifies the runner's identity in other services.",
                        "properties": {
                            "speedruncomID": {
                                "description": "Speedrun.com ID specifies the runner's Speedrun.com ID.",
                                "examples": [
                                    "kjpdr4jq"
                                ],
                                "title": "Speedrun.com ID",
                                "type": "string"
                            },
                            "splitsioID": {
                                "description": "Splits.io ID specifies the runner's Splits.io ID.",
                                "examples": [
                                    "234"
                                ],
                                "title": "Splits.io ID",
                                "type": "string"
                            },
                            "twitchID": {
                                "description": "Twitch ID specifies the runner's Twitch ID.",
                                "examples": [
                                    "29798286"
                                ],
                                "title": "Twitch ID",
                                "type": "string"
                            },
                            "twitterID": {
                                "description": "Twitter ID specifies the runner's Twitter ID.",
                                "examples": [
                                    "119476949"
                                ],
                                "title": "Twitter ID",
                                "type": "string"
                            }
                        },
                        "title": "Links",
                        "type": "object"
                    },
                    "longname": {
                        "description": "Longname is a human-readable runner name, intended for display to users.",
                        "examples": [
                            "Glacials"
                        ],
                        "title": "Longname",
                        "type": "string"
                    },
                    "shortname": {
                        "description": "Shortname is a machine-readable runner name, intended for use in APIs, databases, URLs, and filenames.",
                        "examples": [
                            "glacials"
                        ],
                        "title": "Shortname",
                        "type": "string"
                    }
                },
                "required": [
                    "shortname"
                ],
                "title": "Runner",
                "type": "object"
            },
            "title": "Runners",
            "type": "array"
        },
        "segments": {
            "description": "Segments is an array of all segments for this run, ordered from first to last.",
            "items": {
                "additionalProperties": false,
                "description": "Segment is one segment in this run.",
                "properties": {
                    "bestDuration": {
                        "$ref": "#/definitions/duration"
                    },
                    "endedAt": {
                        "$ref": "#/definitions/runTime"
                    },
                    "histories": {
                        "default": [],
                        "description": "Histories is an array of previous completions of this segment by this runner.",
                        "items": {
                            "additionalProperties": false,
                            "description": "History is a single recorded attempt of this segment by this runner.",
                            "properties": {
                                "attemptNumber": {
                                    "description": "Attempt Number is the number of lifetime attempts the runner will have made on this category after this one. Generally these attempt numbers should correspond to those in Attempts -> History, although a number given here may not be present there if the run was reset before completion.",
                                    "title": "Attempt Number",
                                    "type": "integer"
                                },
                                "endedAt": {
                                    "$ref": "#/definitions/runTime"
                                },
                                "isReset": {
                                    "default": false,
                                    "description": "Is Reset should be true if the runner reset the run during this segment. If so, this and all future segments' Ended Ats for this run are ignored.",
                                    "title": "Is Reset",
                                    "type": "boolean"
                                },
                                "isSkipped": {
                                    "default": false,
                                    "description": "Is Skipped should be true if the runner skipped over the split that ends this segment, rather than splitting. If so, this segment's Ended At is ignored.",
                                    "title": "Is Skipped",
                                    "type": "boolean"
                                }
                            },
                            "required": [
                                "attemptNumber"
                            ],
                            "title": "History",
                            "type": "object"
                        },
                        "title": "Histories",
                        "type": "array"
                    },
                    "isReset": {
                        "default": false,
                        "description": "Is Reset should be true if the runner reset the run during this segment. If so, this and all future segments' Ended Ats for this run are ignored.",
                        "title": "Is Reset",
                        "type": "boolean"
                    },
                    "isSkipped": {
                        "default": false,
                        "description": "Is Skipped should be true if the runner skipped over the split that ends this segment, rather than splitting. If so, this segment's Ended At is ignored.",
                        "title": "Is Skipped",
                        "type": "boolean"
                    },
                    "name": {
                        "description": "Name is the runner-provided name of this segment",
                        "examples": [
                            "World 1-2",
                            "Epilogue",
                            "Bottle"
                        ],
                        "title": "Name",
                        "type": "string"
                    }
                },
                "title": "Segment",
                "type": "object"
            },
            "title": "Segments",
            "type": "array"
        },
        "startedAt": {
            "_format": "date-time",
            "description": "Started At is the date and time at which the run was started, specified in RFC 3339 format.",
            "examples": [
                "2002-10-02T10:00:00-05:00",
                "2002-10-02T15:00:00Z",
                "2002-10-02T15:00:00.05Z"
            ],
            "title": "Started At",
            "type": "string"
        },
        "timer": {
            "additionalProperties": false,
            "description": "Timer holds information about the timer used to record the run.",
            "properties": {
                "longname": {
                    "description": "Longname is a human-readable timer name, intended for display to users.",
                    "examples": [
                        "LiveSplit",
                        "WSplit",
                        "Time Split Tracker",
                        "Llanfair",
                        "Llanfair (Gered's Fork)"
                    ],
                    "title": "Longname",
                    "type": "string"
                },
                "shortname": {
                    "description": "Shortname is a machine-readable timer name, intended for use in APIs, databases, URLs, and filenames.",
                    "examples": [
                        "livesplit",
                        "wsplit",
                        "timesplittracker",
                        "llanfair",
                        "llanfair_gered"
                    ],
                    "title": "Shortname",
                    "type": "string"
                },
                "version": {
                    "description": "Version is the version of the timer used to record this run. Semantic Versioning is strongly recommended but not enforced.",
                    "examples": [
                        "v1.0",
                        "v3.1.4",
                        "v2.3.4-alpha1"
                    ],
                    "title": "Version",
                    "type": "string"
                },
                "website": {
                    "_format": "uri",
                    "description": "Website is the URL for the timer's website.",
                    "examples": [
                        "http://livesplit.org"
                    ],
                    "title": "Website",
                    "type": "string"
                }
            },
            "required": [
                "shortname",
                "longname",
                "version"
            ],
            "title": "Timer",
            "type": "object"
        },
        "videoURL": {
            "_format": "uri",
            "description": "Video URL is the location of a VOD of the run.",
            "examples": [
                "https://www.youtube.com/watch?v=0No0y9C1tmM",
                "https://www.twitch.tv/videos/180016373"
            ],
            "title": "Video URL",
            "type": "string"
        }
    },
    "required": [
        "_schemaVersion",
        "timer"
    ],
    "title": "Splits.io Exchange Format",
    "type": "object"
}