curl --request PATCH \
--url https://api.scoutworks.app/api/v1/budgets/{budgetId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"amount": "<string>",
"sectionIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"eventIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"startDate": "2023-12-25",
"endDate": "2023-12-25"
}
'import requests
url = "https://api.scoutworks.app/api/v1/budgets/{budgetId}"
payload = {
"name": "<string>",
"amount": "<string>",
"sectionIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"eventIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"startDate": "2023-12-25",
"endDate": "2023-12-25"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
amount: '<string>',
sectionIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
eventIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
startDate: '2023-12-25',
endDate: '2023-12-25'
})
};
fetch('https://api.scoutworks.app/api/v1/budgets/{budgetId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "income",
"periodId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"available": "<string>",
"spent": "<string>",
"remaining": "<string>",
"sectionIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"eventIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Update a budget
Changes only the fields you send. sectionIds and eventIds replace the lists. Changing type while any line is linked to the budget answers 409 conflict. In an open accounting year only: a closed one answers 409 period_closed. An id from another group answers 400. A change is made as the admin who created the key, and the record names the key, so Scoutworks shows a script did it. Writes count towards the key’s usual limit and a second one of 30 changes a minute. A group whose subscription has lapsed answers 402.
Send the ETag you last read for the budget as If-Match: if the budget has changed since, the request answers 412 stale_write and changes nothing. Optional, and recommended.
curl --request PATCH \
--url https://api.scoutworks.app/api/v1/budgets/{budgetId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"amount": "<string>",
"sectionIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"eventIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"startDate": "2023-12-25",
"endDate": "2023-12-25"
}
'import requests
url = "https://api.scoutworks.app/api/v1/budgets/{budgetId}"
payload = {
"name": "<string>",
"amount": "<string>",
"sectionIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"eventIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"startDate": "2023-12-25",
"endDate": "2023-12-25"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
amount: '<string>',
sectionIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
eventIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
startDate: '2023-12-25',
endDate: '2023-12-25'
})
};
fetch('https://api.scoutworks.app/api/v1/budgets/{budgetId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "income",
"periodId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"available": "<string>",
"spent": "<string>",
"remaining": "<string>",
"sectionIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"eventIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Authorizations
Headers
Path Parameters
Body
Send only the fields to change. A field not listed here is refused with a 400.