Skip to navigation

Retrieve a website's Patch & Protect statistics

View as MarkdownOpen in Claude

Returns the attacks Patch & Protect blocked on one website: how many per day, the addresses that insisted the most with their country, and the rules that fired, each with its total. Use it to show a customer what the protection did over a week. The id in the path is the id of the website’s protection record: read it from the site_preset_patchstack include of “Retrieve a website” or “List websites”.

start_date and end_date are whole days, never in the future, and both optional: the default is the last seven whole days, ending today.

That default is the period kept ready. Modular DS stores one period per website and refreshes it regularly, so a read of the default range comes from what is stored and cached_at says when it was read. Any other period is read from the security provider, stored in place of the previous one and answered, which takes longer.

The figures need the add-on subscribed, the protection on the website and your role must be allowed to read statistics; without them the call answers 404. A website whose protection is not enabled yet has nothing to read and answers empty lists. Unlike most requests, the answer is the statistics on their own, not a JSON:API document.

Authentication

AuthorizationBearer

Personal access token created in the Modular DS dashboard; read-only tokens can only call GET endpoints.

Path parameters

site_preset_patchstackstringRequired

Query parameters

start_datestringOptional

First whole day to count, as YYYY-MM-DD, never in the future and not after end_date. Defaults to six days before end_date, so the default range is seven days counting both ends.

end_datestringOptional

Last whole day to count, as YYYY-MM-DD. Defaults to today and is never in the future.

Response

200 - Seven days of blocked attacks

attackslist of objectsOptional
cached_atstring or nullOptional

When the figures were read from the security provider (ISO 8601); null when nothing has been read.

end_datestring or nullOptional

Last day the figures cover, as YYYY-MM-DD.

ipslist of objectsOptional
ruleslist of objectsOptional
start_datestring or nullOptional

First day the figures cover, as YYYY-MM-DD.