curl --request POST \
--url https://api.watchdog.no/v1/agreements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.watchdog.no/v1/agreements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/agreements"
payload = {}
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",
"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>"
}
}
}{
"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": "Agreement work is in progress, an active agreement is missing a required field, the source document is unavailable, or the Idempotency-Key was reused with a different request.",
"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 agreement
Creates an agreement. Status defaults to draft; an active agreement needs a title. Send an empty object to create an empty draft. Matching does not start until you refresh matched invoices. Repeating the request with the same Idempotency-Key returns the original agreement with 200.
curl --request POST \
--url https://api.watchdog.no/v1/agreements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.watchdog.no/v1/agreements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.watchdog.no/v1/agreements"
payload = {}
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",
"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>"
}
}
}{
"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": "Agreement work is in progress, an active agreement is missing a required field, the source document is unavailable, or the Idempotency-Key was reused with a different request.",
"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.
Optional protection for safely retrying a request after a timeout or lost response. Choose a unique value (for example, a UUID) for each action and reuse it with the same input when retrying. Omit it for a normal request.
1 - 200^[\x21-\x7e]+$Body
Initial status. An active agreement needs a title.
draft, active, archived 500^\d{4}-\d{2}-\d{2}$^\d{4}-\d{2}-\d{2}$Suppliers the agreement covers. An empty array matches no invoices.
Recipients the agreement covers. An empty array means any recipient.
Tags to assign, replacing the current ones. An empty array removes all tags. Tags do not affect matching or checks.
Projects to assign, replacing the current selection. Empty clears it. Classification only; does not affect matching or checks.
Omit to assign the creator; null leaves the agreement unassigned.
1 - 200^[A-Za-z0-9_-]+$Show child attributes
Show child attributes
Show child attributes
Show child attributes
Extra context for compliance checks of this agreement. Null clears it.
20000Which extra alerts to raise. Omit to use the organization defaults; 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
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