# Update a Video By Video ID

> Part of the [SpatialGen API documentation](/index.md). [HTML version of this page](/api/02_update_video/).

Update the properties of your SpatialGen Videos

## API context

-   API requests use `https://spatialgen.com` with the `/api` path prefix, included once.
-   Authenticate requests to SpatialGen API endpoints with the `X-SPATIALGEN-APPKEY` HTTP header.
-   Use a key from the workspace that owns the requested resources. Follow the roles and scopes specified for each endpoint below.
-   Keep `admin` and `upload` keys on a trusted backend. `readonly` keys may be used in client apps for permitted read operations.
-   Presigned upload URLs have their own authorization. Do not send your SpatialGen API key to those URLs.

See the [API key guide](/guides/get-started.md) for roles, key creation, expiration, revocation, and rotation.

* * *

**POST** `/videos/[id]`

Update the properties of a video by its ID. All fields available to be edited are optional, and only the passed fields will be modified. This endpoint will return the full information for the updated video.

Required API Key Role

`admin`

**Update Request Parameters**

-   `name`: (optional) string
-   `description`: (optional) string
-   `layout`: (optional) “2D”, “MVHEVC”, “SBS”, “TB”, “AIV”
-   `perspective`: (optional) “Regular”, “180”, “360”
-   `isPublished`: (optional) boolean

### Example request to update a video’s information by ID

updateVideoInfo.js

```js
const updatedVideoData = {
    name: 'new video name',
    description: 'new video description',
    layout: '2D',
    perspective: 'Regular',
    isPublished: true
}

fetch('https://spatialgen.com/api/videos/<yourvideoid>', {
    method: 'POST',
    headers: {
        'X-SPATIALGEN-APPKEY': apiKey,
    },
    body: JSON.stringify(updatedVideoData)
})
```

### Example Response

response.json

```json
{

    "createdAt": string,            // Date in string format
    "description": string,          // Description of the video
    "fileFormat3D": string,         // Format of the 3D file
    "folderName": string,           // Name of the folder
    "id": number,                   // ID of the video
    "is3D": boolean,                // If the video is in 3D
    "isStreaming": boolean,         // If the video is streaming
    "perspective": number,          // Perspective
    "thumbnailUrl": string,         // Thumbnail URL
    "videoLength": number,          // Length of the video in seconds
    "videoHeight": number,          // Height of the video
    "videoName": string             // Name of the video

}
```
