Skip to main content
POST
/
v1
/
workspace
/
website
/
{website_id}
/
media
/
upload
Upload a media file
curl --request POST \
  --url https://apidev.lindo.ai/v1/workspace/website/{website_id}/media/upload \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "file_base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
  "file_name": "hero-image.jpg",
  "media_type": "images",
  "content_type": "image/jpeg"
}
'
{
  "success": true,
  "result": {
    "url": "https://cdn.ln-cdn.com/c/website_abc123/images/hero-image.jpg",
    "file_name": "hero-image.jpg",
    "media_type": "images"
  }
}

Authorizations

Authorization
string
header
required

Enter your API key (starts with lindo_sk_)

Path Parameters

website_id
string
required

Unique identifier of the website

Example:

"ws_abc123"

Body

application/json
file_base64
string
required

Base64 encoded file data (with or without data URL prefix)

Example:

"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="

file_name
string
required

Name of the file including extension

Example:

"hero-image.jpg"

media_type
enum<string>
default:images

Type of media being uploaded

Available options:
images,
videos,
documents,
fonts
Example:

"images"

content_type
string

MIME type of the file

Example:

"image/jpeg"

Response

File uploaded successfully

success
enum<boolean>
required

Indicates the operation was successful

Available options:
true,
false
Example:

true

result
object
required