Optisway home
Documentation menu

REST API reference: Runs

A run is one execution of a test: it starts as queued, becomes running and ends as passed, failed or error. Finished runs carry their checks and findings, and their evidence downloads as a ZIP or as single files such as report.pdf when the organisation's plan includes run evidence.

Run

One run with its status, trigger, timing, checks, findings and evidence; artifacts.url and artifacts.filesUrl point at the v1 downloads.

Fields: Run
FieldTypeDescription
idstringThe run's id, a decimal string; read the run again with GET /runs/{id}.
testIdstringThe numeric id of the test that ran.
testNamestringThe name of the test that ran.
testKind"availability" | "links" | "seo" | "vitals" | "visual" | "a11y" | "rest" | "graphql" | "script" | "journey"The kind of the test that ran.
projectIdstringThe id of the test's project.
projectNamestringThe name of the test's project.
status"queued" | "running" | "passed" | "failed" | "error"queued and running still change; passed, failed and error are final (error means the run could not be completed).
trigger"manual" | "schedule" | "api"What started the run: manual (the app), schedule or api (this API).
startedAtISO 8601 string | nullWhen the run started (UTC), or null while it is queued.
finishedAtISO 8601 string | nullWhen the run finished (UTC), or null until it is final.
durationMsinteger | nullHow long the run took, in milliseconds, or null until it is final.
summarystringThe result in one English line, such as 503 Service Unavailable in 184 ms; an empty string until the run finishes.
checks.totalintegerHow many checks the run evaluated (one per finding, warnings included).
checks.passedintegerHow many checks passed (findings with severity pass).
checks.failedintegerHow many checks failed (findings with severity fail).
findingsFinding[]Every finding of the run, in the order the checks produced them; empty while queued.
findings[].severity"pass" | "warn" | "fail"pass, warn (worth a look, does not fail the run) or fail (fails the run).
findings[].codestringA stable machine code of the check, such as status, response-time or broken-link.
findings[].messagestringWhat the check found, in one English sentence.
findings[].targetstring | nullThe URL or page element the finding is about, or null when it has none.
findings[].valuenumber | nullThe measured number behind the finding, read together with unit (503 with status), or null.
findings[].unitstring | nullThe unit of value: ms (milliseconds), s (seconds), score, count, ratio or status (an HTTP status code), or null.
findings[].ruleIdstring | nullThe accessibility rule an a11y-issue finding reports, a stable id such as image-alt or color-contrast; null for every other finding.
artifactsobject | nullThe run's stored evidence ZIP, or null when nothing was stored.
artifacts.bytesintegerThe size of the ZIP in bytes.
artifacts.videobooleantrue when the ZIP holds a screen recording (video.webm).
artifacts.urlstringThe path that downloads the ZIP (GET /runs/{id}/artifacts).
artifacts.filesUrlstringThe path that downloads one entry of the ZIP; add ?path=report.pdf (GET /runs/{id}/files).
artifactErrorstring | nullWhy the evidence could not be stored (up to 200 characters), or null; it never changes status.
createdAtISO 8601 stringWhen the run was queued (UTC).
links.selfstringThe path of this run (GET /runs/{id}).
links.teststringThe path of the test that ran (GET /tests/{id}).
Example: RunJSON
{
  "id": "4821",
  "testId": "318",
  "testName": "Checkout page",
  "testKind": "availability",
  "projectId": "42",
  "projectName": "Acme Shop",
  "status": "failed",
  "trigger": "api",
  "startedAt": "2026-10-19T09:12:01.000Z",
  "finishedAt": "2026-10-19T09:12:03.140Z",
  "durationMs": 2140,
  "summary": "503 Service Unavailable in 184 ms",
  "checks": {
    "total": 3,
    "passed": 2,
    "failed": 1
  },
  "findings": [
    {
      "severity": "fail",
      "code": "status",
      "message": "503 Service Unavailable",
      "target": "https://shop.example.com/",
      "value": 503,
      "unit": "status",
      "ruleId": null
    },
    {
      "severity": "pass",
      "code": "redirect-chain",
      "message": "No redirects",
      "target": "https://shop.example.com/",
      "value": 0,
      "unit": "count",
      "ruleId": null
    },
    {
      "severity": "pass",
      "code": "response-time",
      "message": "184 ms",
      "target": "https://shop.example.com/",
      "value": 184,
      "unit": "ms",
      "ruleId": null
    }
  ],
  "artifacts": {
    "bytes": 48213,
    "video": false,
    "url": "/api/v1/runs/4821/artifacts",
    "filesUrl": "/api/v1/runs/4821/files"
  },
  "artifactError": null,
  "createdAt": "2026-10-19T09:12:00.000Z",
  "links": {
    "self": "/api/v1/runs/4821",
    "test": "/api/v1/tests/318"
  }
}

RunSummary

The short form of a run, used in lastRun.

Fields: RunSummary
FieldTypeDescription
idstringThe run's id, a decimal string; read the run again with GET /runs/{id}.
status"queued" | "running" | "passed" | "failed" | "error"queued and running still change; passed, failed and error are final (error means the run could not be completed).
trigger"manual" | "schedule" | "api"What started the run: manual (the app), schedule or api (this API).
startedAtISO 8601 string | nullWhen the run started (UTC), or null while it is queued.
finishedAtISO 8601 string | nullWhen the run finished (UTC), or null until it is final.
durationMsinteger | nullHow long the run took, in milliseconds, or null until it is final.
summarystringThe result in one English line, such as 503 Service Unavailable in 184 ms; an empty string until the run finishes.
Example: RunSummaryJSON
{
  "id": "4821",
  "status": "failed",
  "trigger": "api",
  "startedAt": "2026-10-19T09:12:01.000Z",
  "finishedAt": "2026-10-19T09:12:03.140Z",
  "durationMs": 2140,
  "summary": "503 Service Unavailable in 184 ms"
}

