Create target
curl --request POST \
--url https://app.azalt.co/api/v1/targets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"targetEntries": [
{
"year": 123,
"targetValue": 123,
"siteId": "<string>",
"month": 123,
"quarter": 123
}
],
"indicatorId": "<string>",
"title": "<string>",
"baselineYear": 123,
"baselineMonth": 123,
"baselineQuarter": 123,
"metadata": {}
}
'import requests
url = "https://app.azalt.co/api/v1/targets"
payload = {
"targetEntries": [
{
"year": 123,
"targetValue": 123,
"siteId": "<string>",
"month": 123,
"quarter": 123
}
],
"indicatorId": "<string>",
"title": "<string>",
"baselineYear": 123,
"baselineMonth": 123,
"baselineQuarter": 123,
"metadata": {}
}
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({
targetEntries: [{year: 123, targetValue: 123, siteId: '<string>', month: 123, quarter: 123}],
indicatorId: '<string>',
title: '<string>',
baselineYear: 123,
baselineMonth: 123,
baselineQuarter: 123,
metadata: {}
})
};
fetch('https://app.azalt.co/api/v1/targets', 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/targets",
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([
'targetEntries' => [
[
'year' => 123,
'targetValue' => 123,
'siteId' => '<string>',
'month' => 123,
'quarter' => 123
]
],
'indicatorId' => '<string>',
'title' => '<string>',
'baselineYear' => 123,
'baselineMonth' => 123,
'baselineQuarter' => 123,
'metadata' => [
]
]),
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/targets"
payload := strings.NewReader("{\n \"targetEntries\": [\n {\n \"year\": 123,\n \"targetValue\": 123,\n \"siteId\": \"<string>\",\n \"month\": 123,\n \"quarter\": 123\n }\n ],\n \"indicatorId\": \"<string>\",\n \"title\": \"<string>\",\n \"baselineYear\": 123,\n \"baselineMonth\": 123,\n \"baselineQuarter\": 123,\n \"metadata\": {}\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/targets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"targetEntries\": [\n {\n \"year\": 123,\n \"targetValue\": 123,\n \"siteId\": \"<string>\",\n \"month\": 123,\n \"quarter\": 123\n }\n ],\n \"indicatorId\": \"<string>\",\n \"title\": \"<string>\",\n \"baselineYear\": 123,\n \"baselineMonth\": 123,\n \"baselineQuarter\": 123,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/targets")
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 \"targetEntries\": [\n {\n \"year\": 123,\n \"targetValue\": 123,\n \"siteId\": \"<string>\",\n \"month\": 123,\n \"quarter\": 123\n }\n ],\n \"indicatorId\": \"<string>\",\n \"title\": \"<string>\",\n \"baselineYear\": 123,\n \"baselineMonth\": 123,\n \"baselineQuarter\": 123,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"indicatorId": "<string>",
"organizationId": "<string>",
"title": "<string>",
"baselineYear": 123,
"baselineMonth": 123,
"baselineQuarter": 123,
"metadata": {},
"targetEntries": [
{
"year": 123,
"targetValue": 123,
"siteId": "<string>",
"month": 123,
"quarter": 123
}
],
"createdAt": "<string>",
"updatedAt": "<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": []
}Target
Create target
Create a new sustainability or performance target.
Target Structure:
indicatorId: Link to a specific indicator (optional)title: Descriptive name for the targetbaselineYear/Month/Quarter: Reference period for relative targetsmetadata: Custom key-value data for external system integrationtargetEntries: Array of target values with periods, types (ABSOLUTE/RELATIVE_PERCENT), and site-specific or organization-wide scope
Targets support both absolute values and percentage-based goals relative to baseline periods.
POST
/
targets
Create target
curl --request POST \
--url https://app.azalt.co/api/v1/targets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"targetEntries": [
{
"year": 123,
"targetValue": 123,
"siteId": "<string>",
"month": 123,
"quarter": 123
}
],
"indicatorId": "<string>",
"title": "<string>",
"baselineYear": 123,
"baselineMonth": 123,
"baselineQuarter": 123,
"metadata": {}
}
'import requests
url = "https://app.azalt.co/api/v1/targets"
payload = {
"targetEntries": [
{
"year": 123,
"targetValue": 123,
"siteId": "<string>",
"month": 123,
"quarter": 123
}
],
"indicatorId": "<string>",
"title": "<string>",
"baselineYear": 123,
"baselineMonth": 123,
"baselineQuarter": 123,
"metadata": {}
}
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({
targetEntries: [{year: 123, targetValue: 123, siteId: '<string>', month: 123, quarter: 123}],
indicatorId: '<string>',
title: '<string>',
baselineYear: 123,
baselineMonth: 123,
baselineQuarter: 123,
metadata: {}
})
};
fetch('https://app.azalt.co/api/v1/targets', 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/targets",
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([
'targetEntries' => [
[
'year' => 123,
'targetValue' => 123,
'siteId' => '<string>',
'month' => 123,
'quarter' => 123
]
],
'indicatorId' => '<string>',
'title' => '<string>',
'baselineYear' => 123,
'baselineMonth' => 123,
'baselineQuarter' => 123,
'metadata' => [
]
]),
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/targets"
payload := strings.NewReader("{\n \"targetEntries\": [\n {\n \"year\": 123,\n \"targetValue\": 123,\n \"siteId\": \"<string>\",\n \"month\": 123,\n \"quarter\": 123\n }\n ],\n \"indicatorId\": \"<string>\",\n \"title\": \"<string>\",\n \"baselineYear\": 123,\n \"baselineMonth\": 123,\n \"baselineQuarter\": 123,\n \"metadata\": {}\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/targets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"targetEntries\": [\n {\n \"year\": 123,\n \"targetValue\": 123,\n \"siteId\": \"<string>\",\n \"month\": 123,\n \"quarter\": 123\n }\n ],\n \"indicatorId\": \"<string>\",\n \"title\": \"<string>\",\n \"baselineYear\": 123,\n \"baselineMonth\": 123,\n \"baselineQuarter\": 123,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/targets")
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 \"targetEntries\": [\n {\n \"year\": 123,\n \"targetValue\": 123,\n \"siteId\": \"<string>\",\n \"month\": 123,\n \"quarter\": 123\n }\n ],\n \"indicatorId\": \"<string>\",\n \"title\": \"<string>\",\n \"baselineYear\": 123,\n \"baselineMonth\": 123,\n \"baselineQuarter\": 123,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"indicatorId": "<string>",
"organizationId": "<string>",
"title": "<string>",
"baselineYear": 123,
"baselineMonth": 123,
"baselineQuarter": 123,
"metadata": {},
"targetEntries": [
{
"year": 123,
"targetValue": 123,
"siteId": "<string>",
"month": 123,
"quarter": 123
}
],
"createdAt": "<string>",
"updatedAt": "<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
Response
Successful response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I

