curl --request POST \
--url https://api-canary.watchdog.no/v1/alert-topics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agreement_id": "b3f4c2d1-0a9e-4c6b-8f7d-5e4a3b2c1d0e",
"title": "Order size discount"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agreement_id: 'b3f4c2d1-0a9e-4c6b-8f7d-5e4a3b2c1d0e',
title: 'Order size discount'
})
};
fetch('https://api-canary.watchdog.no/v1/alert-topics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-canary.watchdog.no/v1/alert-topics"
payload = {
"agreement_id": "b3f4c2d1-0a9e-4c6b-8f7d-5e4a3b2c1d0e",
"title": "Order size discount"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agreement": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
},
"title": "<string>",
"description": "<string>",
"is_locked": true,
"counts": {
"pending": {
"credited": 1,
"uncredited": 1
},
"accepted": {
"credited": 1,
"uncredited": 1
},
"dismissed": {
"credited": 1,
"uncredited": 1
}
},
"organization_currency": {
"currency_code": "<string>",
"impact_amount": "<string>",
"missing_amount_count": 123,
"by_verdict": {
"pending": {
"credited": {
"alert_count": 123,
"missing_amount_count": 123,
"impact_amount": "<string>"
},
"uncredited": {
"alert_count": 123,
"missing_amount_count": 123,
"impact_amount": "<string>"
}
},
"accepted": {
"credited": {
"alert_count": 123,
"missing_amount_count": 123,
"impact_amount": "<string>"
},
"uncredited": {
"alert_count": 123,
"missing_amount_count": 123,
"impact_amount": "<string>"
}
},
"dismissed": {
"credited": {
"alert_count": 123,
"missing_amount_count": 123,
"impact_amount": "<string>"
},
"uncredited": {
"alert_count": 123,
"missing_amount_count": 123,
"impact_amount": "<string>"
}
}
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"key_questions": [
"<string>"
],
"evidence": {
"citations": [
{
"source_ref": 123,
"citation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"quote": "<string>",
"text": "<string>",
"verification": "verified",
"verification_score": 123,
"available": true,
"source_type": "document",
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_name": "<string>",
"page": "<string>",
"section_title": "<string>",
"context_before": "<string>",
"context_after": "<string>",
"original_quote": "<string>"
}
],
"truncated": true
}
}{
"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": "An alert is invalidated and cannot be put in a topic.",
"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"
}
}Create an alert topic
Creates a topic on an agreement and moves the given alerts into it, out of any other topic. Lock the topic (PATCH is_locked: true) to keep automatic categorization from changing it; an unlocked topic without alerts can be removed by the next categorization.
curl --request POST \
--url https://api-canary.watchdog.no/v1/alert-topics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agreement_id": "b3f4c2d1-0a9e-4c6b-8f7d-5e4a3b2c1d0e",
"title": "Order size discount"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agreement_id: 'b3f4c2d1-0a9e-4c6b-8f7d-5e4a3b2c1d0e',
title: 'Order size discount'
})
};
fetch('https://api-canary.watchdog.no/v1/alert-topics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-canary.watchdog.no/v1/alert-topics"
payload = {
"agreement_id": "b3f4c2d1-0a9e-4c6b-8f7d-5e4a3b2c1d0e",
"title": "Order size discount"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agreement": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
},
"title": "<string>",
"description": "<string>",
"is_locked": true,
"counts": {
"pending": {
"credited": 1,
"uncredited": 1
},
"accepted": {
"credited": 1,
"uncredited": 1
},
"dismissed": {
"credited": 1,
"uncredited": 1
}
},
"organization_currency": {
"currency_code": "<string>",
"impact_amount": "<string>",
"missing_amount_count": 123,
"by_verdict": {
"pending": {
"credited": {
"alert_count": 123,
"missing_amount_count": 123,
"impact_amount": "<string>"
},
"uncredited": {
"alert_count": 123,
"missing_amount_count": 123,
"impact_amount": "<string>"
}
},
"accepted": {
"credited": {
"alert_count": 123,
"missing_amount_count": 123,
"impact_amount": "<string>"
},
"uncredited": {
"alert_count": 123,
"missing_amount_count": 123,
"impact_amount": "<string>"
}
},
"dismissed": {
"credited": {
"alert_count": 123,
"missing_amount_count": 123,
"impact_amount": "<string>"
},
"uncredited": {
"alert_count": 123,
"missing_amount_count": 123,
"impact_amount": "<string>"
}
}
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"key_questions": [
"<string>"
],
"evidence": {
"citations": [
{
"source_ref": 123,
"citation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"quote": "<string>",
"text": "<string>",
"verification": "verified",
"verification_score": 123,
"available": true,
"source_type": "document",
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_name": "<string>",
"page": "<string>",
"section_title": "<string>",
"context_before": "<string>",
"context_after": "<string>",
"original_quote": "<string>"
}
],
"truncated": true
}
}{
"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": "An alert is invalidated and cannot be put in a topic.",
"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
1 - 200Markdown. A new topic has no sources yet, so inline citations such as [1] are rejected.
100000Questions the supplier or reviewer should answer.
1001 - 20000Alerts of the agreement to move into the topic, out of any other topic. Move more later with POST /v1/alert-topics/{id}/alerts.
1 - 5000 elementsResponse
The new topic with its alert counts.
Show child attributes
Show child attributes
Alerts by verdict, each split into credited and uncredited alerts.
Show child attributes
Show child attributes
Impact in the organization currency. Alerts without a converted impact are counted in missing_amount_count.
Show child attributes
Show child attributes
Show child attributes
Show child attributes