Create a new spam filter
/api/spam-filtersCreate a new spam filter for your organization. Provide either structured filter
criteria or a raw OTTL condition in the spec, but not both.
If metadata.labels["dash0.com/origin"] is provided, it must be unique within
the organization and dataset. A request with a duplicate origin returns 400.
If no origin is provided, the server auto-generates one (api-<uuid>).
Parameters 1
datasetqueryOptional dataset to query across. Defaults to whatever is configured to be the default dataset for the organization.
"^[a-zA-Z0-9_-]{3,26}$"Sample request123456789101112131415161718192021curl --request POST 'https://api.eu-west-1.aws.dash0.com/api/spam-filters' \--header "Authorization: Bearer ${DASH0_AUTH_TOKEN}" \--header 'Content-Type: application/json' \--data-raw '{"kind": "Dash0SpamFilter","metadata": {"name": "Example"},"spec": {"contexts": ["datapoint"],"filter": [{"key": "service.name","operator": "is","value": "shop"}]}}'
Request body required
The value must match at least one of these schemas.
v1alpha1 spam filter definition. Uses contexts (array) in the spec.
v1alpha2 spam filter definition. Uses context (scalar) in the spec.
Responses
The created spam filter
The value must match at least one of these schemas.
v1alpha1 spam filter definition. Uses contexts (array) in the spec.
v1alpha2 spam filter definition. Uses context (scalar) in the spec.