Create activity definition
curl --request POST \
--url https://app.azalt.co/api/v1/activity-definitions \
--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"
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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
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', 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",
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([
'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"
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("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/activity-definitions")
.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")
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 \"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": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}ActivityDefinition
Create activity definition
Create a new activity definition template:
Required Parameters:
name: 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: Array of input field definitions
Optional Parameters:
description: Detailed description of the activity typeisCommon: Make available to all organizations (requires elevated permissions)
Activity definitions serve as templates for creating activities with consistent calculation logic and user interfaces.
POST
/
activity-definitions
Create activity definition
curl --request POST \
--url https://app.azalt.co/api/v1/activity-definitions \
--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"
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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
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', 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",
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([
'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"
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("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/activity-definitions")
.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")
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 \"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": "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
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I

