Take action on an email
curl --request POST \
--url https://api.ocean.security/api/v1/decision_center/actions \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"action": "quarantine",
"include_reason_in_correction_email": true,
"internet_message_id": "<CAF=x1@mail.example.com>",
"reason": "<string>",
"send_correction_email": true,
"threat_id": "e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050",
"verdict": "malicious"
}
'import requests
url = "https://api.ocean.security/api/v1/decision_center/actions"
payload = {
"action": "quarantine",
"include_reason_in_correction_email": True,
"internet_message_id": "<CAF=x1@mail.example.com>",
"reason": "<string>",
"send_correction_email": True,
"threat_id": "e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050",
"verdict": "malicious"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
action: 'quarantine',
include_reason_in_correction_email: true,
internet_message_id: '<CAF=x1@mail.example.com>',
reason: '<string>',
send_correction_email: true,
threat_id: 'e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050',
verdict: 'malicious'
})
};
fetch('https://api.ocean.security/api/v1/decision_center/actions', 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.ocean.security/api/v1/decision_center/actions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action' => 'quarantine',
'include_reason_in_correction_email' => true,
'internet_message_id' => '<CAF=x1@mail.example.com>',
'reason' => '<string>',
'send_correction_email' => true,
'threat_id' => 'e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050',
'verdict' => 'malicious'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ocean.security/api/v1/decision_center/actions"
payload := strings.NewReader("{\n \"action\": \"quarantine\",\n \"include_reason_in_correction_email\": true,\n \"internet_message_id\": \"<CAF=x1@mail.example.com>\",\n \"reason\": \"<string>\",\n \"send_correction_email\": true,\n \"threat_id\": \"e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050\",\n \"verdict\": \"malicious\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ocean.security/api/v1/decision_center/actions")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"quarantine\",\n \"include_reason_in_correction_email\": true,\n \"internet_message_id\": \"<CAF=x1@mail.example.com>\",\n \"reason\": \"<string>\",\n \"send_correction_email\": true,\n \"threat_id\": \"e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050\",\n \"verdict\": \"malicious\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ocean.security/api/v1/decision_center/actions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": \"quarantine\",\n \"include_reason_in_correction_email\": true,\n \"internet_message_id\": \"<CAF=x1@mail.example.com>\",\n \"reason\": \"<string>\",\n \"send_correction_email\": true,\n \"threat_id\": \"e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050\",\n \"verdict\": \"malicious\"\n}"
response = http.request(request)
puts response.read_body{
"results": {
"action_taken": "quarantined",
"correction_email_status": "success",
"failure_reason": "message_not_found",
"messages_attempted": 123,
"messages_failed": 123,
"previous_verdict": "<string>",
"status": "succeeded",
"threat_id": "<string>",
"verdict": "<string>"
},
"status": 123
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Decision Center
Take action on an email
Runs an action (quarantine, move or restore) on every mailbox copy of one email, and optionally changes its verdict to one the tenant’s remediation policy allows for that action. Identify the email by threat_id or internet_message_id, not both. Not idempotent: after a timeout, check the email before retrying. Audit-logged.
POST
/
api
/
v1
/
decision_center
/
actions
Take action on an email
curl --request POST \
--url https://api.ocean.security/api/v1/decision_center/actions \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"action": "quarantine",
"include_reason_in_correction_email": true,
"internet_message_id": "<CAF=x1@mail.example.com>",
"reason": "<string>",
"send_correction_email": true,
"threat_id": "e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050",
"verdict": "malicious"
}
'import requests
url = "https://api.ocean.security/api/v1/decision_center/actions"
payload = {
"action": "quarantine",
"include_reason_in_correction_email": True,
"internet_message_id": "<CAF=x1@mail.example.com>",
"reason": "<string>",
"send_correction_email": True,
"threat_id": "e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050",
"verdict": "malicious"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
action: 'quarantine',
include_reason_in_correction_email: true,
internet_message_id: '<CAF=x1@mail.example.com>',
reason: '<string>',
send_correction_email: true,
threat_id: 'e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050',
verdict: 'malicious'
})
};
fetch('https://api.ocean.security/api/v1/decision_center/actions', 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.ocean.security/api/v1/decision_center/actions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action' => 'quarantine',
'include_reason_in_correction_email' => true,
'internet_message_id' => '<CAF=x1@mail.example.com>',
'reason' => '<string>',
'send_correction_email' => true,
'threat_id' => 'e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050',
'verdict' => 'malicious'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ocean.security/api/v1/decision_center/actions"
payload := strings.NewReader("{\n \"action\": \"quarantine\",\n \"include_reason_in_correction_email\": true,\n \"internet_message_id\": \"<CAF=x1@mail.example.com>\",\n \"reason\": \"<string>\",\n \"send_correction_email\": true,\n \"threat_id\": \"e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050\",\n \"verdict\": \"malicious\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ocean.security/api/v1/decision_center/actions")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"quarantine\",\n \"include_reason_in_correction_email\": true,\n \"internet_message_id\": \"<CAF=x1@mail.example.com>\",\n \"reason\": \"<string>\",\n \"send_correction_email\": true,\n \"threat_id\": \"e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050\",\n \"verdict\": \"malicious\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ocean.security/api/v1/decision_center/actions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": \"quarantine\",\n \"include_reason_in_correction_email\": true,\n \"internet_message_id\": \"<CAF=x1@mail.example.com>\",\n \"reason\": \"<string>\",\n \"send_correction_email\": true,\n \"threat_id\": \"e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050\",\n \"verdict\": \"malicious\"\n}"
response = http.request(request)
puts response.read_body{
"results": {
"action_taken": "quarantined",
"correction_email_status": "success",
"failure_reason": "message_not_found",
"messages_attempted": 123,
"messages_failed": 123,
"previous_verdict": "<string>",
"status": "succeeded",
"threat_id": "<string>",
"verdict": "<string>"
},
"status": 123
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Taking a Decision Center action through the API is in beta. The request and response may change.
If the endpoint returns
403 with “This feature is not available for your tenant”, it isn’t enabled
for your tenant yet — contact Ocean support.Body
application/json
The email and the action to take
