---
title: "Update a file segment"
method: PUT
path: "/files/{file_id}/segments/{segment_id}"
tags: ["Files", "File Segments"]
---

# Update a file segment

`PUT /files/{file_id}/segments/{segment_id}`

## Request

- Base URL: `https://api.cloudglue.dev/v1`
- URL: `https://api.cloudglue.dev/v1/files/{file_id}/segments/{segment_id}`
- Auth: HTTP bearer

Update a file segment

## Path parameters

- `file_id` string, uuid, required
- `segment_id` string, uuid, required

## Request body

- object
  - `metadata` object: The user defined metadata for the segment. Nullable

## Response `200`

File segment updated successfully

- FileSegment
  - `id` string, uuid, required: The ID of the segment
  - `file_id` string, uuid, required: The ID of the file
  - `start_time` number, required: The start time of the segment in seconds
  - `end_time` number, required: The end time of the segment in seconds
  - `thumbnail_url` string, required: The URL of the thumbnail for the segment (if available)
  - `metadata` object: The user defined metadata for the segment
  - `segmentation_id` string, uuid: The ID of the segmentation job it belongs to

## Other responses

- `400`: Invalid request or malformed file segment update parameters
- `404`: File segment not found
- `500`: An unexpected error occurred on the server

## Changes

- **2026-10-30** `23d3f240819f`: 3 info
  - added the optional property `code` to the response with the `400` status
  - added the optional property `code` to the response with the `404` status
  - added the optional property `code` to the response with the `500` status
- **2025-12-12** `89641a9d6eb2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cloudglue/apis/cloudglue-api/changes/files/:file_id/segments/:segment_id/put.md)

---

[API](https://skmtc.dev/cloudglue/apis/cloudglue-api.md) - [All operations](https://skmtc.dev/cloudglue/apis/cloudglue-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cloudglue/apis/cloudglue-api/revisions/23d3f240819f?raw)
