Skip to content
Start here

Create an SFU app

client.Calls.SFU.New(ctx, params) (*SFUNewResponse, error)
POST/accounts/{account_id}/calls/apps

Creates a Realtime SFU app. An app is an isolated namespace in which sessions can access the app’s tracks.

Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Calls Write
ParametersExpand Collapse
params SFUNewParams
AccountID param.Field[string]

Path param: The account identifier tag.

maxLength32
Name param.Field[string]Optional

Body param: A short description of a Realtime SFU app, not shown to end users.

ReturnsExpand Collapse
type SFUNewResponse struct{…}
Created Time

The date and time the item was created.

formatdate-time
Modified Time

The date and time the item was last modified.

formatdate-time
Name string

A short description of a Realtime SFU app, not shown to end users.

Secret string

Bearer token

maxLength64
minLength64
UID string

A Cloudflare-generated unique identifier for a item.

maxLength32
minLength32

Create an SFU app

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  sfu, err := client.Calls.SFU.New(context.TODO(), calls.SFUNewParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", sfu.UID)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "created": "2014-01-02T02:20:00Z",
    "modified": "2014-01-02T02:20:00Z",
    "name": "production-realtime-app",
    "secret": "66bcf64aa8907b9f9d90ac17746a77ce394c393b92b3916633dc02846e608ad4",
    "uid": "2a95132c15732412d22c1476fa83f27a"
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "created": "2014-01-02T02:20:00Z",
    "modified": "2014-01-02T02:20:00Z",
    "name": "production-realtime-app",
    "secret": "66bcf64aa8907b9f9d90ac17746a77ce394c393b92b3916633dc02846e608ad4",
    "uid": "2a95132c15732412d22c1476fa83f27a"
  }
}