NotificationRouting

Which of the organisation’s notification channels a test notifies: all of them or only the selected ones.

Fields: NotificationRouting
FieldTypeDescription
scope"all" | "selected"all (the default): finished runs notify every active notification channel of the organisation; selected: only the channels in channelIds. Each channel's own choice between failed runs only and every finished run still applies, and the run e-mails to members are not affected.
channelIdsstring[] (≤ 20 distinct channel ids, ascending)The ids of the selected channels in ascending order (NotificationChannel.id from GET /notification-channels), always empty with all; an empty list with selected means no channel notifications, and a deleted channel leaves every list. Test files exported from the app leave the routing out, because channel ids belong to one organisation.
Example: NotificationRoutingJSON
{
  "scope": "selected",
  "channelIds": [
    "12"
  ]
}

NotificationChannel

A notification channel of the organisation: its provider, name, masked target and when it notifies; never the webhook URL or key.

Fields: NotificationChannel
FieldTypeDescription
idstringThe channel's id, a decimal string; use it in notificationRouting.channelIds.
provider"slack" | "teams" | "pumble" | "pagerduty"Where the channel posts: slack, teams (Microsoft Teams), pumble or pagerduty.
namestringThe channel's name as shown in Settings.
targetHintstringThe masked webhook address or integration key, such as hooks.slack.com…Xk2f; the full value is never returned.
onlyFailuresbooleantrue when the channel hears about failed and errored runs only (PagerDuty also resolves its incident when the test passes again), false for every finished run.
activebooleanfalse while the channel is paused: tests can still select it, but it receives nothing.
locale"en" | "de" | "tr"The language every message to the channel is written in, its run links included: en (English), de (German) or tr (Turkish), chosen in Settings.
createdAtISO 8601 stringWhen the channel was added (UTC).
Example: NotificationChannelJSON
{
  "id": "12",
  "provider": "slack",
  "name": "Checkout team",
  "targetHint": "hooks.slack.com…Xk2f",
  "onlyFailures": true,
  "active": true,
  "locale": "en",
  "createdAt": "2026-10-05T09:00:00.000Z"
}

List runs GET /runs

Lists every run in the key's scope, newest first; the optional filters project, test and status combine. Needs read access. The example lists the failed runs of project 42, two per page, and next continues with older runs.

Needs a key with access: Read

Parameters

Parameters: GET /runs
NameInTypeRequiredDescriptionExample
projectQuery stringstring (numeric project id)NoReturns only the runs of tests in this project (numeric id).42
testQuery stringstring (numeric id or tst_… id)NoReturns only the runs of this test (numeric id or tst_… id).tst_7k2m9q4xh3vd
statusQuery string"queued" | "running" | "passed" | "failed" | "error"NoReturns only runs with this status.failed
limitQuery stringinteger, 1–50, default 20NoHow many runs one page holds: a whole number from 1 to 50; without it, a page holds 20.2
beforeQuery stringstring (run id)NoReturns only runs older than this run id; you normally follow next instead of setting it yourself.4790

Example request

curl --fail-with-body -sS "https://optisway.com/api/v1/runs?project=42&status=failed&limit=2" \
  -H "Authorization: Bearer $OPTISWAY_API_KEY"
// Node.js 18+: save as optisway.mjs and run `node optisway.mjs`
const url = "https://optisway.com/api/v1/runs?project=42&status=failed&limit=2";
const response = await fetch(url, {
  headers: {
    Authorization: `Bearer ${process.env.OPTISWAY_API_KEY}`,
  },
});
if (!response.ok) {
  const { error, message } = await response.json();
  console.error(`${response.status} ${error}: ${message}`);
  process.exit(1);
}
const { items } = await response.json();
for (const item of items) console.log(item.id, item.status, item.summary);
# pip install requests
import os
import sys

import requests

api_key = os.environ["OPTISWAY_API_KEY"]
response = requests.get(
    "https://optisway.com/api/v1/runs?project=42&status=failed&limit=2",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
if not response.ok:
    envelope = response.json()
    print(f"{response.status_code} {envelope['error']}: {envelope['message']}", file=sys.stderr)
    sys.exit(1)
for item in response.json()["items"]:
    print(item["id"], item["status"], item["summary"])
require "json"
require "net/http"
require "uri"

uri = URI("https://optisway.com/api/v1/runs?project=42&status=failed&limit=2")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("OPTISWAY_API_KEY")}"
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }
unless response.is_a?(Net::HTTPSuccess)
  envelope = JSON.parse(response.body)
  warn "#{response.code} #{envelope["error"]}: #{envelope["message"]}"
  exit 1
end
JSON.parse(response.body)["items"].each do |item|
  puts [item["id"], item["status"], item["summary"]].join("  ")
end
<?php
$curl = curl_init("https://optisway.com/api/v1/runs?project=42&status=failed&limit=2");
curl_setopt_array($curl, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("OPTISWAY_API_KEY"),
  ],
]);
$body = curl_exec($curl);
if ($body === false) {
  fwrite(STDERR, curl_error($curl) . "\n");
  exit(1);
}
$status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
if ($status < 200 || $status >= 300) {
  $envelope = json_decode($body, true);
  fwrite(STDERR, "$status {$envelope['error']}: {$envelope['message']}\n");
  exit(1);
}
foreach (json_decode($body, true)["items"] as $item) {
  echo $item["id"], "  ", $item["status"], "  ", $item["summary"], "\n";
}
// Java 11+: save as Main.java and run `java Main.java`
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
  public static void main(String[] args) throws Exception {
    String url = "https://optisway.com/api/v1/runs?project=42&status=failed&limit=2";
    HttpRequest request = HttpRequest.newBuilder(URI.create(url))
        .header("Authorization", "Bearer " + System.getenv("OPTISWAY_API_KEY"))
        .build();
    HttpResponse<String> response = HttpClient.newHttpClient()
        .send(request, HttpResponse.BodyHandlers.ofString());
    if (response.statusCode() >= 300) {
      String error = response.body();
      System.err.println(response.statusCode() + " " + field(error, "error") + ": "
          + field(error, "message"));
      System.exit(1);
    }
    // { "items": [...], "next": ... } -- any JSON library (Jackson, Gson, org.json) parses it;
    // this example stays dependency-free and prints the raw JSON.
    System.out.println(response.body());
  }

  /** The first string value of a JSON key (dependency-free; Jackson or Gson parse JSON properly). */
  static String field(String json, String key) {
    Matcher match = Pattern.compile("\"" + key + "\"\\s*:\\s*(?:\"((?:[^\"\\\\]|\\\\.)*)\"|null)")
        .matcher(json);
    return match.find() ? match.group(1) : null;
  }
}
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
	"os"
)

