# API-Referenz: Streams

> Endpunkte der Gruppe «Streams» der Sendtide API mit Parametern, Request-Body, Antworten und curl-Beispielen. Die Referenz ist auf Englisch.

URL: https://sendtide.ch/docs/api/streams/

5 Endpunkte der Gruppe «Streams». Die Referenz stammt aus der englischen OpenAPI-Spezifikation und ist nicht übersetzt.
## List message streams

GET /v1/streams
### Beispiel

```
curl "https://api.sendtide.ch/v1/streams" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | The streams |
## Create a stream

POST /v1/streams
Up to 10 streams besides transactional and broadcast (422 stream_limit). Only transactional streams can be created for now, the kind broadcast is refused with 403 broadcast_not_available (not available yet). A transactional stream can still default List-Unsubscribe (unsubscribe_default).
### Request-Body application/json
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| slug * | string | Example: newsletter |
| name * | string | |
| kind * | enum: transactional / broadcast | |
| track | boolean / null | |
| unsubscribe_default | boolean / null | |
| unsubscribe_required | boolean | |
### Beispiel

```
curl -X POST "https://api.sendtide.ch/v1/streams" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"slug":"newsletter","name":"Newsletter","kind":"broadcast"}'
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 201 | Created Stream |
| 409 | Fehler im üblichen Format, [Fehler und Limits](https://sendtide.ch/docs/fehler-und-limits/) |
| 422 | Fehler im üblichen Format, [Fehler und Limits](https://sendtide.ch/docs/fehler-und-limits/) |
## Get a stream

GET /v1/streams/{slug}
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| slug * | path | string | |
### Beispiel

```
curl "https://api.sendtide.ch/v1/streams/newsletter" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | The stream Stream |
| 404 | Fehler im üblichen Format, [Fehler und Limits](https://sendtide.ch/docs/fehler-und-limits/) |
## Change a stream

PATCH /v1/streams/{slug}
name (own streams only), track and unsubscribe_default (true, false or null for the account's setting), unsubscribe_required. The kind and the slug cannot change.
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| slug * | path | string | |
### Request-Body application/json
| Feld | Typ | Beschreibung |
| --- | --- | --- |
| name | string | |
| track | boolean / null | |
| unsubscribe_default | boolean / null | |
| unsubscribe_required | boolean | |
### Beispiel

```
curl -X PATCH "https://api.sendtide.ch/v1/streams/newsletter" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{}'
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 200 | Updated Stream |
| 422 | Fehler im üblichen Format, [Fehler und Limits](https://sendtide.ch/docs/fehler-und-limits/) |
## Delete a stream of your own

DELETE /v1/streams/{slug}
Not the built-in streams (422 stream_builtin), and not while mail of the stream waits (409 stream_in_use).
### Parameter
| Name | Ort | Typ | Beschreibung |
| --- | --- | --- | --- |
| slug * | path | string | |
### Beispiel

```
curl -X DELETE "https://api.sendtide.ch/v1/streams/newsletter" \
  -H "Authorization: Bearer sk_test_…"
```
### Antworten
| Status | Beschreibung |
| --- | --- |
| 204 | Deleted |
