Create a tasks plan

Create a new task plan by sending a description and an optional associated location.

Create a new task plan by sending the plan description and, optionally, an associated location.

Input parameters (Body)

Send the following parameters in the request body as JSON.

ParameterTypeRequiredDescription
descriptionStringYesTask plan description. Must be 1–255 characters. Cannot be empty or contain only whitespace.
id_locationIntegerOptionalLocation ID from the catalog. If omitted, the plan is not restricted to a location. If provided, it must match a valid location.

Output parameters

ParameterTypeDescription
successBooleantrue if the operation was successful.
messageStringHTTP code as a string ("201").
data.idIntegerUnique generated ID of the task plan.
data.descriptionStringDescription of the created plan.
data.id_locationIntegerAssigned location ID (null if not provided).
data.task_numberIntegerNumber of tasks associated with the plan, initialized as 0.
data.assets_numberIntegerNumber of linked assets, initialized as 0.
data.is_activeBooleanActive status of the plan (true by default).
totalStringTotal number of records created ("1").

Error codes

CodeCondition
400 Bad Requestdescription is empty, null, contains only whitespace, or exceeds 255 characters; id_location does not exist.
401 UnauthorizedBearer token is missing, expired, or invalid.
403 ForbiddenUser does not have the task manager role or higher.
500 Internal Server ErrorDatabase creation failed.

Example

Request: POST https://app.fracttal.com/api/groups_tasks

{
  "description": "Preventive maintenance for north sector pumps",
  "id_location": 1
}

Response:

{
  "success": true,
  "message": "201",
  "data": {
    "id": 385298,
    "description": "Preventive maintenance for north sector pumps",
    "id_location": 1,
    "task_number": 0,
    "assets_number": 0,
    "is_active": true
  },
  "total": "1"
}

Response without id_location

{
  "success": true,
  "message": "201",
  "data": {
    "id": 385299,
    "description": "General inspection plan",
    "id_location": null,
    "task_number": 0,
    "assets_number": 0,
    "is_active": true
  },
  "total": "1"
}

TEST CONNECTION

Response
200
Language
LoadingLoading…