stores
Creates, updates, deletes, gets or lists a stores resource.
Overview
| Name | stores |
| Type | Resource |
| Id | cloudflare.secrets_store.stores |
Fields
The following fields are returned by SELECT queries:
- get_by_account
- get_by_system
- list_by_account
- list_by_system
store details
| Name | Datatype | Description |
|---|---|---|
id | string | Store Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
name | string | The name of the store (example: service_x_keys) |
account_id | string | Account Identifier (example: 985e105f4ecef8ad9ca31a8372d0c353) |
created | string (date-time) | Whenthe secret was created. (example: 2023-09-21T18:56:32.624632Z) |
modified | string (date-time) | When the secret was modified. (example: 2023-09-21T18:56:32.624632Z) |
Store details
| Name | Datatype | Description |
|---|---|---|
id | string | Store Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
name | string | The name of the store (example: service_x_keys) |
account_id | string | Account Identifier (example: 985e105f4ecef8ad9ca31a8372d0c353) |
created | string (date-time) | Whenthe secret was created. (example: 2023-09-21T18:56:32.624632Z) |
modified | string (date-time) | When the secret was modified. (example: 2023-09-21T18:56:32.624632Z) |
List account stores response
| Name | Datatype | Description |
|---|---|---|
id | string | Store Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
name | string | The name of the store (example: service_x_keys) |
account_id | string | Account Identifier (example: 985e105f4ecef8ad9ca31a8372d0c353) |
created | string (date-time) | Whenthe secret was created. (example: 2023-09-21T18:56:32.624632Z) |
modified | string (date-time) | When the secret was modified. (example: 2023-09-21T18:56:32.624632Z) |
List account stores response
| Name | Datatype | Description |
|---|---|---|
id | string | Store Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
name | string | The name of the store (example: service_x_keys) |
account_id | string | Account Identifier (example: 985e105f4ecef8ad9ca31a8372d0c353) |
created | string (date-time) | Whenthe secret was created. (example: 2023-09-21T18:56:32.624632Z) |
modified | string (date-time) | When the secret was modified. (example: 2023-09-21T18:56:32.624632Z) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_by_account | select | account_id, store_id | Returns details of a single store | |
get_by_system | select | account_tag, store_id | Returns 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_account | select | account_id | direction, page, per_page, order | Lists all the stores in an account |
list_by_system | select | account_tag | direction, page, per_page, order | Lists all stores in an account that are managed by the calling service. Only returns stores where managed_by matches the authenticated service. |
create | insert | account_id, name | Creates a store in the account | |
secrets_store_system_create | insert | account_tag, name, account_id | Creates 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. | |
delete | delete | account_id, store_id | Deletes a single store | |
secrets_store_system_delete_by_id | delete | account_tag, store_id | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
account_tag | string | Account tag identifier (e.g., '12a6ed19f349896cfbd6694ba3de8d31'). This is the account's external tag identifier, not the numeric account ID. |
store_id | string | The secrets store ID. |
direction | string | Direction to sort objects |
order | string | Order secrets by values in the given field |
page | integer | Page number |
per_page | integer | Number of objects to return per page |
SELECT examples
- get_by_account
- get_by_system
- list_by_account
- list_by_system
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
;
Returns 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.
SELECT
id,
name,
account_id,
created,
modified
FROM cloudflare.secrets_store.stores
WHERE account_tag = '{{ account_tag }}' -- required
AND store_id = '{{ store_id }}' -- required
;
Lists all the stores in an account
SELECT
id,
name,
account_id,
created,
modified
FROM cloudflare.secrets_store.stores
WHERE account_id = '{{ account_id }}' -- required
AND direction = '{{ direction }}'
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND order = '{{ order }}'
;
Lists all stores in an account that are managed by the calling service. Only returns stores where managed_by matches the authenticated service.
SELECT
id,
name,
account_id,
created,
modified
FROM cloudflare.secrets_store.stores
WHERE account_tag = '{{ account_tag }}' -- required
AND direction = '{{ direction }}'
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND order = '{{ order }}'
;
INSERT examples
- create
- secrets_store_system_create
- Manifest
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
;
Creates 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.
INSERT INTO cloudflare.secrets_store.stores (
account_id,
name,
account_tag
)
SELECT
{{ account_id }} /* required */,
'{{ name }}' /* required */,
'{{ account_tag }}'
RETURNING
errors,
messages,
result,
result_info,
success
;
# Description fields are for documentation purposes
- name: stores
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the stores resource.
- name: account_tag
value: "{{ account_tag }}"
description: Required parameter for the stores resource.
- name: name
value: "{{ name }}"
description: |
The name of the store
- name: account_id
value: {{ account_id }}
description: |
Account internal ID (numeric). Required for system API routes. This value must remain consistent for all stores within an account managed by the same service.
DELETE examples
- delete
- secrets_store_system_delete_by_id
Deletes a single store
DELETE FROM cloudflare.secrets_store.stores
WHERE account_id = '{{ account_id }}' --required
AND store_id = '{{ store_id }}' --required
;
Deletes a store managed by the calling service. Returns 404 if the store doesn't exist or is not managed by the authenticated service.
DELETE FROM cloudflare.secrets_store.stores
WHERE account_tag = '{{ account_tag }}' --required
AND store_id = '{{ store_id }}' --required
;