Upload an automation action parameter attachment
curl --request POST \
--url https://clarus-api.com/api/automation_action_parameters/{automation_action_parameter_id}/attachment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'X-Clarus-Subdomain: <api-key>' \
--form file=@example-fileimport requests
url = "https://clarus-api.com/api/automation_action_parameters/{automation_action_parameter_id}/attachment"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'X-Clarus-Subdomain': '<api-key>'}
};
options.body = form;
fetch('https://clarus-api.com/api/automation_action_parameters/{automation_action_parameter_id}/attachment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Automations
Upload an automation action parameter attachment
Upload a file as the attachment for an automation action parameter (e.g. a template body or import file). Replaces any existing attachment.
POST
/
api
/
automation_action_parameters
/
{automation_action_parameter_id}
/
attachment
Upload an automation action parameter attachment
curl --request POST \
--url https://clarus-api.com/api/automation_action_parameters/{automation_action_parameter_id}/attachment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'X-Clarus-Subdomain: <api-key>' \
--form file=@example-fileimport requests
url = "https://clarus-api.com/api/automation_action_parameters/{automation_action_parameter_id}/attachment"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'X-Clarus-Subdomain': '<api-key>'}
};
options.body = form;
fetch('https://clarus-api.com/api/automation_action_parameters/{automation_action_parameter_id}/attachment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Upload Format
This endpoint takes amultipart/form-data request (not JSON:API format) with the file in a file field. The file name and MIME type are taken from the uploaded file.
When sending multipart, don’t set the Content-Type header yourself. Your HTTP client sets multipart/form-data with the boundary when you attach the file.
Example (cURL)
curl -X POST https://clarus-api.com/api/automation_action_parameters/42/attachment \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Clarus-Subdomain: acme-warehouse" \
-F "[email protected];type=text/html"
Deprecated: raw body upload
Sending the raw file as the request body is still accepted but deprecated and will be removed. Until you switch to multipart, keep sending both headers:Content-Type with the file’s MIME type and Content-Disposition: attachment; filename="<name>".Authorizations
Path Parameters
Response
Attachment uploaded successfully

