Upload a design template file
import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/design-template-files/"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('template_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/design-template-files/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/design-template-files/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form template_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form file='@example-file'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"content_type": "<string>",
"signed_url": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": "User not found"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}Design System Templates
Upload a design template file
Upload a reference/example file and attach it to a design template. Requires project-admin permission.
POST
/
projects
/
{project_id}
/
design-template-files
/
Upload a design template file
import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/design-template-files/"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('template_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/design-template-files/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/design-template-files/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form template_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form file='@example-file'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"content_type": "<string>",
"signed_url": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": "User not found"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}Authorizations
BearerAuthTokenAuth
Use Authorization: Bearer
Path Parameters
UUID of the project
Body
multipart/form-data
Response
File uploaded successfully
Soft reference to the matching entry's id in the project's design_templates.
Signed storage (GCS/S3) URL for browser/UI download and for the generation agent to fetch.