Intro

Internal users can communicate with Ctfreak using a RESTful JSON API.

For example to launch a task on the demo server, you start by getting a token for the demo user account (username: demo / password: demo):

And you use this token to launch a task (get the taskId displayed in the web UI)

  • HTTP POST: https://demo.ctfreak.com/api/v1/executions

  • Header:

    Content-Type: application/json
    Authorization: Bearer N4tbVp4iAGtJ-_HsfNjuRuyG79wL7xLsz1TpNLxi7B0=
    
  • Body:

    {
      "taskId": "01G9SAGYJM6544WZR8P3W7XB5Q",
    }
    

If you launch a parameterizable task, each parameter is initialized with its default value, but you can override it.

For example, for a task with the parameters:

  • COUNTRY_CODE of type selector
  • CLEAN of type checkbox
  • MAX_RETRY of type integer
  • START_DATE of type date

You can attempt to run the following query:

  • HTTP POST: https://demo.ctfreak.com/api/v1/executions

  • Header:

    Content-Type: application/json
    Authorization: Bearer N4tbVp4iAGtJ-_HsfNjuRuyG79wL7xLsz1TpNLxi7B0=
    
  • Body:

    {
      "taskId": "01G9SAGYJM6544WZR8P3W7XB5Q",
      "parameterMap": {
          "COUNTRY_CODE": "US",
          "CLEAN": true,
          "MAX_RETRY": 5,
          "START_DATE": "2024-01-25"
      }
    }