---
title: "Delete Flow Segment"
method: DELETE
path: "/flows/{flowId}/segments"
tags: ["FlowSegments"]
---

# Delete Flow Segment

`DELETE /flows/{flowId}/segments`

Deletes the flow segments. If the deletion takes too long then this request will return 202 Accepted and the `Location` header will point to a
Flow Delete Request to monitor deletion progress

## Query parameters

- `timerange` string — A timerange of timestamps. It is represented using one or two timestamps with inclusivity and exclusivity markers. E.g. * `[0:0_10:0)` represents 10 seconds of media starting at timestamp `0:0` and ending before `10:0`. * `(5:0_` represents a timerange starting after `5:0` and to eternity. * `[1694429247:0_1694429248:0)` is a 1 second TAI timerange starting at 2023-09-11T10:46:50.0Z UTC. * `[1694429247:0]` is an instantaneous TAI timerange at 2023-09-11T10:46:50.0Z UTC. This is equivalent to `[1694429247:0_1694429247:0]`. The short syntax is preferred due to ease of identification as instantaneous. Instantaneous TimeRanges cannot use exclusive markers (i.e. `(` or `)`). * A `[` or `]` indicates that bound is inclusive, and a `(` or `)` indicates that bound is exclusive. Details of the format can be found in the [Timestamps in TAMS](https://github.com/bbc/tams/blob/main/docs/appnotes/0008-timestamps-in-TAMS.md) application note.
- `object_id` string

## Response `202`

This request has taken longer than the configured timeout, and will continue asynchronously

- Deletionrequest — Describes an ongoing deletion request
  - `id` string, required — Deletion Request ID
  - `flow_id` string, required — ID of the flow to which the deletion request relates
  - `timerange_to_delete` string, required — A timerange of timestamps. It is represented using one or two timestamps with inclusivity and exclusivity markers. E.g. * `[0:0_10:0)` represents 10 seconds of media starting at timestamp `0:0` and ending before `10:0`. * `(5:0_` represents a timerange starting after `5:0` and to eternity. * `[1694429247:0_1694429248:0)` is a 1 second TAI timerange starting at 2023-09-11T10:46:50.0Z UTC. * `[1694429247:0]` is an instantaneous TAI timerange at 2023-09-11T10:46:50.0Z UTC. This is equivalent to `[1694429247:0_1694429247:0]`. The short syntax is preferred due to ease of identification as instantaneous. Instantaneous TimeRanges cannot use exclusive markers (i.e. `(` or `)`). * A `[` or `]` indicates that bound is inclusive, and a `(` or `)` indicates that bound is exclusive. Details of the format can be found in the [Timestamps in TAMS](https://github.com/bbc/tams/blob/main/docs/appnotes/0008-timestamps-in-TAMS.md) application note.
  - `timerange_remaining` string — A timerange of timestamps. It is represented using one or two timestamps with inclusivity and exclusivity markers. E.g. * `[0:0_10:0)` represents 10 seconds of media starting at timestamp `0:0` and ending before `10:0`. * `(5:0_` represents a timerange starting after `5:0` and to eternity. * `[1694429247:0_1694429248:0)` is a 1 second TAI timerange starting at 2023-09-11T10:46:50.0Z UTC. * `[1694429247:0]` is an instantaneous TAI timerange at 2023-09-11T10:46:50.0Z UTC. This is equivalent to `[1694429247:0_1694429247:0]`. The short syntax is preferred due to ease of identification as instantaneous. Instantaneous TimeRanges cannot use exclusive markers (i.e. `(` or `)`). * A `[` or `]` indicates that bound is inclusive, and a `(` or `)` indicates that bound is exclusive. Details of the format can be found in the [Timestamps in TAMS](https://github.com/bbc/tams/blob/main/docs/appnotes/0008-timestamps-in-TAMS.md) application note.
  - `delete_flow` boolean, required — Whether the Flow should be deleted once the timerange has been
  - `created` string, date-time — Date/Time when this deletion request was created
  - `created_by` string — A string identifier for the entity that created the deletion request. Implementations SHOULD set suitable default values for `created_by` based on the principal accessing the system, and MAY permit clients to edit the value, subject to suitable permissions-based limitations.
  - `updated` string, date-time — Date/Time when this deletion request was updated
  - `expiry` string, date-time — Date/Time when this deletion request will be deleted
  - `status` 'created' | 'started' | 'done' | 'error', required — Status of the delete request
  - `error` Error — Provides more information for the error status.
    - `type` string, required — The error type name.
    - `summary` string, required — Summary description of the error and causes.
    - `traceback` string[] — Stack trace leading to error (as a list of strings)
    - `time` string, date-time, required — Time at which the error ocurred, to aid in log correlation

## Other responses

- `204` — No content. The flow segments have been or will be deleted.
- `400` — Bad request. Invalid query options.
- `403` — Forbidden. You do not have permission to modify this flow. It may be marked read-only.
- `404` — The requested flow ID in the path is invalid.

## Changes

- **2025-06-11** `e3d4dd57646b` — 1 warning, 2 info
  - changed the pattern of the `query` request parameter `timerange` from `^(\[|\()?(-?\d+:\d+)?(_(-?\d+:\d+)?)?(\]|\))?$` to `^(\[|\()?(-?(0|[1-9][0-9]*):(0|[1-9][0-9]{0,8}))?(_(-?(0|[1-9][0-9]*):(0|[1-9][0-9]{0,8}))?)?(\]|\))?$`
  - the `timerange_remaining` response's property pattern was changed from `^(\[|\()?(-?\d+:\d+)?(_(-?\d+:\d+)?)?(\]|\))?$` to `^(\[|\()?(-?(0|[1-9][0-9]*):(0|[1-9][0-9]{0,8}))?(_(-?(0|[1-9][0-9]*):(0|[1-9][0-9]{0,8}))?)?(\]|\))?$` for the status `202`
  - the `timerange_to_delete` response's property pattern was changed from `^(\[|\()?(-?\d+:\d+)?(_(-?\d+:\d+)?)?(\]|\))?$` to `^(\[|\()?(-?(0|[1-9][0-9]*):(0|[1-9][0-9]{0,8}))?(_(-?(0|[1-9][0-9]*):(0|[1-9][0-9]{0,8}))?)?(\]|\))?$` for the status `202`
- …earlier changes not shown

[Full history](https://skmtc.dev/aws-samples/apis/time-addressable-media-store/changes/flows/:flowId/segments/delete.md)

---

[API](https://skmtc.dev/aws-samples/apis/time-addressable-media-store.md) · [All operations](https://skmtc.dev/aws-samples/apis/time-addressable-media-store/llms.txt) · [OpenAPI document](https://skmtc.dev/aws-samples/apis/time-addressable-media-store/revisions/fff531b4534a?raw)
