Table of content

Video upload

Uploading a video on your Dailymotion’s account can be done programmatically using our API. Below are described the different steps to follow in order to successfully upload content.

Note: a quota applies to video upload, please refer to the rate limit section.

Upload and publish videos

1. Authenticate the user

As uploading a video is an action that impacts one’s account, you need to be authenticated with the account on which the video is going to belong to and request the manage_videos scope. See the authentication guide for more information on how to authenticate the user and request an access token for our API calls. You will have to pass the returned access token to each of the following calls.

2. Get an upload URL

Perform a GET request to to retrieve an upload URL. Don’t forget to provide your access token to the request. The upload_url will be returned along with the progress_url (the endpoint is described in more details at /file/upload).

curl -H "Authorization: Bearer ${ACCESS_TOKEN}" \

3. Upload the video

The video can actually be uploaded to the upload_url retrieved above by making a POST HTTP request using the multipart/form-data content type. The video data has to be contained in a file field:

curl -X POST \
     -F 'file=@/path/to/your/video.mp4' \

Once the POST HTTP request is finished, the upload server will return a JSON object containing several fields, you only need the url one for the next steps.


  • The upload request requires a minimum version of TLS 1.2 protocol
  • If the upload POST fails, you need to reacquire a new upload_url.
  • The upload url does not have an expiry term for uploading, although some activity has to be “seen” on started uploads at least every 4 hours.

4. Create the video

With the video URL you just retrieved (url field in the returned response), you can perform a POST HTTP request to, with a url=<URL> field. This API call will create the video on your account. The identifier of the newly created video will be returned in the response, in the field.

curl -X POST -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -d "url=<URL>" \

If you are an MCN with specific permissions set by your content manager, you can set your content provider id on videos.

curl -X POST -H "Authorization: Bearer ${ACCESS_TOKEN}" \
     -d "url=<URL>" \
     -d "content_provider=YOUR_CONTENT_PROVIDER_NAME" \
     -d "content_provider_id=CONTENT_PROVIDER_ID" \

5. Publish the video

Once the video is created, it doesn’t mean it is published. You have to perform another POST request on<VIDEO_ID> URL along with the fields you want to modify. Some fields like titletagschannel and is_created_for_kids are mandatory before you can publish the video. Set those fields, and toggle the published field to true to publish the video.

curl -X POST -H "Authorization: Bearer ${ACCESS_TOKEN}" \
     -d 'published=true' \
     -d 'title=<TITLE>' \
     -d 'channel=<CHANNEL>' \
     -d 'tags=<TAGS>' \
     -d "is_created_for_kids=<true|false>" \<VIDEO_ID>



  • if your video has an external url, you don’t need to upload it to our servers, you can directly use this url as the video source. Skip steps 2 and 3, and directly post the video using the url field (set to your video source url).
  • you can perform steps 4 and 5 in a single HTTP request by passing all the extra information in the initial POST request as follows.
curl -X POST \
     -H "Authorization: Bearer ${ACCESS_TOKEN}" \
     -d 'url=<VIDEO_URL>' \
     -d 'title=Dailymotion cURL upload test' \
     -d 'tags=dailymotion,api,sdk,test' \
     -d 'channel=videogames' \
     -d 'published=true' \
     -d 'is_created_for_kids=false' \

Resume function

We provide a resume function for uploading videos. In this case, you have to replace /upload by /rupload in the upload url. The protocol is described in this NGinx module page.

Code samples

$url = $api->uploadFile('/path/to/your/video.mp4');
        'url'       => $url,
        'title'     => 'Dailymotion PHP SDK upload test',
        'tags'      => 'dailymotion,api,sdk,test',
        'channel'   => 'videogames',
        'published' => true,
        'is_created_for_kids' => false,
// get an upload url
DM.api('/file/upload', function (response)
    //upload the video and get the url
    var xhr =  new XMLHttpRequest();'POST', response.upload_url, true);
    var formData = new FormData(document.getElementById("fileDomId"));

    // check when video is uploaded
    xhr.onreadystatechange = function ()
        if (xhr.readyState == 4)
            // create the video object and publish the video
                    url: JSON.parse(xhr.response).url,
                    title: 'Dailymotion PHP SDK upload test',
                    tags: 'dailymotion,api,sdk,test',
                    channel: 'videogames',
                    published: 'true',
                    is_created_for_kids: 'false'
d = dailymotion.Dailymotion()
d.set_grant_type('password', api_key=API_KEY, api_secret=API_SECRET,
    scope=['manage_videos'], info={'username': USERNAME, 'password': PASSWORD})
url = d.upload('./video.mp4')
        "url": url,
        "title": "MyTitle",
        "published": "true",
        "channel": "news",
        "is_created_for_kids": "false",