# Quickstart

Follow the next steps to generate your first video using Colossyan's API.

1. Grab your token as described in the [editor](https://docs.colossyan.com/basics/editor "mention") page.
2. Send your first request

```javascript
const token = "<paste-your-token-here>";
const api = "https://app.colossyan.com/api/v1";

const job = {
  videoCreative: {
    settings: {
      name: "My first video",
      videoSize: {
        width: 1920,
        height: 1080
      }
    },
    scenes: [
      {
        tracks: [
          {
            type: "actor",
            position: { x: 420, y: 0 },
            size: { width: 1080, height: 1080 },
            actor: "karen",
            text: "This is my first video generated with Colossyan! Amazing!",
            speakerId: "aquXcfLbkxpW4BBI5qKm"
          }
        ]
      }
    ]
  }
};

const response = await fetch(`${api}/video-generation-jobs`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${token}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(job),
});

const result = await response.json();
console.log(result); // { id, videoId }
```

{% hint style="info" %}
In the snippet above, we post a new *video generation job*. \
\
Let's walk through what you should expect the generated video to look like.

* The videos name will be *My first video*.
* It will have a width of *1920px* and a height of *1080px.*
* It will consist of a single scene
* We added an *actor track* to it, with the actor being *karen*.
  * We configured the actor to say *This is my first video generated with Colossyan! Amazing!* using the voice of *aquXcfLbkxpW4BBI5qKm*.
  * The actor is set to be *1080px \* 1080px* in size and it's top-left will be in the *(420;0)* coordinates, counting from the top-left, resulting in the actor being in the middle of the video.
    {% endhint %}

4. If you successfully sent the request, you should have received two things in return.&#x20;
   1. An `id` that you can use to delete or request status updates on the job
   2. A `videoId` that you'll be able to query the generated video with once it's ready.
5. Navigate to the workspace where you have created your API key. You should see the video generate. Once it's ready, it should look exactly like this

{% embed url="<https://drive.google.com/file/d/1ib4PsExwEkD6DjqKozSJXPc62maMSCe5/view?usp=sharing>" %}

6. Congratulations! 🎉 You just generated your first video using our API!

{% hint style="info" %}
Generating the payloads for complex videos can get very complicated, very quickly (multiple scenes, and images and videos etc...). To get ahead of this, we provide a way to export the request body from the Colossyan video editor.

\
This way you can use our UI to craft your video templates easily, and then customize them at the last mile.&#x20;
{% endhint %}
