Skip to content
Start here

View secret usage

client.SecretsStore.Quota.Get(ctx, query) (*QuotaGetResponse, error)
GET/accounts/{account_id}/secrets_store/quota

Lists the number of secrets used in the account.

Security

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)
Secrets Store WriteSecrets Store Read
ParametersExpand Collapse
query QuotaGetParams
AccountID param.Field[string]

Account Identifier

maxLength32
ReturnsExpand Collapse
type QuotaGetResponse struct{…}
Secrets QuotaGetResponseSecrets
Quota float64

The number of secrets the account is entitlted to use

Usage float64

The number of secrets the account is currently using

View secret usage

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
    option.WithAPIEmail("user@example.com"),
  )
  quota, err := client.SecretsStore.Quota.Get(context.TODO(), secrets_store.QuotaGetParams{
    AccountID: cloudflare.F("985e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", quota.Secrets)
}
{
  "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": {
    "secrets": {
      "quota": 10,
      "usage": 10
    }
  },
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}
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": {
    "secrets": {
      "quota": 10,
      "usage": 10
    }
  },
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}