Skip to content
Start here

List account stores

client.SecretsStore.Stores.List(ctx, params) (*V4PagePaginationArray[StoreListResponse], error)
GET/accounts/{account_id}/secrets_store/stores

Lists all the stores in an 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
params StoreListParams
AccountID param.Field[string]

Path param: Account Identifier

maxLength32
Direction param.Field[StoreListParamsDirection]optional

Query param: Direction to sort objects

const StoreListParamsDirectionAsc StoreListParamsDirection = "asc"
const StoreListParamsDirectionDesc StoreListParamsDirection = "desc"
Order param.Field[StoreListParamsOrder]optional

Query param: Order secrets by values in the given field

const StoreListParamsOrderName StoreListParamsOrder = "name"
const StoreListParamsOrderComment StoreListParamsOrder = "comment"
const StoreListParamsOrderCreated StoreListParamsOrder = "created"
const StoreListParamsOrderModified StoreListParamsOrder = "modified"
const StoreListParamsOrderStatus StoreListParamsOrder = "status"
Page param.Field[int64]optional

Query param: Page number

minimum0
multipleOf1
PerPage param.Field[int64]optional

Query param: Number of objects to return per page

maximum100
minimum0
multipleOf1
ReturnsExpand Collapse
type StoreListResponse struct{…}
ID string

Store Identifier

maxLength32
Created Time

Whenthe secret was created.

formatdate-time
Modified Time

When the secret was modified.

formatdate-time
Name string

The name of the store

List account stores

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"),
  )
  page, err := client.SecretsStore.Stores.List(context.TODO(), secrets_store.StoreListParams{
    AccountID: cloudflare.F("985e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "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": [
    {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "created": "2023-09-21T18:56:32.624632Z",
      "modified": "2023-09-21T18:56:32.624632Z",
      "name": "service_x_keys"
    }
  ],
  "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": [
    {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "created": "2023-09-21T18:56:32.624632Z",
      "modified": "2023-09-21T18:56:32.624632Z",
      "name": "service_x_keys"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}