Create contract
curl --request POST \
--url https://api.nops.io/v1/contract-tracker \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "AWS Enterprise Discount",
"startDate": "2025-01-01",
"endDate": "2027-12-31",
"yearlySpend": {
"2025": 1000000
}
}
'import requests
url = "https://api.nops.io/v1/contract-tracker"
payload = {
"name": "AWS Enterprise Discount",
"startDate": "2025-01-01",
"endDate": "2027-12-31",
"yearlySpend": { "2025": 1000000 }
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'AWS Enterprise Discount',
startDate: '2025-01-01',
endDate: '2027-12-31',
yearlySpend: {'2025': 1000000}
})
};
fetch('https://api.nops.io/v1/contract-tracker', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nops.io/v1/contract-tracker"
payload := strings.NewReader("{\n \"name\": \"AWS Enterprise Discount\",\n \"startDate\": \"2025-01-01\",\n \"endDate\": \"2027-12-31\",\n \"yearlySpend\": {\n \"2025\": 1000000\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"contract": {
"id": "contract-1",
"name": "AWS Enterprise Discount"
}
}
}{
"error": {
"code": "forbidden_scope",
"message": "API key is missing required scope: budgets:write",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "forbidden_scope",
"message": "API key is missing required scope: budgets:write",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Contract tracker
Create contract
POST
https://api.nops.io
/
v1
/
contract-tracker
Create contract
curl --request POST \
--url https://api.nops.io/v1/contract-tracker \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "AWS Enterprise Discount",
"startDate": "2025-01-01",
"endDate": "2027-12-31",
"yearlySpend": {
"2025": 1000000
}
}
'import requests
url = "https://api.nops.io/v1/contract-tracker"
payload = {
"name": "AWS Enterprise Discount",
"startDate": "2025-01-01",
"endDate": "2027-12-31",
"yearlySpend": { "2025": 1000000 }
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'AWS Enterprise Discount',
startDate: '2025-01-01',
endDate: '2027-12-31',
yearlySpend: {'2025': 1000000}
})
};
fetch('https://api.nops.io/v1/contract-tracker', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nops.io/v1/contract-tracker"
payload := strings.NewReader("{\n \"name\": \"AWS Enterprise Discount\",\n \"startDate\": \"2025-01-01\",\n \"endDate\": \"2027-12-31\",\n \"yearlySpend\": {\n \"2025\": 1000000\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"contract": {
"id": "contract-1",
"name": "AWS Enterprise Discount"
}
}
}{
"error": {
"code": "forbidden_scope",
"message": "API key is missing required scope: budgets:write",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "forbidden_scope",
"message": "API key is missing required scope: budgets:write",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Authorizations
API key from Settings → Security → API Keys. Pass as Authorization: Bearer YOUR_API_KEY.
Headers
Unique key for safe retries on write requests (required, max 64 characters).
Maximum string length:
64Body
application/json
Required string length:
1 - 255Pattern:
^\d{4}-\d{2}-\d{2}$Pattern:
^\d{4}-\d{2}-\d{2}$Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
MONTHLY, QUARTERLY, ANNUALLY Required range:
0 <= x <= 100Required range:
0 <= x <= 100Response
Create contract
Show child attributes
Show child attributes
Was this page helpful?