Timeline API

You need to authenticate to use the API. More about Cloud authentication or On premise authentication.

Timeline API can be used for reading timeline data and it works on all server versions.

The bottom part of the document, Create, Update and Delete actions, are meant for modifying tags on the server, so the actions only work on Tag timelines. This is supported in MT server version 4.1 and later. It allows one user to change tags of all other users on the server. This user needs to have Content editor permission.

Tagging API is useful, when you want to transfer tags from another system and create them in ManicTime. Service, which is responsible for transferring tags can log on as this user, then create tags for other users on the server.

Get home

Returns all available links.

GET http://localhost:8080/api  
Accept: application/vnd.manictime.v3+json
HTTP/1.1 200 OK
Content-Type: application/vnd.manictime.v3+json; charset=utf-8

{  
    "links": [  
        {  
            "rel": "self",  
            "href": "http://localhost:8080/api/"  
        },  
        {  
            "rel": "manictime/timelines",  
            "href": "http://localhost:8080/api/timelines"  
        },  
        {  
            "rel": "manictime/environments",  
            "href": "http://localhost:8080/api/environments"  
        },  
        {  
            "rel": "manictime/screenshots",  
            "href": "http://localhost:8080/api/screenshots"  
        },  
        {  
            "rel": "manictime/clientState",  
            "href": "http://localhost:8080/api/clientState"  
        },  
        {  
            "rel": "manictime/tagcombinationlist",  
            "href": "http://localhost:8080/api/tagcombinationlist"  
        },  
        {  
            "rel": "manictime/clientsettings",  
            "href": "http://localhost:8080/api/clientSettings"  
        }  
    ]  
}

Get timelines

Returns all timelines visible to current user. Follow link “manictime/timelines” from home response.

GET http://localhost:8080/api/timelines  
Accept: application/vnd.manictime.v3+json
HTTP/1.1 200 OK  
Content-Type: application/vnd.manictime.v3+json; charset=utf-8

{  
    "timelines": [  
        {  
            "timelineKey": "ae35ba85-ed33-462d-8338-3ace1d77ba7b",  
            "publishKey": "01d4e456-df48-4b7f-a47d-4ff1b8f607cd",  
            "owner": {  
                "username": "admin@manictime.com",  
                "displayName": "Admin"  
            },  
            "schema": {  
                "name": "ManicTime/Tags",  
                "version": "1.0.0.0",  
                "baseSchema": {  
                    "name": "ManicTime/Generic/GroupList",  
                    "version": "1.0.0.0"  
                }  
            },  
            "homeEnvironment": {  
                "environmentId": "eebf80c0-5e42-4874-ae65-34b6c65a48ea",  
                "deviceName": "LOCAL"  
            },  
            "deviceDisplayName": "LOCAL",  
            "lastUpdate": {  
                "updatedUtcTime": "2020-09-21T12:25:03.76+00:00",  
                "environment": {  
                    "environmentId": "eebf80c0-5e42-4874-ae65-34b6c65a48ea",  
                    "deviceName": "LOCAL"  
                }  
            },  
            "lastChangeId": "53,1029250202",  
            "updateProtocol": "Changes",  
            "timestamp": "9,1461934769",  
            "links": [  
                {  
                    "rel": "self",  
                    "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b"  
                },  
                {  
                    "rel": "manictime/getchanges",  
                    "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/changes"  
                },  
                {  
                    "rel": "manictime/activities",  
                    "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities"  
                },  
                {  
                    "rel": "manictime/addchanges",  
                    "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/changes"  
                },  
                {  
                    "rel": "manictime/editactivities",  
                    "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities"  
                }  
            ]  
        }  
    ]  
}

Get activities

Returns all timeline activities for specified time range. Follow link “manictime/activities” from timeline and add “fromTime” and “toTime” URL parameters.

GET http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities?fromTime=2020-09-21&toTime=2020-09-22  
Accept: application/vnd.manictime.v3+json
HTTP/1.1 200 OK  
Content-Type: application/vnd.manictime.v3+json; charset=utf-8

