Activities Endpoints

The following REST endpoints are available to manage activities. Note that "activities" are either tasks or subprocesses.

Note: There is no endpoint to create a new activity.

Get Activity: GET project/{prj_uid}/activity/{act_uid}

Gets the properties of a specified activity (task or subprocess).

GET /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}

URL Parameters:

NameDescriptionExample
workspaceWorkspace name /api/1.0/workflow/project/84233230756cbb13a780d37064601378/activity/27487747556cbb168597107027360480
prj_uidUnique ID (UID) of the project. /api/1.0/workflow/project/84233230756cbb13a780d37064601378/activity/27487747556cbb168597107027360480
act_uidUnique ID of the activity (step or subprocess) /api/1.0/workflow/project/84233230756cbb13a780d37064601378/activity/27487747556cbb168597107027360480

Result:

If executed with success, the HTTP status code is set to 200 and the following object is returned with information about the activity:

-->
ElementDescription
{
"definition": [], The definition of the task, which is always an empty array.
"properties": { An object containing the task properties.
"tas_title": "Define Client", The title of the task or subprocess.
"tas_description": "Company client", The description of the task or subprocess. The task/subprocess description is displayed when the user views the Case Summary.
"tas_def_title": "Client @#name", The title of the case, which can contain variables and is set when the case arrives at the task. It is displayed at the top of the screen next to the case number when a case is opened. If set to "" (empty string), then the title of the case displays the case number preceded by #.
"tas_def_subject_message": "Your case @#caseNo", The subject line of the email notification to be sent to the assigned user(s) of the next task.
"tas_def_message": "New case @#caseNo.\nRegards, @#mngr",The text (body) of the email notification to be sent to the assigned user(s) if the tas_def_message_type is set to "text".
"tas_def_description": "Info about client '@#name'", The description of the case, which can contain variables and is set when the case arrives at the task. The description is displayed when the user views the Case Summary. If set to "" (empty string), then there is no case description.
"tas_type": "NORMAL", The type of activity, which can be:
"NORMAL": A task that only has normal assigned users.
"ADHOC": A task that has ad hoc assigned users (and can also have normal assigned users).
"SUBPROCESS": A subprocess. Most of the other properties can be ignored, except tas_title and tas_description.
"tas_duration": 4, The number of time units before the task becomes overdue. The default is 1.
"tas_type_day": "2", If set to "1", then the task duration is counted by "Work Days", which is Monday through Friday (the default setting). If set to "2", then the time is counted by "Calendar Days", and the calendar being used is set in tas_calendar.
"tas_timeunit": "DAYS", The time unit for the task duration, which can be: "DAYS", "HOURS" or "MINUTES".
"tas_priority_variable": "@@priority",A variable that determines the priority of the task. If the variable contains 1, then the case is the highest priority. If it contains 3, then the case has normal priority, which is the default. If 5, then the case has lowest priority. If set to "" (empty string), then the case will have normal priority. Note that this property can only contain variables and not literal values so it will not work correctly if set to "4".
"tas_assign_type": "BALANCED" The type of assignment rule, which can be: "BALANCED" (Cyclical Assignment), "MANUAL", "EVALUATE" (Value Based Assignment), "REPORT_TO", "SELF_SERVICE", "SELF_SERVICE_EVALUATE" (Self Service Value Based Assignment), "MULTIPLE_INSTANCE" (Parallel), "MULTIPLE_INSTANCE_VALUE_BASED" (Parallel Value Based Assignment).
"tas_assign_variable": "@@SYS_NEXT_USER_TO_BE_ASSIGNED", The variable that holds the unique ID of the user to be assigned to the Value Based Assignment task. Remember that this user must also be in the list of users assigned to the task.
"tas_group_variable": "@@SYS_GROUP_TO_BE_ASSIGNED", The variable that contains the unique IDs of the groups and users which can claim a Self Service Value Based Assignment task. Remember that these users/groups must also be in the list of users/groups assigned to the task.
"tas_transfer_fly": "FALSE", If set to "TRUE", then users are allowed to change the task duration during runtime; whereas if set to "FALSE", the task duration is a fixed amount of predetermined time.
"tas_send_last_email": "TRUE", If set to "TRUE", then an email notification is sent to the next assigned user(s), meaning the users assigned to the next task will receive a custom email message when the case is routed. If set to "FALSE", then there will be no email notification sent.
"tas_derivation_screen_tpl": "routingScreen.html", The file name of the template file displayed after routing the task. If none, then set to "" (empty screen).
"tas_selfservice_timeout": 1, If set to 1, then there is a self service timeout, meaning that a trigger will be executed if no one claims a case with a self-service task within the configured amount of time. If there is no timeout, then set to 0.
"tas_selfservice_time": "5", The amount of time before a self service task times out. If none, then set to "" (empty string).
"tas_selfservice_time_unit": "DAYS",The time units for calculating the timeout of a self service task, which can be "MINUTES", "HOURS" or "DAYS". If none selected, then set to "" (empty string).
"tas_selfservice_trigger_uid": "2840568655706c023962945046408021", The unique ID of the trigger executed after the timeout of a self service task. If no trigger, then set to "" (empty string).
"tas_selfservice_execution": "EVERY_TIME", If set to "ONCE", then the trigger of the self service timeout is executed once. If set to "EVERY_TIME", then the trigger is executed every time the cron.php script is run after the timeout.
"tas_offline": "TRUE", "Enable this task for offline use" option value. If the option was checked, the value will be "TRUE", otherwise it will be "FALSE".
"tas_email_server_uid": "6270141605851bf3cb71eb2041564369", The unique ID of the email server selected to send the task notifications.
"tas_auto_root": "TRUE", "Route case when back online" option value. If the option was checked, the value will be "TRUE", otherwise it will be "FALSE".
"tas_receive_server_uid": "6270141605851bf3cb71eb2041564369", The unique ID of the email server selected to send the task notifications.
"tas_receive_last_email": "TRUE", If set to "TRUE", the "Notify the assigned user to this task" option was checked and a notification will be sent to the current assigned user(s), meaning the user(s) assigned to this task will receive a custom email message when the case arrives to this task. If set to "FALSE", no email notification is sent.
"tas_receive_email_from_format": 0, If the "Assigned User" option was selected in the notification configuration, the value will be 0. If the "Email Server Settings" option was selected, the value will be 1.
"tas_receive_message_type": "text", The content type of the notification, that can be "text" or "template".
"tas_receive_message_template": "alert_message.html", The template set in the notification configuration.
"tas_receive_subject_message": "New Case for @#USR_USERNAME", Subject of the message.
"tas_receive_message": "New case assigned!", Content of the message.
"tas_average": NULL, The average amount of time to complete the task, if using the Strategic Dashboards plugin in the Enterprise Edition; otherwise, it is set to NULL.
"tas_sdv": NULL, The standard deviation of the time to complete the task, if using the Strategic Dashboards plugin in the Enterprise Edition; otherwise, it is set to NULL.
"tas_calendar": "1720244195706d204dbfde6080740114", The unique ID of the calendar used to calculate the duration of the task. If set to "00000000000000000000000000000001", then the "Default Calendar" is used. If set to "" (empty string), then no calendar is used, so the time is calculated 24 hours of every day.
"tas_def_message_type": "text", If set to "text", then use plain text for the email notification sent to the next assigned user(s). This text is entered directly in the "Activity Properties" dialog box and is available in the tas_def_message property. If set to "html", then the body of the email notification is defined by a template file set in the tas_def_message_template property.
"tas_def_message_template": "alert_message.html" The filename of the template file that defines the body of the email notification sent to the next assigned user(s) if the tas_def_message_type property is set to "html".
}
}

