Sucuri API v2 — Response Format
API v2 - Response Format
With the introduction of the second version for the Website Firewall API the structure of the responses was unified and now all of them are JSON-encoded. Every request you send will be responded with the same attributes and the values will only be changed when your request is executed successfully.
json
{
"status": boolean,
"messages": []string,
"action": string,
"request_time": timestamp,
"verbose": boolean,
"output": []object
}
| Attribute | Type | Description |
|---|---|---|
status |
boolean | Either a one or a zero. Indicates success or failure of the operation; an explanation is available via messages. |
messages |
[]string | A list of messages collected through the execution of the action specified in the request. |
action |
string | The official name of the action executed; old action names from the first API version will be normalized to the v2 names. |
request_time |
timestamp | Unix timestamp the request was processed. |
output |
[]object | Result data from the operation. Empty when status = 0. |
property |
string | Not a property of the response but a filter parameter you can send. If present, the response is simplified automatically (no need for verbose). If the string matches an attribute of output, only that attribute is returned; otherwise null. |
Rate Limiting
All API requests are subject to rate limiting. By default, requests are limited to 12 requests per minute and 60 requests per hour per API key.
When a rate limit is exceeded, the API responds with HTTP status 429 Too Many Requests:
json
{
"status": 0,
"messages": "Rate limit exceeded. Please try again later.",
"request_time": 1706400000,
"rate_limit": {
"limit": 12,
"remaining": 0,
"reset_time": 1706400060,
"window": "minute"
}
}
Rate Limit Headers
All API responses include rate limit information in HTTP headers:
| Header | Description |
|---|---|
X-RateLimit-Limit |
The maximum number of requests allowed in the current time window. |
X-RateLimit-Remaining |
The number of requests remaining in the current time window. |
X-RateLimit-Reset |
Unix timestamp indicating when the rate limit window resets. |
Retry-After |
Only present on 429 responses. Number of seconds to wait before retrying. |