Starting a Task by Javascript

Does anyone know if it’s possible to start an Object’s task programmatically using Javascript?
Currently, only scheduled options are available but I need to do it on specific event, not cyclic period.

I dug deep into the Knack object and found task-related stuff but not sure how to use them.

Normand D.

Hello Normand,

Yes, you can do that but it explores your api keys.

Sunny Singla

1 Like

Hey @Sunny_Singla keen to know the basic syntax if you can share something?

Sure Brad,

try the below code it works for me.

url: ‘**APPLICATIONID**/tasks/task_1/runtaskjob’,
type: ‘GET’,
headers: {
‘X-Knack-Application-Id’: ‘APPID’, // change to your app’s API info
‘X-Knack-REST-API-Key’: ‘KEY’. // change to your app’s key
success: function (response) {


you need to change task_1 with you task id


1 Like


That’s pretty cool, thanks!

I’m very curious to know… where did you get that information?
Is there a full documentation of these functions somewhere?


Yep - same questions!
Tested and works BTW and could be obfuscated via a scenario.

Hello Normand,

There is no documentation for this.

Sunny Singla

Ok but then, how did you find out about the URL and the runtaskjob command?
I wonder what else is hiding that could be useful…


I partially answered myself.

In the console view, I had an error on a PUT and saw this URL:

So I extracted the first part until the v1/ and tried this:

Tadam! A ton of code appeared, and at the end, there were my server URLs:

    "clientSubdomainMap": {
      "read": [
      "write": [

But that’s only a partial answer. What about the runtaskjob command?



I also check this in the console. while running tasks manually.