Skip to content
Start here

List store secrets

client.SecretsStore.Stores.Secrets.List(ctx, storeID, params) (*V4PagePaginationArray[StoreSecretListResponse], error)
GET/accounts/{account_id}/secrets_store/stores/{store_id}/secrets

Lists all store secrets

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
storeID string

Store Identifier

maxLength32
params StoreSecretListParams
AccountID param.Field[string]

Path param: Account Identifier

maxLength32
Direction param.Field[StoreSecretListParamsDirection]Optional

Query param: Direction to sort objects

const StoreSecretListParamsDirectionAsc StoreSecretListParamsDirection = "asc"
const StoreSecretListParamsDirectionDesc StoreSecretListParamsDirection = "desc"
Order param.Field[StoreSecretListParamsOrder]Optional

Query param: Order secrets by values in the given field

const StoreSecretListParamsOrderName StoreSecretListParamsOrder = "name"
const StoreSecretListParamsOrderComment StoreSecretListParamsOrder = "comment"
const StoreSecretListParamsOrderCreated StoreSecretListParamsOrder = "created"
const StoreSecretListParamsOrderModified StoreSecretListParamsOrder = "modified"
const StoreSecretListParamsOrderStatus StoreSecretListParamsOrder = "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
Scopes param.Field[[][]string]Optional

Query param: Only secrets with the given scopes will be returned

ReturnsExpand Collapse
type StoreSecretListResponse struct{…}
ID string

Secret identifier tag.

maxLength32
Created Time

Whenthe secret was created.

formatdate-time
Modified Time

When the secret was modified.

formatdate-time
Name string

The name of the secret

Status StoreSecretListResponseStatus
One of the following:
const StoreSecretListResponseStatusPending StoreSecretListResponseStatus = "pending"
const StoreSecretListResponseStatusActive StoreSecretListResponseStatus = "active"
const StoreSecretListResponseStatusDeleted StoreSecretListResponseStatus = "deleted"
StoreID string

Store Identifier

maxLength32
Comment stringOptional

Freeform text describing the secret

Scopes []stringOptional

The list of services that can use this secret.

List store secrets

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
    option.WithAPIEmail("user@example.com"),
  )
  page, err := client.SecretsStore.Stores.Secrets.List(
    context.TODO(),
    "023e105f4ecef8ad9ca31a8372d0c353",
    secrets_store.StoreSecretListParams{
      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": "3fd85f74b32742f1bff64a85009dda07",
      "created": "2023-09-21T18:56:32.624632Z",
      "modified": "2023-09-21T18:56:32.624632Z",
      "name": "MY_API_KEY",
      "status": "pending",
      "store_id": "023e105f4ecef8ad9ca31a8372d0c353",
      "comment": "info about my secret",
      "scopes": [
        "workers",
        "ai_gateway",
        "dex",
        "access"
      ]
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}
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": "3fd85f74b32742f1bff64a85009dda07",
      "created": "2023-09-21T18:56:32.624632Z",
      "modified": "2023-09-21T18:56:32.624632Z",
      "name": "MY_API_KEY",
      "status": "pending",
      "store_id": "023e105f4ecef8ad9ca31a8372d0c353",
      "comment": "info about my secret",
      "scopes": [
        "workers",
        "ai_gateway",
        "dex",
        "access"
      ]
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}