Skip to content
Start here

Delete User Subscription

client.User.Subscriptions.Delete(ctx, identifier) (*SubscriptionDeleteResponse, error)
DELETE/user/subscriptions/{identifier}

Deletes a user's subscription.

Security
API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

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

Example:X-Auth-Email: user@example.com

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

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Billing Write
ParametersExpand Collapse
identifier string

Subscription identifier tag.

maxLength32
ReturnsExpand Collapse
type SubscriptionDeleteResponse struct{…}
SubscriptionID stringoptional

Subscription identifier tag.

maxLength32

Delete User Subscription

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  subscription, err := client.User.Subscriptions.Delete(context.TODO(), "506e3185e9c882d175a2d0cb0093d9f2")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", subscription.SubscriptionID)
}
{
  "subscription_id": "506e3185e9c882d175a2d0cb0093d9f2"
}
Returns Examples
{
  "subscription_id": "506e3185e9c882d175a2d0cb0093d9f2"
}