func main() {
	url := "https://optisway.com/api/v1/runs?project=42&status=failed&limit=2"
	req, err := http.NewRequest(http.MethodGet, url, nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("OPTISWAY_API_KEY"))
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	if resp.StatusCode >= 300 {
		var envelope struct {
			Error   string `json:"error"`
			Message string `json:"message"`
		}
		_ = json.NewDecoder(resp.Body).Decode(&envelope)
		fmt.Fprintf(os.Stderr, "%d %s: %s\n", resp.StatusCode, envelope.Error, envelope.Message)
		os.Exit(1)
	}
	var body map[string]any
	if err := json.NewDecoder(resp.Body).Decode(&body); err != nil {
		panic(err)
	}
	for _, raw := range body["items"].([]any) {
		item := raw.(map[string]any)
		fmt.Println(item["id"], item["status"], item["summary"])
	}
}
// .NET 8: `dotnet new console`, replace Program.cs with this file, then `dotnet run`
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json;

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
  new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("OPTISWAY_API_KEY"));
var url = "https://optisway.com/api/v1/runs?project=42&status=failed&limit=2";
using var response = await client.GetAsync(url);
if (!response.IsSuccessStatusCode)
{
  var envelope = await response.Content.ReadFromJsonAsync<JsonElement>();
  var error = envelope.GetProperty("error");
  var message = envelope.GetProperty("message");
  Console.Error.WriteLine($"{(int)response.StatusCode} {error}: {message}");
  Environment.Exit(1);
}
var body = await response.Content.ReadFromJsonAsync<JsonElement>();
foreach (var item in body.GetProperty("items").EnumerateArray())
{
  Console.WriteLine(string.Join("  ",
    item.GetProperty("id"), item.GetProperty("status"), item.GetProperty("summary")));
}

Example response

Returns: An object with items (Run objects) and next (the path of the next page, or null on the last page).

Status: 200 OK

Headers: Content-Type: application/json; charset=utf-8 Cache-Control: no-store

Response body: List runsJSON
{
  "items": [
    {
      "id": "4821",
      "testId": "318",
      "testName": "Checkout page",
      "testKind": "availability",
      "projectId": "42",
      "projectName": "Acme Shop",
      "status": "failed",
      "trigger": "api",
      "startedAt": "2026-10-19T09:12:01.000Z",
      "finishedAt": "2026-10-19T09:12:03.140Z",
      "durationMs": 2140,
      "summary": "503 Service Unavailable in 184 ms",
      "checks": {
        "total": 3,
        "passed": 2,
        "failed": 1
      },
      "findings": [
        {
          "severity": "fail",
          "code": "status",
          "message": "503 Service Unavailable",
          "target": "https://shop.example.com/",
          "value": 503,
          "unit": "status",
          "ruleId": null
        },
        {
          "severity": "pass",
          "code": "redirect-chain",
          "message": "No redirects",
          "target": "https://shop.example.com/",
          "value": 0,
          "unit": "count",
          "ruleId": null
        },
        {
          "severity": "pass",
          "code": "response-time",
          "message": "184 ms",
          "target": "https://shop.example.com/",
          "value": 184,
          "unit": "ms",
          "ruleId": null
        }
      ],
      "artifacts": {
        "bytes": 48213,
        "video": false,
        "url": "/api/v1/runs/4821/artifacts",
        "filesUrl": "/api/v1/runs/4821/files"
      },
      "artifactError": null,
      "createdAt": "2026-10-19T09:12:00.000Z",
      "links": {
        "self": "/api/v1/runs/4821",
        "test": "/api/v1/tests/318"
      }
    },
    {
      "id": "4790",
      "testId": "318",
      "testName": "Checkout page",
      "testKind": "availability",
      "projectId": "42",
      "projectName": "Acme Shop",
      "status": "failed",
      "trigger": "schedule",
      "startedAt": "2026-10-18T09:12:02.000Z",
      "finishedAt": "2026-10-18T09:12:12.310Z",
      "durationMs": 10310,
      "summary": "The page could not be loaded: No response within 10 s.",
      "checks": {
        "total": 1,
        "passed": 0,
        "failed": 1
      },
      "findings": [
        {
          "severity": "fail",
          "code": "fetch-error",
          "message": "No response within 10 s.",
          "target": "https://shop.example.com/",
          "value": null,
          "unit": null,
          "ruleId": null
        }
      ],
      "artifacts": {
        "bytes": 41877,
        "video": false,
        "url": "/api/v1/runs/4790/artifacts",
        "filesUrl": "/api/v1/runs/4790/files"
      },
      "artifactError": null,
      "createdAt": "2026-10-18T09:12:00.000Z",
      "links": {
        "self": "/api/v1/runs/4790",
        "test": "/api/v1/tests/318"
      }
    }
  ],
  "next": "/api/v1/runs?project=42&status=failed&limit=2&before=4790"
}

