Semantic Doc Compare data API
Comparisons are computed in your browser by an on-device embedding model, so there is no job to submit and nothing to bill. What the API exposes is the one thing the app stores: the comparison reports a person chooses to save.
No run API, by design
Semantic Doc Compare has no server-side model. Reading files, splitting, embedding (all-MiniLM-L6-v2 with ONNX Runtime Web), alignment and the meaning-change checks all happen in the page, and your documents never leave the device. To reproduce the method in a script, embed paragraphs with the same open model and follow the steps in llms.txt; to sync saved comparisons, use the endpoints below. They cost nothing to call.
Base URL and envelope
https://api.skillsafe.ai/v1/app-api
Every response is a JSON envelope. Success carries data; failure carries error with a stable code.
{"ok":true,"data":{ ... }}
{"ok":false,"error":{"code":"NOT_FOUND","message":"no such record"}}
| Code | HTTP | What it means here |
|---|---|---|
UNAUTHORIZED | 401 | Missing, malformed or expired bearer token. |
FORBIDDEN | 403 | A valid token for a different app. |
NOT_FOUND | 404 | No such record visible to you. Rows belong to their owner, so someone else's record is a 404. |
VALIDATION_ERROR | 400 | A declared field has the wrong type, usually a saved_at that is not ISO-8601 with a Z. |
RATE_LIMITED | 429 | Too many requests; back off and retry. |
QUOTA_EXCEEDED | 409 | Too many records for one owner, or a document over 64 KB. |
The comparisons collection
One record per saved comparison. Owner-read, user-write. The full documents are never stored; the report quotes only the passages that differ or were reworded.
| Field | Type | Meaning |
|---|---|---|
label | string | A name, e.g. "Remote work policy 2025 vs 2026". |
name_a | string | Name of document A. |
name_b | string | Name of document B. |
unit | string | paragraph or sentence. |
overlap | number | Meaning overlap, 0 to 1: similarity of matched pairs weighted by their length, over all words in both documents. |
same | number | Pairs with identical wording. |
reworded | number | Pairs with the same meaning in other words. |
changed | number | Matched pairs whose meaning changed. |
removed | number | Units only in A. |
added | number | Units only in B. |
moved | number | Matched pairs that changed position. |
report_md | string | The Markdown report, clipped on whole lines. |
saved_at | timestamp | ISO-8601 with a Z. |
Steps
1 Get a token
A guest token needs no credentials (the body names the app) and owns its own saved comparisons. To use the identity your browser already has, copy the token from the session page instead; every later step is the same.
POST https://api.skillsafe.ai/v1/app-api/guest
curl -s -X POST https://api.skillsafe.ai/v1/app-api/guest \
-H "Content-Type: application/json" \
-d '{"slug": "semantic-doc-compare"}'
import json, urllib.request
TOKEN = "YOUR_TOKEN" # from /tokens.html, or step 1
body = json.dumps({"slug": "semantic-doc-compare"}).encode()
req = urllib.request.Request(
"https://api.skillsafe.ai/v1/app-api/guest",
method="POST",
data=body,
headers={"Content-Type": "application/json"},
)
with urllib.request.urlopen(req) as r:
print(json.load(r)["data"])
const TOKEN = "YOUR_TOKEN"; // from /tokens.html, or step 1
const res = await fetch("https://api.skillsafe.ai/v1/app-api/guest", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({"slug": "semantic-doc-compare"}),
});
const { data, error } = await res.json();
if (error) throw new Error(error.code);
console.log(data);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
token := "YOUR_TOKEN" // from /tokens.html, or step 1
body := strings.NewReader(`{"slug": "semantic-doc-compare"}`)
req, _ := http.NewRequest("POST", "https://api.skillsafe.ai/v1/app-api/guest", body)
_ = token
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}
import java.net.URI;
import java.net.http.*;
HttpClient client = HttpClient.newHttpClient();
String token = "YOUR_TOKEN"; // from /tokens.html, or step 1
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.skillsafe.ai/v1/app-api/guest"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"slug\": \"semantic-doc-compare\"}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require "json"
require "net/http"
token = "YOUR_TOKEN" # from /tokens.html, or step 1
uri = URI("https://api.skillsafe.ai/v1/app-api/guest")
req = Net::HTTP::Post.new(uri)
req["Content-Type"] = "application/json"
req.body = {"slug" => "semantic-doc-compare"}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)["data"]
<?php
$token = "YOUR_TOKEN"; // from /tokens.html, or step 1
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.skillsafe.ai/v1/app-api/guest");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"slug": "semantic-doc-compare"}');
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Accept: application/json", "Content-Type: application/json"]);
$res = curl_exec($ch);
curl_close($ch);
print_r(json_decode($res, true)["data"]);
using System.Net.Http;
using System.Text;
var token = "YOUR_TOKEN"; // from /tokens.html, or step 1
using var client = new HttpClient();
var req = new HttpRequestMessage(new HttpMethod("POST"), "https://api.skillsafe.ai/v1/app-api/guest");
req.Content = new StringContent("{\"slug\": \"semantic-doc-compare\"}", Encoding.UTF8, "application/json");
var res = await client.SendAsync(req);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Returns:
{"data":{"token":"aut_...","guest_id":"gst_...","expires_at":"..."}}
2 See who the token is
Three fields: subject_type, subject_id and credits. The signed-in test is subject_type == "user". Nothing on this app spends credits.
GET https://api.skillsafe.ai/v1/app-api/me
curl -s -X GET https://api.skillsafe.ai/v1/app-api/me \
-H "Authorization: Bearer $DOC_COMPARE_TOKEN"
import json, urllib.request
TOKEN = "YOUR_TOKEN" # from /tokens.html, or step 1
req = urllib.request.Request(
"https://api.skillsafe.ai/v1/app-api/me",
method="GET",
headers={"Authorization": "Bearer " + TOKEN},
)
with urllib.request.urlopen(req) as r:
print(json.load(r)["data"])
const TOKEN = "YOUR_TOKEN"; // from /tokens.html, or step 1
const res = await fetch("https://api.skillsafe.ai/v1/app-api/me", {
method: "GET",
headers: { Authorization: "Bearer " + TOKEN },
});
const { data, error } = await res.json();
if (error) throw new Error(error.code);
console.log(data);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
token := "YOUR_TOKEN" // from /tokens.html, or step 1
body := strings.NewReader("")
req, _ := http.NewRequest("GET", "https://api.skillsafe.ai/v1/app-api/me", body)
req.Header.Set("Authorization", "Bearer "+token)
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}
import java.net.URI;
import java.net.http.*;
HttpClient client = HttpClient.newHttpClient();
String token = "YOUR_TOKEN"; // from /tokens.html, or step 1
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.skillsafe.ai/v1/app-api/me"))
.header("Authorization", "Bearer " + token)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require "json"
require "net/http"
token = "YOUR_TOKEN" # from /tokens.html, or step 1
uri = URI("https://api.skillsafe.ai/v1/app-api/me")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{token}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)["data"]
<?php
$token = "YOUR_TOKEN"; // from /tokens.html, or step 1
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.skillsafe.ai/v1/app-api/me");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Accept: application/json", "Authorization: Bearer $token"]);
$res = curl_exec($ch);
curl_close($ch);
print_r(json_decode($res, true)["data"]);
using System.Net.Http;
using System.Text;
var token = "YOUR_TOKEN"; // from /tokens.html, or step 1
using var client = new HttpClient();
var req = new HttpRequestMessage(new HttpMethod("GET"), "https://api.skillsafe.ai/v1/app-api/me");
req.Headers.Add("Authorization", "Bearer " + token);
var res = await client.SendAsync(req);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Returns:
{"data":{"subject_type":"user","subject_id":"usr_...","credits":12000}}
3 Save a comparison
The same record the app writes when you press Save to my account. saved_at is a declared timestamp and must be ISO-8601 with a Z. report_md is the Markdown report (the app clips it on whole lines to stay well under the 64 KB document cap).
POST https://api.skillsafe.ai/v1/app-api/collections/comparisons/records
curl -s -X POST https://api.skillsafe.ai/v1/app-api/collections/comparisons/records \
-H "Authorization: Bearer $DOC_COMPARE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"doc": {"label": "Remote work policy 2025 vs 2026", "name_a": "remote-work-policy-2025", "name_b": "remote-work-policy-2026", "unit": "paragraph", "overlap": 0.796, "same": 3, "reworded": 2, "changed": 6, "removed": 1, "added": 2, "moved": 1, "report_md": "# Semantic comparison: remote-work-policy-2025 vs remote-work-policy-2026\n...", "saved_at": "2026-10-31T09:00:00Z"}}'
import json, urllib.request
TOKEN = "YOUR_TOKEN" # from /tokens.html, or step 1
body = json.dumps({"doc": {"label": "Remote work policy 2025 vs 2026", "name_a": "remote-work-policy-2025", "name_b": "remote-work-policy-2026", "unit": "paragraph", "overlap": 0.796, "same": 3, "reworded": 2, "changed": 6, "removed": 1, "added": 2, "moved": 1, "report_md": "# Semantic comparison: remote-work-policy-2025 vs remote-work-policy-2026\n...", "saved_at": "2026-10-31T09:00:00Z"}}).encode()
req = urllib.request.Request(
"https://api.skillsafe.ai/v1/app-api/collections/comparisons/records",
method="POST",
data=body,
headers={"Authorization": "Bearer " + TOKEN, "Content-Type": "application/json"},
)
with urllib.request.urlopen(req) as r:
print(json.load(r)["data"])
const TOKEN = "YOUR_TOKEN"; // from /tokens.html, or step 1
const res = await fetch("https://api.skillsafe.ai/v1/app-api/collections/comparisons/records", {
method: "POST",
headers: { Authorization: "Bearer " + TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({"doc": {"label": "Remote work policy 2025 vs 2026", "name_a": "remote-work-policy-2025", "name_b": "remote-work-policy-2026", "unit": "paragraph", "overlap": 0.796, "same": 3, "reworded": 2, "changed": 6, "removed": 1, "added": 2, "moved": 1, "report_md": "# Semantic comparison: remote-work-policy-2025 vs remote-work-policy-2026\n...", "saved_at": "2026-10-31T09:00:00Z"}}),
});
const { data, error } = await res.json();
if (error) throw new Error(error.code);
console.log(data);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
token := "YOUR_TOKEN" // from /tokens.html, or step 1
body := strings.NewReader(`{"doc": {"label": "Remote work policy 2025 vs 2026", "name_a": "remote-work-policy-2025", "name_b": "remote-work-policy-2026", "unit": "paragraph", "overlap": 0.796, "same": 3, "reworded": 2, "changed": 6, "removed": 1, "added": 2, "moved": 1, "report_md": "# Semantic comparison: remote-work-policy-2025 vs remote-work-policy-2026\n...", "saved_at": "2026-10-31T09:00:00Z"}}`)
req, _ := http.NewRequest("POST", "https://api.skillsafe.ai/v1/app-api/collections/comparisons/records", body)
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}
import java.net.URI;
import java.net.http.*;
HttpClient client = HttpClient.newHttpClient();
String token = "YOUR_TOKEN"; // from /tokens.html, or step 1
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.skillsafe.ai/v1/app-api/collections/comparisons/records"))
.header("Authorization", "Bearer " + token)
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"doc\": {\"label\": \"Remote work policy 2025 vs 2026\", \"name_a\": \"remote-work-policy-2025\", \"name_b\": \"remote-work-policy-2026\", \"unit\": \"paragraph\", \"overlap\": 0.796, \"same\": 3, \"reworded\": 2, \"changed\": 6, \"removed\": 1, \"added\": 2, \"moved\": 1, \"report_md\": \"# Semantic comparison: remote-work-policy-2025 vs remote-work-policy-2026\\n...\", \"saved_at\": \"2026-10-31T09:00:00Z\"}}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require "json"
require "net/http"
token = "YOUR_TOKEN" # from /tokens.html, or step 1
uri = URI("https://api.skillsafe.ai/v1/app-api/collections/comparisons/records")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{token}"
req["Content-Type"] = "application/json"
req.body = {"doc" => {"label" => "Remote work policy 2025 vs 2026", "name_a" => "remote-work-policy-2025", "name_b" => "remote-work-policy-2026", "unit" => "paragraph", "overlap" => 0.796, "same" => 3, "reworded" => 2, "changed" => 6, "removed" => 1, "added" => 2, "moved" => 1, "report_md" => "# Semantic comparison: remote-work-policy-2025 vs remote-work-policy-2026\n...", "saved_at" => "2026-10-31T09:00:00Z"}}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)["data"]
<?php
$token = "YOUR_TOKEN"; // from /tokens.html, or step 1
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.skillsafe.ai/v1/app-api/collections/comparisons/records");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"doc": {"label": "Remote work policy 2025 vs 2026", "name_a": "remote-work-policy-2025", "name_b": "remote-work-policy-2026", "unit": "paragraph", "overlap": 0.796, "same": 3, "reworded": 2, "changed": 6, "removed": 1, "added": 2, "moved": 1, "report_md": "# Semantic comparison: remote-work-policy-2025 vs remote-work-policy-2026\n...", "saved_at": "2026-10-31T09:00:00Z"}}');
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Accept: application/json", "Authorization: Bearer $token", "Content-Type: application/json"]);
$res = curl_exec($ch);
curl_close($ch);
print_r(json_decode($res, true)["data"]);
using System.Net.Http;
using System.Text;
var token = "YOUR_TOKEN"; // from /tokens.html, or step 1
using var client = new HttpClient();
var req = new HttpRequestMessage(new HttpMethod("POST"), "https://api.skillsafe.ai/v1/app-api/collections/comparisons/records");
req.Headers.Add("Authorization", "Bearer " + token);
req.Content = new StringContent("{\"doc\": {\"label\": \"Remote work policy 2025 vs 2026\", \"name_a\": \"remote-work-policy-2025\", \"name_b\": \"remote-work-policy-2026\", \"unit\": \"paragraph\", \"overlap\": 0.796, \"same\": 3, \"reworded\": 2, \"changed\": 6, \"removed\": 1, \"added\": 2, \"moved\": 1, \"report_md\": \"# Semantic comparison: remote-work-policy-2025 vs remote-work-policy-2026\\n...\", \"saved_at\": \"2026-10-31T09:00:00Z\"}}", Encoding.UTF8, "application/json");
var res = await client.SendAsync(req);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Returns:
{"data":{"record":{"record_id":"rec_...","doc":{"label":"Remote work policy 2025 vs 2026", ...}}}}
4 List saved comparisons
Every where entry is an operator object (eq ne lt lte gt gte in contains); the bare-value form is rejected. Sorting uses sort. Records come back as {record_id, doc}: read fields from doc.
POST https://api.skillsafe.ai/v1/app-api/collections/comparisons/query
curl -s -X POST https://api.skillsafe.ai/v1/app-api/collections/comparisons/query \
-H "Authorization: Bearer $DOC_COMPARE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"where": {"unit": {"eq": "paragraph"}}, "sort": {"field": "saved_at", "dir": "desc"}, "limit": 20}'
import json, urllib.request
TOKEN = "YOUR_TOKEN" # from /tokens.html, or step 1
body = json.dumps({"where": {"unit": {"eq": "paragraph"}}, "sort": {"field": "saved_at", "dir": "desc"}, "limit": 20}).encode()
req = urllib.request.Request(
"https://api.skillsafe.ai/v1/app-api/collections/comparisons/query",
method="POST",
data=body,
headers={"Authorization": "Bearer " + TOKEN, "Content-Type": "application/json"},
)
with urllib.request.urlopen(req) as r:
print(json.load(r)["data"])
const TOKEN = "YOUR_TOKEN"; // from /tokens.html, or step 1
const res = await fetch("https://api.skillsafe.ai/v1/app-api/collections/comparisons/query", {
method: "POST",
headers: { Authorization: "Bearer " + TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({"where": {"unit": {"eq": "paragraph"}}, "sort": {"field": "saved_at", "dir": "desc"}, "limit": 20}),
});
const { data, error } = await res.json();
if (error) throw new Error(error.code);
console.log(data);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
token := "YOUR_TOKEN" // from /tokens.html, or step 1
body := strings.NewReader(`{"where": {"unit": {"eq": "paragraph"}}, "sort": {"field": "saved_at", "dir": "desc"}, "limit": 20}`)
req, _ := http.NewRequest("POST", "https://api.skillsafe.ai/v1/app-api/collections/comparisons/query", body)
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}
import java.net.URI;
import java.net.http.*;
HttpClient client = HttpClient.newHttpClient();
String token = "YOUR_TOKEN"; // from /tokens.html, or step 1
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.skillsafe.ai/v1/app-api/collections/comparisons/query"))
.header("Authorization", "Bearer " + token)
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"where\": {\"unit\": {\"eq\": \"paragraph\"}}, \"sort\": {\"field\": \"saved_at\", \"dir\": \"desc\"}, \"limit\": 20}"))
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require "json"
require "net/http"
token = "YOUR_TOKEN" # from /tokens.html, or step 1
uri = URI("https://api.skillsafe.ai/v1/app-api/collections/comparisons/query")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{token}"
req["Content-Type"] = "application/json"
req.body = {"where" => {"unit" => {"eq" => "paragraph"}}, "sort" => {"field" => "saved_at", "dir" => "desc"}, "limit" => 20}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)["data"]
<?php
$token = "YOUR_TOKEN"; // from /tokens.html, or step 1
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.skillsafe.ai/v1/app-api/collections/comparisons/query");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"where": {"unit": {"eq": "paragraph"}}, "sort": {"field": "saved_at", "dir": "desc"}, "limit": 20}');
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Accept: application/json", "Authorization: Bearer $token", "Content-Type: application/json"]);
$res = curl_exec($ch);
curl_close($ch);
print_r(json_decode($res, true)["data"]);
using System.Net.Http;
using System.Text;
var token = "YOUR_TOKEN"; // from /tokens.html, or step 1
using var client = new HttpClient();
var req = new HttpRequestMessage(new HttpMethod("POST"), "https://api.skillsafe.ai/v1/app-api/collections/comparisons/query");
req.Headers.Add("Authorization", "Bearer " + token);
req.Content = new StringContent("{\"where\": {\"unit\": {\"eq\": \"paragraph\"}}, \"sort\": {\"field\": \"saved_at\", \"dir\": \"desc\"}, \"limit\": 20}", Encoding.UTF8, "application/json");
var res = await client.SendAsync(req);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Returns:
{"data":{"records":[{"record_id":"rec_...","doc":{"unit":"paragraph","changed":6, ...}}]},"meta":{"pagination":{"has_more":false}}}
5 Delete one
Use the record_id from the create or query step. A record that is not yours returns 404, because rows are visible only to their owner.
DELETE https://api.skillsafe.ai/v1/app-api/collections/comparisons/records/rec_REPLACE_ME
curl -s -X DELETE https://api.skillsafe.ai/v1/app-api/collections/comparisons/records/rec_REPLACE_ME \
-H "Authorization: Bearer $DOC_COMPARE_TOKEN"
import json, urllib.request
TOKEN = "YOUR_TOKEN" # from /tokens.html, or step 1
req = urllib.request.Request(
"https://api.skillsafe.ai/v1/app-api/collections/comparisons/records/rec_REPLACE_ME",
method="DELETE",
headers={"Authorization": "Bearer " + TOKEN},
)
with urllib.request.urlopen(req) as r:
print(json.load(r)["data"])
const TOKEN = "YOUR_TOKEN"; // from /tokens.html, or step 1
const res = await fetch("https://api.skillsafe.ai/v1/app-api/collections/comparisons/records/rec_REPLACE_ME", {
method: "DELETE",
headers: { Authorization: "Bearer " + TOKEN },
});
const { data, error } = await res.json();
if (error) throw new Error(error.code);
console.log(data);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
token := "YOUR_TOKEN" // from /tokens.html, or step 1
body := strings.NewReader("")
req, _ := http.NewRequest("DELETE", "https://api.skillsafe.ai/v1/app-api/collections/comparisons/records/rec_REPLACE_ME", body)
req.Header.Set("Authorization", "Bearer "+token)
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}
import java.net.URI;
import java.net.http.*;
HttpClient client = HttpClient.newHttpClient();
String token = "YOUR_TOKEN"; // from /tokens.html, or step 1
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.skillsafe.ai/v1/app-api/collections/comparisons/records/rec_REPLACE_ME"))
.header("Authorization", "Bearer " + token)
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
require "json"
require "net/http"
token = "YOUR_TOKEN" # from /tokens.html, or step 1
uri = URI("https://api.skillsafe.ai/v1/app-api/collections/comparisons/records/rec_REPLACE_ME")
req = Net::HTTP::Delete.new(uri)
req["Authorization"] = "Bearer #{token}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)["data"]
<?php
$token = "YOUR_TOKEN"; // from /tokens.html, or step 1
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.skillsafe.ai/v1/app-api/collections/comparisons/records/rec_REPLACE_ME");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Accept: application/json", "Authorization: Bearer $token"]);
$res = curl_exec($ch);
curl_close($ch);
print_r(json_decode($res, true)["data"]);
using System.Net.Http;
using System.Text;
var token = "YOUR_TOKEN"; // from /tokens.html, or step 1
using var client = new HttpClient();
var req = new HttpRequestMessage(new HttpMethod("DELETE"), "https://api.skillsafe.ai/v1/app-api/collections/comparisons/records/rec_REPLACE_ME");
req.Headers.Add("Authorization", "Bearer " + token);
var res = await client.SendAsync(req);
Console.WriteLine(await res.Content.ReadAsStringAsync());
Returns:
{"data":{"deleted":true}}