> For the complete documentation index, see [llms.txt](https://annotationdocs.telusinternational.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://annotationdocs.telusinternational.com/video-segmentation/create-a-job.md).

# Create a job

## A JOB

<mark style="color:green;">`POST`</mark> `https://api.playment.io/v1/projects/:project_id/jobs`

#### Path Parameters

| Name                                          | Type   | Description                                           |
| --------------------------------------------- | ------ | ----------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark> | string | ID of the project in which you want to create the job |

#### Headers

| Name                                        | Type   | Description                |
| ------------------------------------------- | ------ | -------------------------- |
| x-api-key<mark style="color:red;">\*</mark> | string | API key for authentication |

#### Request Body

| Name                                             | Type   | Description                                                                                                                                                                                                                                                                                                            |
| ------------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| batch\_id<mark style="color:red;">\*</mark>      | string | <p>A batch is a way to organise multiple jobs under one <code>batch\_id</code>.  You can create new batches from the dashboard or by using the batch creation API.<br><br>If <code>batch\_id</code> is left empty or the key is not present, the job is created in the <code>Default batch</code> in your project.</p> |
| data<mark style="color:red;">\*</mark>           | object | The `data` object contains all the information and attachments required to label a job. The `data` object is defined below                                                                                                                                                                                             |
| work\_flow\_id<mark style="color:red;">\*</mark> | string | The ID of the workflow inside which you want to create the job                                                                                                                                                                                                                                                         |
| reference\_id<mark style="color:red;">\*</mark>  | string | The unique identifier of the job                                                                                                                                                                                                                                                                                       |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "data": {
    "job_id": UUID,
    "reference_id": "001",
    "work_flow_id": UUID
  },
  "success": true
}
```

{% endtab %}
{% endtabs %}

## Payload

```json
{
    "reference_id": "001",
    "data": {
        "video_data": {
            "frames": [
                {
                    "frame_id": "frame1",
                    "src": "https://s3.aws.com/600x400/000/fff.jpg&text=Dummy+Image+1"
                },
                {
                    "frame_id": "frame2",
                    "src": "https://s3.aws.com/600x400/000/fff.jpg&text=Dummy+Image+2"
                }
            ]
        },
        "reference_data": {
            "raster": {
                "images": [
                    {
                        "frame_id": "frame1",
                        "data": [
                            {
                                "label": "camera 1",
                                "image_url": "https://s3.aws.com/600x400/000/fff.jpg&text=Dummy+Image+1"
                            },
                            {
                                "label": "camera 2",
                                "image_url": "https://s3.aws.com/600x400/000/fff.jpg&text=Dummy+Image+1"
                            }
                        ]
                    },
                    {
                        "frame_id": "frame2",
                        "data": [
                            {
                                "label": "camera 1",
                                "image_url": "https://s3.aws.com/600x400/000/fff.jpg&text=Dummy+Image+1"
                            },
                            {
                                "label": "camera 2",
                                "image_url": "https://s3.aws.com/600x400/000/fff.jpg&text=Dummy+Image+1"
                            }
                        ]
                    }
                ]
            }
        }
    },
    "work_flow_id": <UUID>,
    "batch_id": <UUID>
}
```

## Payload Definition

| Key                      | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data.video_data.frames` | `array`  | <p>This contains an array of objects, with each object containing two properties: <br><code>frame\_id</code> - Unique identifier for the frame<br><code>src</code> - URL of the image</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `data.reference_data`    | `Object` | <p>The <code>reference\_data</code> object contains an additional list of images that can be used as a reference while annotating the primary image.</p><p>This is an <code>optional</code> key based on your requirement. </p><p></p><p><code>data.reference\_data.raster.images</code> is an array of objects, each containing two properties: <code>frame\_id</code> and <code>data.</code></p><p></p><p><code>frame\_id</code> is a unique identifier for the frame, which will be used to map reference image(s) with the main image.</p><p></p><p>Each element of the <code>data</code> array contains two properties: <code>label</code> and <code>image\_url</code>.</p><p></p><p><code>image\_url</code> - URL of the image</p><p><code>label</code>- Name of the image. </p> |
