Update activity definition
curl --request PUT \
--url https://app.azalt.co/api/v1/activity-definitions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"uiCode": "<string>",
"calcCode": "<string>",
"inputs": [
{
"name": "<string>",
"type": "string",
"required": true,
"exportName": "<string>",
"example": "<string>",
"editor": {
"type": "select",
"options": [
{
"label": "<string>",
"value": "<string>"
}
]
}
}
],
"description": "<string>",
"metadataSchema": {},
"isCommon": true
}
'import requests
url = "https://app.azalt.co/api/v1/activity-definitions/{id}"
payload = {
"name": "<string>",
"uiCode": "<string>",
"calcCode": "<string>",
"inputs": [
{
"name": "<string>",
"type": "string",
"required": True,
"exportName": "<string>",
"example": "<string>",
"editor": {
"type": "select",
"options": [
{
"label": "<string>",
"value": "<string>"
}
]
}
}
],
"description": "<string>",
"metadataSchema": {},
"isCommon": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
uiCode: '<string>',
calcCode: '<string>',
inputs: [
{
name: '<string>',
type: 'string',
required: true,
exportName: '<string>',
example: '<string>',
editor: {type: 'select', options: [{label: '<string>', value: '<string>'}]}
}
],
description: '<string>',
metadataSchema: {},
isCommon: true
})
};
fetch('https://app.azalt.co/api/v1/activity-definitions/{id}', 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/activity-definitions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'uiCode' => '<string>',
'calcCode' => '<string>',
'inputs' => [
[
'name' => '<string>',
'type' => 'string',
'required' => true,
'exportName' => '<string>',
'example' => '<string>',
'editor' => [
'type' => 'select',
'options' => [
[
'label' => '<string>',
'value' => '<string>'
]
]
]
]
],
'description' => '<string>',
'metadataSchema' => [
],
'isCommon' => true
]),
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/activity-definitions/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"uiCode\": \"<string>\",\n \"calcCode\": \"<string>\",\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"type\": \"string\",\n \"required\": true,\n \"exportName\": \"<string>\",\n \"example\": \"<string>\",\n \"editor\": {\n \"type\": \"select\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"description\": \"<string>\",\n \"metadataSchema\": {},\n \"isCommon\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.azalt.co/api/v1/activity-definitions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"uiCode\": \"<string>\",\n \"calcCode\": \"<string>\",\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"type\": \"string\",\n \"required\": true,\n \"exportName\": \"<string>\",\n \"example\": \"<string>\",\n \"editor\": {\n \"type\": \"select\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"description\": \"<string>\",\n \"metadataSchema\": {},\n \"isCommon\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/activity-definitions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"uiCode\": \"<string>\",\n \"calcCode\": \"<string>\",\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"type\": \"string\",\n \"required\": true,\n \"exportName\": \"<string>\",\n \"example\": \"<string>\",\n \"editor\": {\n \"type\": \"select\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"description\": \"<string>\",\n \"metadataSchema\": {},\n \"isCommon\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"uiCode": "<string>",
"calcCode": "<string>",
"inputs": [
{
"name": "<string>",
"type": "string",
"required": true,
"exportName": "<string>",
"example": "<string>",
"editor": {
"type": "select",
"options": [
{
"label": "<string>",
"value": "<string>"
}
]
}
}
],
"organizationId": "<string>",
"metadataSchema": {},
"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": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}ActivityDefinition
Update activity definition
Update an existing activity definition template:
Required Parameters:
id: Unique identifier of the activity definition to updatename: Human-readable name for the definitionuiCode: React component body code for the input form (do NOT includefunction ActivityUI(...) {or the closing brace - the system wraps it)calcCode: JavaScript function body code for the calculation (do NOT includeasync function calculate(inputValues) {or the closing brace - the system wraps it usinginputs)inputs: Complete array of input field definitions
Optional Parameters:
description: Detailed description of the activity typemetadataSchema: Declared metadata fields returned by the calculationisCommon: Toggle shared visibility for all organizations (admin only)
This endpoint replaces the editable activity definition fields and returns the updated definition. Updating calculation code can change future calculation results, so test the definition before applying changes in production workflows.
PUT
/
activity-definitions
/
{id}
Update activity definition
curl --request PUT \
--url https://app.azalt.co/api/v1/activity-definitions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"uiCode": "<string>",
"calcCode": "<string>",
"inputs": [
{
"name": "<string>",
"type": "string",
"required": true,
"exportName": "<string>",
"example": "<string>",
"editor": {
"type": "select",
"options": [
{
"label": "<string>",
"value": "<string>"
}
]
}
}
],
"description": "<string>",
"metadataSchema": {},
"isCommon": true
}
'import requests
url = "https://app.azalt.co/api/v1/activity-definitions/{id}"
payload = {
"name": "<string>",
"uiCode": "<string>",
"calcCode": "<string>",
"inputs": [
{
"name": "<string>",
"type": "string",
"required": True,
"exportName": "<string>",
"example": "<string>",
"editor": {
"type": "select",
"options": [
{
"label": "<string>",
"value": "<string>"
}
]
}
}
],
"description": "<string>",
"metadataSchema": {},
"isCommon": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
uiCode: '<string>',
calcCode: '<string>',
inputs: [
{
name: '<string>',
type: 'string',
required: true,
exportName: '<string>',
example: '<string>',
editor: {type: 'select', options: [{label: '<string>', value: '<string>'}]}
}
],
description: '<string>',
metadataSchema: {},
isCommon: true
})
};
fetch('https://app.azalt.co/api/v1/activity-definitions/{id}', 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/activity-definitions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'uiCode' => '<string>',
'calcCode' => '<string>',
'inputs' => [
[
'name' => '<string>',
'type' => 'string',
'required' => true,
'exportName' => '<string>',
'example' => '<string>',
'editor' => [
'type' => 'select',
'options' => [
[
'label' => '<string>',
'value' => '<string>'
]
]
]
]
],
'description' => '<string>',
'metadataSchema' => [
],
'isCommon' => true
]),
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/activity-definitions/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"uiCode\": \"<string>\",\n \"calcCode\": \"<string>\",\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"type\": \"string\",\n \"required\": true,\n \"exportName\": \"<string>\",\n \"example\": \"<string>\",\n \"editor\": {\n \"type\": \"select\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"description\": \"<string>\",\n \"metadataSchema\": {},\n \"isCommon\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.azalt.co/api/v1/activity-definitions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"uiCode\": \"<string>\",\n \"calcCode\": \"<string>\",\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"type\": \"string\",\n \"required\": true,\n \"exportName\": \"<string>\",\n \"example\": \"<string>\",\n \"editor\": {\n \"type\": \"select\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"description\": \"<string>\",\n \"metadataSchema\": {},\n \"isCommon\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/activity-definitions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"uiCode\": \"<string>\",\n \"calcCode\": \"<string>\",\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"type\": \"string\",\n \"required\": true,\n \"exportName\": \"<string>\",\n \"example\": \"<string>\",\n \"editor\": {\n \"type\": \"select\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"description\": \"<string>\",\n \"metadataSchema\": {},\n \"isCommon\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"uiCode": "<string>",
"calcCode": "<string>",
"inputs": [
{
"name": "<string>",
"type": "string",
"required": true,
"exportName": "<string>",
"example": "<string>",
"editor": {
"type": "select",
"options": [
{
"label": "<string>",
"value": "<string>"
}
]
}
}
],
"organizationId": "<string>",
"metadataSchema": {},
"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": "NOT_FOUND",
"message": "Not found",
"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.
Path Parameters
Body
application/json
Response
Successful response
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I

