Skip to content
Start here

Secrets

List script secrets
GET/accounts/{account_id}/workers/scripts/{script_name}/secrets
Get secret binding
GET/accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}
Add script secret
PUT/accounts/{account_id}/workers/scripts/{script_name}/secrets
Delete script secret
DELETE/accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}
ModelsExpand Collapse
SecretListResponse = object { name, text, type } or object { algorithm, format, name, 4 more }

A secret value accessible through a binding.

One of the following:
SecretText = object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The secret value to use.

type: "secret_text"

The kind of resource that the binding provides.

SecretKey = object { algorithm, format, name, 4 more }
algorithm: unknown

Algorithm-specific key parameters. Learn more.

format: "raw" or "pkcs8" or "spki" or "jwk"

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: string

A JavaScript variable name for the binding.

type: "secret_key"

The kind of resource that the binding provides.

usages: array of "encrypt" or "decrypt" or "sign" or 5 more

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: optional string

Base64-encoded key data. Required if format is "raw", "pkcs8", or "spki".

key_jwk: optional unknown

Key data in JSON Web Key format. Required if format is "jwk".

SecretGetResponse = object { name, text, type } or object { algorithm, format, name, 4 more }

A secret value accessible through a binding.

One of the following:
SecretText = object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The secret value to use.

type: "secret_text"

The kind of resource that the binding provides.

SecretKey = object { algorithm, format, name, 4 more }
algorithm: unknown

Algorithm-specific key parameters. Learn more.

format: "raw" or "pkcs8" or "spki" or "jwk"

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: string

A JavaScript variable name for the binding.

type: "secret_key"

The kind of resource that the binding provides.

usages: array of "encrypt" or "decrypt" or "sign" or 5 more

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: optional string

Base64-encoded key data. Required if format is "raw", "pkcs8", or "spki".

key_jwk: optional unknown

Key data in JSON Web Key format. Required if format is "jwk".

SecretUpdateResponse = object { name, text, type } or object { algorithm, format, name, 4 more }

A secret value accessible through a binding.

One of the following:
SecretText = object { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The secret value to use.

type: "secret_text"

The kind of resource that the binding provides.

SecretKey = object { algorithm, format, name, 4 more }
algorithm: unknown

Algorithm-specific key parameters. Learn more.

format: "raw" or "pkcs8" or "spki" or "jwk"

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: string

A JavaScript variable name for the binding.

type: "secret_key"

The kind of resource that the binding provides.

usages: array of "encrypt" or "decrypt" or "sign" or 5 more

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: optional string

Base64-encoded key data. Required if format is "raw", "pkcs8", or "spki".

key_jwk: optional unknown

Key data in JSON Web Key format. Required if format is "jwk".

SecretDeleteResponse = unknown