{  
    "timelineKey": "ae35ba85-ed33-462d-8338-3ace1d77ba7b",  
    "publishKey": "01d4e456-df48-4b7f-a47d-4ff1b8f607cd",  
    "owner": {  
        "username": "admin@manictime.com",  
        "displayName": "Admin"  
    },  
    "schema": {  
        "name": "ManicTime/Tags",  
        "version": "1.0.0.0",  
        "baseSchema": {  
            "name": "ManicTime/Generic/GroupList",  
            "version": "1.0.0.0"  
        }  
    },  
    "homeEnvironment": {  
        "environmentId": "eebf80c0-5e42-4874-ae65-34b6c65a48ea",  
        "deviceName": "LOCAL"  
    },  
    "deviceDisplayName": "LOCAL",  
    "lastUpdate": {  
        "updatedUtcTime": "2020-09-21T12:40:29.64+00:00",  
        "environment": {  
            "environmentId": "943f2ca3-120f-40a3-9e21-40071f5421a7",  
            "deviceName": "LOCAL"  
        }  
    },  
    "lastChangeId": "58,864659224",  
    "updateProtocol": "Changes",  
    "timestamp": "13,2001671361",  
    "links": [  
        {  
            "rel": "self",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b"  
        },  
        {  
            "rel": "manictime/getchanges",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/changes"  
        },  
        {  
            "rel": "manictime/activities",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities"  
        },  
        {  
            "rel": "manictime/addchanges",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/changes"  
        },  
        {  
            "rel": "manictime/editactivities",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities"  
        },  
        {  
            "rel": "manictime/updatedactivities",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338- 3ace1d77ba7b/activities?fromTime=2020-09-21T00:00:00&toTime=2020-09- 22T00:00:00&updatedAfterTimestamp=58,864659224"  
        }  
    ],  
    "entities": [  
        {  
            "entityType": "activity",  
            "entityId": 41,  
            "values": {  
                "groupListId": 40,  
                "isActive": true,  
                "name": "tag1, tag2",  
                "timeInterval": {  
                    "start": "2020-09-21T09:18:47+02:00",  
                    "duration": 2258  
                }  
            }  
        },  
        {  
            "entityType": "groupList",  
            "entityId": 40,  
            "values": {  
                "groupIds": [  
                    38,  
                    39  
                ]  
            }  
        },  
        {  
            "entityType": "group",  
            "entityId": 38,  
            "values": {  
                "color": "73A3D0",  
                "key": "tag1",  
                "name": "tag1",  
                "skipColor": false  
            }  
        },  
        {  
            "entityType": "group",  
            "entityId": 39,  
            "values": {  
                "color": "EA81D8",  
                "key": "tag2",  
                "name": "tag2",  
                "skipColor": false  
            }  
        }  
    ]  
}

Create activity

Creates activity. Follow link “manictime/editactivities” from timeline. “expectedLastChangeId“ in request body is
optional and is used for concurrency control. If present, must be the same as timeline “lastChangeId”.

POST http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities
Accept: application/vnd.manictime.v3+json  
Content-Type: application/vnd.manictime.v3+json  
{  
    "expectedLastChangeId": "53,1029250202",  
    "values": {  
        "name": "tag1, tag2",  
        "notes": "my notes",  
        "timeInterval": {  
            "start": "2020-09-21T10:00:00+02:00",  
            "duration": 600  
        }  
    }  
}
HTTP/1.1 200 OK  
Content-Type: application/vnd.manictime.v3+json; charset=utf-8  

