Upload a media asset
curl --request POST \
--url https://beta.creatorcore.co/api/v2/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'X-CreatorCore-Organization-Id: <api-key>' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'X-CreatorCore-Organization-Id': '<api-key>'}
};
options.body = form;
fetch('https://beta.creatorcore.co/api/v2/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://beta.creatorcore.co/api/v2/media"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"Authorization": "Bearer <token>",
"X-CreatorCore-Organization-Id": "<api-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"success": true,
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purpose": "branding_logo",
"visibility": "org",
"url": "<string>",
"publicUrl": "<string>",
"fallbackUrl": "<string>",
"contentType": "<string>",
"sizeBytes": 123,
"originalFilename": "<string>",
"sha256": "<string>",
"cacheControl": "<string>",
"context": {},
"createdAt": "<string>",
"updatedAt": "<string>"
}
}{
"success": false,
"error": "<string>",
"code": "file_too_large",
"maxBytes": 4000000,
"directUpload": "/api/v2/media/uploads"
}Media
Upload a media asset
Uploads a file as multipart form data. Set permission or visibility to org (members only) or public (anonymous file access; metadata remains org-only). Returns a serve URL at /api/v2/media/{id}. For files up to 4MB (4,000,000 bytes); a bigger file gets 413 file_too_large. For anything larger use a direct upload: POST /api/v2/media/uploads, PUT the bytes to the returned URL, then POST /api/v2/media/uploads//complete.
POST
/
api
/
v2
/
media
Upload a media asset
curl --request POST \
--url https://beta.creatorcore.co/api/v2/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'X-CreatorCore-Organization-Id: <api-key>' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'X-CreatorCore-Organization-Id': '<api-key>'}
};
options.body = form;
fetch('https://beta.creatorcore.co/api/v2/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://beta.creatorcore.co/api/v2/media"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"Authorization": "Bearer <token>",
"X-CreatorCore-Organization-Id": "<api-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"success": true,
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purpose": "branding_logo",
"visibility": "org",
"url": "<string>",
"publicUrl": "<string>",
"fallbackUrl": "<string>",
"contentType": "<string>",
"sizeBytes": 123,
"originalFilename": "<string>",
"sha256": "<string>",
"cacheControl": "<string>",
"context": {},
"createdAt": "<string>",
"updatedAt": "<string>"
}
}{
"success": false,
"error": "<string>",
"code": "file_too_large",
"maxBytes": 4000000,
"directUpload": "/api/v2/media/uploads"
}Authorizations
Body
multipart/form-data
Was this page helpful?