Get files by entity
curl --request GET \
--url https://app.azalt.co/api/v1/media/by-entity \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.azalt.co/api/v1/media/by-entity"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.azalt.co/api/v1/media/by-entity', 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/media/by-entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.azalt.co/api/v1/media/by-entity"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.azalt.co/api/v1/media/by-entity")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/media/by-entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"relatedModelType": "<string>",
"relatedModelId": "<string>",
"fieldName": "<string>",
"fileName": "<string>",
"extension": "<string>",
"fileSize": 123,
"organizationRefId": "<string>",
"userRefId": "<string>",
"formSubmissionRefId": "<string>",
"reportTemplateRefId": "<string>",
"formElementSubmissionRefId": "<string>",
"isDeleted": true,
"fileKey": "<string>",
"contentType": "<string>",
"signedUrl": "<string>",
"expiresAt": "<string>",
"complianceCheckRefId": "<string>",
"activityRefId": "<string>",
"createdAt": "<unknown>",
"updatedAt": "<unknown>"
}
]{
"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": []
}File
Get files by entity
Get all files attached to a specific item (like a form submission or organization), with secure download links.
Required parameters:
entityType: What type of item (e.g., “form-submission”, “organization”, “dashboard”)entityId: The ID of that specific item
What you get back:
- File details (name, size, type, when uploaded)
- Secure download URLs that expire after a time limit
- Info about who uploaded each file and when
- Files organized by what they’re attached to
Common uses:
- Show documents attached to form submissions
- Display supporting files for environmental calculations
- List organization assets and resources
- Get evidence files for compliance reports
Security features:
- Download links expire for security
- Only authorized users in your organization can access files
- Files are kept separate by type to prevent mix-ups
- All file access is logged for auditing
GET
/
media
/
by-entity
Get files by entity
curl --request GET \
--url https://app.azalt.co/api/v1/media/by-entity \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.azalt.co/api/v1/media/by-entity"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.azalt.co/api/v1/media/by-entity', 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/media/by-entity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.azalt.co/api/v1/media/by-entity"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.azalt.co/api/v1/media/by-entity")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/media/by-entity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"relatedModelType": "<string>",
"relatedModelId": "<string>",
"fieldName": "<string>",
"fileName": "<string>",
"extension": "<string>",
"fileSize": 123,
"organizationRefId": "<string>",
"userRefId": "<string>",
"formSubmissionRefId": "<string>",
"reportTemplateRefId": "<string>",
"formElementSubmissionRefId": "<string>",
"isDeleted": true,
"fileKey": "<string>",
"contentType": "<string>",
"signedUrl": "<string>",
"expiresAt": "<string>",
"complianceCheckRefId": "<string>",
"activityRefId": "<string>",
"createdAt": "<unknown>",
"updatedAt": "<unknown>"
}
]{
"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.
Query Parameters
Available options:
Organization, User, FormSubmission, FormElementSubmission, ReportTemplate, ComplianceCheck, Activity, FormElement, FormSite, ReportSection, Report, ReportSectionTemplateExample, AiConversation Response
Successful response

