---
title: Get K2 stream
---

[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**

# Get K2 stream

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

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

Get K2 stream details.

##### 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

streamID string

Specifies the public ID of the K2 stream.

maxLength32

minLength32

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

<details>

<summary>

query StreamGetParams

</summary>

AccountID param.Field\[string]

Specifies the public ID of the account.

maxLength32

minLength32

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

</details>

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

##### ReturnsExpand Collapse

<details>

<summary>

type StreamGetResponse struct{…}

</summary>

ID string

Specifies the public ID of the K2 stream.

maxLength32

minLength32

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamGetResponse%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)%20StreamGetResponse%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)%20StreamGetResponse%20%3E%20(schema)%20%3E%20(property)%20endpoint">Link to this property</a>

<details>

<summary>

HTTP StreamGetResponseHTTP

</summary>

One of the following:

<details>

<summary>

type StreamGetResponseHTTPEnabled struct{…}

</summary>

Enabled StreamGetResponseHTTPEnabledEnabled

Indicates whether the HTTP endpoint accepts records.

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamGetResponse%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)%20StreamGetResponse%20%3E%20(schema)%20%3E%20(property)%20http%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

type StreamGetResponseHTTPObject struct{…}

</summary>

Enabled StreamGetResponseHTTPObjectEnabled

Indicates whether the HTTP endpoint accepts records.

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamGetResponse%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)%20StreamGetResponse%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 StreamGetResponseHTTPObjectCORSOptional

</summary>

<details>

<summary>

Origins StreamGetResponseHTTPObjectCORSOriginsUnionOptional

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

</summary>

One of the following:

type StreamGetResponseHTTPObjectCORSOriginsArray \[]StreamGetResponseHTTPObjectCORSOriginsArrayItem

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamGetResponse%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 StreamGetResponseHTTPObjectCORSOriginsArray \[]string

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamGetResponse%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)%20StreamGetResponse%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)%20StreamGetResponse%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)%20StreamGetResponse%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)%20StreamGetResponse%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)%20StreamGetResponse%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)%20StreamGetResponse%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)%20StreamGetResponse%20%3E%20(schema)%20%3E%20(property)%20retention_seconds">Link to this property</a>

<details>

<summary>

WorkerBinding StreamGetResponseWorkerBinding

</summary>

One of the following:

<details>

<summary>

type StreamGetResponseWorkerBindingEnabled struct{…}

</summary>

Enabled StreamGetResponseWorkerBindingEnabledEnabled

Indicates whether Workers bindings can produce records to the stream.

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamGetResponse%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)%20StreamGetResponse%20%3E%20(schema)%20%3E%20(property)%20worker_binding%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

type StreamGetResponseWorkerBindingEnabled struct{…}

</summary>

Enabled StreamGetResponseWorkerBindingEnabledEnabled

Indicates whether Workers bindings can produce records to the stream.

<a href="#(resource)%20k2.streams%20%3E%20(model)%20StreamGetResponse%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)%20StreamGetResponse%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)%20StreamGetResponse%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)%20StreamGetResponse%20%3E%20(schema)>)

### Get K2 stream

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"),
  )
  stream, err := client.K2.Streams.Get(
    context.TODO(),
    "053e105f4ecef8ad9ca31a8372d0c353",
    k2.StreamGetParams{
      AccountID: cloudflare.F("0123105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", stream.ID)
}
```

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
    }
  },
  "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
    }
  },
  "success": true
}
```