Errors you can get

  • invalid_request 400 A path, filter or limit is invalid, or a JSON body is unreadable, too large or invalid.
  • unauthorized 401 The key is missing, malformed, unknown, revoked or expired, or its creator is no longer a member.
  • rate_limited 429 The key sent too many requests; wait the seconds in Retry-After.
  • unavailable 503 A temporary problem on our side; try again later.

Read a run GET /runs/{id}

Reads one run: its status, timing, check counts, every finding and the artifact download paths. Needs read access; after starting a run, read it every 10 seconds until status is passed, failed or error. The example shows run 4821 after it failed because the page answered 503.

Needs a key with access: Read

Parameters

Parameters: GET /runs/{id}
NameInTypeRequiredDescriptionExample
idPathstring (numeric run id)YesThe numeric id of the run, as returned in Run.id and in the Location header of a started run.4821

Example request

curl --fail-with-body -sS "https://optisway.com/api/v1/runs/4821" \
  -H "Authorization: Bearer $OPTISWAY_API_KEY"
// Node.js 18+: save as optisway.mjs and run `node optisway.mjs`
const url = "https://optisway.com/api/v1/runs/4821";
const response = await fetch(url, {
  headers: {
    Authorization: `Bearer ${process.env.OPTISWAY_API_KEY}`,
  },
});
if (!response.ok) {
  const { error, message } = await response.json();
  console.error(`${response.status} ${error}: ${message}`);
  process.exit(1);
}
const body = await response.json();
console.log(`Status: ${body.status}`);
console.log(`Summary: ${body.summary}`);
# pip install requests
import os
import sys

import requests

api_key = os.environ["OPTISWAY_API_KEY"]
response = requests.get(
    "https://optisway.com/api/v1/runs/4821",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
if not response.ok:
    envelope = response.json()
    print(f"{response.status_code} {envelope['error']}: {envelope['message']}", file=sys.stderr)
    sys.exit(1)
body = response.json()
print("Status:", body["status"])
print("Summary:", body["summary"])
require "json"
require "net/http"
require "uri"

uri = URI("https://optisway.com/api/v1/runs/4821")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("OPTISWAY_API_KEY")}"
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }
unless response.is_a?(Net::HTTPSuccess)
  envelope = JSON.parse(response.body)
  warn "#{response.code} #{envelope["error"]}: #{envelope["message"]}"
  exit 1
end
body = JSON.parse(response.body)
puts "Status: #{body["status"]}"
puts "Summary: #{body["summary"]}"
<?php
$curl = curl_init("https://optisway.com/api/v1/runs/4821");
curl_setopt_array($curl, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("OPTISWAY_API_KEY"),
  ],
]);
$body = curl_exec($curl);
if ($body === false) {
  fwrite(STDERR, curl_error($curl) . "\n");
  exit(1);
}
$status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
if ($status < 200 || $status >= 300) {
  $envelope = json_decode($body, true);
  fwrite(STDERR, "$status {$envelope['error']}: {$envelope['message']}\n");
  exit(1);
}
$data = json_decode($body, true);
echo "Status: {$data['status']}\n";
echo "Summary: {$data['summary']}\n";
// Java 11+: save as Main.java and run `java Main.java`
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
  public static void main(String[] args) throws Exception {
    String url = "https://optisway.com/api/v1/runs/4821";
    HttpRequest request = HttpRequest.newBuilder(URI.create(url))
        .header("Authorization", "Bearer " + System.getenv("OPTISWAY_API_KEY"))
        .build();
    HttpResponse<String> response = HttpClient.newHttpClient()
        .send(request, HttpResponse.BodyHandlers.ofString());
    if (response.statusCode() >= 300) {
      String error = response.body();
      System.err.println(response.statusCode() + " " + field(error, "error") + ": "
          + field(error, "message"));
      System.exit(1);
    }
    String body = response.body();
    System.out.println("Status: " + field(body, "status"));
    System.out.println("Summary: " + field(body, "summary"));
  }

  /** The first string value of a JSON key (dependency-free; Jackson or Gson parse JSON properly). */
  static String field(String json, String key) {
    Matcher match = Pattern.compile("\"" + key + "\"\\s*:\\s*(?:\"((?:[^\"\\\\]|\\\\.)*)\"|null)")
        .matcher(json);
    return match.find() ? match.group(1) : null;
  }
}
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
	"os"
)

func main() {
	url := "https://optisway.com/api/v1/runs/4821"
	req, err := http.NewRequest(http.MethodGet, url, nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("OPTISWAY_API_KEY"))
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	if resp.StatusCode >= 300 {
		var envelope struct {
			Error   string `json:"error"`
			Message string `json:"message"`
		}
		_ = json.NewDecoder(resp.Body).Decode(&envelope)
		fmt.Fprintf(os.Stderr, "%d %s: %s\n", resp.StatusCode, envelope.Error, envelope.Message)
		os.Exit(1)
	}
	var body map[string]any
	if err := json.NewDecoder(resp.Body).Decode(&body); err != nil {
		panic(err)
	}
	fmt.Println("Status:", body["status"])
	fmt.Println("Summary:", body["summary"])
}
// .NET 8: `dotnet new console`, replace Program.cs with this file, then `dotnet run`
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json;

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
  new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("OPTISWAY_API_KEY"));
var url = "https://optisway.com/api/v1/runs/4821";
using var response = await client.GetAsync(url);
if (!response.IsSuccessStatusCode)
{
  var envelope = await response.Content.ReadFromJsonAsync<JsonElement>();
  var error = envelope.GetProperty("error");
  var message = envelope.GetProperty("message");
  Console.Error.WriteLine($"{(int)response.StatusCode} {error}: {message}");
  Environment.Exit(1);
}
var body = await response.Content.ReadFromJsonAsync<JsonElement>();
Console.WriteLine($"Status: {body.GetProperty("status")}");
Console.WriteLine($"Summary: {body.GetProperty("summary")}");

Example response

