curl --request POST \
--url https://api.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.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.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>",
"by_verdict": {
"pending": {
"credited": {
"alert_count": 123,
"impact_amount": "<string>"
},
"uncredited": {
"alert_count": 123,
"impact_amount": "<string>"
}
},
"accepted": {
"credited": {
"alert_count": 123,
"impact_amount": "<string>"
},
"uncredited": {
"alert_count": 123,
"impact_amount": "<string>"
}
},
"dismissed": {
"credited": {
"alert_count": 123,
"impact_amount": "<string>"
},
"uncredited": {
"alert_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",
"available": true,
"source_type": "document",
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_name": "<string>",
"section_title": "<string>",
"quote": "<string>",
"verification": "verified",
"original_quote": "<string>",
"context_before": "<string>",
"context_after": "<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. The topic stays, with or without alerts, until it is deleted or merged away, or its last alerts are deleted while it is unlocked. Categorization does not put alerts into an empty topic; fill it with alert_ids or POST /v1/alert-topics//alerts. Lock it (PATCH is_locked: true) to keep automatic categorization from rewriting its text.
curl --request POST \
--url https://api.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.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.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>",
"by_verdict": {
"pending": {
"credited": {
"alert_count": 123,
"impact_amount": "<string>"
},
"uncredited": {
"alert_count": 123,
"impact_amount": "<string>"
}
},
"accepted": {
"credited": {
"alert_count": 123,
"impact_amount": "<string>"
},
"uncredited": {
"alert_count": 123,
"impact_amount": "<string>"
}
},
"dismissed": {
"credited": {
"alert_count": 123,
"impact_amount": "<string>"
},
"uncredited": {
"alert_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",
"available": true,
"source_type": "document",
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"document_name": "<string>",
"section_title": "<string>",
"quote": "<string>",
"verification": "verified",
"original_quote": "<string>",
"context_before": "<string>",
"context_after": "<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: the sum of the alerts’ converted impacts.
Show child attributes
Show child attributes
Show child attributes
Show child attributes