curl --request POST \
--url https://api.watchdog.no/v1/agreements/{id}/context-suggestions/{suggestion_id}/accept \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.watchdog.no/v1/agreements/{id}/context-suggestions/{suggestion_id}/accept', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/agreements/{id}/context-suggestions/{suggestion_id}/accept"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"status": "draft",
"effective_date": "<string>",
"expiration_date": "<string>",
"suppliers": [],
"recipients": [],
"tags": [],
"projects": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"project_numbers": [
"<string>"
]
}
],
"owner_user_id": "<string>",
"owner": {
"user_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>"
},
"readiness": {
"ready": true,
"reasons": [
"inactive"
]
},
"renewal_action": {
"kind": "cancel_by",
"deadline": "<string>"
},
"version": 1,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"alert_summary": {
"counts": {
"pending": {
"credited": 1,
"uncredited": 1
},
"accepted": {
"credited": 1,
"uncredited": 1
},
"dismissed": {
"credited": 1,
"uncredited": 1
}
},
"pending_topic_count": 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>"
}
}
}
}
},
"relationships": {
"price_item_count": 1,
"document_count": 1,
"invoice_match_count": 1,
"supplier_invoice_count": 1,
"eligible_invoice_count": 1
},
"applicability": {
"match": "all",
"conditions": [
{
"field": "all_references",
"operator": "contains",
"values": [
"<string>"
]
}
]
},
"renewal": {
"mode": null,
"period": null,
"occurrences_remaining": null,
"notice_period": null,
"deadline_override": null
},
"instructions": "<string>",
"alert_settings": {
"flag_undercharges": false,
"flag_uncovered_items": false
},
"matching_settings": {
"smart_matching_enabled": false,
"smart_matching_criterion": null
},
"created_by_name": "<string>",
"created_by_deleted": true,
"suggested_entities": {
"supplier": {
"name": "<string>",
"org_number": "<string>",
"candidates": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"organization_number": "<string>"
}
]
},
"recipient": {
"name": "<string>",
"org_number": "<string>"
}
}
}{
"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": "The suggestion was already reviewed or no longer fits the instructions, the instructions would exceed 20,000 characters, or agreement work is in progress. Nothing changed.",
"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"
}
}Accept a suggested instruction edit
Applies the suggested edit to the agreement’s instructions and returns the updated agreement. Existing checks become outdated.
curl --request POST \
--url https://api.watchdog.no/v1/agreements/{id}/context-suggestions/{suggestion_id}/accept \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.watchdog.no/v1/agreements/{id}/context-suggestions/{suggestion_id}/accept', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/agreements/{id}/context-suggestions/{suggestion_id}/accept"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"status": "draft",
"effective_date": "<string>",
"expiration_date": "<string>",
"suppliers": [],
"recipients": [],
"tags": [],
"projects": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"project_numbers": [
"<string>"
]
}
],
"owner_user_id": "<string>",
"owner": {
"user_id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>"
},
"readiness": {
"ready": true,
"reasons": [
"inactive"
]
},
"renewal_action": {
"kind": "cancel_by",
"deadline": "<string>"
},
"version": 1,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"alert_summary": {
"counts": {
"pending": {
"credited": 1,
"uncredited": 1
},
"accepted": {
"credited": 1,
"uncredited": 1
},
"dismissed": {
"credited": 1,
"uncredited": 1
}
},
"pending_topic_count": 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>"
}
}
}
}
},
"relationships": {
"price_item_count": 1,
"document_count": 1,
"invoice_match_count": 1,
"supplier_invoice_count": 1,
"eligible_invoice_count": 1
},
"applicability": {
"match": "all",
"conditions": [
{
"field": "all_references",
"operator": "contains",
"values": [
"<string>"
]
}
]
},
"renewal": {
"mode": null,
"period": null,
"occurrences_remaining": null,
"notice_period": null,
"deadline_override": null
},
"instructions": "<string>",
"alert_settings": {
"flag_undercharges": false,
"flag_uncovered_items": false
},
"matching_settings": {
"smart_matching_enabled": false,
"smart_matching_criterion": null
},
"created_by_name": "<string>",
"created_by_deleted": true,
"suggested_entities": {
"supplier": {
"name": "<string>",
"org_number": "<string>",
"candidates": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"organization_number": "<string>"
}
]
},
"recipient": {
"name": "<string>",
"org_number": "<string>"
}
}
}{
"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": "The suggestion was already reviewed or no longer fits the instructions, the instructions would exceed 20,000 characters, or agreement work is in progress. Nothing changed.",
"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.
Path Parameters
A pending suggestion of this agreement.
Response
The resource.
draft (being set up), active (Watchdog checks invoices against it) or archived (no longer checked). It does not say whether the contract term is in force: use expiration_date, renewal_action or the valid_on filter for that.
draft, active, archived ^\d{4}-\d{2}-\d{2}$^\d{4}-\d{2}-\d{2}$Suppliers the agreement covers. An empty array matches no invoices.
Show child attributes
Show child attributes
[]
Recipients the agreement covers. An empty array means any recipient.
Show child attributes
Show child attributes
[]
Assigned tags.
Show child attributes
Show child attributes
[]
Show child attributes
Show child attributes
1 - 200^[A-Za-z0-9_-]+$Show child attributes
Show child attributes
Whether the agreement can be checked. reasons lists what is missing when ready is false.
Show child attributes
Show child attributes
The next renewal action from the renewal terms. A null deadline means no dated action is known.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Show child attributes
Show child attributes
x >= 0All alerts of this agreement, as GET /v1/alerts/metrics?agreement_ids={id} reports them.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Extra invoice-matching conditions on reference and delivery fields. Null means none.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Extra context for compliance checks of this agreement.
Which extra alerts to raise for this agreement. Replaces the whole object; omitted flags are false.
Show child attributes
Show child attributes
Smart matching settings. Replaces the whole object; omitted values are false or null.
Show child attributes
Show child attributes
The account that created the agreement was deleted. created_by_name keeps their name, or is null once the account is anonymised.
Show child attributes
Show child attributes