Update or create a spam filter by origin or ID
/api/spam-filters/{originOrId}Updates an existing spam filter or creates a new one if it doesn't exist.
Useful for Infrastructure-as-Code workflows. Provide either structured filter
criteria or a raw OTTL condition in the spec, but not both.
Parameters 2
originOrIdpathrequiredSpam filter origin or UUID
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 PUT 'https://api.eu-west-1.aws.dash0.com/api/spam-filters/123e4567-e89b-42d3-a456-426614174000' \--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 updated or 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.