---
title: "Get TUS' parameters for direct upload"
method: GET
path: "/streaming/videos/{video_id}/upload"
tags: ["Videos"]
---

# Get TUS' parameters for direct upload

`GET /streaming/videos/{video_id}/upload`

Use this method to get TUS' session parameters: hostname of the server to upload, secure token.

The general sequence of actions for a direct upload of a video is as follows:
- Create video entity via POST method ["Create video"](/docs/api-reference/streaming/videos/create-video)
- Get TUS' session parameters (you are here now)
- Upload file via TUS client, choose your implementation on [tus.io](https://tus.io/implementations) 

Final endpoint for uploading is constructed using the following template: "https://{hostname}/upload/". Also you have to provide token, `client_id`, `video_id` as metadata too. 

A short javascript example is shown below, based on tus-js-client. Variable "data" below is the result of this API request. Please, note that we support 2.x version only of tus-js-client.

```
    uploads[data.video.id] = new tus.Upload(file, {
      endpoint: `https://${data.servers[0].hostname}/upload/`,
      metadata: {
        filename: data.video.name,
        token: data.token,
        video_id: data.video.id,
        client_id: data.video.client_id
      },
      onSuccess: function() {
        ...
      }
    }
    uploads[data.video.id].start();
  ```

## Path parameters

- `video_id` integer, required

## Response `200`

Successful

- GetUrlAndTokenToUploadVideo
  - `servers` object[] — An array which contains information about servers you can upload a video to. **Server;** type — object. --- Server has the following fields: - **id;** type — integer Server ID - **hostname;** type — string Server hostname
  - `token` string — Token
  - `video` object — Contains information about the created video. See the full description in the Get video request

---

[API](https://skmtc.dev/g-core/apis/gcore-openapi.md) · [All operations](https://skmtc.dev/g-core/apis/gcore-openapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/g-core/gcore-openapi/revisions/09e652815095/schema)
