---
title: List K2 streams
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[K2](https://developers.cloudflare.com/api/go/resources/k2)

[Streams](https://developers.cloudflare.com/api/go/resources/k2/subresources/streams)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# List K2 streams

client.K2.Streams.List(ctx, params) (\*V4PagePaginationArray\[[StreamListResponse](<https://developers.cloudflare.com/api/go/resources/k2#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)>)], error)

GET/accounts/{account\_id}/k2/streams

List or filter K2 streams in an account.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### ParametersExpand Collapse

<details>

<summary>

params StreamListParams

</summary>

AccountID param.Field\[string]

Path param: Specifies the public ID of the account.

maxLength32

minLength32

<a href="#(resource)%20k2.streams%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

Name param.Field\[string]Optional

Query param: Filters K2 streams by name using a case-insensitive substring.

maxLength128

minLength1

<a href="#(resource)%20k2.streams%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20name">Link to this property</a>

Page param.Field\[int64]Optional

Query param

minimum1

<a href="#(resource)%20k2.streams%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20page">Link to this property</a>

PerPage param.Field\[int64]Optional

Query param

maximum100

minimum1

<a href="#(resource)%20k2.streams%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20per_page">Link to this property</a>

</details>

[Link to this property](<#(resource)%20k2.streams%20%3E%20(method)%20list%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type StreamListResponse struct{…}

</summary>

ID string

Specifies the public ID of the K2 stream.

maxLength32

minLength32

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

CreatedAt Time

formatdate-time

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

Endpoint string

Indicates the base HTTP endpoint for producing and consuming records.

formaturi

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20endpoint">Link to this property</a>

<details>

<summary>

HTTP StreamListResponseHTTP

</summary>

One of the following:

<details>

<summary>

type StreamListResponseHTTPEnabled struct{…}

</summary>

Enabled StreamListResponseHTTPEnabledEnabled

Indicates whether the HTTP endpoint accepts records.

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20http%20%3E%20(variant)%200%20%3E%20(property)%20enabled">Link to this property</a>

</details>

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20http%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

type StreamListResponseHTTPObject struct{…}

</summary>

Enabled StreamListResponseHTTPObjectEnabled

Indicates whether the HTTP endpoint accepts records.

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20http%20%3E%20(variant)%201%20%3E%20(property)%20enabled">Link to this property</a>

Authentication boolOptional

Indicates whether the HTTP endpoint requires an API token with K2 produce permission. When false or omitted, the endpoint accepts unauthenticated records.

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20http%20%3E%20(variant)%201%20%3E%20(property)%20authentication">Link to this property</a>

<details>

<summary>

CORS StreamListResponseHTTPObjectCORSOptional

</summary>

<details>

<summary>

Origins StreamListResponseHTTPObjectCORSOriginsUnionOptional

Allows requests from these HTTP or HTTPS origins. Use a wildcard only as the sole origin.

</summary>

One of the following:

type StreamListResponseHTTPObjectCORSOriginsArray \[]StreamListResponseHTTPObjectCORSOriginsArrayItem

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20http%20%3E%20(variant)%201%20%3E%20(property)%20cors%20%3E%20(property)%20origins%20%3E%20(variant)%200">Link to this property</a>

type StreamListResponseHTTPObjectCORSOriginsArray \[]string

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20http%20%3E%20(variant)%201%20%3E%20(property)%20cors%20%3E%20(property)%20origins%20%3E%20(variant)%201">Link to this property</a>

</details>

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20http%20%3E%20(variant)%201%20%3E%20(property)%20cors%20%3E%20(property)%20origins">Link to this property</a>

</details>

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20http%20%3E%20(variant)%201%20%3E%20(property)%20cors">Link to this property</a>

</details>

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20http%20%3E%20(variant)%201">Link to this property</a>

</details>

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20http">Link to this property</a>

ModifiedAt Time

formatdate-time

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20modified_at">Link to this property</a>

Name string

Indicates the name of the K2 stream.

maxLength128

minLength1

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

RetentionSeconds int64

Shows the configured record retention period from 1 hour (3600 seconds) to 30 days (2592000 seconds), inclusive.

maximum2592000

minimum3600

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20retention_seconds">Link to this property</a>

<details>

<summary>

WorkerBinding StreamListResponseWorkerBinding

</summary>

One of the following:

<details>

<summary>

type StreamListResponseWorkerBindingEnabled struct{…}

</summary>

Enabled StreamListResponseWorkerBindingEnabledEnabled

Indicates whether Workers bindings can produce records to the stream.

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20worker_binding%20%3E%20(variant)%200%20%3E%20(property)%20enabled">Link to this property</a>

</details>

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20worker_binding%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

type StreamListResponseWorkerBindingEnabled struct{…}

</summary>

Enabled StreamListResponseWorkerBindingEnabledEnabled

Indicates whether Workers bindings can produce records to the stream.

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20worker_binding%20%3E%20(variant)%201%20%3E%20(property)%20enabled">Link to this property</a>

</details>

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20worker_binding%20%3E%20(variant)%201">Link to this property</a>

</details>

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)%20%3E%20(property)%20worker_binding">Link to this property</a>

</details>

[Link to this property](<#(resource)%20k2.streams%20%3E%20(model)%20StreamListResponse%20%3E%20(schema)>)

### List K2 streams

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/k2"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.K2.Streams.List(context.TODO(), k2.StreamListParams{
    AccountID: cloudflare.F("0123105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

200 example

```
{
  "result": [
    {
      "id": "053e105f4ecef8ad9ca31a8372d0c353",
      "created_at": "2019-12-27T18:11:19.117Z",
      "endpoint": "https://053e105f4ecef8ad9ca31a8372d0c353.k2.cloudflarestorage.com",
      "http": {
        "enabled": false
      },
      "modified_at": "2019-12-27T18:11:19.117Z",
      "name": "my_k2_stream",
      "retention_seconds": 604800,
      "worker_binding": {
        "enabled": false
      }
    }
  ],
  "result_info": {
    "count": 0,
    "page": 0,
    "per_page": 0,
    "total_count": 0
  },
  "success": true
}
```

##### Returns Examples

200 example

```
{
  "result": [
    {
      "id": "053e105f4ecef8ad9ca31a8372d0c353",
      "created_at": "2019-12-27T18:11:19.117Z",
      "endpoint": "https://053e105f4ecef8ad9ca31a8372d0c353.k2.cloudflarestorage.com",
      "http": {
        "enabled": false
      },
      "modified_at": "2019-12-27T18:11:19.117Z",
      "name": "my_k2_stream",
      "retention_seconds": 604800,
      "worker_binding": {
        "enabled": false
      }
    }
  ],
  "result_info": {
    "count": 0,
    "page": 0,
    "per_page": 0,
    "total_count": 0
  },
  "success": true
}
```