Update storage settings
With content_storage: "discard", emails sent from now on keep their subject, body, headers, template variables and attachment filenames only until they are sent, fail or are canceled (scheduled emails keep them until their time comes); request logs never keep them. Their metadata (addresses, tags, category, status, recipients, events) is kept as usual. Settings belong to the API key's own environment: a coss_test_… key only ever changes sandbox settings. Emails keep the setting that applied when they were sent.
bearerAuthAuthorizationBearer <token>A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.
Coss-Version?"2026-10-10"The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.
"2026-10-10"application/json- body
- body
- …
Applies to emails sent from now on; emails already sent keep their setting.
content_storage*stringstore keeps emails' content; discard clears it once they are sent.
"store""discard"The environment's storage settings.
application/json- response
- response
- …
What coss.com keeps of the API key's environment's emails. Emails keep the setting that applied when they were sent.
object*"storage_settings""storage_settings"content_storage*stringstore (the default) keeps each email's content (subject, body, headers, template variables, attachment filenames) for the email retention period. discard keeps it only until the email is sent, fails or is canceled; its metadata (addresses, tags, category, status, recipients, events) is kept as usual.
"store""discard"updated_at*|When the setting last changed; null if it never did (content is stored).
date-timeimport { Coss } from "coss";const coss = new Coss({ apiKey: process.env.COSS_API_KEY, baseUrl: "https://api.coss.com",});const { data, error } = await coss.email.storage.update({ content_storage: "discard",});{ "object": "storage_settings", "content_storage": "discard", "updated_at": "2026-10-16T10:00:00.000Z"}