POST /api/admin/bounce/v1
Note
This page was generated by extracting information from a JSON Schema data file for the API. It may be missing some information, or otherwise suggest approximate or placeholder values based on information in the schema file; this is due to limitations on how that data is extracted from the underlying Rust code and into the JSON Schema, and then again from there and into these docs.
Allows the system operator to administratively bounce messages that match certain criteria, or if no criteria are provided, ALL messages.
Request Body
The request body is required.
The Content-Type header must be set to application/json.
Describes which messages should be bounced. The criteria apply to the scheduled queue associated with a given message.
This is an object value, with the following properties:
-
campaign- optional nullablestring. The campaign name to match. If omitted, any campaign will match. -
domain- optional nullablestring. The domain name to match. If omitted, any domain will match. -
duration- optional nullablestring. Defaults to "5m". Specifies how long this bounce directive remains active. While active, newly injected messages that match the bounce criteria will also be bounced. -
expires- optional nullablestring(date-time). instead of specifying the duration, you can set an explicit expiration timestamp -
queue_names- optional array ofstring. If present, queue_names takes precedence overcampaign,tenant, anddomainand specifies the exact set of scheduled queue names to which the bounce applies. -
reason- requiredstring. Reason to log in the delivery log. Each matching message will be bounced with an AdminBounce record unless you suppress logging. The reason will also be shown in the list of currently active admin bounces. -
routing_domain- optional nullablestring. The routing_domain name to match. If omitted, any routing_domain will match. -
suppress_logging- optionalboolean. If true, do not generate AdminBounce delivery logs for matching messages. -
tenant- optional nullablestring. The tenant to match. If omitted, any tenant will match.
Examples
{
"campaign": "campaign_name",
"domain": "example.com",
"duration": "20m",
"expires": "1990-12-31T23:59:60Z",
"queue_names": [
"campaign_name:tenant_name@example.com"
],
"reason": "Cleaning up a bad send",
"routing_domain": "routing_domain.com",
"suppress_logging": false,
"tenant": "tenant_name"
}
Responses
Status 200
Bounce added successfully
Content-Type: application/json
This is an object value, with the following properties:
-
bounced- requiredobject. Deprecated: this field is no longer populated, as bounces are now always asynchronous. In earlier versions the following applies:A map of queue name to number of bounced messages that were processed as part of the initial sweep. Additional bounces may be generated if/when other messages that match the rule are discovered, but those obviously cannot be reported in the context of the initial request.
-
id- requiredstring(uuid). The id of the bounce rule that was registered. This can be used later to delete the rule if desired. -
total_bounced- requiredinteger. Deprecated: this field is no longer populated, as bounces are now always asynchronous. In earlier versions the following applies:The sum of the number of bounced messages reported by the
bouncedfield.