Returns: A Run object.

Status: 200 OK

Headers: Content-Type: application/json; charset=utf-8 Cache-Control: no-store

Response body: Read a runJSON
{
  "id": "4821",
  "testId": "318",
  "testName": "Checkout page",
  "testKind": "availability",
  "projectId": "42",
  "projectName": "Acme Shop",
  "status": "failed",
  "trigger": "api",
  "startedAt": "2026-10-19T09:12:01.000Z",
  "finishedAt": "2026-10-19T09:12:03.140Z",
  "durationMs": 2140,
  "summary": "503 Service Unavailable in 184 ms",
  "checks": {
    "total": 3,
    "passed": 2,
    "failed": 1
  },
  "findings": [
    {
      "severity": "fail",
      "code": "status",
      "message": "503 Service Unavailable",
      "target": "https://shop.example.com/",
      "value": 503,
      "unit": "status",
      "ruleId": null
    },
    {
      "severity": "pass",
      "code": "redirect-chain",
      "message": "No redirects",
      "target": "https://shop.example.com/",
      "value": 0,
      "unit": "count",
      "ruleId": null
    },
    {
      "severity": "pass",
      "code": "response-time",
      "message": "184 ms",
      "target": "https://shop.example.com/",
      "value": 184,
      "unit": "ms",
      "ruleId": null
    }
  ],
  "artifacts": {
    "bytes": 48213,
    "video": false,
    "url": "/api/v1/runs/4821/artifacts",
    "filesUrl": "/api/v1/runs/4821/files"
  },
  "artifactError": null,
  "createdAt": "2026-10-19T09:12:00.000Z",
  "links": {
    "self": "/api/v1/runs/4821",
    "test": "/api/v1/tests/318"
  }
}

Errors you can get

  • not_found 404 The resource does not exist or is outside the key’s scope.
  • unauthorized 401 The key is missing, malformed, unknown, revoked or expired, or its creator is no longer a member.
  • rate_limited 429 The key sent too many requests; wait the seconds in Retry-After.
  • unavailable 503 A temporary problem on our side; try again later.

Download the artifacts ZIP GET /runs/{id}/artifacts

Downloads the run's evidence as one ZIP file: the PDF report, manifest.json and, depending on the kind, screenshots, proof shots, the video and visual comparison images. Needs read access; a run that stored no artifacts answers 404 not_found, or 422 plan_limit_reached when the organisation's plan does not include run evidence (a ZIP stored earlier still downloads). The example saves the ZIP of run 4821 under the name from Content-Disposition.

Needs a key with access: Read

Parameters

Parameters: GET /runs/{id}/artifacts
NameInTypeRequiredDescriptionExample
idPathstring (numeric run id)YesThe numeric id of the run, as returned in Run.id and in the Location header of a started run.4821

Example request

curl --fail-with-body -sS -o run-4821.zip "https://optisway.com/api/v1/runs/4821/artifacts" \
  -H "Authorization: Bearer $OPTISWAY_API_KEY" \
  -w "HTTP %{http_code}, wrote %{size_download} bytes\n"
// Node.js 18+: save as optisway.mjs and run `node optisway.mjs`
import { writeFile } from "node:fs/promises";

const url = "https://optisway.com/api/v1/runs/4821/artifacts";
const response = await fetch(url, {
  headers: {
    Authorization: `Bearer ${process.env.OPTISWAY_API_KEY}`,
  },
});
if (!response.ok) {
  const { error, message } = await response.json();
  console.error(`${response.status} ${error}: ${message}`);
  process.exit(1);
}
const bytes = Buffer.from(await response.arrayBuffer());
await writeFile("run-4821.zip", bytes);
console.log(`Saved run-4821.zip (${bytes.length} bytes)`);
# pip install requests
import os
import sys

import requests

api_key = os.environ["OPTISWAY_API_KEY"]
response = requests.get(
    "https://optisway.com/api/v1/runs/4821/artifacts",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
if not response.ok:
    envelope = response.json()
    print(f"{response.status_code} {envelope['error']}: {envelope['message']}", file=sys.stderr)
    sys.exit(1)
with open("run-4821.zip", "wb") as file:
    file.write(response.content)
print(f"Saved run-4821.zip ({len(response.content)} bytes)")
require "json"
require "net/http"
require "uri"

uri = URI("https://optisway.com/api/v1/runs/4821/artifacts")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("OPTISWAY_API_KEY")}"
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }
unless response.is_a?(Net::HTTPSuccess)
  envelope = JSON.parse(response.body)
  warn "#{response.code} #{envelope["error"]}: #{envelope["message"]}"
  exit 1
end
File.binwrite("run-4821.zip", response.body)
puts "Saved run-4821.zip (#{response.body.bytesize} bytes)"
<?php
$curl = curl_init("https://optisway.com/api/v1/runs/4821/artifacts");
curl_setopt_array($curl, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("OPTISWAY_API_KEY"),
  ],
]);
$body = curl_exec($curl);
if ($body === false) {
  fwrite(STDERR, curl_error($curl) . "\n");
  exit(1);
}
$status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
if ($status < 200 || $status >= 300) {
  $envelope = json_decode($body, true);
  fwrite(STDERR, "$status {$envelope['error']}: {$envelope['message']}\n");
  exit(1);
}
file_put_contents("run-4821.zip", $body);
echo "Saved run-4821.zip (" . strlen($body) . " bytes)\n";
// Java 11+: save as Main.java and run `java Main.java`
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
  public static void main(String[] args) throws Exception {
    String url = "https://optisway.com/api/v1/runs/4821/artifacts";
    HttpRequest request = HttpRequest.newBuilder(URI.create(url))
        .header("Authorization", "Bearer " + System.getenv("OPTISWAY_API_KEY"))
        .build();
    HttpResponse<byte[]> response = HttpClient.newHttpClient()
        .send(request, HttpResponse.BodyHandlers.ofByteArray());
    if (response.statusCode() >= 300) {
      String error = new String(response.body(), StandardCharsets.UTF_8);
      System.err.println(response.statusCode() + " " + field(error, "error") + ": "
          + field(error, "message"));
      System.exit(1);
    }
    Files.write(Path.of("run-4821.zip"), response.body());
    System.out.println("Saved run-4821.zip (" + response.body().length + " bytes)");
  }

  /** The first string value of a JSON key (dependency-free; Jackson or Gson parse JSON properly). */
  static String field(String json, String key) {
    Matcher match = Pattern.compile("\"" + key + "\"\\s*:\\s*(?:\"((?:[^\"\\\\]|\\\\.)*)\"|null)")
        .matcher(json);
    return match.find() ? match.group(1) : null;
  }
}
package main