{  
    "timelineKey": "ae35ba85-ed33-462d-8338-3ace1d77ba7b",  
    "publishKey": "01d4e456-df48-4b7f-a47d-4ff1b8f607cd",  
    "owner": {  
        "username": "admin@manictime.com",  
        "displayName": "Admin"  
    },  
    "schema": {  
        "name": "ManicTime/Tags",  
        "version": "1.0.0.0",  
        "baseSchema": {  
            "name": "ManicTime/Generic/GroupList",  
            "version": "1.0.0.0"  
        }  
    },  
    "homeEnvironment": {  
        "environmentId": "eebf80c0-5e42-4874-ae65-34b6c65a48ea",  
        "deviceName": "LOCAL"  
    },  
    "deviceDisplayName": "LOCAL",  
    "lastUpdate": {  
        "updatedUtcTime": "2020-09-21T12:35:47.59+00:00",  
        "environment": {  
            "environmentId": "eebf80c0-5e42-4874-ae65-34b6c65a48ea",  
            "deviceName": "LOCAL"  
        }  
    },  
    "lastChangeId": "54,1726677341",  
    "updateProtocol": "Changes",  
    "timestamp": "10,1048516227",  
    "links": [  
        {  
            "rel": "self",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b"  
        },  
        {  
            "rel": "manictime/getchanges",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/changes"  
        },  
        {  
            "rel": "manictime/activities",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities"  
        },  
        {  
            "rel": "manictime/addchanges",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/changes"  
        },  
        {  
            "rel": "manictime/editactivities",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities"  
        }  
    ],  
    "entities": [  
        {  
            "entityType": "activity",  
            "entityId": 49,  
            "values": {  
                "groupListId": 40,  
                "isActive": true,  
                "name": "tag1, tag2",  
                "notes": "my notes",  
                "timeInterval": {  
                    "start": "2020-09-21T10:00:00+02:00",  
                    "duration": 600  
                }  
            }  
        },  
        {  
            "entityType": "groupList",  
            "entityId": 40,  
            "values": {  
                "groupIds": [  
                    38,  
                    39  
                ]  
            }  
        },  
        {  
            "entityType": "group",  
            "entityId": 38,  
            "values": {  
                "color": "73A3D0",  
                "key": "tag1",  
                "name": "tag1",  
                "skipColor": false  
            }  
        },  
        {  
            "entityType": "group",  
            "entityId": 39,  
            "values": {  
                "color": "EA81D8",  
                "key": "tag2",  
                "name": "tag2",  
                "skipColor": false  
            }  
        }  
    ]  
}

Update activity

Updates activity. Follow link “manictime/editactivities” from timeline and add activity “entityId” to the end of the URL. “expectedLastChangeId“ in request body is optional and is used for concurrency control. If present, must be the same as timeline “lastChangeId”.

PUT http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities/49
Accept: application/vnd.manictime.v3+json  
Content-Type: application/vnd.manictime.v3+json 

{  
    "expectedLastChangeId": "54,1726677341",  
    "values": {  
        "name": "tag1, tag2, :billable",  
        "notes": "my other notes",  
        "timeInterval": {  
            "start": "2020-09-21T10:00:00+02:00",  
            "duration": 900  
        }  
    }  
}
HTTP/1.1 200 OK  
Content-Type: application/vnd.manictime.v3+json; charset=utf-8  

