Creates a complete task inside an existing task plan in a single atomic call: task + triggers + subtasks + resources. The operation is transactional: if any validation fails, nothing is persisted to the database.
Required add-on
The company must have the ADVANCED APIS add-on enabled. Without it, the endpoint returns 403.
Input parameters — Required
Sent in the request body.
Parameter
Type
Required
Description
description
string
Yes
Task description. Minimum 3 characters, maximum 200. Cannot be empty.
id_task_type_main
integer
Yes
Main task type. Must exist in the company's main task type catalog.
id_group_task
integer
Yes
ID of the task plan where the task will be created. The plan must exist and be active.
triggers
array
Yes
Array of triggers. Minimum 1. See structure below.
triggers structure
Each trigger must include id_task_trigger_type and the conditional fields based on its type.
Resource ID by type: inventory (inventories.items tool/spare part) · HR (companies.hourly_rates) · services (third_parties.service_types).
qty
numeric
Yes
Quantity. Must be > 0.
unit_cost
numeric
Yes
Unit cost. Must be > 0. total_cost is calculated automatically (qty × unit_cost).
Output parameters
Successful response: HTTP 201. Data is returned inside data.
Parameter
Type
Description
id
integer
ID of the created task.
id_group_task
integer
ID of the plan it belongs to.
description
string
Task description.
id_task_type_main
integer
Main type.
id_task_type / id_task_type_2
integer
Classifications.
id_priorities
integer
Priority.
duration
integer
Duration in seconds.
stop_assets
boolean
true if stop_assets_sec > 0.
stop_assets_sec
integer
Asset downtime in seconds.
is_configured
boolean
false if the task requires additional configuration from the UI.
config_pending
boolean
true when there are READING_WHEN/READING_EVERY triggers and the plan already has assets (meters need linking).
date_create
string
Creation date ISO 8601.
triggers
array
Created triggers, with generated IDs.
subtasks
array
Created subtasks.
resources
array
Created resources.
is_configured and config_pending
When the task has reading triggers (READING_WHEN or READING_EVERY) and the plan already has associated assets, the task is created successfully but returns "is_configured": false and "config_pending": true. Additional configuration is required to link meters to the plan's assets.
Errors
Code
Cause
401
Not authenticated · missing auth · invalid company · invalid user.
403
The company does not have the ADVANCED APIS add-on, or the user lacks ADD permission on Task Plans.
400
Missing body · validation failed (required fields, ranges, types) · plan not found or inactive · resource/unit/event not found in catalog.