Import portable task archive
POST
/tasks/importUses the importId from the inspection step (or a multipart file for backward compatibility), atomically creates missing dependencies and payloads, rewrites all portable IDs, and creates the task.
Contract
Parameter | Value |
|---|---|
| Section | tasks |
| Authentication | CookieAuth |
| Consumes | application/json, multipart/form-data |
| Produces | application/json |
Parameters
3 parameters
Name | Location | Required | Type | Description |
|---|---|---|---|---|
| file | formData | yes | file | .pa-task-export archive |
| mappings | formData | no | string | Agent/PCI mapping JSON |
| request | body | no | object | Single-use importId and mappings from the archive inspection |
{}{ "importId": "<string>", "mappings": { "agents": { "<key>": 0 }, "pciInterfaces": { "<key>": "<string>" } } }
Responses
4 responses
Status | Description | Type |
|---|---|---|
200 | Created task and counters of created/matched objects | object |
400 | Invalid archive or mapping | object |
401 | Unauthorized | object |
500 | Failed to create task | object |
{ "created": { "agents": 0, "applications": 0, "certificates": 0, "compromisedHostCampaigns": 0, "cveSignatures": 0, "fileBytes": 0, "files": 0, "macs": 0, "networks": 0, "payloadBytes": 0, "tunnels": 0 }, "data": 0, "matched": { "agents": 0, "applications": 0, "certificates": 0, "compromisedHostCampaigns": 0, "cveSignatures": 0, "fileBytes": 0, "files": 0, "macs": 0, "networks": 0, "payloadBytes": 0, "tunnels": 0 }, "syncQueued": true, "taskId": 0, "updatedApplications": 0 }{ "data": {}, "error": "<string>" }{ "data": {}, "error": "<string>" }{ "data": {}, "error": "<string>" }