Example:

Response
200 (OK)
Content-Type: application/json
{
    "definition": [],
    "properties": {
      "tas_title": "Task 1",
      "tas_description": "",
      "tas_def_title": "",
      "tas_def_subject_message": "Case assigned for @#USR_USERNAME",
      "tas_def_message": "New case assigned!",
      "tas_def_description": "",
      "tas_type": "NORMAL",
      "tas_duration": 1,
      "tas_type_day": "1",
      "tas_timeunit": "DAYS",
      "tas_priority_variable": "",
      "tas_assign_type": "BALANCED",
      "tas_assign_variable": "@@SYS_NEXT_USER_TO_BE_ASSIGNED",
      "tas_group_variable": "",
      "tas_transfer_fly": "FALSE",
      "tas_send_last_email": "TRUE",
      "tas_derivation_screen_tpl": "",
      "tas_selfservice_timeout": 0,
      "tas_selfservice_time": 0,
      "tas_selfservice_time_unit": "",
      "tas_selfservice_trigger_uid": "",
      "tas_selfservice_execution": "EVERY_TIME",
      "tas_not_email_from_format": 0,
      "tas_email_server_uid": "634735107585935512ea0c4064203094",
      "tas_receive_server_uid": "328704833585934b0e53468018164403",
      "tas_receive_last_email": "TRUE",
      "tas_receive_email_from_format": 1,
      "tas_receive_message_type": "text",
      "tas_receive_message_template": "actionsByEmail.html",
      "tas_receive_subject_message": "New Case for @#USR_USERNAME",
      "tas_receive_message": "New case assigned!",
      "tas_average": null,
      "tas_sdv": null,
      "tas_calendar": "",
      "tas_def_message_type": "text",
      "tas_def_message_template": "alert_message.html"
    }
}

