Uploads
Upload a file
On this page
POST
/v1/uploadsNeedsGenerateMCP toolcreate_upload
Start uploading a JPEG, PNG or WebP photo (up to 10 MB: a new influencer's photo, a picture to work from, or a video's start or end frame), an MP4 clip (up to 50 MB, at least 1 second long) or a WAV, MP3 or M4A recording (up to 10 MB), for reference media. Send the bytes to upload.url with a PUT and the headers given, then complete it. It costs nothing.
Authorization
AuthorizationstringrequiredBearerthen the key, with thegeneratescope. A Layo API key, from layo.co/api-keys.
Body
mimeTypeenum<string>requiredThe file's format:image/jpeg,image/pngorimage/webpfor a photo,video/mp4for a clip,audio/wav,audio/mpeg(MP3) oraudio/mp4(M4A) for a recording.Available options:
image/jpegimage/pngimage/webpvideo/mp4audio/wavaudio/mpegaudio/mp4byteSizeintegerrequiredThe file's exact size in bytes: up to 10 MB for a photo, 50 MB for a clip, 10 MB for a recording.Range:
0 < x <= 52428800
Response
application/jsonOK
idstring<uuid>requiredThe upload's id: complete it, then pass it where its kind goes (a photo inphotoIdsorimageIds, or any file as an item'sidin a video'smedias).uploadobjectrequiredShow child attributesHide child attributes
urlstringrequiredSend the file's bytes here with an HTTP PUT, beforeexpiresInseconds.headersobjectrequiredSend exactly these headers with the PUT, plus a Content-Length equal tobyteSize: the link is signed for that length, so a chunked upload is refused.expiresInintegerrequiredSeconds the link lasts from now.Range:
x >= -9007199254740991