curl --request POST \
--url https://api.watchdog.no/v1/claims/alerts/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alerts": {
"alert_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"filter": {
"view_ids": [
"<string>"
],
"claim_ids": [
"<string>"
],
"has_claim": true,
"claim_statuses": [],
"invoice_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"company_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"agreement_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"purchase_order_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"agreement_statuses": [],
"supplier_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"recipient_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"tag_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"topic_ids": [
"<string>"
],
"has_topic": true,
"check_types": [],
"verdicts": [],
"credited": true,
"confidence_levels": [],
"currency_codes": [
"<string>"
],
"correction_types": [],
"impact_min": "<string>",
"impact_max": "<string>",
"issued_from": "<string>",
"issued_through": "<string>",
"created_from": "<string>",
"created_through": "<string>",
"search": "<string>",
"not": []
},
"excluded_alert_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"move_from_open_claims": true,
"accept_alerts": true
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
alerts: {
alert_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
filter: {
view_ids: ['<string>'],
claim_ids: ['<string>'],
has_claim: true,
claim_statuses: [],
invoice_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
company_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
agreement_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
purchase_order_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
agreement_statuses: [],
supplier_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
recipient_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
tag_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
topic_ids: ['<string>'],
has_topic: true,
check_types: [],
verdicts: [],
credited: true,
confidence_levels: [],
currency_codes: ['<string>'],
correction_types: [],
impact_min: '<string>',
impact_max: '<string>',
issued_from: '<string>',
issued_through: '<string>',
created_from: '<string>',
created_through: '<string>',
search: '<string>',
not: []
},
excluded_alert_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
move_from_open_claims: true,
accept_alerts: true
}
})
};
fetch('https://api.watchdog.no/v1/claims/alerts/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/claims/alerts/preview"
payload = { "alerts": {
"alert_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"filter": {
"view_ids": ["<string>"],
"claim_ids": ["<string>"],
"has_claim": True,
"claim_statuses": [],
"invoice_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"company_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"agreement_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"purchase_order_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"agreement_statuses": [],
"supplier_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"recipient_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"tag_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"topic_ids": ["<string>"],
"has_topic": True,
"check_types": [],
"verdicts": [],
"credited": True,
"confidence_levels": [],
"currency_codes": ["<string>"],
"correction_types": [],
"impact_min": "<string>",
"impact_max": "<string>",
"issued_from": "<string>",
"issued_through": "<string>",
"created_from": "<string>",
"created_through": "<string>",
"search": "<string>",
"not": []
},
"excluded_alert_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"move_from_open_claims": True,
"accept_alerts": True
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"joining_count": 1,
"joining_by_verdict": {
"pending": 1,
"accepted": 1,
"dismissed": 1,
"skipped": 1
},
"already_in_claim_count": 1,
"left_out": {
"ineligible_count": 1,
"completed_claim_count": 1,
"invalidated_count": 1,
"open_claim_count": 1
},
"joining_alert_ids": {
"pending": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"accepted": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"dismissed": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"skipped": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}{
"error": {
"code": "validation_error",
"message": "The request is invalid. details lists up to 20 field errors. Request bodies are limited to 2 MiB.",
"request_id": "req_example"
}
}{
"error": {
"code": "invalid_token",
"message": "The bearer token is missing or invalid.",
"request_id": "req_example"
}
}{
"error": {
"code": "forbidden",
"message": "Access denied. The error code says why: forbidden, token_disabled, organization_required, insufficient_role or mfa_required.",
"request_id": "req_example"
}
}{
"error": {
"code": "not_found",
"message": "The agreement, the claim, an alert in alerts.alert_ids or a selected View was not found.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "The agreement cannot receive new claims (it is deleted, or neither active nor archived), the claim is not pending or in progress, more than 5000 alerts would join, or a selected View has invalid saved filters.",
"request_id": "req_example"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Wait for the Retry-After delay before retrying.",
"request_id": "req_example"
}
}{
"error": {
"code": "internal_error",
"message": "Unexpected server failure. Include the request ID when contacting support.",
"request_id": "req_example"
}
}{
"error": {
"code": "service_unavailable",
"message": "Temporarily unavailable. Retry after the Retry-After delay, when provided.",
"request_id": "req_example"
}
}Preview adding alerts to a claim
Says which selected alerts would join a claim, by verdict, and why the others would not, changing nothing. Send agreement_id for a new claim (POST /v1/claims) or claim_id for a pending or in-progress one (POST /v1/alerts/update with claim_id), with the alerts object POST /v1/claims takes (at most 5000 alerts). The preview applies those commands’ rules, but where the commands refuse alert_ids that cannot join, it counts them under left_out. To add exactly what was previewed, send the joining_alert_ids you want as alert_ids: a claim asks only for confirmed alerts, so the app leaves the false alarms out. Alerts can change before you send the command; it then applies its own rules.
curl --request POST \
--url https://api.watchdog.no/v1/claims/alerts/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alerts": {
"alert_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"filter": {
"view_ids": [
"<string>"
],
"claim_ids": [
"<string>"
],
"has_claim": true,
"claim_statuses": [],
"invoice_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"company_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"agreement_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"purchase_order_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"agreement_statuses": [],
"supplier_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"recipient_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"tag_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"topic_ids": [
"<string>"
],
"has_topic": true,
"check_types": [],
"verdicts": [],
"credited": true,
"confidence_levels": [],
"currency_codes": [
"<string>"
],
"correction_types": [],
"impact_min": "<string>",
"impact_max": "<string>",
"issued_from": "<string>",
"issued_through": "<string>",
"created_from": "<string>",
"created_through": "<string>",
"search": "<string>",
"not": []
},
"excluded_alert_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"move_from_open_claims": true,
"accept_alerts": true
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
alerts: {
alert_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
filter: {
view_ids: ['<string>'],
claim_ids: ['<string>'],
has_claim: true,
claim_statuses: [],
invoice_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
company_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
agreement_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
purchase_order_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
agreement_statuses: [],
supplier_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
recipient_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
tag_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
topic_ids: ['<string>'],
has_topic: true,
check_types: [],
verdicts: [],
credited: true,
confidence_levels: [],
currency_codes: ['<string>'],
correction_types: [],
impact_min: '<string>',
impact_max: '<string>',
issued_from: '<string>',
issued_through: '<string>',
created_from: '<string>',
created_through: '<string>',
search: '<string>',
not: []
},
excluded_alert_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
move_from_open_claims: true,
accept_alerts: true
}
})
};
fetch('https://api.watchdog.no/v1/claims/alerts/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/claims/alerts/preview"
payload = { "alerts": {
"alert_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"filter": {
"view_ids": ["<string>"],
"claim_ids": ["<string>"],
"has_claim": True,
"claim_statuses": [],
"invoice_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"company_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"agreement_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"purchase_order_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"agreement_statuses": [],
"supplier_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"recipient_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"tag_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"topic_ids": ["<string>"],
"has_topic": True,
"check_types": [],
"verdicts": [],
"credited": True,
"confidence_levels": [],
"currency_codes": ["<string>"],
"correction_types": [],
"impact_min": "<string>",
"impact_max": "<string>",
"issued_from": "<string>",
"issued_through": "<string>",
"created_from": "<string>",
"created_through": "<string>",
"search": "<string>",
"not": []
},
"excluded_alert_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"move_from_open_claims": True,
"accept_alerts": True
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"joining_count": 1,
"joining_by_verdict": {
"pending": 1,
"accepted": 1,
"dismissed": 1,
"skipped": 1
},
"already_in_claim_count": 1,
"left_out": {
"ineligible_count": 1,
"completed_claim_count": 1,
"invalidated_count": 1,
"open_claim_count": 1
},
"joining_alert_ids": {
"pending": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"accepted": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"dismissed": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"skipped": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}{
"error": {
"code": "validation_error",
"message": "The request is invalid. details lists up to 20 field errors. Request bodies are limited to 2 MiB.",
"request_id": "req_example"
}
}{
"error": {
"code": "invalid_token",
"message": "The bearer token is missing or invalid.",
"request_id": "req_example"
}
}{
"error": {
"code": "forbidden",
"message": "Access denied. The error code says why: forbidden, token_disabled, organization_required, insufficient_role or mfa_required.",
"request_id": "req_example"
}
}{
"error": {
"code": "not_found",
"message": "The agreement, the claim, an alert in alerts.alert_ids or a selected View was not found.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "The agreement cannot receive new claims (it is deleted, or neither active nor archived), the claim is not pending or in progress, more than 5000 alerts would join, or a selected View has invalid saved filters.",
"request_id": "req_example"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Wait for the Retry-After delay before retrying.",
"request_id": "req_example"
}
}{
"error": {
"code": "internal_error",
"message": "Unexpected server failure. Include the request ID when contacting support.",
"request_id": "req_example"
}
}{
"error": {
"code": "service_unavailable",
"message": "Temporarily unavailable. Retry after the Retry-After delay, when provided.",
"request_id": "req_example"
}
}Authorizations
Headers
Body
Response
The alerts that would join, by verdict, and those left out, by reason.