If an error occurred, the status code is set to 400 or higher and an error object is returned, such as:

{
  "error": {
    "code":    400,
    "message": "Bad Request: The activity with act_uid: '67732074357069b874ae219031485148', does not exist."
  }
}

PHP Example:

$pmWorkspace = 'workflow';
$clientId = 'YOXQRMHAMMMKSOENEDENDFQDTJTGTUUS';
$clientSecret = '32667560556abe5142235e0090500305';
$username = 'admin';
$password = 'p4sSw0rd';
$oToken = pmRestLogin($clientId, $clientSecret, $username, $password);
if (!isset($oToken) or !isset($oToken->access_token)) {
   die("Error: Can't access ProcessMaker REST");
}

$projectId = '67183605756a7ddf5b86c47017319951';
$taskId = '51532843656a7de25d98900065683932';
$oRet = pmRestRequest("GET", "/api/1.0/$pmWorkspace/project/$projectId/activity/$taskId", null, $oToken->access_token);
if ($oRet->status == 200)
   echo $oRet->response->properties->tas_title ." Task is type ". $oRet->response->properties->tas_assign_type;
elseif ($oRet->status == 400) {
   echo $oRet->response->error->message;
else
   print_r($oRet);

Update Activity: PUT project/{prj_uid}/activity/{act_uid}

Updates the properties of a specified activity (task or subprocess).

Permission:

Users must have the PM_FACTORY permission assigned to their role to perform this action.

Structure:

PUT /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}

URL Parameters:

NameDescriptionExample
workspaceWorkspace name /api/1.0/workflow/project/84233230756cbb13a780d37064601378/activity/27487747556cbb168597107027360480
prj_uidUnique ID (UID) of the project. /api/1.0/workflow/project/84233230756cbb13a780d37064601378/activity/27487747556cbb168597107027360480
act_uidUnique ID of the activity (step or subprocess) /api/1.0/workflow/project/84233230756cbb13a780d37064601378/activity/27487747556cbb168597107027360480

PUT Parameters:

