Recalculate multiple activities
curl --request POST \
--url https://app.azalt.co/api/v1/activities/recalculate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"formId": "<string>",
"key": "<string>",
"siteId": "<string>",
"year": 123,
"periodUnit": 123
}
'import requests
url = "https://app.azalt.co/api/v1/activities/recalculate"
payload = {
"formId": "<string>",
"key": "<string>",
"siteId": "<string>",
"year": 123,
"periodUnit": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
formId: '<string>',
key: '<string>',
siteId: '<string>',
year: 123,
periodUnit: 123
})
};
fetch('https://app.azalt.co/api/v1/activities/recalculate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.azalt.co/api/v1/activities/recalculate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'formId' => '<string>',
'key' => '<string>',
'siteId' => '<string>',
'year' => 123,
'periodUnit' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.azalt.co/api/v1/activities/recalculate"
payload := strings.NewReader("{\n \"formId\": \"<string>\",\n \"key\": \"<string>\",\n \"siteId\": \"<string>\",\n \"year\": 123,\n \"periodUnit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}HttpResponse<String> response = Unirest.post("https://app.azalt.co/api/v1/activities/recalculate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"formId\": \"<string>\",\n \"key\": \"<string>\",\n \"siteId\": \"<string>\",\n \"year\": 123,\n \"periodUnit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/activities/recalculate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"formId\": \"<string>\",\n \"key\": \"<string>\",\n \"siteId\": \"<string>\",\n \"year\": 123,\n \"periodUnit\": 123\n}"
response = http.request(request)
puts response.read_body{
"totalActivities": 123,
"successCount": 123,
"errors": [
{
"activityId": "<string>",
"error": "<string>"
}
]
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Activity
Recalculate multiple activities
Bulk recalculate activities with filtering:
Required Parameters:
formId: Form containing the activitieskey: Activity definition key
Optional Filtering:
siteId: Recalculate for specific site onlyyear: Recalculate for specific year onlyperiodUnit: Recalculate for specific time period only
Useful for batch updates when definitions, datasets, or calculation logic changes. Returns summary of successful recalculations and any errors.
POST
/
activities
/
recalculate
Recalculate multiple activities
curl --request POST \
--url https://app.azalt.co/api/v1/activities/recalculate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"formId": "<string>",
"key": "<string>",
"siteId": "<string>",
"year": 123,
"periodUnit": 123
}
'import requests
url = "https://app.azalt.co/api/v1/activities/recalculate"
payload = {
"formId": "<string>",
"key": "<string>",
"siteId": "<string>",
"year": 123,
"periodUnit": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
formId: '<string>',
key: '<string>',
siteId: '<string>',
year: 123,
periodUnit: 123
})
};
fetch('https://app.azalt.co/api/v1/activities/recalculate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.azalt.co/api/v1/activities/recalculate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'formId' => '<string>',
'key' => '<string>',
'siteId' => '<string>',
'year' => 123,
'periodUnit' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.azalt.co/api/v1/activities/recalculate"
payload := strings.NewReader("{\n \"formId\": \"<string>\",\n \"key\": \"<string>\",\n \"siteId\": \"<string>\",\n \"year\": 123,\n \"periodUnit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}HttpResponse<String> response = Unirest.post("https://app.azalt.co/api/v1/activities/recalculate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"formId\": \"<string>\",\n \"key\": \"<string>\",\n \"siteId\": \"<string>\",\n \"year\": 123,\n \"periodUnit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/activities/recalculate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"formId\": \"<string>\",\n \"key\": \"<string>\",\n \"siteId\": \"<string>\",\n \"year\": 123,\n \"periodUnit\": 123\n}"
response = http.request(request)
puts response.read_body{
"totalActivities": 123,
"successCount": 123,
"errors": [
{
"activityId": "<string>",
"error": "<string>"
}
]
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I

