Upload a workspace file
curl --request POST \
--url https://developer.creao.ai/v1/workspaces/{workspace_id}/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'import fs from 'fs';
const formData = new FormData();
formData.append('file', await new Response(fs.createReadStream('example-file')).blob());
const url = 'https://developer.creao.ai/v1/workspaces/{workspace_id}/files';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}, body: formData};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://developer.creao.ai/v1/workspaces/{workspace_id}/files"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"sha256": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": "UNSUPPORTED_FILE_TYPE"
}{
"error": "AUTHENTICATION_REQUIRED"
}{
"error": "<string>",
"message": "<string>",
"available": 123,
"required": 123,
"retryAfterSeconds": 123
}{
"error": "FILE_TOO_LARGE"
}{
"error": "RATE_LIMITED"
}Workspace Files
Upload a workspace file
Upload a file to a personal workspace.
POST
/
v1
/
workspaces
/
{workspace_id}
/
files
Upload a workspace file
curl --request POST \
--url https://developer.creao.ai/v1/workspaces/{workspace_id}/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'import fs from 'fs';
const formData = new FormData();
formData.append('file', await new Response(fs.createReadStream('example-file')).blob());
const url = 'https://developer.creao.ai/v1/workspaces/{workspace_id}/files';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}, body: formData};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://developer.creao.ai/v1/workspaces/{workspace_id}/files"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"sha256": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": "UNSUPPORTED_FILE_TYPE"
}{
"error": "AUTHENTICATION_REQUIRED"
}{
"error": "<string>",
"message": "<string>",
"available": 123,
"required": 123,
"retryAfterSeconds": 123
}{
"error": "FILE_TOO_LARGE"
}{
"error": "RATE_LIMITED"
}Authorizations
bearerAuthapiKeyQuery
Account API key from Developer Console. Keys start with cr_sk_.
Path Parameters
Body
multipart/form-data