{  
    "timelineKey": "ae35ba85-ed33-462d-8338-3ace1d77ba7b",  
    "publishKey": "01d4e456-df48-4b7f-a47d-4ff1b8f607cd",  
    "owner": {  
        "username": "admin@manictime.com",  
        "displayName": "Admin"  
    },  
    "schema": {  
        "name": "ManicTime/Tags",  
        "version": "1.0.0.0",  
        "baseSchema": {  
            "name": "ManicTime/Generic/GroupList",  
            "version": "1.0.0.0"  
        }  
    },  
    "homeEnvironment": {  
        "environmentId": "eebf80c0-5e42-4874-ae65-34b6c65a48ea",  
        "deviceName": "LOCAL"  
    },  
    "deviceDisplayName": "LOCAL",  
    "lastUpdate": {  
        "updatedUtcTime": "2020-09-21T12:37:10.72+00:00",  
        "environment": {  
            "environmentId": "eebf80c0-5e42-4874-ae65-34b6c65a48ea",  
            "deviceName": "LOCAL"  
        }  
    },  
    "lastChangeId": "56,323071752",  
    "updateProtocol": "Changes",  
    "timestamp": "11,519433731",  
    "links": [  
        {  
            "rel": "self",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b"  
        },  
        {  
            "rel": "manictime/getchanges",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/changes"  
        },  
        {  
            "rel": "manictime/activities",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities"  
        },  
        {  
            "rel": "manictime/addchanges",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/changes"  
        },  
        {  
            "rel": "manictime/editactivities",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities"  
        }  
    ],  
    "entities": [  
        {  
            "entityType": "activity",  
            "entityId": 49,  
            "values": {  
                "groupListId": 50,  
                "isActive": true,  
                "name": "tag1, tag2, :billable",  
                "notes": "my other notes",  
                "timeInterval": {  
                    "start": "2020-09-21T10:00:00+02:00",  
                    "duration": 900  
                }  
            }  
        },  
        {  
            "entityType": "groupList",  
            "entityId": 50,  
            "values": {  
                "groupIds": [  
                    38,  
                    39,  
                    3  
                ]  
            }  
        },  
        {  
            "entityType": "group",  
            "entityId": 38,  
            "values": {  
                "color": "73A3D0",  
                "key": "tag1",  
                "name": "tag1",  
                "skipColor": false  
            }  
        },  
        {  
            "entityType": "group",  
            "entityId": 39,  
            "values": {  
                "color": "EA81D8",  
                "key": "tag2",  
                "name": "tag2",  
                "skipColor": false  
            }  
        },  
        {  
            "entityType": "group",  
            "entityId": 3,  
            "values": {  
                "color": "5846FC",  
                "key": ":billable",  
                "name": ":billable",  
                "skipColor": false  
            }  
        }  
    ]  
}  

Delete activity

Deletes activity. Follow link “manictime/editactivities” from timeline and add activity “entityId” to the end of the URL. “expectedLastChangeId“ in request body is optional and is used for concurrency control. If present, must be the same as timeline “lastChangeId”.

DELETE http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities/49 
Accept: application/vnd.manictime.v3+json  
Content-Type: application/vnd.manictime.v3+json  

{  
    "expectedLastChangeId": "56,323071752"  
}
HTTP/1.1 200 OK  
Content-Type: application/vnd.manictime.v3+json; charset=utf-8  

{  
    "timelineKey": "ae35ba85-ed33-462d-8338-3ace1d77ba7b",  
    "publishKey": "01d4e456-df48-4b7f-a47d-4ff1b8f607cd",  
    "owner": {  
        "username": "admin@manictime.com",  
        "displayName": "Admin"  
    },  
    "schema": {  
        "name": "ManicTime/Tags",  
        "version": "1.0.0.0",  
        "baseSchema": {  
            "name": "ManicTime/Generic/GroupList",  
            "version": "1.0.0.0"  
        }  
    },  
    "homeEnvironment": {  
        "environmentId": "eebf80c0-5e42-4874-ae65-34b6c65a48ea",  
        "deviceName": "LOCAL"  
    },  
    "deviceDisplayName": "LOCAL",  
    "lastUpdate": {  
        "updatedUtcTime": "2020-09-21T12:39:31.55+00:00",  
        "environment": {  
            "environmentId": "eebf80c0-5e42-4874-ae65-34b6c65a48ea",  
            "deviceName": "LOCAL"  
        }  
    },  
    "lastChangeId": "57,1907424414",  
    "updateProtocol": "Changes",  
    "timestamp": "12,279785520",  
    "links": [  
        {  
            "rel": "self",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b"  
        },  
        {  
            "rel": "manictime/getchanges",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/changes"  
        },  
        {  
            "rel": "manictime/activities",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities"  
        },  
        {  
            "rel": "manictime/addchanges",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/changes"  
        },  
        {  
            "rel": "manictime/editactivities",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities"  
        }  
    ],  
    "entities": []  
}

