---
title: "Delete a data stream"
method: DELETE
path: "/data_streams/{key}"
---

# Delete a data stream

`DELETE /data_streams/{key}`

Permanently deletes a data stream and all associated records and property definitions.

**Sync vs async:** Streams with at most 10,000 records are deleted synchronously and return 204. Streams above that threshold *must* be deleted asynchronously by passing `?async=true`; otherwise the request fails with 409. Callers may also opt into the async path explicitly for any size. The async path returns 202 with a `DataStreamOperation` payload; poll `GET /data_streams/{key}/operations/{id}` for progress.

## Path parameters

- `key` string, required

## Query parameters

- `async` 'true' | 'false'

## Response `202`

Async delete accepted. Poll `GET /data_streams/{key}/operations/{id}` (also set in the `Location` header) until `status` is `completed` or `failed`.

- DataStreamOperation — Async operation against a data stream (delete or reset). Poll via GET /data_streams/{key}/operations/{id}.
  - `id` integer
  - `data_stream_id` integer
  - `data_stream_key` string
  - `kind` 'delete' | 'reset'
  - `status` 'pending' | 'running' | 'completed' | 'failed'
  - `progress` integer — Percentage 0-100
  - `error_message` string, nullable
  - `started_at` string, date-time, nullable
  - `completed_at` string, date-time, nullable
  - `created_at` string, date-time
  - `requested_by_user_id` integer, nullable

## Other responses

- `204` — Data stream deleted synchronously (record count ≤ 10,000 and `async` not requested)
- `401` — Unauthorized
- `404` — Data stream not found
- `409` — Either (a) the stream is linked to reconciliations and cannot be deleted, or (b) it has more than 10,000 records and `?async=true` was not provided.

---

[API](https://skmtc.net/endclose/apis/end-close-api.md) · [All operations](https://skmtc.net/endclose/apis/end-close-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/endclose/end-close-api/revisions/613ceff68dc7/schema)
