Todoist Quick Add

Posted by davenicholls, Last update almost 6 years ago

Action to create one of more tasks in Todoist.

The action uses the Todoist Quick Add API call so it can take advantage of the features used within the native Todoist apps to add tasks to specific projects and set due dates/times. For example:

Make Cake Thursday 5pm #Food
Call Joe tomorrow #personal

Each line in the draft is processed as a separate task. Blank lines are retained. When complete the actions adds ‘OK’ or ‘Fail’ to the end of each line depending on the result fo the API call. This is primarily for testing.

You will need to add your Todoist API Token to the script in the position indicated


  • script

    // check to see if draft is blank
    var content = draft.content;
    var check = content.length;
    var todoistToken = "Insert your Todoist API Token Here";
    if (content.length == 0) {
    	alert("Draft is blank");
    	context.cancel("Draft was blank");
    // Call API for each line in a draft
    var newDraft = "";
    // split draft and loop over lines
    var lines = draft.content.split("\n");
    var http = HTTP.create(); // create HTTP object
    for (var line of lines) {
    	if (line.length == 0) {
    	else {
    		var response = http.request({
    		  	"url": "",
    	  		"method": "POST",
    		  	"data": {
    		if (response.success) {
    			newDraft+= line + " - OK\n"
    		else {
    			newDraft+= line + " - Failed\n"


  • After Success Default
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.