Signed Webhooks
Ocean can send a signed HTTP request to your own server every time a scan finishes, so a bot, a panel or a game server reacts to the verdict without polling the API. Every request follows the Standard Webhooks specification and carries the scan summary the Discord webhook shows, as JSON.
- Events
scan.completed,webhook.test- Signature
- HMAC-SHA256, Standard Webhooks v1
- Retries
- 8 attempts, exponential backoff from 10 seconds
- Managed from
- The dashboard, or the MCP and the REST API with
webhooks:manage
When Ocean sends an event
Ocean sends one scan.completed event when a scan finishes, at the same moment it posts the Discord scan message. Each scan goes to one endpoint at most:
- A scan from a pin generated from an enterprise goes to that enterprise's endpoint.
- Any other scan goes to the personal endpoint of the account that created the pin.
Each enterprise and each account has at most one endpoint. Only the owner of an enterprise manages its endpoint. A personal endpoint needs the same access as API keys: an active personal plan or an enterprise membership.
Nothing is sent while the endpoint is disabled, while the enterprise is inactive or once the owner no longer has that access.
Set it up in the dashboard
- Open Settings › Integrations for a personal endpoint. For an enterprise endpoint, open the enterprise from Enterprise in the sidebar and go to its Settings tab; only the owner sees this section.
- In the Signed webhook section, enter the https URL of your endpoint and select Save endpoint. Ocean asks you to confirm it's you first.
- Copy the secret that starts with
whsec_and store it on your server, for example in an environment variable. Ocean shows it only once. - Select Send test event and check that the delivery shows up in the recent deliveries with a
2xxcode.
The same section rotates the secret, deletes the webhook, shows whether the endpoint is active or disabled and lists the recent deliveries with their status, HTTP code, attempts, time and pin.
Set it up with the MCP
An AI assistant connected to the Ocean MCP server can create and manage the endpoint for you. Grant the webhooks:manage scope on the consent screen when you connect it.
| Tool | Arguments | Description |
|---|---|---|
| get_webhook_endpoint | enterpriseId (optional) | Read the endpoint, its status and the end of its secret |
| set_webhook_endpoint | url, enterpriseId (optional) | Create the endpoint or change its URL. The secret comes back only when the endpoint is created. Saving re-enables a disabled endpoint |
| rotate_webhook_secret | enterpriseId (optional) | Replace the secret right away and return the new one |
| delete_webhook_endpoint | enterpriseId (optional) | Delete the endpoint |
| send_test_webhook | enterpriseId (optional) | Queue a test event, even while the endpoint is disabled |
| list_webhook_deliveries | cursor, enterpriseId (optional) | List the deliveries, newest first, 20 per page |
Without enterpriseId a tool works on your personal endpoint. With it, the tool works on that enterprise's endpoint and you must own the enterprise. The enterprise ID is the last part of its dashboard address, /dashboard/enterprise/<id>.
Example prompts
- Set my Ocean webhook to
https://hooks.example.com/ocean, send a test event and tell me whether it was delivered. - Show the Ocean webhook deliveries that failed today and tell me what went wrong.
- Rotate the signed webhook secret of my Ocean enterprise
ENTERPRISE_IDand give me the new secret.
The secret goes through the conversation
Creating the endpoint and rotating the secret return the full secret to the assistant. Move it to your server's environment and keep it out of shared chats.
Set it up with the REST API
The same six operations are REST routes under https://api.anticheat.ac/v1/webhook. Send an API key that has the webhooks:manage permission in the x-api-key header; you create keys in Settings › API Keys.
| Route | Operation | Arguments |
|---|---|---|
| GET /v1/webhook | get_webhook_endpoint | enterpriseId |
| POST /v1/webhook | set_webhook_endpoint | url, enterpriseId |
| POST /v1/webhook/rotate-secret | rotate_webhook_secret | enterpriseId |
| POST /v1/webhook/delete | delete_webhook_endpoint | enterpriseId |
| POST /v1/webhook/test | send_test_webhook | enterpriseId |
| GET /v1/webhook/deliveries | list_webhook_deliveries | cursor, enterpriseId |
GET routes read the arguments from the query string and POST routes from a JSON body. enterpriseId is optional on every route. The test route answers 202, because the event is only queued; the others answer 200.
curl -X POST https://api.anticheat.ac/v1/webhook \
-H "x-api-key: $OCEAN_API_KEY" \
-H "content-type: application/json" \
-d '{ "url": "https://hooks.example.com/ocean" }'
curl "https://api.anticheat.ac/v1/webhook/deliveries" \
-H "x-api-key: $OCEAN_API_KEY"A key needs no identity confirmation, because the key itself is the authorization, and every change made with it is recorded like a change made in the dashboard.
Responses
The MCP tools and the REST routes return the same JSON.
| Operation | Response |
|---|---|
| get_webhook_endpoint | { "available": boolean, "endpoint": Endpoint | null } |
| set_webhook_endpoint | { "endpoint": Endpoint, "secret": string | null }The secret only when the endpoint was created |
| rotate_webhook_secret | { "endpoint": Endpoint, "secret": string } |
| delete_webhook_endpoint | { "deleted": true } |
| send_test_webhook | { "deliveryId": string } |
| list_webhook_deliveries | { "items": Delivery[], "nextCursor": string | null }20 per page, newest first. Pass nextCursor as cursor to get the next page |
While webhooks are temporarily unavailable, available is false and the other operations fail with Webhooks are not available right now.
Endpoint object
| Field | Type | Description |
|---|---|---|
| url | string | The URL Ocean delivers to |
| status | string | active or disabled |
| disabledReason | string | null | Why the endpoint was disabled, for example consecutive_failures |
| secretPreview | string | whsec_… and the last 4 characters of the secret |
| consecutiveFailures | number | Failed deliveries in a row since the last success |
| createdAt, updatedAt | string | ISO 8601 dates |
Delivery object
| Field | Type | Description |
|---|---|---|
| id | string | Delivery ID |
| eventId | string | The webhook-id of the event |
| eventType | string | scan.completed or webhook.test |
| pin | string | null | The scan pin, null for test events |
| status | string | pending, succeeded or failed |
| attempts | number | Attempts made so far |
| lastStatusCode | number | null | HTTP status code of the last attempt |
| lastError | string | null | Short reason for the last failure, at most 200 characters. It never contains the response body |
| durationMs | number | null | How long the last attempt took, in milliseconds |
| createdAt | string | When the event was queued |
| completedAt | string | null | When the delivery succeeded or failed for good, null while it is pending |
Deliveries are kept for 30 days.
Payload
Every event is a JSON object with type, timestamp and data. A scan.completed event carries the same scan data as the Discord message:
{
"type": "scan.completed",
"timestamp": "2026-11-28T18:04:05.000Z",
"data": {
"pin": "AB12CD34",
"game": "FiveM",
"verdict": "CHEATING",
"resultUrl": "https://anticheat.ac/results/pin/AB12CD34",
"scanTime": "string as stored",
"country": "AR",
"vpn": false,
"windowsInstall": "string as stored",
"lastLogon": "string as stored",
"javaw": "string as stored",
"recycleBin": "string as stored",
"detections": ["names as listed in the Discord embed"],
"warnings": ["names as listed in the Discord embed"],
"detectionCount": 1,
"warningCount": 0,
"discordAccounts": [{ "id": "123456789012345678", "username": "player" }],
"alts": ["string"],
"windowTexts": [{ "text": "string", "process": "string or null" }],
"recordings": ["string"],
"author": { "id": "user id", "username": "string", "role": "Owner | Admin | Member | null" },
"enterprise": { "id": "string", "name": "string" }
}
}| Field | Type | Description |
|---|---|---|
| type | string | The event type |
| timestamp | string | When the event happened, ISO 8601 in UTC |
| data.pin | string | The scan pin |
| data.game | string | The game that was scanned |
| data.verdict | string | LEGIT, SUSPICIOUS or CHEATING, the same verdict as the Discord message |
| data.resultUrl | string | Link to the scan result on Ocean |
| data.scanTime | string | null | The scan time line of the Discord message |
| data.country | string | null | The country of the Discord message |
| data.vpn | boolean | Whether a VPN was detected |
| data.windowsInstall | string | null | The System line of the Discord message |
| data.lastLogon | string | null | The Boot Time line of the Discord message |
| data.javaw | string | null | The game process line of the Discord message, labelled with the game name there |
| data.recycleBin | string | null | The Recycle Bin line of the Discord message |
| data.detections | string[] | Detection names, as the Discord message lists them |
| data.warnings | string[] | Warning names, as the Discord message lists them |
| data.detectionCount | number | Number of detections |
| data.warningCount | number | Number of warnings |
| data.discordAccounts | { id, username }[] | The Discord accounts of the Discord message |
| data.alts | string[] | The accounts list of the Discord message |
| data.windowTexts | { text, process }[] | Window texts found, each with its process or null |
| data.recordings | string[] | Recording software found |
| data.author | { id, username, role } | The account that created the pin. role is Owner, Admin or Member of the enterprise, and null for a personal endpoint |
| data.enterprise | { id, name } | null | The enterprise the pin was generated from, null for a personal endpoint |
A missing text value is null and a missing list is empty, never a placeholder such as Unknown. The payload never includes HWIDs, IP addresses, screenshots, file lists or anything else the Discord message does not show.
Headers and signature
| Header | Value |
|---|---|
| content-type | application/json |
| user-agent | Ocean-Webhooks/1.0 |
| webhook-id | msg_ and a random ID, the same on every retry of one event |
| webhook-timestamp | Unix time in seconds when this attempt was sent |
| webhook-signature | v1, and the signature in base64 |
The secret looks like whsec_<base64>. Decode the part after whsec_ from base64 to get 32 bytes and use them as the HMAC-SHA256 key over this text:
<webhook-id>.<webhook-timestamp>.<raw body>
Encode the result in base64 and compare it with the value after v1, in constant time. Sign the raw body exactly as it arrived: parsing the JSON and serializing it again changes the bytes, and the signature no longer matches.
Reject the request when webhook-timestamp is more than 5 minutes away from your clock, so a captured request cannot be replayed later. The standardwebhooks libraries check the signature and the time for you.
Verify the signature
Every sample reads the secret from OCEAN_WEBHOOK_SECRET, answers 204 to a valid event and 400 to anything else.
Node.js with standardwebhooks
npm install standardwebhooks express
express.raw keeps the body as the bytes Ocean sent, which is what the signature covers:
import express from "express";
import { Webhook } from "standardwebhooks";
const webhook = new Webhook(process.env.OCEAN_WEBHOOK_SECRET);
const app = express();
app.post("/ocean", express.raw({ type: "application/json" }), (req, res) => {
let event;
try {
event = webhook.verify(req.body, req.headers);
} catch {
return res.sendStatus(400);
}
if (event.type === "scan.completed") {
console.log(event.data.pin, event.data.verdict);
}
res.sendStatus(204);
});
app.listen(3000);Python with standardwebhooks
pip install standardwebhooks flask
request.get_data() returns the raw body as bytes:
import os
from flask import Flask, request
from standardwebhooks import Webhook, WebhookVerificationError
app = Flask(__name__)
webhook = Webhook(os.environ["OCEAN_WEBHOOK_SECRET"])
@app.post("/ocean")
def ocean_webhook():
try:
event = webhook.verify(request.get_data(), dict(request.headers))
except WebhookVerificationError:
return "", 400
if event["type"] == "scan.completed":
print(event["data"]["pin"], event["data"]["verdict"])
return "", 204Node.js without a library
Only the built-in crypto module. Pass the raw body as a Buffer; the function throws when the request is not valid:
import { createHmac, timingSafeEqual } from "node:crypto";
const TOLERANCE_SECONDS = 5 * 60;
export function verifyOceanWebhook(rawBody, headers, secret) {
const id = headers["webhook-id"];
const timestamp = headers["webhook-timestamp"];
const signatures = headers["webhook-signature"];
if (!id || !timestamp || !signatures) throw new Error("Missing webhook headers");
const sentAt = Number(timestamp);
if (!Number.isInteger(sentAt) || Math.abs(Date.now() / 1000 - sentAt) > TOLERANCE_SECONDS) {
throw new Error("Webhook timestamp is too old or too new");
}
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
if (key.length === 0) throw new Error("Missing webhook secret");
const expected = createHmac("sha256", key)
.update(id + "." + timestamp + ".")
.update(rawBody)
.digest();
const valid = signatures.split(" ").some((entry) => {
const [version, signature] = entry.split(",");
if (version !== "v1" || !signature) return false;
const received = Buffer.from(signature, "base64");
return received.length === expected.length && timingSafeEqual(received, expected);
});
if (!valid) throw new Error("Invalid webhook signature");
return JSON.parse(rawBody.toString("utf8"));
}FiveM server resource
A FiveM server hands the HTTP requests for a resource to its SetHttpHandler, at addresses like http://127.0.0.1:30120/ocean-webhooks/ocean. Ocean only sends to public https addresses without a port, so put a reverse proxy with your own domain and a TLS certificate in front of the server. The *.users.cfx.re addresses that Cfx.re used to print at startup were retired in 2026.
With Caddy, which gets the certificate for you, this Caddyfile forwards only the resource path to the server:
hooks.example.com {
handle /ocean-webhooks/* {
reverse_proxy 127.0.0.1:30120
}
handle {
respond "Not found" 404
}
}Save https://hooks.example.com/ocean-webhooks/ocean as your endpoint. Then create the resource folder ocean-webhooks with this fxmanifest.lua:
fx_version 'cerulean' game 'gta5' server_script 'server.js'
Add the secret and the resource to server.cfg. A set convar stays on the server; never use setr or sets, which share it with players or the server list:
set ocean_webhook_secret "whsec_..." ensure ocean-webhooks
And add server.js. It reads the body with the 'binary' option of setDataHandler, so the signature is checked against the exact bytes:
const { createHmac, timingSafeEqual } = require("crypto");
const TOLERANCE_SECONDS = 5 * 60;
function isValidOceanWebhook(rawBody, headers, secret) {
const id = headers["webhook-id"];
const timestamp = headers["webhook-timestamp"];
const signatures = headers["webhook-signature"];
if (!id || !timestamp || !signatures) return false;
const sentAt = Number(timestamp);
if (!Number.isInteger(sentAt) || Math.abs(Date.now() / 1000 - sentAt) > TOLERANCE_SECONDS) return false;
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
if (key.length === 0) return false;
const expected = createHmac("sha256", key)
.update(id + "." + timestamp + ".")
.update(rawBody)
.digest();
return signatures.split(" ").some((entry) => {
const [version, signature] = entry.split(",");
if (version !== "v1" || !signature) return false;
const received = Buffer.from(signature, "base64");
return received.length === expected.length && timingSafeEqual(received, expected);
});
}
function reply(response, status) {
response.writeHead(status);
response.send();
}
SetHttpHandler((request, response) => {
if (request.method !== "POST" || request.path !== "/ocean") return reply(response, 404);
request.setDataHandler((data) => {
const headers = {};
for (const [name, value] of Object.entries(request.headers)) headers[name.toLowerCase()] = value;
const rawBody = Buffer.from(data);
if (!isValidOceanWebhook(rawBody, headers, GetConvar("ocean_webhook_secret", ""))) return reply(response, 400);
const event = JSON.parse(rawBody.toString("utf8"));
if (event.type === "scan.completed") {
console.log("Ocean scan " + event.data.pin + ": " + event.data.verdict);
}
reply(response, 204);
}, "binary");
});Retries and idempotency
Answer with any 2xx status within 10 seconds. Any other status, a timeout or a network error is a failed attempt, and Ocean tries again: 8 attempts in total, with an exponential backoff that starts at 10 seconds. Redirects are not followed, so a 3xx answer fails too.
Answer first and do slow work afterwards, so a slow task does not turn into a timeout and a retry.
Handle each event once
A retry can reach you after your server already handled the event, for example when your answer was lost on the way. Every attempt of one event carries the same webhook-id: store the IDs you have processed and skip any you have seen before.
Automatic disable
After 20 failed deliveries in a row, Ocean disables the endpoint and notifies its owner in the dashboard; for an enterprise endpoint that is the enterprise owner. A successful delivery resets the count.
To turn it back on, fix your server, then save the endpoint again in the dashboard or with set_webhook_endpoint. Saving re-enables it and resets the count.
Test event
Send test event in the dashboard, send_test_webhook in the MCP and its REST route queue a webhook.test event:
{
"type": "webhook.test",
"timestamp": "2026-11-28T18:04:05.000Z",
"data": { "message": "Test event from Ocean" }
}It is signed, retried and listed with the deliveries like any other event. It is sent even while the endpoint is disabled, so you can check a fix before saving the endpoint again. Each owner can send 5 test events per minute.
Rotate the secret
Rotate secret in the dashboard or rotate_webhook_secret replaces the secret at once: requests sent from then on are signed with the new secret and the old one no longer verifies. Update your server right after you rotate.
Ocean shows the full secret only when the endpoint is created and when you rotate it. Afterwards you only see whsec_… and its last 4 characters. If you lose the secret, rotate it.
URL rules
https://only, on the default port: no explicit port such as:8443.- A public host name: no IP address, no
localhostor.localname, and no name that resolves to a private network. - No user name or password in the URL, and at most 2048 characters.
- No redirects: Ocean does not follow them, so save the final URL.
Ocean checks the URL when you save it and again before every delivery. A URL that breaks a rule is refused with The webhook URL must be a public https address.
Troubleshooting
| Symptom | Meaning |
|---|---|
| The signature does not match | You verified a parsed or re-encoded body, or used an old secret. Verify the raw body with the current secret |
| The timestamp is too old or too new | Your server clock is more than 5 minutes off. Sync it with NTP |
| Deliveries fail without an HTTP code | Ocean got no answer: the host does not resolve to a public address, the TLS handshake failed or your server took longer than 10 seconds |
Deliveries fail with a 3xx code | Your server answered with a redirect. Save the final https URL |
| The endpoint shows as disabled | 20 deliveries failed in a row. Fix your server, send a test event, then save the endpoint again |
| The same event arrives twice | A retry after a lost or late answer. Skip webhook-id values you already handled |
The webhook URL must be a public https address | The URL breaks one of the URL rules above |
Webhooks are not available right now | Webhooks are temporarily unavailable on Ocean's side. Try again later |
| No event arrives after a scan | The scan went to another endpoint, since scans from enterprise pins go to the enterprise endpoint, or the endpoint is disabled, or its owner no longer has access |
| The FiveM resource never gets the request | Check that the reverse proxy forwards the path to port 30120, that the resource is started and that its folder name matches the first part of the path |