# Delete Stream

`DELETE /data-streams/user/{streamSlug}` · Core · Realtime Feeds & Streams

Deletes a user stream by its slug. Its retained messages are removed and its reserved storage is returned to the organization's allotment; the slug can be used again. Answers with the slug and `status: deleted`. Needs PROJECT_ADMIN. Audited as `data.write.pulse_stream.deleted`.

## Parameters

| Name | In | Required | Description |
|---|---|---|---|
| `streamSlug` | path | yes | The Pulse Stream's slug. Example: `"order-events"`. |
| `projectSlug` | path | yes | The project's slug: the path segment after `@`. It is unique within the org. Example: `"storefront"`. |

## Responses

- **200**: Success

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | object | yes | The stream that was deleted. |
| `data.slug` | string | yes | The slug of the stream that was deleted. |
| `data.status` | enum ("deleted") | yes | Always `deleted`. |
| `meta` | object | yes |  |


## Errors

| HTTP | Code | When |
|---|---|---|
| 403 | `K9O_IAM_POLICY_DENIED` | The bound IAMPolicy ceiling denies streams:delete for this principal. |
| 404 | `K9O_NOT_FOUND` | The project could not be found, or the caller has no project membership. |
| 404 | `K9O_STREAM_NOT_FOUND` | No active Pulse Stream with that slug exists in this project. |

## Code samples

### cURL

```bash
curl -X DELETE 'https://<org>.api-<region>.k9o.io/@storefront/data-streams/user/<streamSlug>' \
  -H 'Authorization: Bearer $K9O_TOKEN'
```

### fetch

```javascript
const res = await fetch('https://<org>.api-<region>.k9o.io/@storefront/data-streams/user/<streamSlug>', {
  method: 'DELETE',
  headers: {
    'Authorization': `Bearer ${process.env.K9O_TOKEN}`
  },
});
const { data, meta } = await res.json();
```

### k9o CLI

```bash
k9o stream delete <slug>
```

### @k9o/core

```typescript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.streams.delete('<streamSlug>')
```

### k9o

```python
# k9o = create_client(org_slug="playground", project_slug="storefront", api_key="k9o_…")
response = k9o.streams.delete("<streamSlug>")
```

### sdk-go

```go
// ctx := context.Background()
// client, _ := k9o.NewClient(k9o.ClientOpts{OrgSlug: "playground", ProjectSlug: "storefront", APIKey: "k9o_…"})
data, _, kerr := client.Streams.Delete(ctx, "<streamSlug>")
```

### k9o

```rust
// let k9o = Client::new(ClientOpts { org_slug: "playground".into(), project_slug: "storefront".into(), api_key: "k9o_…".into() })?;
let resp = k9o.streams.delete("<streamSlug>").await?
```

### dev.k9o:core

```java
// K9o k9o = K9o.createClient(K9o.Opts.builder().orgSlug("playground").projectSlug("storefront").apiKey("k9o_…").build());
var response = k9o.streams().delete("<streamSlug>")
```

### K9o.Core

```c#
// var k9o = K9oClient.Create(new K9oOptions { OrgSlug = "playground", ProjectSlug = "storefront", ApiKey = "k9o_…" });
var response = await k9o.Streams.DeleteAsync("<streamSlug>")
```

### k9o

```ruby
# k9o = K9o.create_client(org_slug: "playground", project_slug: "storefront", api_key: "k9o_…")
response = k9o.streams.delete("<streamSlug>")
```

### k9o/sdk

```php
// $k9o = K9oClient::create(['org_slug' => 'playground', 'project_slug' => 'storefront', 'api_key' => 'k9o_…']);
$response = $k9o->streams->delete('<streamSlug>')
```

### K9o

```swift
// let k9o = try K9o.createClient(orgSlug: "playground", projectSlug: "storefront", apiKey: "k9o_…")
let result = try await k9o.streams.delete("<streamSlug>")
```

### core-kotlin

```kotlin
// val k9o = createClient { orgSlug = "playground"; projectSlug = "storefront"; apiKey = "k9o_…" }
val result = k9o.streams.delete("<streamSlug>")
```

### k9o (Flutter)

```dart
// final k9o = K9o.createClient(orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…');
final result = await k9o.streams.delete('<streamSlug>')
```

### @k9o/react-native

```javascript
// const k9o = createClient({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })  // RN, secure storage
const { data } = await k9o.streams.delete('<streamSlug>')
```


Canonical page: https://docs.kilimanjaro.dev/api-playground/core/delete-stream
