Skip to content
Primary navigation

Delete organization spend alert

client.Admin.Organization.SpendAlerts.Delete(ctx, alertID) (*OrganizationSpendAlertDeleted, error)
DELETE/organization/spend_alerts/{alert_id}

Deletes an organization spend alert.

ParametersExpand Collapse
alertID string
ReturnsExpand Collapse
type OrganizationSpendAlertDeleted struct{…}

Confirmation payload returned after deleting an organization spend alert.

ID string

The deleted spend alert ID.

Deleted bool

Whether the spend alert was deleted.

Object OrganizationSpendAlertDeleted

Always organization.spend_alert.deleted.

Delete organization spend alert

package main

import (
  "context"
  "fmt"

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

func main() {
  client := openai.NewClient(
    option.WithAdminAPIKey("My Admin API Key"),
  )
  organizationSpendAlertDeleted, err := client.Admin.Organization.SpendAlerts.Delete(context.TODO(), "alert_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", organizationSpendAlertDeleted.ID)
}
{
    "id": "alert_abc123",
    "object": "organization.spend_alert.deleted",
    "deleted": true
}
Returns Examples
{
    "id": "alert_abc123",
    "object": "organization.spend_alert.deleted",
    "deleted": true
}