---
title: "Stream"
description: "<p>API for creating stream models. A stream is the same as a [data stream](https://learn.lytics.com/product-docs/data-management/using-data-streams#what-are-data-streams?</p><p>) and is consumed for ingestion into a given entity table. It is described by its slug, which is the value used to identify the stream in collection as well as in the FROM statement on a given query.</p>"
url: "https://www.contentstack.com/docs/developers/apis/lytics-api/v1/stream"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-11-05"
---

# Stream

API for creating stream models. A stream is the same as a \[data stream\](https://learn.lytics.com/product-docs/data-management/using-data-streams#what-are-data-streams?

) and is consumed for ingestion into a given entity table. It is described by its slug, which is the value used to identify the stream in collection as well as in the FROM statement on a given query.

## Retrieve a Single Stream

### Retrieve a Single Stream

**GET** `/api/stream/{id}`

Get a stream according to its ID.

#### URL Parameters

- **id** (required)
  ID of the stream in the form of a hash. You can also use the slug.

#### Query Parameters

- **account_id** (optional)
  Your Lytics account ID.

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
{
  "data": [
    {
      "account_id": "d8e403de6fbf0090b17b42a2bb37716e",
      "aid": 2,
      "channel": "email",
      "created": "2018-07-31T22:41:21.908Z",
      "hidden": false,
      "id": "765ed319ddc918e6bb5f9b1d6359a3c4",
      "method": "",
      "providers": [],
      "slug": "hellow",
      "tables": [],
      "updated": "2018-07-31T22:41:21.908Z"
    }
  ],
  "message": "success",
  "status": 200
}
```

## Update a Stream

### Update a Stream

**PUT** `/api/stream/{id}`

Update a stream with a given ID. The parameters listed below provided in the PUT request will overwrite the current parameters in the model.

Stream attributes that a user is able to update:

\* \*slug\* (string) ... raw value of the stream as it appears in both queries and collection

\* \*channel\* (string, optional) ... method by which this stream collects data. Only allowable channel types: web, email, mobile, ad, sms, pos

\* \*label\* (string, optional) ... user assignable label, for display in the UI

\* \*description\* (string, optional) ... user assignable description

\* \*providers\* (\[\]string, optional) ... names of the providers that send data on this stream

#### URL Parameters

- **id** (required)
  ID of the stream in the form of a hash. You can also use the slug.

#### Query Parameters

- **account_id** (optional)
  Your Lytics account ID.

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
{
  "data": [
    {
      "account_id": "d8e403de6fbf0090b17b42a2bb37716e",
      "aid": 2,
      "channel": "email",
      "created": "2018-07-31T22:41:21.908Z",
      "hidden": false,
      "id": "765ed319ddc918e6bb5f9b1d6359a3c4",
      "method": "",
      "providers": [],
      "slug": "hellow",
      "tables": [],
      "updated": "2018-07-31T22:41:21.908Z"
    }
  ],
  "message": "success",
  "status": 200
}
```

## Delete a Stream

### Delete a Stream

**DELETE** `/api/stream/{id}`

Delete a stream with a given ID.

#### URL Parameters

- **id** (required)
  ID of the stream in the form of a hash. You can also use the slug.

#### Query Parameters

- **account_id** (optional)
  Your Lytics account ID.

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
OK
```

## Retrieve a List of Streams from Account

### Retrieve a List of Streams from Account

**GET** `/api/stream`

Get a list of all the streams for an account

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
OK
```

## Create a Stream

### Create a Stream

**POST** `/api/stream`

JSON Parameters:

\* \*slug\* (string) ... raw value of the stream as it appears in both queries and collection

\* \*channel\* (string) ... method by which this stream collects data. Only allowable channel types: web, email, mobile, ad, sms, pos

\* \*label\* (string, optional) ... user assignable label, for display in the UI

\* \*description\* (string, optional) ... user assignable description

\* \*tables\* (\[\]string, optional) ... names of the tables to which this stream writes

\* \*providers\* (\[\]string, optional) ... names of the providers that send data on this stream

\* \*hidden\* (bool, optional) ... whether stream is hidden in stream stats?

\* \*method\* (string, optional) ... either 'bulk' or 'streaming'

#### Headers

- **Authorization** (optional)

#### Sample Response

```json
{
  "data": [
    {
      "account_id": "d8e403de6fbf0090b17b42a2bb37716e",
      "aid": 2,
      "channel": "email",
      "created": "2018-07-31T22:41:21.908Z",
      "hidden": false,
      "id": "765ed319ddc918e6bb5f9b1d6359a3c4",
      "method": "",
      "providers": [],
      "slug": "hellow",
      "tables": [],
      "updated": "2018-07-31T22:41:21.908Z"
    }
  ],
  "message": "success",
  "status": 200
}
```