ElementDescription
{Start object.
"properties": { Start properties object.
"tas_title": "Define Client",The title of the task or subprocess.
"tas_description": "Enter info about client", The description of the task or subprocess. The task/subprocess description is displayed when the user views the Case Summary.
"tas_priority_variable": "@@priority", A variable that determines the priority of the task. If the variable contains 1, then the case is the highest priority. If it contains 3, then the case is normal priority, which is the default. If 5, then the case is lowest priority. If set to "" (empty string), then the case will have normal priority. Note that this property can only contain variables and not literal values, so it will not work correctly if set to "4".
"tas_derivation_screen_tpl": "routingScreen.html", The filename of the template file displayed after routing the task. If none, then set to "" (empty screen).
"tas_assign_type": "BALANCED", The type of assignment rule, which can be: "BALANCED" (Cyclical Assignment), "MANUAL", "EVALUATE" (Value Based Assignment), "REPORT_TO", "SELF_SERVICE", "SELF_SERVICE_EVALUATE" (Self Service Value Based Assignment), "MULTIPLE_INSTANCE" (Parallel Assignment in Enterprise E.), "MULTIPLE_INSTANCE_VALUE_BASED" (Parallel Value Based Assignment in Enterprise E.).
"tas_assign_variable": "@@nextAssigned" The variable that holds the unique ID of the user to be assigned to a Value Based Assignment task. The default is "@@SYS_NEXT_USER_TO_BE_ASSIGNED". Remember that this user must also be in the list of users assigned to the task.
"tas_group_variable": "@@canClaimGroup",The variable that contains the unique IDs of the groups and users which can claim a Self Service Value Based Assignment task. The default is "@@SYS_GROUP_TO_BE_ASSIGNED". Remember that these users/groups must also be in the list of users/groups assigned to the task.
"tas_selfservice_time": "5",The amount of time of the timeout in a self service task. If none, then set to "" (empty string).
"tas_selfservice_timeout": 1,Set to 1 for a self service timeout, meaning that a trigger will be executed if no one claims a case with a self-service task within the configured amount of time. If there is no timeout, then set to 0.
"tas_selfservice_time_unit": "DAYS",The time units for calculating the timeout of a self service task, which can be "" (none), "MINUTES", "HOURS" or "DAYS".
"tas_selfservice_trigger_uid": "2840568655706c023962945046408021",The unique ID of the trigger executed after the timeout of a self service task. If no trigger, then set to "" (empty string).
"tas_selfservice_execution": "ONCE",If set to "ONCE", then the trigger of the self service timeout is executed once. If set to "EVERY_TIME", then the trigger is executed every time the cron.php script is run after the timeout.
"tas_transfer_fly": "FALSE",If set to "TRUE", then users are allowed to change the task duration during runtime; whereas if set to "FALSE", the task duration is a fixed amount of predetermined time.
"tas_offline": "TRUE", If set to "TRUE" the task will be enable for offline use in ProcessMaker Mobile.
"tas_auto_root": "TRUE", If set to "TRUE" the task will be enable to be routed automatically as soon as the ProcessMaker Mobile app is back online.
"tas_duration": 14,The number of time units before the task becomes overdue. The default is 1.
"tas_timeunit": "DAYS",The time unit of the task duration, which can be: "DAYS", "HOURS" or "MINUTES".
"tas_type_day": "2", If set to "1", then the task duration is counted by "Work Days", which is Monday through Friday, which is the default. If set to "2", then the time is counted by "Calendar Days" and the calendar being used is set in tas_calendar.
"tas_calendar": "1720244195706d204dbfde6080740114",The unique ID of the calendar used to calculate the duration of the task. If set to "00000000000000000000000000000001", then the "Default Calendar" is used. If set to "" (empty string), then no calendar is used, so task time is calculated 24 hours of every day.
"tas_def_title": "Client @#name",The title of the case, which can contain variables and is set when the case arrives at the task. It is displayed at the top of the screen next to the case number when a case is opened. If set to "" (empty string), then the title of the case displays the case number preceded by #.
"tas_def_description": "Info about client '@#name'",The description of the case, which can contain variables and is set when the case arrives at the task. The description is displayed when the user views the Case Summary. If set to "" (empty string), then there is no case description.
"tas_send_last_email": "TRUE",If set to "TRUE", then an email notification is sent to the next assigned user(s), meaning the users assigned to this task will receive a custom email message when the case arrives at this task. If set to "FALSE", then no email notification is sent for this task.
"tas_def_subject_message": "Your case @#caseNo", The subject line of the email notification to be sent to the assigned user(s) of the task. It may contain variables.
"tas_def_message_type": "text",If set to "text", then use plain text for the email notification sent to the assigned user(s). This text is entered directly in the "Activity Properties" dialog box and is available in the tas_def_message property. If set to "html", then the body of the email notification is defined by a template file set in the tas_def_message_template property.
"tas_def_message": "New case @#caseNo.\nRegards, @#mngr",The text (body) of the email notification to sent to the assigned user(s) if the tas_def_message_type is set to "text". The text can contain variables.
"tas_def_message_template": "alert_message.html"The filename of the template file that defines the body the email notification sent to the assigned user(s) of the task if the tas_def_message_typeproperty is set to "html".
"tas_email_server_uid": "" The unique ID of the email server selected to send the task notifications.
"tas_receive_server_uid": "6270141605851bf3cb71eb2041564369", The unique ID of the email server configured to send task notifications.
"tas_receive_last_email": "TRUE", If set to "TRUE", the "Notify the assigned user to this task" option was checked and a notification will be sent to the current assigned user(s), meaning the user(s) assigned to this task will receive a custom email message when the case arrives to this task. If set to "FALSE", no email notification is sent.
"tas_receive_email_from_format": 0, If the "Assigned User" option was selected in the notification configuration, the value will be 0. If the "Email Server Settings" option was selected, the value will be 1.
"tas_receive_message_type": "text", The content type of the notification, that can be "text" or "template".
"tas_receive_message_template": "alert_message.html", The template set in the notification configuration.
"tas_receive_subject_message": "New Case for @#USR_USERNAME", Subject of the message.
"tas_receive_message": "New case assigned!", Content of the notification.
} End properties object.
}

