Skip to main content

Import portable task archive

POST
/tasks/import

Uses 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
Sectiontasks
AuthenticationCookieAuth
Consumesapplication/json, multipart/form-data
Producesapplication/json

Parameters

3 parameters

Name
Location
Required
Type
Description
fileformDatayesfile.pa-task-export archive
mappingsformDatanostringAgent/PCI mapping JSON
requestbodynoobjectSingle-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 objectsobject
400
Invalid archive or mappingobject
401
Unauthorizedobject
500
Failed to create taskobject
  • {
      "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>"
    }