import (
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	url := "https://optisway.com/api/v1/runs/4821/artifacts"
	req, err := http.NewRequest(http.MethodGet, url, nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("OPTISWAY_API_KEY"))
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	if resp.StatusCode >= 300 {
		var envelope struct {
			Error   string `json:"error"`
			Message string `json:"message"`
		}
		_ = json.NewDecoder(resp.Body).Decode(&envelope)
		fmt.Fprintf(os.Stderr, "%d %s: %s\n", resp.StatusCode, envelope.Error, envelope.Message)
		os.Exit(1)
	}
	file, err := os.Create("run-4821.zip")
	if err != nil {
		panic(err)
	}
	defer file.Close()
	size, err := io.Copy(file, resp.Body)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Saved run-4821.zip (%d bytes)\n", size)
}
// .NET 8: `dotnet new console`, replace Program.cs with this file, then `dotnet run`
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json;

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
  new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("OPTISWAY_API_KEY"));
var url = "https://optisway.com/api/v1/runs/4821/artifacts";
using var response = await client.GetAsync(url);
if (!response.IsSuccessStatusCode)
{
  var envelope = await response.Content.ReadFromJsonAsync<JsonElement>();
  var error = envelope.GetProperty("error");
  var message = envelope.GetProperty("message");
  Console.Error.WriteLine($"{(int)response.StatusCode} {error}: {message}");
  Environment.Exit(1);
}
var bytes = await response.Content.ReadAsByteArrayAsync();
await File.WriteAllBytesAsync("run-4821.zip", bytes);
Console.WriteLine($"Saved run-4821.zip ({bytes.Length} bytes)");

Example response

Returns: The ZIP file itself (application/zip).

Status: 200 OK

Headers: Content-Type: application/zip Content-Disposition: attachment; filename="checkout-page-run-4821.zip" Cache-Control: no-store

The body is the ZIP file itself, not JSON; write it to a file. Errors still answer with the JSON error object.

Errors you can get

  • not_found 404 The resource does not exist or is outside the key’s scope.
  • plan_limit_reached 422 The organisation’s plan does not allow it: the test limit is reached, the kind is not included, or (on artifact downloads) run evidence is not included in the plan.
  • unauthorized 401 The key is missing, malformed, unknown, revoked or expired, or its creator is no longer a member.
  • rate_limited 429 The key sent too many requests; wait the seconds in Retry-After.
  • unavailable 503 A temporary problem on our side; try again later.

Download one artifact file GET /runs/{id}/files

Downloads one entry of the run's ZIP without the rest, for example the PDF report. Needs read access; a path that names no possible entry answers 400 invalid_request, an entry this ZIP does not hold 404 not_found, and a run without a ZIP on a plan that does not include run evidence 422 plan_limit_reached. The example saves report.pdf of run 4821.

Needs a key with access: Read

Parameters

Parameters: GET /runs/{id}/files
NameInTypeRequiredDescriptionExample
idPathstring (numeric run id)YesThe numeric id of the run, as returned in Run.id and in the Location header of a started run.4821
pathQuery stringstring (entry inside the ZIP, e.g. report.pdf)YesThe entry inside the run's ZIP: report.pdf, video.webm, manifest.json, screenshots/<name>.jpg, screenshots_proof/<name>.jpg or visual/<width>x<height>-(baseline|current|diff).png.report.pdf

Example request

curl --fail-with-body -sS -o report.pdf \
  "https://optisway.com/api/v1/runs/4821/files?path=report.pdf" \
  -H "Authorization: Bearer $OPTISWAY_API_KEY" \
  -w "HTTP %{http_code}, wrote %{size_download} bytes\n"
// Node.js 18+: save as optisway.mjs and run `node optisway.mjs`
import { writeFile } from "node:fs/promises";

const url = "https://optisway.com/api/v1/runs/4821/files?path=report.pdf";
const response = await fetch(url, {
  headers: {
    Authorization: `Bearer ${process.env.OPTISWAY_API_KEY}`,
  },
});
if (!response.ok) {
  const { error, message } = await response.json();
  console.error(`${response.status} ${error}: ${message}`);
  process.exit(1);
}
const bytes = Buffer.from(await response.arrayBuffer());
await writeFile("report.pdf", bytes);
console.log(`Saved report.pdf (${bytes.length} bytes)`);
# pip install requests
import os
import sys

import requests

api_key = os.environ["OPTISWAY_API_KEY"]
response = requests.get(
    "https://optisway.com/api/v1/runs/4821/files?path=report.pdf",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
if not response.ok:
    envelope = response.json()
    print(f"{response.status_code} {envelope['error']}: {envelope['message']}", file=sys.stderr)
    sys.exit(1)
with open("report.pdf", "wb") as file:
    file.write(response.content)
print(f"Saved report.pdf ({len(response.content)} bytes)")
require "json"
require "net/http"
require "uri"

uri = URI("https://optisway.com/api/v1/runs/4821/files?path=report.pdf")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("OPTISWAY_API_KEY")}"
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }
unless response.is_a?(Net::HTTPSuccess)
  envelope = JSON.parse(response.body)
  warn "#{response.code} #{envelope["error"]}: #{envelope["message"]}"
  exit 1