All properties are optional, but certain properties have dependent properties, which must be set. For example, if tas_transfer_fly is set to "FALSE", then it is not necessary to set tas_duration, but if set to "TRUE", then tas_duration must be set. The easiest way to avoid problems is to first call GET project/{prj_uid}/activity/{act_uid} to get the list of properties for an activity and then set the properties that need to be changed.

Note: It is recommended to not include the tas_type property, because it will cause an error if set to "SUBPROCESS", and changing it from "NORMAL" to "ADHOC or vice versa will set inaccurate information.

Note: If the activity is a subprocess, only tas_title and tas_description are used. Currently there are no endpoints for getting and updating the other properties of subprocesses.

Result:

If the activity was successfully updated, then the HTTP status code is set to 200 and there is no response. If an error occurred, the status code is set to 400 or higher and an error object is returned, such as:

{
  "error": {
    "code":    400,
    "message": "Bad Request: The activity with act_uid: '67732074357069b874ae219031485148', does not exist."
  }
}

PHP Example:

$pmWorkspace = 'workflow';
$clientId = 'YOXQRMHAMMMKSOENEDENDFQDTJTGTUUS';
$clientSecret = '32667560556abe5142235e0090500305';
$username = 'admin';
$password = 'p4sSw0rd';
$oToken = pmRestLogin($clientId, $clientSecret, $username, $password);
if (!isset($oToken) or !isset($oToken->access_token)) {
   die("Error: Can't access ProcessMaker REST");
}

$projectId = '67183605756a7ddf5b86c47017319951';
$taskId = '51532843656a7de25d98900065683932';
$aData = array(
   "properties" => array(
      "tas_title"                      => "Define client",
      "tas_description"                => "Enter client Info",
      "tas_type_day"                   => "2",
      "tas_timeunit"                   => "HOURS",
      "tas_duration"                   => 3,
      "tas_priority_variable"          => "@@priority",
      "tas_assign_type"                => "BALANCED",
      "tas_assign_variable"            => "",
      "tas_group_variable"             => "",
      "tas_transfer_fly"               => "FALSE",
      "tas_send_last_email"            => "TRUE",
      "tas_derivation_screen_tpl"      => "routingScreen.html",
      "tas_selfservice_timeout"        => 1,
      "tas_selfservice_time"           => "34",
      "tas_selfservice_time_unit"      => "HOURS",
      "tas_selfservice_trigger_uid"    => "2840568655706c023962945046408021",
      "tas_selfservice_execution"      => "ONCE",
      "tas_def_title"                  => "Client @#clientType",
      "tas_def_description"            => "",
      "tas_def_message"                => "Your new case @#caseNo,\nRegards, @#manager",
      "tas_def_subject_message"        => "Assigned to case @#caseNo",
      "tas_average"                    => 23,
      "tas_sdv"                        => 0.5,
      "tas_calendar"                   => "00000000000000000000000000000001",
      "tas_def_message_type"           => "text",
      "tas_def_message_template"       => "",
      "tas_email_server_uid"           => ""
      "tas_receive_server_uid"         => "328704833585934b0e53468018164403",
      "tas_receive_last_email"         => "TRUE",
      "tas_receive_email_from_format"  => 1,
      "tas_receive_message_type"       => "text",
      "tas_receive_message_template"   => "actionsByEmail.html",
      "tas_receive_subject_message"    => "New Case for @#USR_USERNAME",
      "tas_receive_message"            => "New case assigned!",
   )
);

$oRet = pmRestRequest("GET", "/api/1.0/$pmWorkspace/project/$projectId/activity/$taskId", $aData, $oToken->access_token);
if ($oRet->status == 400) {
   echo $oRet->response->error->message;
else
   print_r($oRet);

Delete Activity: DELETE project/{prj_uid}/activity/{act_uid}

Deletes a specified activity (task or subprocess).

Permission:

Users must have the PM_FACTORY permission assigned to their role to perform this action.

Structure:

DELETE /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}

