Skip to main content

stores

Creates, updates, deletes, gets or lists a stores resource.

Overview

Namestores
TypeResource
Idcloudflare.secrets_store.stores

Fields

The following fields are returned by SELECT queries:

store details

NameDatatypeDescription
idstringStore Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353)
namestringThe name of the store (example: service_x_keys)
account_idstringAccount Identifier (example: 985e105f4ecef8ad9ca31a8372d0c353)
createdstring (date-time)Whenthe secret was created. (example: 2023-09-21T18:56:32.624632Z)
modifiedstring (date-time)When the secret was modified. (example: 2023-09-21T18:56:32.624632Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_accountselectaccount_id, store_idReturns details of a single store
get_by_systemselectaccount_tag, store_idReturns details of a single store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.
list_by_accountselectaccount_iddirection, page, per_page, orderLists all the stores in an account
list_by_systemselectaccount_tagdirection, page, per_page, orderLists all stores in an account that are managed by the calling service. Only returns stores where managed_by matches the authenticated service.
createinsertaccount_id, nameCreates a store in the account
secrets_store_system_createinsertaccount_tag, name, account_idCreates a store in the account on behalf of the calling service. The store will be marked as managed by the authenticated service. Requires account_id in the request body.
deletedeleteaccount_id, store_idDeletes a single store
secrets_store_system_delete_by_iddeleteaccount_tag, store_idDeletes a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
account_tagstringAccount tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31'). This is the account's external tag identifier, not the numeric account ID.
store_idstringThe secrets store ID.
directionstringDirection to sort objects
orderstringOrder secrets by values in the given field
pageintegerPage number
per_pageintegerNumber of objects to return per page

SELECT examples

Returns details of a single store

SELECT
id,
name,
account_id,
created,
modified
FROM cloudflare.secrets_store.stores
WHERE account_id = '{{ account_id }}' -- required
AND store_id = '{{ store_id }}' -- required
;

INSERT examples

Creates a store in the account

INSERT INTO cloudflare.secrets_store.stores (
name,
account_id
)
SELECT
'{{ name }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
result_info,
success
;

DELETE examples

Deletes a single store

DELETE FROM cloudflare.secrets_store.stores
WHERE account_id = '{{ account_id }}' --required
AND store_id = '{{ store_id }}' --required
;