Skip to content
Start here

Create App

client.RealtimeKit.Apps.Post(ctx, params) (*AppPostResponse, error)
POST/accounts/{account_id}/realtime/kit/apps

Create new app for your account

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)
Realtime AdminRealtime
ParametersExpand Collapse
params AppPostParams
AccountID param.Field[string]

Path param

Name param.Field[string]

Body param

ReturnsExpand Collapse
type AppPostResponse struct{…}
Data AppPostResponseDataoptional
App AppPostResponseDataAppoptional
ID stringoptional
CreatedAt stringoptional
Name stringoptional
Success booloptional

Create App

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.RealtimeKit.Apps.Post(context.TODO(), realtime_kit.AppPostParams{
    AccountID: cloudflare.F("account_id"),
    Name: cloudflare.F("name"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
{
  "data": {
    "app": {
      "created_at": "2025-01-01T08:16:40.644Z",
      "id": "my-app-id",
      "name": "my-new-app"
    }
  },
  "success": true
}
Returns Examples
{
  "data": {
    "app": {
      "created_at": "2025-01-01T08:16:40.644Z",
      "id": "my-app-id",
      "name": "my-new-app"
    }
  },
  "success": true
}