Swagger examples
This page is the common request catalog for game profiles, project networks, protected servers, attack incidents, raw events, and traffic. The examples are static and never send or store credentials.
Limits and behavior are described in the matching API section. The planned server update operation is not listed here until it is approved for production integrations.
Complete API examples
Castles API request catalog
Static Swagger-style requests and shortened responses for every currently implemented public operation.
These examples do not send requests or store credentials. Replace placeholders locally and keep secrets out of URLs and logs.
Game profiles and protected servers
Project-scoped operations for profiles, networks, and server lifecycle.
Authorization: Bearer <token>GET/{project}/v2/games
List game profiles available to the project.
Example parameters
projectexample-projectRequest
curl \
-H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
'https://api.castles.pro/example-project/v2/games'Response
200 Successful response[
{
"id": "ark",
"name": "ARK: Survival Evolved",
"main_port_id": "game"
}
]Response schema
[]GameProfile[][].idstring[].namestring[].main_port_idstringGET/{project}/v2/network
List networks assigned to the project.
Example parameters
projectexample-projectRequest
curl \
-H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
'https://api.castles.pro/example-project/v2/network'Response
200 Successful response[
"192.0.2.0/24",
"198.51.100.0/24"
]Response schema
[]string[][] valueCIDR stringGET/{project}/v2
List protected servers with pagination and an optional end-user filter.
Example parameters
projectexample-projectstart0length50endUsercustomer-exampleRequest
curl \
-H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
'https://api.castles.pro/example-project/v2?start=0&length=50&endUser=customer-example'Response
200 Successful response{
"rows": [
{
"game": "ark",
"ipAddress": "192.0.2.10",
"enduser": "customer-example",
"ports": {
"game": 29016,
"query": 29015,
"rcon": 29020
},
"protection": {
"status": "online",
"address": "192.0.2.10/29016",
"additional": "query:29015, rcon:29020",
"comment": "Protected game server"
}
}
],
"total_count": 1
}Response schema
rows[]GameServer[]total_countintegerGET/{project}/v2/{ip_address}
List protected servers registered on one public address.
Example parameters
projectexample-projectip_address192.0.2.10Request
curl \
-H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
'https://api.castles.pro/example-project/v2/192.0.2.10'Response
200 Successful response[
{
"game": "ark",
"ipAddress": "192.0.2.10",
"enduser": "customer-example",
"ports": {
"game": 29016,
"query": 29015,
"rcon": 29020
},
"protection": {
"status": "online",
"address": "192.0.2.10/29016",
"additional": "query:29015, rcon:29020",
"comment": "Protected game server"
}
}
]Response schema
[]GameServer[][].ipAddressIPv4 string[].portsPortsGET/{project}/v2/{ip_address}/{main_port}
Load one protected server by address and primary port.
Example parameters
projectexample-projectip_address192.0.2.10main_port29016Request
curl \
-H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
'https://api.castles.pro/example-project/v2/192.0.2.10/29016'Response
200 Successful response{
"game": "ark",
"ipAddress": "192.0.2.10",
"enduser": "customer-example",
"ports": {
"game": 29016,
"query": 29015,
"rcon": 29020
},
"protection": {
"status": "online",
"address": "192.0.2.10/29016",
"additional": "query:29015, rcon:29020",
"comment": "Protected game server"
}
}Response schema
gamestringipAddressIPv4 stringenduserstringportsPortsprotectionProtectionPOST/{project}/v2/{ip_address}
Add a game server to protection.
Example parameters
projectexample-projectip_address192.0.2.10Request
curl \
-X POST \
-H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"game":"ark","ports":{"game":29016,"query":29015,"rcon":29020},"enduser":"customer-example"}' \
'https://api.castles.pro/example-project/v2/192.0.2.10'Response
200 Successful response{
"game": "ark",
"ipAddress": "192.0.2.10",
"enduser": "customer-example",
"ports": {
"game": 29016,
"query": 29015,
"rcon": 29020
},
"protection": {
"status": "online",
"address": "192.0.2.10/29016",
"additional": "query:29015, rcon:29020",
"comment": "Protected game server"
}
}Response schema
gamestringipAddressIPv4 stringportsPortsprotection.statusprotected | online | updating | deletedDELETE/{project}/v2/{ip_address}/{main_port}
Remove one protected server after confirming its address and primary port.
Example parameters
projectexample-projectip_address192.0.2.10main_port29016Request
curl \
-X DELETE \
-H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
'https://api.castles.pro/example-project/v2/192.0.2.10/29016'Response
200 Successful response{
"status": true
}Response schema
statusbooleanAttack events and traffic
CIDR-scoped attack incidents, raw events, charts, and aggregate traffic.
X-API-Key: <api_key>GET/alerts/incidents
List logical incidents after tenant filtering and detector-event grouping.
Example parameters
days7limit20severityhigh,middleRequest
curl \
-H 'X-API-Key: <api_key>' \
-H 'Accept: application/json' \
'https://api.castles.pro/alerts/incidents?days=7&limit=20&severity=high,middle'Response
200 Successful response{
"status": "success",
"payload": {
"total": 1,
"limit": 20,
"offset": 0,
"results": [
{
"incidentId": "inc_example_001",
"target": "192.0.2.44",
"layer": "L3",
"active": false,
"severity": "high",
"startTime": "2026-08-22T15:23:55Z",
"stopTime": "2026-08-22T15:45:31Z",
"peakBps": 209280000000,
"peakPps": 18100000,
"sourceEventCount": 2,
"availableMetrics": [
"bps",
"pps"
],
"breakdownAvailable": true
}
]
}
}Response schema
payload.totalintegerpayload.limitintegerpayload.offsetintegerpayload.results[]IncidentSummary[]GET/alerts/incidents/{incidentId}
Load metadata, source events, chart series, and traffic breakdowns for one incident.
Example parameters
incidentIdinc_example_001Request
curl \
-H 'X-API-Key: <api_key>' \
-H 'Accept: application/json' \
'https://api.castles.pro/alerts/incidents/inc_example_001'Response
200 Successful response{
"status": "success",
"payload": {
"incident": {
"incidentId": "inc_example_001",
"target": "192.0.2.44",
"layer": "L3",
"active": false,
"severity": "high",
"availableMetrics": [
"bps",
"pps"
]
},
"sourceEvents": [
{
"eventId": "evt_example_001",
"detector": "BPS",
"active": false
}
],
"traffic": {
"continuous": true,
"bps": {
"unit": "bps",
"peakValue": 209280000000,
"points": []
},
"pps": {
"unit": "pps",
"peakValue": 18100000,
"points": []
},
"rps": null
},
"breakdown": {
"topAs": [],
"topIp": [],
"topProtocols": []
}
}
}Response schema
payload.incidentIncidentSummarypayload.sourceEvents[]RawEvent[]payload.trafficTrafficExportpayload.breakdownTrafficBreakdownGET/alerts/aggregate-traffic
Build one deduplicated traffic series across visible attack targets.
Example parameters
days7metricbpslayerl3severityhigh,middleRequest
curl \
-H 'X-API-Key: <api_key>' \
-H 'Accept: application/json' \
'https://api.castles.pro/alerts/aggregate-traffic?days=7&metric=bps&layer=l3&severity=high,middle'Response
200 Successful response{
"status": "success",
"payload": {
"metric": "bps",
"fromTime": "2026-08-15T15:45:31Z",
"toTime": "2026-08-22T15:45:31Z",
"bucketSeconds": 300,
"peakValue": 209280000000,
"lastValue": 0,
"trafficTargets": 1,
"trafficEventGroups": 1,
"collapsedDetectorEvents": 1,
"maxSimultaneousTargets": 1,
"points": [
{
"timestamp": "2026-08-22T15:25:00Z",
"value": 209280000000,
"attackCount": 1,
"contributors": [
{
"eventId": "evt_example_001",
"layer": "l3",
"target": "192.0.2.44",
"value": 209280000000
}
]
}
]
}
}Response schema
payload.metricbps | pps | rpspayload.bucketSecondsintegerpayload.points[]AggregatePoint[]payload.points[].contributors[]TrafficContributor[]GET/alerts
List individual detector events for audit and low-level diagnostics.
Example parameters
days7limit10severityhigh,middleRequest
curl \
-H 'X-API-Key: <api_key>' \
-H 'Accept: application/json' \
'https://api.castles.pro/alerts?days=7&limit=10&severity=high,middle'Response
200 Successful response{
"status": "success",
"payload": {
"total": 1,
"limit": 10,
"offset": 0,
"results": [
{
"uid": "evt_example_001",
"layer": "L3",
"target": "192.0.2.44",
"active": false,
"detector": "BPS",
"severity": "high",
"startTime": "2026-08-22T15:23:55Z",
"stopTime": "2026-08-22T15:45:31Z",
"peakBps": 209280000000,
"peakPps": 18100000,
"peakRps": null
}
]
}
}Response schema
payload.totalintegerpayload.results[]RawEvent[]payload.results[].uidstringpayload.results[].peakBpsnumber | nullGET/alerts/{layer}/{uid}
Load one individual detector event by layer and event identifier.
Example parameters
layerl3uidevt_example_001Request
curl \
-H 'X-API-Key: <api_key>' \
-H 'Accept: application/json' \
'https://api.castles.pro/alerts/l3/evt_example_001'Response
200 Successful response{
"status": "success",
"payload": {
"uid": "evt_example_001",
"layer": "L3",
"target": "192.0.2.44",
"active": false,
"detector": "BPS",
"severity": "high",
"startTime": "2026-08-22T15:23:55Z",
"stopTime": "2026-08-22T15:45:31Z",
"peakBps": 209280000000,
"peakPps": 18100000
}
}Response schema
payload.uidstringpayload.layerL3 | L7payload.targetstringpayload.activebooleanGET/alerts/{layer}/{uid}/traffic
Load the original chart series and available Top traffic breakdowns for one event.
Example parameters
layerl3uidevt_example_001typeasRequest
curl \
-H 'X-API-Key: <api_key>' \
-H 'Accept: application/json' \
'https://api.castles.pro/alerts/l3/evt_example_001/traffic?type=as'Response
200 Successful response{
"status": "success",
"source": "provider",
"continuous": true,
"payload": {
"items": [
{
"name": "total",
"data": [
{
"timestamp": "2026-08-22T15:24:00Z",
"bits": 209280000000
}
]
},
{
"name": "AS64500",
"data": [
{
"timestamp": "2026-08-22T15:24:00Z",
"bits": 72000000000
}
]
}
],
"tops": {
"sourceAs": [
{
"asn": 64500,
"companyName": "Example Network",
"countryCode": "ZZ",
"bps": 72000000000
}
],
"ip": [
{
"address": "198.51.100.24",
"countryCode": "ZZ",
"bps": 31000000000
}
],
"protocol": [
{
"number": 17,
"name": "UDP",
"bps": 190000000000
}
],
"tcpPorts": [],
"udpPorts": []
}
}
}Response schema
sourceprovider | webhook_observationscontinuousbooleanpayload.items[]TrafficSeries[]payload.topsRawTrafficBreakdowns