curl --request POST \
--url https://api.trycomp.ai/v1/isms/documents/{id}/upload \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fileName": "ISMS Scope Statement.docx",
"fileType": "application/pdf"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileName: 'ISMS Scope Statement.docx', fileType: 'application/pdf'})
};
fetch('https://api.trycomp.ai/v1/isms/documents/{id}/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/isms/documents/{id}/upload"
payload = {
"fileName": "ISMS Scope Statement.docx",
"fileType": "application/pdf"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Upload a file as an ISMS document's content | Comp AI API
Attaches a customer-supplied PDF or DOCX as the document’s content. Does not switch the document to it — call PATCH content-source with ‘uploaded’ for that.
curl --request POST \
--url https://api.trycomp.ai/v1/isms/documents/{id}/upload \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fileName": "ISMS Scope Statement.docx",
"fileType": "application/pdf"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileName: 'ISMS Scope Statement.docx', fileType: 'application/pdf'})
};
fetch('https://api.trycomp.ai/v1/isms/documents/{id}/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/isms/documents/{id}/upload"
payload = {
"fileName": "ISMS Scope Statement.docx",
"fileType": "application/pdf"
}
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
Path Parameters
Body
Original filename. Stored as-is for display and download; only a sanitised copy is used in the storage key.
255"ISMS Scope Statement.docx"
MIME type of the file. Only PDF and DOCX are accepted — an uploaded file is the document itself and is never converted.
application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document "application/pdf"
Base64-encoded file contents, for the web UI and direct callers. AI/MCP clients should upload via /v1/uploads/presign (purpose=document) and pass s3Key instead. Provide exactly one of fileData or s3Key.
"JVBERi0xLjcKJUVPRgo="
Key of a file already uploaded via /v1/uploads/presign (purpose=document). The server reads the bytes from storage. Provide exactly one of fileData or s3Key.
"org_abc123/uploads/document/1735000000000-scope.docx"
Response
File attached; refreshed ISMS document
Was this page helpful?

