curl --request POST \
--url https://api.trycomp.ai/v1/evidence-forms/uploads \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fileName": "network_diagram.png",
"fileType": "image/png"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileName: 'network_diagram.png', fileType: 'image/png'})
};
fetch('https://api.trycomp.ai/v1/evidence-forms/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/evidence-forms/uploads"
payload = {
"fileName": "network_diagram.png",
"fileType": "image/png"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Upload evidence form file | Comp AI API
Upload one file for a form file field and get back the object to send under that field key. Provide exactly one of.
curl --request POST \
--url https://api.trycomp.ai/v1/evidence-forms/uploads \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fileName": "network_diagram.png",
"fileType": "image/png"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileName: 'network_diagram.png', fileType: 'image/png'})
};
fetch('https://api.trycomp.ai/v1/evidence-forms/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/evidence-forms/uploads"
payload = {
"fileName": "network_diagram.png",
"fileType": "image/png"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Authorizations
API key for authentication
Headers
Organization ID (required for session auth, optional for API key auth)
Body
A file for one file field of a form. Provide exactly one of fileData or s3Key. Returns the {fileName, fileKey, downloadUrl} object to put under that field key when submitting.
Form the file belongs to.
board-meeting, it-leadership-meeting, risk-committee-meeting, meeting, access-request, whistleblower-report, penetration-test, rbac-matrix, infrastructure-inventory, employee-performance-evaluation, network-diagram, tabletop-exercise, account-types Original file name, stored for display and download.
"network_diagram.png"
MIME type of the file.
"image/png"
Base64-encoded file contents, for the web UI and direct callers. AI/MCP clients should upload via /v1/uploads/presign (purpose=evidence) and pass s3Key instead.
"iVBORw0KGgo="
Key of a file already uploaded via /v1/uploads/presign (purpose=evidence). The server reads the bytes from storage, so no base64 travels through the client.
"org_abc123/uploads/evidence/1735000000000-network_diagram.png"
Response
Was this page helpful?

