SDK reference

Agents

Each route's function in the SDK, its call beside the same request in cURL.
orgAgents

GET/v1/orgs/:orgId/agents

Devices, pending network requests and recent jobs.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/agents' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
patchOrgAgentsDevicesByDeviceId

PATCH/v1/orgs/:orgId/agents/devices/:deviceId

Renames a device or changes its network mode and host allowlist.

Parameters and answers
curl -X PATCH 'https://api.cactive.com.au/v1/orgs/{orgId}/agents/devices/{deviceId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "networkMode": "allowlist",
    "hosts": [
      "example"
    ],
    "name": "Example"
  }'
deleteOrgAgentsDevicesByDeviceId

DELETE/v1/orgs/:orgId/agents/devices/:deviceId

Revokes a device. Its credential stops working on the next request.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/agents/devices/{deviceId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgAgentsRequestsByDecision

POST/v1/orgs/:orgId/agents/requests/:deviceId/:host/:decision

Answers a device's request for a host. Approving adds the host to the device's allowlist.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/agents/requests/{deviceId}/{host}/{decision}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgAgentsJobs

POST/v1/orgs/:orgId/agents/jobs

Queues a job. The first eligible device that polls claims it.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/agents/jobs' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "http.batch",
    "input": {}
  }'
orgAgentsJobsByJobId

GET/v1/orgs/:orgId/agents/jobs/:jobId

A job's status, with a temporary resultsUrl once it's done.

Parameters and answers
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/agents/jobs/{jobId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgAgentsJobsCancel

POST/v1/orgs/:orgId/agents/jobs/:jobId/cancel

Cancels a queued job, or asks the device running it to stop (canceling until it does).

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/agents/jobs/{jobId}/cancel' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postOrgAgentsJobsRequestAccess

POST/v1/orgs/:orgId/agents/jobs/:jobId/request-access

For a queued job a device can't run: files network requests for the hosts it lacks and emails the device's owner what else it needs (capability, full network access). Nothing changes until someone approves.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/agents/jobs/{jobId}/request-access' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "deviceId": "<deviceId>"
  }'