Patch secrets
Deletes first, then sets, in one write that bumps record_generation. Deleting a name that is not there is not an error here.
A name you set that the app’s bindings do not declare as a secret is stored, but the Worker’s env does not carry it: the answer lists it in warnings
(code: secret-not-declared, with the fix) and the status is still 200. Declare it in the deploy’s bindings and the value goes live with that deploy. Names match [A-Za-z_][A-Za-z0-9_]*, at
most 128 characters; at most 128 secrets per app and 64 KiB of values in total. Values are strings.
/v1/apps/{project}/secretsAuthorizationBearer token · headerrequiredA team API key, sbk_..., from Settings, API keys.
x-api-keyAPI key · headerrequiredThe same key, in a header of its own.
projectstringrequiredThe app's name, unique within the team. 3 to 51 characters (or 1), lowercase letters, digits and dashes, not starting or ending with a dash.
application/jsonsetobjectSecret name to value. The values are secrets: never returned by any route, keep them out of logs.
deletestring[]Written.
app_idstringrequiredrecord_generationintegerrequirednamesstring[]requiredwarningsSecretWarningsrequiredEmpty when every name set is declared. Absent from answers of Clouds before 2026-11-25.
Show propertiesHide properties
SecretWarningcodestringrequiredMatch on this, not on the text.
secret-not-declarednamestringrequiredThe secret that is stored but not declared.
messagestringrequiredA message for people. Do not parse it.
fixstringrequiredThe change that makes the Worker see it, as one line for people: add the name to secrets in sproutboat.jsonc and deploy.
The request is malformed. path names the field when one is at fault; some refusals (a digest mismatch, a body that is not JSON) carry a message only.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredinvaliderrorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerNo key, or an invalid, expired or revoked key (unknown or missing API token, invalid, expired or revoked API key). No reason.
errorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerThe key lacks a grant (reason: forbidden, need: "<resource>:<action>").
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredforbiddenneedstringrequiredThe grant, as <resource>:<action>, for example app:write.
No such app, build, secret, manifest or claim in this team (another team's resource looks the same).
errorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerThe body is over the limit for this route (reason: too-large; some refusals carry a message only).
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredtoo-largeerrorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerThe key is over its requests a minute (600, or 2,000 with app:write; reason: key-rate-limited, retry_after_s, Retry-After). Wait that long and retry.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredkey-rate-limitedretry_after_sintegerrequiredSeconds to wait; also the Retry-After header.