Create forms from CSV
curl --request POST \
--url https://app.azalt.co/api/v1/forms/import-csv \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"forms": [
{
"name": "<string>",
"siteIds": [
"<string>"
],
"years": [
123
],
"elements": [
{
"key": "<string>",
"label": "<string>",
"optionValues": [
"<string>"
],
"optionLabels": [
"<string>"
],
"datasetItems": [
"<string>"
],
"description": "<string>",
"placeholder": "<string>",
"unit": "<string>",
"unitId": "<string>",
"required": true,
"metadata": {}
}
],
"tags": [
"<string>"
]
}
]
}
'import requests
url = "https://app.azalt.co/api/v1/forms/import-csv"
payload = { "forms": [
{
"name": "<string>",
"siteIds": ["<string>"],
"years": [123],
"elements": [
{
"key": "<string>",
"label": "<string>",
"optionValues": ["<string>"],
"optionLabels": ["<string>"],
"datasetItems": ["<string>"],
"description": "<string>",
"placeholder": "<string>",
"unit": "<string>",
"unitId": "<string>",
"required": True,
"metadata": {}
}
],
"tags": ["<string>"]
}
] }
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({
forms: [
{
name: '<string>',
siteIds: ['<string>'],
years: [123],
elements: [
{
key: '<string>',
label: '<string>',
optionValues: ['<string>'],
optionLabels: ['<string>'],
datasetItems: ['<string>'],
description: '<string>',
placeholder: '<string>',
unit: '<string>',
unitId: '<string>',
required: true,
metadata: {}
}
],
tags: ['<string>']
}
]
})
};
fetch('https://app.azalt.co/api/v1/forms/import-csv', 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/forms/import-csv",
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([
'forms' => [
[
'name' => '<string>',
'siteIds' => [
'<string>'
],
'years' => [
123
],
'elements' => [
[
'key' => '<string>',
'label' => '<string>',
'optionValues' => [
'<string>'
],
'optionLabels' => [
'<string>'
],
'datasetItems' => [
'<string>'
],
'description' => '<string>',
'placeholder' => '<string>',
'unit' => '<string>',
'unitId' => '<string>',
'required' => true,
'metadata' => [
]
]
],
'tags' => [
'<string>'
]
]
]
]),
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/forms/import-csv"
payload := strings.NewReader("{\n \"forms\": [\n {\n \"name\": \"<string>\",\n \"siteIds\": [\n \"<string>\"\n ],\n \"years\": [\n 123\n ],\n \"elements\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"optionValues\": [\n \"<string>\"\n ],\n \"optionLabels\": [\n \"<string>\"\n ],\n \"datasetItems\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"unit\": \"<string>\",\n \"unitId\": \"<string>\",\n \"required\": true,\n \"metadata\": {}\n }\n ],\n \"tags\": [\n \"<string>\"\n ]\n }\n ]\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/forms/import-csv")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"forms\": [\n {\n \"name\": \"<string>\",\n \"siteIds\": [\n \"<string>\"\n ],\n \"years\": [\n 123\n ],\n \"elements\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"optionValues\": [\n \"<string>\"\n ],\n \"optionLabels\": [\n \"<string>\"\n ],\n \"datasetItems\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"unit\": \"<string>\",\n \"unitId\": \"<string>\",\n \"required\": true,\n \"metadata\": {}\n }\n ],\n \"tags\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/forms/import-csv")
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 \"forms\": [\n {\n \"name\": \"<string>\",\n \"siteIds\": [\n \"<string>\"\n ],\n \"years\": [\n 123\n ],\n \"elements\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"optionValues\": [\n \"<string>\"\n ],\n \"optionLabels\": [\n \"<string>\"\n ],\n \"datasetItems\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"unit\": \"<string>\",\n \"unitId\": \"<string>\",\n \"required\": true,\n \"metadata\": {}\n }\n ],\n \"tags\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"name": "<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": []
}Form
Create forms from CSV
Bulk create multiple forms from a structured CSV template, ideal for large-scale deployments. Requires site manager permissions.
CSV Format Requirements:
- Form Definition Columns: name, description, instructions
- Element Columns: element_type, element_label, element_key, element_required, element_options
- Deployment Columns: site_ids, year, period_type
- Configuration Columns: public_access, password_protected, metadata
Supported Element Types: All 11 form element types supported by the platform
Batch Processing Features:
- Multiple forms created in a single operation
- Automatic element key generation for consistency
- Site deployment across multiple locations
- Validation and error reporting for each row
Use Cases:
- Deploying standardized forms across multiple sites
- Migrating forms from external systems
- Creating template-based form libraries
- Rapid deployment for compliance requirements
- Scaling data collection to hundreds of locations
Error Handling:
- Row-by-row validation with detailed error messages
- Partial success handling (some forms created, others failed)
- Preview mode to validate before actual creation
- Rollback options for failed batch operations
POST
/
forms
/
import-csv
Create forms from CSV
curl --request POST \
--url https://app.azalt.co/api/v1/forms/import-csv \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"forms": [
{
"name": "<string>",
"siteIds": [
"<string>"
],
"years": [
123
],
"elements": [
{
"key": "<string>",
"label": "<string>",
"optionValues": [
"<string>"
],
"optionLabels": [
"<string>"
],
"datasetItems": [
"<string>"
],
"description": "<string>",
"placeholder": "<string>",
"unit": "<string>",
"unitId": "<string>",
"required": true,
"metadata": {}
}
],
"tags": [
"<string>"
]
}
]
}
'import requests
url = "https://app.azalt.co/api/v1/forms/import-csv"
payload = { "forms": [
{
"name": "<string>",
"siteIds": ["<string>"],
"years": [123],
"elements": [
{
"key": "<string>",
"label": "<string>",
"optionValues": ["<string>"],
"optionLabels": ["<string>"],
"datasetItems": ["<string>"],
"description": "<string>",
"placeholder": "<string>",
"unit": "<string>",
"unitId": "<string>",
"required": True,
"metadata": {}
}
],
"tags": ["<string>"]
}
] }
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({
forms: [
{
name: '<string>',
siteIds: ['<string>'],
years: [123],
elements: [
{
key: '<string>',
label: '<string>',
optionValues: ['<string>'],
optionLabels: ['<string>'],
datasetItems: ['<string>'],
description: '<string>',
placeholder: '<string>',
unit: '<string>',
unitId: '<string>',
required: true,
metadata: {}
}
],
tags: ['<string>']
}
]
})
};
fetch('https://app.azalt.co/api/v1/forms/import-csv', 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/forms/import-csv",
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([
'forms' => [
[
'name' => '<string>',
'siteIds' => [
'<string>'
],
'years' => [
123
],
'elements' => [
[
'key' => '<string>',
'label' => '<string>',
'optionValues' => [
'<string>'
],
'optionLabels' => [
'<string>'
],
'datasetItems' => [
'<string>'
],
'description' => '<string>',
'placeholder' => '<string>',
'unit' => '<string>',
'unitId' => '<string>',
'required' => true,
'metadata' => [
]
]
],
'tags' => [
'<string>'
]
]
]
]),
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/forms/import-csv"
payload := strings.NewReader("{\n \"forms\": [\n {\n \"name\": \"<string>\",\n \"siteIds\": [\n \"<string>\"\n ],\n \"years\": [\n 123\n ],\n \"elements\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"optionValues\": [\n \"<string>\"\n ],\n \"optionLabels\": [\n \"<string>\"\n ],\n \"datasetItems\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"unit\": \"<string>\",\n \"unitId\": \"<string>\",\n \"required\": true,\n \"metadata\": {}\n }\n ],\n \"tags\": [\n \"<string>\"\n ]\n }\n ]\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/forms/import-csv")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"forms\": [\n {\n \"name\": \"<string>\",\n \"siteIds\": [\n \"<string>\"\n ],\n \"years\": [\n 123\n ],\n \"elements\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"optionValues\": [\n \"<string>\"\n ],\n \"optionLabels\": [\n \"<string>\"\n ],\n \"datasetItems\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"unit\": \"<string>\",\n \"unitId\": \"<string>\",\n \"required\": true,\n \"metadata\": {}\n }\n ],\n \"tags\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/forms/import-csv")
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 \"forms\": [\n {\n \"name\": \"<string>\",\n \"siteIds\": [\n \"<string>\"\n ],\n \"years\": [\n 123\n ],\n \"elements\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"optionValues\": [\n \"<string>\"\n ],\n \"optionLabels\": [\n \"<string>\"\n ],\n \"datasetItems\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"unit\": \"<string>\",\n \"unitId\": \"<string>\",\n \"required\": true,\n \"metadata\": {}\n }\n ],\n \"tags\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"name": "<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": []
}⌘I

