curl --request POST \
--url https://api-canary.watchdog.no/v1/check-selections/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"selection": {
"scope": {
"type": "agreements",
"filter": {
"mine": true,
"team_ids": [
"<string>"
],
"ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"renewal_action_kinds": [],
"renewal_deadline_from": "<string>",
"renewal_deadline_through": "<string>",
"search": "<string>",
"statuses": [],
"supplier_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"recipient_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"tag_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"has_alert_verdicts": [],
"has_alert_credited": true,
"effective_from": "<string>",
"effective_through": "<string>",
"expiration_from": "<string>",
"expiration_through": "<string>",
"valid_on": "<string>"
},
"agreement_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"excluded_agreement_ids": []
},
"mode": "outstanding",
"invoices": {
"type": "all",
"excluded_invoice_ids": []
},
"issued_from": "2023-12-25",
"issued_through": "2023-12-25"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
selection: {
scope: {
type: 'agreements',
filter: {
mine: true,
team_ids: ['<string>'],
ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
renewal_action_kinds: [],
renewal_deadline_from: '<string>',
renewal_deadline_through: '<string>',
search: '<string>',
statuses: [],
supplier_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
recipient_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
tag_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
has_alert_verdicts: [],
has_alert_credited: true,
effective_from: '<string>',
effective_through: '<string>',
expiration_from: '<string>',
expiration_through: '<string>',
valid_on: '<string>'
},
agreement_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
excluded_agreement_ids: []
},
mode: 'outstanding',
invoices: {type: 'all', excluded_invoice_ids: []},
issued_from: '2023-12-25',
issued_through: '2023-12-25'
}
})
};
fetch('https://api-canary.watchdog.no/v1/check-selections/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-canary.watchdog.no/v1/check-selections/preview"
payload = { "selection": {
"scope": {
"type": "agreements",
"filter": {
"mine": True,
"team_ids": ["<string>"],
"ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"renewal_action_kinds": [],
"renewal_deadline_from": "<string>",
"renewal_deadline_through": "<string>",
"search": "<string>",
"statuses": [],
"supplier_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"recipient_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"tag_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"has_alert_verdicts": [],
"has_alert_credited": True,
"effective_from": "<string>",
"effective_through": "<string>",
"expiration_from": "<string>",
"expiration_through": "<string>",
"valid_on": "<string>"
},
"agreement_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"excluded_agreement_ids": []
},
"mode": "outstanding",
"invoices": {
"type": "all",
"excluded_invoice_ids": []
},
"issued_from": "2023-12-25",
"issued_through": "2023-12-25"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"options": {
"outstanding": {
"invoice_count": 123,
"replaced_alert_count": 123,
"handled_alert_count": 123
},
"again": {
"invoice_count": 123,
"replaced_alert_count": 123,
"handled_alert_count": 123
}
},
"fingerprint": "<string>",
"sample_invoice_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"agreements": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"reasons": [
"inactive"
],
"check_count": 123
}
],
"invoice_count": 123,
"check_count": 123,
"exceeds_limit": true,
"maximum_checks": 123,
"maximum_runs": 123,
"exclusions": [
{
"reason": "not_ready",
"count": 123
}
],
"deletable_alert_count": 123,
"kept_alert_count": 123,
"kept_user_alert_count": 123,
"cancelled_check_count": 123,
"other_topic_alert_count": 123
}{
"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 resource does not exist in the current organization.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "Scope is too large or cannot be retried.",
"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 an explicit check selection
Read-only preview. Filters resolve the entire agreement collection, not a page. Topics select distinct invoice–agreement pairs, so replacement also affects other topics. Samples choose ten distinct invoices deterministically using the supplied seed. Oversized selections cannot execute.
curl --request POST \
--url https://api-canary.watchdog.no/v1/check-selections/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"selection": {
"scope": {
"type": "agreements",
"filter": {
"mine": true,
"team_ids": [
"<string>"
],
"ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"renewal_action_kinds": [],
"renewal_deadline_from": "<string>",
"renewal_deadline_through": "<string>",
"search": "<string>",
"statuses": [],
"supplier_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"recipient_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"tag_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"has_alert_verdicts": [],
"has_alert_credited": true,
"effective_from": "<string>",
"effective_through": "<string>",
"expiration_from": "<string>",
"expiration_through": "<string>",
"valid_on": "<string>"
},
"agreement_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"excluded_agreement_ids": []
},
"mode": "outstanding",
"invoices": {
"type": "all",
"excluded_invoice_ids": []
},
"issued_from": "2023-12-25",
"issued_through": "2023-12-25"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
selection: {
scope: {
type: 'agreements',
filter: {
mine: true,
team_ids: ['<string>'],
ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
renewal_action_kinds: [],
renewal_deadline_from: '<string>',
renewal_deadline_through: '<string>',
search: '<string>',
statuses: [],
supplier_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
recipient_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
tag_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
has_alert_verdicts: [],
has_alert_credited: true,
effective_from: '<string>',
effective_through: '<string>',
expiration_from: '<string>',
expiration_through: '<string>',
valid_on: '<string>'
},
agreement_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
excluded_agreement_ids: []
},
mode: 'outstanding',
invoices: {type: 'all', excluded_invoice_ids: []},
issued_from: '2023-12-25',
issued_through: '2023-12-25'
}
})
};
fetch('https://api-canary.watchdog.no/v1/check-selections/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-canary.watchdog.no/v1/check-selections/preview"
payload = { "selection": {
"scope": {
"type": "agreements",
"filter": {
"mine": True,
"team_ids": ["<string>"],
"ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"renewal_action_kinds": [],
"renewal_deadline_from": "<string>",
"renewal_deadline_through": "<string>",
"search": "<string>",
"statuses": [],
"supplier_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"recipient_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"tag_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"has_alert_verdicts": [],
"has_alert_credited": True,
"effective_from": "<string>",
"effective_through": "<string>",
"expiration_from": "<string>",
"expiration_through": "<string>",
"valid_on": "<string>"
},
"agreement_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"excluded_agreement_ids": []
},
"mode": "outstanding",
"invoices": {
"type": "all",
"excluded_invoice_ids": []
},
"issued_from": "2023-12-25",
"issued_through": "2023-12-25"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"options": {
"outstanding": {
"invoice_count": 123,
"replaced_alert_count": 123,
"handled_alert_count": 123
},
"again": {
"invoice_count": 123,
"replaced_alert_count": 123,
"handled_alert_count": 123
}
},
"fingerprint": "<string>",
"sample_invoice_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"agreements": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"reasons": [
"inactive"
],
"check_count": 123
}
],
"invoice_count": 123,
"check_count": 123,
"exceeds_limit": true,
"maximum_checks": 123,
"maximum_runs": 123,
"exclusions": [
{
"reason": "not_ready",
"count": 123
}
],
"deletable_alert_count": 123,
"kept_alert_count": 123,
"kept_user_alert_count": 123,
"cancelled_check_count": 123,
"other_topic_alert_count": 123
}{
"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 resource does not exist in the current organization.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "Scope is too large or cannot be retried.",
"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
Personal API key sent as a bearer token, together with X-Organization-Id. The key must have at least the access level the endpoint requires (read, write or admin).
Headers
The organization to act in. Required for personal API keys; list the organizations you can access with GET /v1/organizations.
Body
Show child attributes
Show child attributes
Response
Exact scope, exclusions and confirmation fingerprint.
What each check mode would run in this scope, whichever mode is selected.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes