Open Layo
Browse

Uploads

Upload a file

On this page
POST/v1/uploads

NeedsGenerateNo chargeMCP 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

  • Authorizationstringrequired

    Bearer then the key, with the generate scope. A Layo API key, from layo.co/api-keys.

Body

  • mimeTypeenum<string>required

    The file's format: image/jpeg, image/png or image/webp for a photo, video/mp4 for a clip, audio/wav, audio/mpeg (MP3) or audio/mp4 (M4A) for a recording.

    Available options: image/jpegimage/pngimage/webpvideo/mp4audio/wavaudio/mpegaudio/mp4

  • byteSizeintegerrequired

    The 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/json

OK

  • idstring<uuid>required

    The upload's id: complete it, then pass it where its kind goes (a photo in photoIds or imageIds, or any file as an item's id in a video's medias).
  • uploadobjectrequired

    Show child attributes
    • urlstringrequired

      Send the file's bytes here with an HTTP PUT, before expiresIn seconds.
    • headersobjectrequired

      Send exactly these headers with the PUT, plus a Content-Length equal to byteSize: the link is signed for that length, so a chunked upload is refused.
    • expiresInintegerrequired

      Seconds the link lasts from now.

      Range: x >= -9007199254740991