Export Interactions
curl --request GET \
--url https://api.promptguard.co/api/v1/interactions \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.promptguard.co/api/v1/interactions"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.promptguard.co/api/v1/interactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.promptguard.co/api/v1/interactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.promptguard.co/api/v1/interactions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.promptguard.co/api/v1/interactions")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptguard.co/api/v1/interactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"organization_id": "<string>",
"organization_name": "<string>",
"events": [
{
"schema_version": "<string>",
"event": "<string>",
"event_id": "<string>",
"timestamp": "<string>",
"organization_id": "<string>",
"organization_name": "<string>",
"project_id": "<string>",
"project": "<string>",
"device_id": "<string>",
"device_hostname": "<string>",
"attribution_label_unverified": "<string>",
"identity_verified": true,
"threat_type": "<string>",
"decision": "<string>",
"confidence": 123,
"reason": "<string>",
"direction": "<string>",
"surface": "<string>",
"dashboard_url": "<string>",
"text": "<string>",
"segment": "<string>",
"threshold": {}
}
],
"next_cursor": "<string>",
"has_more": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Export Interactions
Every security event in the Organization, oldest first, threat or not.
GET
/
api
/
v1
/
interactions
Export Interactions
curl --request GET \
--url https://api.promptguard.co/api/v1/interactions \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.promptguard.co/api/v1/interactions"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.promptguard.co/api/v1/interactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.promptguard.co/api/v1/interactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.promptguard.co/api/v1/interactions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.promptguard.co/api/v1/interactions")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptguard.co/api/v1/interactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"organization_id": "<string>",
"organization_name": "<string>",
"events": [
{
"schema_version": "<string>",
"event": "<string>",
"event_id": "<string>",
"timestamp": "<string>",
"organization_id": "<string>",
"organization_name": "<string>",
"project_id": "<string>",
"project": "<string>",
"device_id": "<string>",
"device_hostname": "<string>",
"attribution_label_unverified": "<string>",
"identity_verified": true,
"threat_type": "<string>",
"decision": "<string>",
"confidence": 123,
"reason": "<string>",
"direction": "<string>",
"surface": "<string>",
"dashboard_url": "<string>",
"text": "<string>",
"segment": "<string>",
"threshold": {}
}
],
"next_cursor": "<string>",
"has_more": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
PromptGuard API key for developer endpoints. Keys start with pg_live_ and are created in the dashboard.
Headers
Query Parameters
Read events from this time (ISO 8601). Default: 24 hours ago.
Read events before this time.
next_cursor from the previous page; replaces since.
Events per page.
Required range:
1 <= x <= 1000Response
Successful Response
One page of an Organization's events, oldest first.
Show child attributes
Show child attributes
Where this page ended. Pass it back as cursor to read on; it is returned even when the page is short, so a poller always has its place. Null only when there was no position to report.
Whether another page is ready now.