end
File.binwrite("report.pdf", response.body)
puts "Saved report.pdf (#{response.body.bytesize} bytes)"
<?php
$curl = curl_init("https://optisway.com/api/v1/runs/4821/files?path=report.pdf");
curl_setopt_array($curl, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("OPTISWAY_API_KEY"),
  ],
]);
$body = curl_exec($curl);
if ($body === false) {
  fwrite(STDERR, curl_error($curl) . "\n");
  exit(1);
}
$status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
if ($status < 200 || $status >= 300) {
  $envelope = json_decode($body, true);
  fwrite(STDERR, "$status {$envelope['error']}: {$envelope['message']}\n");
  exit(1);
}
file_put_contents("report.pdf", $body);
echo "Saved report.pdf (" . strlen($body) . " bytes)\n";
// Java 11+: save as Main.java and run `java Main.java`
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
  public static void main(String[] args) throws Exception {
    String url = "https://optisway.com/api/v1/runs/4821/files?path=report.pdf";
    HttpRequest request = HttpRequest.newBuilder(URI.create(url))
        .header("Authorization", "Bearer " + System.getenv("OPTISWAY_API_KEY"))
        .build();
    HttpResponse<byte[]> response = HttpClient.newHttpClient()
        .send(request, HttpResponse.BodyHandlers.ofByteArray());
    if (response.statusCode() >= 300) {
      String error = new String(response.body(), StandardCharsets.UTF_8);
      System.err.println(response.statusCode() + " " + field(error, "error") + ": "
          + field(error, "message"));
      System.exit(1);
    }
    Files.write(Path.of("report.pdf"), response.body());
    System.out.println("Saved report.pdf (" + response.body().length + " bytes)");
  }

  /** The first string value of a JSON key (dependency-free; Jackson or Gson parse JSON properly). */
  static String field(String json, String key) {
    Matcher match = Pattern.compile("\"" + key + "\"\\s*:\\s*(?:\"((?:[^\"\\\\]|\\\\.)*)\"|null)")
        .matcher(json);
    return match.find() ? match.group(1) : null;
  }
}
package main

import (
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	url := "https://optisway.com/api/v1/runs/4821/files?path=report.pdf"
	req, err := http.NewRequest(http.MethodGet, url, nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("OPTISWAY_API_KEY"))
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	if resp.StatusCode >= 300 {
		var envelope struct {
			Error   string `json:"error"`
			Message string `json:"message"`
		}
		_ = json.NewDecoder(resp.Body).Decode(&envelope)
		fmt.Fprintf(os.Stderr, "%d %s: %s\n", resp.StatusCode, envelope.Error, envelope.Message)
		os.Exit(1)
	}
	file, err := os.Create("report.pdf")
	if err != nil {
		panic(err)
	}
	defer file.Close()
	size, err := io.Copy(file, resp.Body)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Saved report.pdf (%d bytes)\n", size)
}
// .NET 8: `dotnet new console`, replace Program.cs with this file, then `dotnet run`
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json;

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
  new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("OPTISWAY_API_KEY"));
var url = "https://optisway.com/api/v1/runs/4821/files?path=report.pdf";
using var response = await client.GetAsync(url);
if (!response.IsSuccessStatusCode)
{
  var envelope = await response.Content.ReadFromJsonAsync<JsonElement>();
  var error = envelope.GetProperty("error");
  var message = envelope.GetProperty("message");
  Console.Error.WriteLine($"{(int)response.StatusCode} {error}: {message}");
  Environment.Exit(1);
}
var bytes = await response.Content.ReadAsByteArrayAsync();
await File.WriteAllBytesAsync("report.pdf", bytes);
Console.WriteLine($"Saved report.pdf ({bytes.Length} bytes)");

Example response

Returns: The file itself, with its own content type (application/pdf for the report).

Status: 200 OK

Headers: Content-Type: application/pdf Cache-Control: no-store X-Content-Type-Options: nosniff

The body is the requested file itself, not JSON; write it to a file. Content-Type matches the entry: application/pdf, image/jpeg, image/png, video/webm or application/json.

Errors you can get

  • invalid_request 400 A path, filter or limit is invalid, or a JSON body is unreadable, too large or invalid.
  • not_found 404 The resource does not exist or is outside the key’s scope.
  • plan_limit_reached 422 The organisation’s plan does not allow it: the test limit is reached, the kind is not included, or (on artifact downloads) run evidence is not included in the plan.
  • unauthorized 401 The key is missing, malformed, unknown, revoked or expired, or its creator is no longer a member.
  • rate_limited 429 The key sent too many requests; wait the seconds in Retry-After.
  • unavailable 503 A temporary problem on our side; try again later.

List notification channels GET /notification-channels

Lists the notification channels of the key's organisation, the Slack, Microsoft Teams, Pumble and PagerDuty destinations that owners and admins add in Settings → Integrations → Notification channels, whose ids go in notificationRouting.channelIds; the webhook URL or integration key is never returned, only the masked targetHint. Needs read access and is not paged; channels belong to the organisation, so a key limited to one project sees all of them too. The example lists the checkout team's Slack channel 12 and the paused PagerDuty service 15.

Needs a key with access: Read

Parameters

This endpoint takes no parameters.

Example request

curl --fail-with-body -sS "https://optisway.com/api/v1/notification-channels" \
  -H "Authorization: Bearer $OPTISWAY_API_KEY"
// Node.js 18+: save as optisway.mjs and run `node optisway.mjs`
const url = "https://optisway.com/api/v1/notification-channels";
const response = await fetch(url, {
  headers: {
    Authorization: `Bearer ${process.env.OPTISWAY_API_KEY}`,
  },
});
if (!response.ok) {
  const { error, message } = await response.json();
  console.error(`${response.status} ${error}: ${message}`);
  process.exit(1);
}
const { items } = await response.json();
for (const item of items) console.log(item.id, item.provider, item.name);
# pip install requests
import os
import sys