Get changes

Returns timeline changes. Follow link “manictime/getchanges” from timeline and optionally add “afterChangeId” and “maxChangeCount” URL parameters. Maximum 1000 changes can be returned in one call. If no parameters are supplied it will return first 1000 changes.

GET http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/getchanges?afterChangeId=5,1176073837&maxChangeCount=5  
Accept: application/vnd.manictime.v3+json
HTTP/1.1 200 OK  
Content-Type: application/vnd.manictime.v3+json; charset=utf-8

{  
    "timelineKey": "ae35ba85-ed33-462d-8338-3ace1d77ba7b",  
    "publishKey": "01d4e456-df48-4b7f-a47d-4ff1b8f607cd",  
    "owner": {  
        "username": "admin@manictime.com",  
        "displayName": "Admin"  
    },  
    "schema": {  
        "name": "ManicTime/Tags",  
        "version": "1.0.0.0",  
        "baseSchema": {  
            "name": "ManicTime/Generic/GroupList",  
            "version": "1.0.0.0"  
        }  
    },  
    "homeEnvironment": {  
        "environmentId": "eebf80c0-5e42-4874-ae65-34b6c65a48ea",  
        "deviceName": "LOCAL"  
    },  
    "deviceDisplayName": "LOCAL",  
    "lastUpdate": {  
        "updatedUtcTime": "2020-09-21T12:40:29.64+00:00",  
        "environment": {  
            "environmentId": "943f2ca3-120f-40a3-9e21-40071f5421a7",  
            "deviceName": "LOCAL"  
        }  
    },  
    "lastChangeId": "58,864659224",  
    "updateProtocol": "Changes",  
    "timestamp": "13,2001671361",  
    "links": [  
        {  
            "rel": "self",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b"  
        },  
        {  
            "rel": "manictime/getchanges",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/changes"  
        },  
        {  
            "rel": "manictime/activities",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities"  
        },  
        {  
            "rel": "manictime/addchanges",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/changes"  
        },  
        {  
            "rel": "manictime/editactivities",  
            "href": "http://localhost:8080/api/timelines/ae35ba85-ed33-462d-8338-3ace1d77ba7b/activities"  
        }  
    ],
    "changes": [
        {
            "changeId": "6,1440621982",
            "changeType": "Create",
            "entityId": 6,
            "entityType": "group",
            "oldValues": {},
            "newValues": {
                "color": "A39BC5",
                "key": "tag1",
                "name": "tag1"
            }
        },
        {
            "changeId": "7,1424170802",
            "changeType": "Create",
            "entityId": 7,
            "entityType": "groupList",
            "oldValues": {},
            "newValues": {
                "groupIds": [
                    6
                ]
            }
        },
        {
            "changeId": "8,1920207178",
            "changeType": "Create",
            "entityId": 8,
            "entityType": "activity",
            "oldValues": {},
            "newValues": {
                "groupListId": 7,
                "timeInterval": {
                    "start": "2020-10-05T08:56:42+02:00",
                    "duration": 3176
                }
            }
        },
        {
            "changeId": "9,661148253",
            "changeType": "Update",
            "entityId": 8,
            "entityType": "activity",
            "oldValues": {
                "timeInterval": {
                    "start": "2020-10-05T08:56:42+02:00",
                    "duration": 3176
                }
            },
            "newValues": {
                "groupListId": 7,
                "timeInterval": {
                    "start": "2020-10-05T08:56:42+02:00",
                    "duration": 6985
                }
            }
        },
        {
            "changeId": "10,845427928",
            "changeType": "Delete",
            "entityId": 8,
            "entityType": "activity",
            "oldValues": {},
            "newValues": {
                "groupListId": 7,
                "timeInterval": {
                    "start": "2020-10-05T08:56:42+02:00",
                    "duration": 6985
                }
            }
        },
    ]  
}