Skip to content

Tasks

Create and manage compliance tasks across frameworks.


List tasks

GET /external/task/framework/{framework}/list

Returns the total number of tasks for a given framework within your company.

Name In Type Description
framework path integer Enter framework's ID

Tip

The Framework ID is located in the Frameworks Manager. You can access it via the Manage icon inside the header's framework selector in the TrustView app.

curl -X GET https://nightly.api.trustview.eu/external/task/framework/1/list \
  -H "X-API-Key: tvw_sk_live_your_key_here"
const res = await fetch(
  "https://nightly.api.trustview.eu/external/task/framework/1/list",
  {
    headers: { "X-API-Key": "tvw_sk_live_your_key_here" },
  }
);
const total = await res.json();
$ch = curl_init('https://nightly.api.trustview.eu/external/task/framework/1/list');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: tvw_sk_live_your_key_here']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch));
curl_close($ch);
import requests

response = requests.get(
    "https://nightly.api.trustview.eu/external/task/framework/1/list",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
)
total = response.json()

Create a task

POST /external/task/framework/{framework}/new

Creates a new task under the specified framework.

Name In Type Description
framework path integer Enter framework's ID

Tip

The Framework ID is located in the Frameworks Manager. You can access it via the Manage icon inside the header's framework selector in the TrustView app.

curl -X POST https://nightly.api.trustview.eu/external/task/framework/1/new \
  -H "X-API-Key: tvw_sk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Review data retention policy",
    "description": "Annual review of retention schedules",
    "priority": 3,
    "labels": [],
    "startDate": "2026-06-01",
    "dueDate": "2026-06-30",
    "departmentId": 1,
    "gaps": []
  }'
const res = await fetch(
  "https://nightly.api.trustview.eu/external/task/framework/1/new",
  {
    method: "POST",
    headers: {
      "X-API-Key": "tvw_sk_live_your_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      title: "Review data retention policy",
      description: "Annual review of retention schedules",
      priority: 3,
      labels: [],
      startDate: "2026-06-01",
      dueDate: "2026-06-30",
      departmentId: 1,
      gaps: [],
    }),
  }
);
const task = await res.json();
$ch = curl_init('https://nightly.api.trustview.eu/external/task/framework/1/new');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: tvw_sk_live_your_key_here',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'title' => 'Review data retention policy',
    'description' => 'Annual review of retention schedules',
    'priority' => 3,
    'labels' => [],
    'startDate' => '2026-06-01',
    'dueDate' => '2026-06-30',
    'departmentId' => 1,
    'gaps' => [],
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch));
curl_close($ch);
import requests

response = requests.post(
    "https://nightly.api.trustview.eu/external/task/framework/1/new",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
    json={
        "title": "Review data retention policy",
        "description": "Annual review of retention schedules",
        "priority": 3,
        "labels": [],
        "startDate": "2026-06-01",
        "dueDate": "2026-06-30",
        "departmentId": 1,
        "gaps": [],
    },
)
task = response.json()

Response

Returns the created task object.


Get a task

GET /external/task/{taskUniqueId}/item

Retrieves a single task by its unique ID.

Name In Type Description
taskUniqueId path string Enter task's unique ID

Tip

The task's unique ID can be found in the address bar when viewing a task.

curl -X GET https://nightly.api.trustview.eu/external/task/6a054b8b9ae1a/item \
  -H "X-API-Key: tvw_sk_live_your_key_here"
const res = await fetch(
  "https://nightly.api.trustview.eu/external/task/6a054b8b9ae1a/item",
  {
    headers: { "X-API-Key": "tvw_sk_live_your_key_here" },
  }
);
const task = await res.json();
$ch = curl_init('https://nightly.api.trustview.eu/external/task/6a054b8b9ae1a/item');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: tvw_sk_live_your_key_here']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch));
curl_close($ch);
import requests

response = requests.get(
    "https://nightly.api.trustview.eu/external/task/6a054b8b9ae1a/item",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
)
task = response.json()

Update a task

PATCH /external/task/{taskUniqueId}/edit

Updates an existing task. Send only the fields you want to change.

Name In Type Description
taskUniqueId path string Enter task's unique ID

Tip

The task's unique ID can be found in the address bar when viewing a task.

curl -X PATCH https://nightly.api.trustview.eu/external/task/6a054b8b9ae1a/edit \
  -H "X-API-Key: tvw_sk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"title": "Review data retention policy (Q2)"}'
const res = await fetch(
  "https://nightly.api.trustview.eu/external/task/6a054b8b9ae1a/edit",
  {
    method: "PATCH",
    headers: {
      "X-API-Key": "tvw_sk_live_your_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ title: "Review data retention policy (Q2)" }),
  }
);
const task = await res.json();
$ch = curl_init('https://nightly.api.trustview.eu/external/task/6a054b8b9ae1a/edit');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: tvw_sk_live_your_key_here',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['title' => 'Review data retention policy (Q2)']));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch));
curl_close($ch);
import requests

response = requests.patch(
    "https://nightly.api.trustview.eu/external/task/6a054b8b9ae1a/edit",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
    json={"title": "Review data retention policy (Q2)"},
)
task = response.json()

Delete a task

DELETE /external/task/{taskUniqueId}/delete

Removes a task.

Name In Type Description
taskUniqueId path string Enter task's unique ID

Tip

The task's unique ID can be found in the address bar when viewing a task.

curl -X DELETE https://nightly.api.trustview.eu/external/task/6a054b8b9ae1a/delete \
  -H "X-API-Key: tvw_sk_live_your_key_here"
const res = await fetch(
  "https://nightly.api.trustview.eu/external/task/6a054b8b9ae1a/delete",
  {
    method: "DELETE",
    headers: { "X-API-Key": "tvw_sk_live_your_key_here" },
  }
);
$ch = curl_init('https://nightly.api.trustview.eu/external/task/6a054b8b9ae1a/delete');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: tvw_sk_live_your_key_here']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
import requests

response = requests.delete(
    "https://nightly.api.trustview.eu/external/task/6a054b8b9ae1a/delete",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
)

Response

Returns 204 No Content on success.