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

# Delete Flow

`DELETE /flows/{flowId}`

Deletes the Flow and associated Segments.
If Flow Segment 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.

Services SHALL only delete Objects when they are no longer referenced by any Flow Segments or other Objects (i.e. as init Objects).

## Response `202`

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

- Deletionrequest — Describes an ongoing deletion request
  - `id` string, required — A Universally Unique Identifier (UUID) as defined in [RFC9562](https://www.rfc-editor.org/rfc/rfc9562)
  - `flow_id` string, required — A Universally Unique Identifier (UUID) as defined in [RFC9562](https://www.rfc-editor.org/rfc/rfc9562)
  - `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. * `_` without timestamps or inclusivity markers represents "eternity" (i.e. the entire timeline). * `()` without timestamps represents "never" (i.e. a range of zero length in no particular position). * `[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. * `_` without timestamps or inclusivity markers represents "eternity" (i.e. the entire timeline). * `()` without timestamps represents "never" (i.e. a range of zero length in no particular position). * `[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. Service implementations SHOULD set suitable default values for `created_by` based on the principal accessing the system.
  - `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 an 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 has been deleted and the Flow Segments have been or will be deleted. Objects referenced in other Flows will not be deleted. Objects that are no longer referenced by any Segments will be deleted.
- `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.

---

[API](https://skmtc.net/aws-samples/apis/time-addressable-media-store.md) · [All operations](https://skmtc.net/aws-samples/apis/time-addressable-media-store/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws-samples/time-addressable-media-store/versions/c442607d1b16/schema)