import requests

api_key = os.environ["OPTISWAY_API_KEY"]
response = requests.get(
    "https://optisway.com/api/v1/notification-channels",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
if not response.ok:
    envelope = response.json()
    print(f"{response.status_code} {envelope['error']}: {envelope['message']}", file=sys.stderr)
    sys.exit(1)
for item in response.json()["items"]:
    print(item["id"], item["provider"], item["name"])
require "json"
require "net/http"
require "uri"

uri = URI("https://optisway.com/api/v1/notification-channels")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("OPTISWAY_API_KEY")}"
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(request) }
unless response.is_a?(Net::HTTPSuccess)
  envelope = JSON.parse(response.body)
  warn "#{response.code} #{envelope["error"]}: #{envelope["message"]}"
  exit 1
end
JSON.parse(response.body)["items"].each do |item|
  puts [item["id"], item["provider"], item["name"]].join("  ")
end
<?php
$curl = curl_init("https://optisway.com/api/v1/notification-channels");
curl_setopt_array($curl, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("OPTISWAY_API_KEY"),
  ],
]);
$body = curl_exec($curl);
if ($body === false) {
  fwrite(STDERR, curl_error($curl) . "\n");
  exit(1);
}
$status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
if ($status < 200 || $status >= 300) {
  $envelope = json_decode($body, true);
  fwrite(STDERR, "$status {$envelope['error']}: {$envelope['message']}\n");
  exit(1);
}
foreach (json_decode($body, true)["items"] as $item) {
  echo $item["id"], "  ", $item["provider"], "  ", $item["name"], "\n";
}
// Java 11+: save as Main.java and run `java Main.java`
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
  public static void main(String[] args) throws Exception {
    String url = "https://optisway.com/api/v1/notification-channels";
    HttpRequest request = HttpRequest.newBuilder(URI.create(url))
        .header("Authorization", "Bearer " + System.getenv("OPTISWAY_API_KEY"))
        .build();
    HttpResponse<String> response = HttpClient.newHttpClient()
        .send(request, HttpResponse.BodyHandlers.ofString());
    if (response.statusCode() >= 300) {
      String error = response.body();
      System.err.println(response.statusCode() + " " + field(error, "error") + ": "
          + field(error, "message"));
      System.exit(1);
    }
    // { "items": [...], "next": ... } -- any JSON library (Jackson, Gson, org.json) parses it;
    // this example stays dependency-free and prints the raw JSON.
    System.out.println(response.body());
  }

  /** The first string value of a JSON key (dependency-free; Jackson or Gson parse JSON properly). */
  static String field(String json, String key) {
    Matcher match = Pattern.compile("\"" + key + "\"\\s*:\\s*(?:\"((?:[^\"\\\\]|\\\\.)*)\"|null)")
        .matcher(json);
    return match.find() ? match.group(1) : null;
  }
}
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
	"os"
)

func main() {
	url := "https://optisway.com/api/v1/notification-channels"
	req, err := http.NewRequest(http.MethodGet, url, nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("OPTISWAY_API_KEY"))
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	if resp.StatusCode >= 300 {
		var envelope struct {
			Error   string `json:"error"`
			Message string `json:"message"`
		}
		_ = json.NewDecoder(resp.Body).Decode(&envelope)
		fmt.Fprintf(os.Stderr, "%d %s: %s\n", resp.StatusCode, envelope.Error, envelope.Message)
		os.Exit(1)
	}
	var body map[string]any
	if err := json.NewDecoder(resp.Body).Decode(&body); err != nil {
		panic(err)
	}
	for _, raw := range body["items"].([]any) {
		item := raw.(map[string]any)
		fmt.Println(item["id"], item["provider"], item["name"])
	}
}
// .NET 8: `dotnet new console`, replace Program.cs with this file, then `dotnet run`
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json;

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
  new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("OPTISWAY_API_KEY"));
var url = "https://optisway.com/api/v1/notification-channels";
using var response = await client.GetAsync(url);
if (!response.IsSuccessStatusCode)
{
  var envelope = await response.Content.ReadFromJsonAsync<JsonElement>();
  var error = envelope.GetProperty("error");
  var message = envelope.GetProperty("message");
  Console.Error.WriteLine($"{(int)response.StatusCode} {error}: {message}");
  Environment.Exit(1);
}
var body = await response.Content.ReadFromJsonAsync<JsonElement>();
foreach (var item in body.GetProperty("items").EnumerateArray())
{
  Console.WriteLine(string.Join("  ",
    item.GetProperty("id"), item.GetProperty("provider"), item.GetProperty("name")));
}

Example response

Returns: An object whose items array holds NotificationChannel objects.

Status: 200 OK

Headers: Content-Type: application/json; charset=utf-8 Cache-Control: no-store

Response body: List notification channelsJSON
{
  "items": [
    {
      "id": "12",
      "provider": "slack",
      "name": "Checkout team",
      "targetHint": "hooks.slack.com…Xk2f",
      "onlyFailures": true,
      "active": true,
      "locale": "en",
      "createdAt": "2026-10-05T09:00:00.000Z"
    },
    {
      "id": "15",
      "provider": "pagerduty",
      "name": "Shop on-call",
      "targetHint": "…9c41",
      "onlyFailures": true,
      "active": false,
      "locale": "de",
      "createdAt": "2026-10-06T11:30:00.000Z"
    }
  ]
}

Errors you can get

  • unauthorized 401 The key is missing, malformed, unknown, revoked or expired, or its creator is no longer a member.
  • rate_limited 429 The key sent too many requests; wait the seconds in Retry-After.
  • unavailable 503 A temporary problem on our side; try again later.