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).

If you plan to make the end-user post the video on this URL, you can configure a callback URL to have your service called once the upload is finished. Simply add a callback_url=<URL> query string parameter to the URL with the encoded URL as value.

curl --header "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 --request POST \
     --form 'file=@/path/to/your/video.mp4' \

Once the POST HTTP request is finished, two scenarios are possible:

  • If you didn't provide a callback URL, the upload server will return a JSON object.
  • If you did provide a callback URL, it will add several query string parameters to your callback URL.

Either way, the only field you'll need is the url one.


  • 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.

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 title, tags and channel are mandatory before you can publish the video. Set those fields, and toggle the published field to true to publish the video.

curl -d 'title=<TITLE>&channel=<CHANNEL>&tags=<TAGS>'<VIDEO_ID>
curl -d 'published=true'<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 --request POST \
     --header "Authorization: Bearer ${ACCESS_TOKEN}" \
     --form 'url=<VIDEO_URL>' \
     --form 'title=Dailymotion cURL upload test' \
     --form 'tags=dailymotion,api,sdk,test' \
     --form 'channel=videogames' \
     --form 'published=true' \

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,
// 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'
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')'/me/videos',
    {'url': url, 'title': 'MyTitle', 'published': 'true', 'channel': 'news'})