URL Parameters:

NameDescriptionExample
workspaceWorkspace name /api/1.0/workflow/project/84233230756cbb13a780d37064601378/activity/27487747556cbb168597107027360480
prj_uidUnique ID (UID) of the project. /api/1.0/workflow/project/84233230756cbb13a780d37064601378/activity/27487747556cbb168597107027360480
act_uidUnique ID of the activity (step or subprocess) /api/1.0/workflow/project/84233230756cbb13a780d37064601378/activity/27487747556cbb168597107027360480

Result:

If the activity was successfully deleted, then the HTTP status code is set to 200 and there is no response. If an error occurred, the status code is set to 400 or higher and an error object is returned, such as:

{
  "error": {
    "code":    400,
    "message": "Bad Request: The activity with act_uid: '67732074357069b874ae219031485148', does not exist."
  }
}

Warning: This endpoint deletes the activity from the TASK or SUB_PROCESS table in the database, but it does NOT remove it from the BPMN_ACTIVITY table if the activity is from a BPMN process. The activity will still appear in the BPMN process map after being deleted.

PHP Example:

$pmWorkspace = 'workflow';
$clientId = 'YOXQRMHAMMMKSOENEDENDFQDTJTGTUUS';
$clientSecret = '32667560556abe5142235e0090500305';
$username = 'admin';
$password = 'p4sSw0rd';
$oToken = pmRestLogin($clientId, $clientSecret, $username, $password);
if (!isset($oToken) or !isset($oToken->access_token)) {
   die("Error: Can't access ProcessMaker REST");
}

$projectId = '67183605756a7ddf5b86c47017319951';
$taskId = '51532843656a7de25d98900065683932';
$oRet = pmRestRequest("DELETE", "/api/1.0/$pmWorkspace/project/$projectId/activity/$taskId", null, $oToken->access_token);
if ($oRet->status == 400) {
   echo $oRet->response->error->message;
else
   print_r($oRet);

Get Starting Tasks: GET project/{prj_uid}/starting-tasks

Returns a list of the starting task(s) in a specified project (or process).

GET /api/1.0/{workspace}/project/{prj_uid}/starting-tasks

URL Parameters:

NameDescriptionExample
workspaceWorkspace name /api/1.0/workflow/project/84233230756cbb13a780d37064601378/starting-tasks
prj_uidUnique ID of the project (or process), which can be found by looking at the @@PROCESS system variable in the Debugger. /api/1.0/workflow/project/84233230756cbb13a780d37064601378/starting-tasks

Result:

If successful, then the HTTP status code is set to 200 and an array of task objects is returned. If an error occurred, the status code is set to 400 or higher and an error object is returned, such as:

{
   "error": {
     "code": 400,
     "message": "Bad Request: The report table '$prj_uid' is related to a process not present in the workspace, import the related process first. To relate the report table to other process, open the process in the designer and import from there. The report table can't be imported."
    }
}

Note: This REST endpoint only returns tasks connected to a normal Start Event. It does not return sub-processes connected to Start Events or tasks connected to Start Timer Events.

Example:

Response:

200 (OK)
[
   {
      "act_name": "Engineering Request",
      "act_uid": "7845618785751f9cc81ed78079255303"
   },
   {
      "act_name": "Purchase  Request",
      "act_uid": "2622157305751e15d62bd28044177072"
   }
]

PHP Example:

Search for the unique ID of the "Purchase Request" task:

$pmWorkspace = 'workflow';
$clientId = 'YOXQRMHAMMMKSOENEDENDFQDTJTGTUUS';
$clientSecret = '32667560556abe5142235e0090500305';
$username = 'admin';
$password = 'p4sSw0rd';
$oToken = pmRestLogin($clientId, $clientSecret, $username, $password);
if (!isset($oToken) or !isset($oToken->access_token)) {
   die("Error: Can't access ProcessMaker REST");
}

$projectId = '67183605756a7ddf5b86c47017319951';
$oRet = pmRestRequest("DELETE", "/api/1.0/$pmWorkspace/project/$projectId/starting-task", null, $oToken->access_token);
if ($oRet->status == 200) {
   $taskId = '';
   foreach ($oRet->response as $oTask) {
      if ($oTask->act_name == "Purchase  Request") {
          $taskId = $oTask->act_uid;
      }
   }
}