If the basin has create_stream_on_appendconfigured, a stream that does not exist is created on first append with the basin’s default stream config.The s2-stream-config header can override that default for the new stream. Its value is a JSON-encoded StreamConfig, the same object accepted by create. Unset fields inherit the basin’s default stream config.The header is only applied when the append creates the stream. It is ignored if the stream already exists, so it is safe to send on every request. To change the config of an existing stream, use reconfigure.
A header value that is not a valid StreamConfig is rejected with a 400bad_header error. The same header is accepted on read for basins with create_stream_on_read.
Defines the interpretation of record data (header name, header value, and body) with the JSON content type.
Use raw (default) for efficient transmission and storage of Unicode data — storage will be in UTF-8.
Use base64 for safe transmission with efficient storage of binary data.
Batch of records to append atomically, which must contain at least one record, and no more than 1000.
The total size of a batch of records may not exceed 1 MiB of metered bytes.
Sequence number of the last record that was appended + 1, and timestamp of the last record that was appended.
The difference between end.seq_num and start.seq_num will be the number of records appended.
Sequence number that will be assigned to the next record on the stream, and timestamp of the last record on the stream.
This can be greater than the end position in case of concurrent appends.
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"S2","description":"API for unlimited, durable, real-time streams.","colors":{"primary":"#252525","light":"#E8E8E8","dark":"#252525"},"logo":{"light":"https://mintcdn.com/streamstore/2KVWF55FbBFAHG9D/logo/s2-black.png?fit=max\u0026auto=format\u0026n=2KVWF55FbBFAHG9D\u0026q=85\u0026s=a21a60dc6c4cc961bb234a8eba956217","dark":"https://mintcdn.com/streamstore/2KVWF55FbBFAHG9D/logo/s2-white.png?fit=max\u0026auto=format\u0026n=2KVWF55FbBFAHG9D\u0026q=85\u0026s=7cd77fc75c133fddce332121b1d71f64","href":"https://s2.dev/"},"favicon":"https://mintcdn.com/streamstore/2KVWF55FbBFAHG9D/logo/s2-black.png?fit=max\u0026auto=format\u0026n=2KVWF55FbBFAHG9D\u0026q=85\u0026s=a21a60dc6c4cc961bb234a8eba956217","api":{"openapi":"specs-denorm/v1/openapi.json","examples":{"defaults":"required","languages":["curl"]}},"appearance":{"default":"system","strict":false},"background":{"color":{"light":"#FFFFFF","dark":"#252525"}},"navbar":{"links":[{"href":"https://github.com/s2-streamstore/s2","label":"s2-streamstore/s2","type":"github"},{"href":"https://discord.gg/vTCs7kMkAf","label":"s2.dev","type":"discord"}]},"footer":{"socials":{"bluesky":"https://bsky.app/profile/s2.dev","x":"https://x.com/s2_streamstore","linkedin":"https://www.linkedin.com/company/streamstore","github":"https://github.com/s2-streamstore","discord":"https://discord.gg/vTCs7kMkAf"}},"seo":{"metatags":{"canonical":"https://s2.dev/docs"}},"integrations":{"posthog":{"apiKey":"phc_o0QA5I7imsTAAtxVm57BogVdpN0U7e70SmwD5lzaiAJ","apiHost":"https://php.s2.dev"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://s2.dev/blog"},{"anchor":"Talk to us","icon":"comments","href":"https://s2.dev/contact"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"streamstore","hasAudioNarration":false,"actualSubdomain":"streamstore","customDomains":["s2.dev"],"gitSource":{"type":"github","owner":"s2-streamstore","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adbbb7a6d07b13661cd85a0","collectionId":"146c9708-f08f-4ebd-9e49-a0d476507bca","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adbbb7a6d07b13661cd85a0"},"feedback":{"thumbs":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6adbbb7a6d07b13661cd85a0","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"API","count":27},{"language":"default","tag":"CLI","count":15},{"language":"default","tag":"Data Plane","count":15},{"language":"default","tag":"SDKs","count":14},{"language":"default","tag":"Concepts","count":13},{"language":"default","tag":"Integrations","count":13},{"language":"default","tag":"Platform","count":10},{"language":"default","tag":"Updates","count":10},{"language":"default","tag":"Control Plane","count":9},{"language":"default","tag":"Start","count":8}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","href":"/docs/_mintlify/custom/streamstore/c2f785041ee9d423/custom.css"},{"filePath":"asciinema-player.css","content":"@keyframes ap-loader-rotation{0%{transform:rotate(0deg)}to{transform:rotate(360deg)}}.ap-default-term-ff{--term-font-family:\"Cascadia Code\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace, \"Symbols Nerd Font\"}div.ap-wrapper{outline:0;height:100%;display:flex;justify-content:center}div.ap-wrapper .title-bar{display:none;top:-78px;transition:top .15s linear;position:absolute;left:0;right:0;box-sizing:content-box;font-size:20px;line-height:1em;padding:15px;font-family:sans-serif;color:#fff;background-color:rgba(0,0,0,.8)}div.ap-wrapper .title-bar img{vertical-align:middle;height:48px;margin-right:16px}div.ap-wrapper .title-bar a{color:#fff;text-decoration:underline}div.ap-wrapper .title-bar a:hover{text-decoration:none}div.ap-wrapper:fullscreen{background-color:#000;width:100%;align-items:center}div.ap-wrapper:fullscreen .title-bar{display:initial}div.ap-wrapper:fullscreen.hud .title-bar{top:0}div.ap-wrapper div.ap-player{text-align:left;display:inline-block;padding:0;position:relative;box-sizing:content-box;overflow:hidden;max-width:100%;border-radius:4px;font-size:15px;background-color:var(--term-color-background)}.ap-player{--term-color-foreground:#ffffff;--term-color-background:#000000;--term-color-0:var(--term-color-foreground);--term-color-1:var(--term-color-foreground);--term-color-2:var(--term-color-foreground);--term-color-3:var(--term-color-foreground);--term-color-4:var(--term-color-foreground);--term-color-5:var(--term-color-foreground);--term-color-6:var(--term-color-foreground);--term-color-7:var(--term-color-foreground);--term-color-8:var(--term-color-0);--term-color-9:var(--term-color-1);--term-color-10:var(--term-color-2);--term-color-11:var(--term-color-3);--term-color-12:var(--term-color-4);--term-color-13:var(--term-color-5);--term-color-14:var(--term-color-6);--term-color-15:var(--term-color-7)}div.ap-term{position:relative;font-family:var(--term-font-family);border-width:.75em;border-radius:0;border-style:solid;border-color:var(--term-color-background);box-sizing:content-box}div.ap-term canvas,div.ap-term svg.ap-term-symbols{position:absolute;inset:0;display:block;width:100%;height:100%}div.ap-term svg.ap-term-symbols{overflow:hidden;pointer-events:none}.ap-line span,div.ap-term svg.ap-term-symbols use{color:var(--term-color-foreground)}div.ap-term svg.ap-term-symbols:not(.ap-blink) .ap-blink{opacity:0}div.ap-term pre.ap-term-text{position:absolute;inset:0;box-sizing:content-box;overflow:hidden;padding:0;margin:0;display:block;white-space:pre;word-wrap:normal;word-break:normal;cursor:text;color:var(--term-color-foreground);outline:0;line-height:var(--term-line-height);font-family:inherit;font-size:inherit;font-variant-ligatures:none;border:0;border-radius:0;background-color:transparent!important}pre.ap-term-text .ap-line{display:block;width:100%;height:var(--term-line-height);position:absolute;top:calc(100%*var(--row)/var(--term-rows));letter-spacing:normal;overflow:hidden}pre.ap-term-text .ap-line span{position:absolute;left:calc(100%*var(--offset)/var(--term-cols));padding:0;display:inline-block;height:100%}pre.ap-term-text:not(.ap-blink) .ap-line .ap-blink{color:transparent;border-color:transparent}pre.ap-term-text .ap-bold{font-weight:700}pre.ap-term-text .ap-faint{opacity:.5}pre.ap-term-text .ap-underline{text-decoration:underline}pre.ap-term-text .ap-italic{font-style:italic}pre.ap-term-text .ap-strike{text-decoration:line-through}div.ap-player div.ap-control-bar{width:100%;height:32px;display:flex;justify-content:space-between;align-items:stretch;color:var(--term-color-foreground);box-sizing:content-box;line-height:1;position:absolute;bottom:0;left:0;opacity:0;transition:opacity .15s linear;user-select:none;border-top:2px solid color-mix(in oklab,var(--term-color-background) 80%,var(--term-color-foreground));z-index:30}div.ap-player div.ap-control-bar *{box-sizing:inherit}div.ap-control-bar svg.ap-icon path{fill:var(--term-color-foreground)}div.ap-control-bar span.ap-button{display:flex;flex:0 0 auto;cursor:pointer}div.ap-control-bar span.ap-playback-button{width:12px;height:12px;padding:10px;margin:0 0 0 2px}div.ap-control-bar span.ap-playback-button svg{height:12px;width:12px}div.ap-control-bar span.ap-timer{display:flex;flex:0 0 auto;min-width:50px;margin:0 10px;height:100%;text-align:center;font-size:13px;line-height:100%;cursor:default}div.ap-control-bar span.ap-timer span{font-family:var(--term-font-family);font-size:inherit;font-weight:600;margin:auto}div.ap-control-bar span.ap-timer .ap-time-remaining,div.ap-control-bar span.ap-timer:hover .ap-time-elapsed{display:none}div.ap-control-bar span.ap-timer:hover .ap-time-remaining{display:flex}div.ap-control-bar .ap-progressbar{display:block;flex:1 1 auto;height:100%;padding:0 10px}div.ap-control-bar .ap-progressbar .ap-bar{display:block;position:relative;cursor:default;height:100%;font-size:0}div.ap-control-bar .ap-progressbar .ap-bar .ap-gutter{display:block;position:absolute;top:15px;left:0;right:0;height:3px}div.ap-control-bar .ap-progressbar .ap-bar .ap-gutter-empty{background-color:color-mix(in oklab,var(--term-color-foreground) 20%,var(--term-color-background))}div.ap-control-bar .ap-progressbar .ap-bar .ap-gutter-full{width:100%;transform-origin:left center;background-color:var(--term-color-foreground);border-radius:3px}div.ap-control-bar.ap-seekable .ap-progressbar .ap-bar{cursor:pointer}div.ap-control-bar .ap-fullscreen-button{width:14px;height:14px;padding:9px;margin:0 2px 0 4px}div.ap-control-bar .ap-fullscreen-button svg{width:14px;height:14px}div.ap-control-bar .ap-fullscreen-button svg.ap-icon-fullscreen-on{display:inline}div.ap-control-bar .ap-fullscreen-button svg.ap-icon-fullscreen-off{display:none}div.ap-control-bar .ap-fullscreen-button .ap-tooltip,div.ap-control-bar .ap-kbd-button .ap-tooltip{right:5px;left:initial;transform:none}div.ap-control-bar .ap-kbd-button{height:14px;padding:9px;margin:0 0 0 4px}div.ap-control-bar .ap-kbd-button svg{width:26px;height:14px}div.ap-control-bar .ap-speaker-button{width:19px;padding:6px 9px;margin:0 0 0 4px;position:relative}div.ap-control-bar .ap-speaker-button svg{width:19px}div.ap-control-bar .ap-speaker-button .ap-tooltip{left:-50%;transform:none}div.ap-wrapper.ap-hud .ap-control-bar{opacity:1}div.ap-wrapper:fullscreen .ap-fullscreen-button svg.ap-icon-fullscreen-on{display:none}div.ap-wrapper:fullscreen .ap-fullscreen-button svg.ap-icon-fullscreen-off{display:inline}span.ap-progressbar span.ap-marker-container{display:block;top:0;bottom:0;width:21px;position:absolute;margin-left:-10px}span.ap-marker-container span.ap-marker{display:block;top:13px;bottom:12px;left:7px;right:7px;background-color:color-mix(in oklab,var(--term-color-foreground) 33%,var(--term-color-background));position:absolute;transition:top .1s,bottom .1s,left .1s,right .1s,background-color .1s;border-radius:50%}span.ap-marker-container span.ap-marker.ap-marker-past{background-color:var(--term-color-foreground)}span.ap-marker-container span.ap-marker:hover,span.ap-marker-container:hover span.ap-marker{background-color:var(--term-color-foreground);top:11px;bottom:10px;left:5px;right:5px}.ap-tooltip-container span.ap-tooltip{visibility:hidden;font-family:var(--term-font-family);font-weight:700;text-align:center;padding:0 .5em;border-radius:4px;position:absolute;z-index:1;white-space:nowrap;font-size:13px;line-height:2em;bottom:100%;left:50%;transform:translateX(-50%)}.ap-tooltip-container:hover span.ap-tooltip{visibility:visible}.ap-player .ap-overlay{z-index:10;background-repeat:no-repeat;background-position:center;position:absolute;top:0;left:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center}.ap-player .ap-overlay-start{cursor:pointer}.ap-player .ap-overlay-start .ap-play-button{font-size:0;position:absolute;left:0;top:0;right:0;bottom:0;text-align:center;color:#fff;height:80px;max-height:66%;margin:auto}.ap-player .ap-overlay-start .ap-play-button div{height:100%}.ap-player .ap-overlay-start .ap-play-button div span{height:100%;display:block}.ap-player .ap-overlay-start .ap-play-button div span svg{height:100%;display:inline-block}.ap-player .ap-overlay-start .ap-play-button svg{filter:drop-shadow(0 0 5px rgba(0,0,0,.4))}.ap-player .ap-overlay-loading .ap-loader{width:48px;height:48px;border-radius:50%;display:inline-block;position:relative;border:10px solid;border-color:rgba(255,255,255,.3) rgba(255,255,255,.5) rgba(255,255,255,.7) #fff;border-color:color-mix(in srgb,var(--term-color-foreground) 30%,var(--term-color-background)) color-mix(in srgb,var(--term-color-foreground) 50%,var(--term-color-background)) color-mix(in srgb,var(--term-color-foreground) 70%,var(--term-color-background)) color-mix(in srgb,var(--term-color-foreground) 100%,var(--term-color-background));box-sizing:border-box;animation:ap-loader-rotation 1s linear infinite}.ap-player .ap-overlay-help>div div,.ap-player .ap-overlay-info{background-color:var(--term-color-background)}.ap-player .ap-overlay-help>div div kbd,.ap-player .ap-overlay-info span,.ap-tooltip-container span.ap-tooltip{color:var(--term-color-background);background-color:var(--term-color-foreground)}.ap-player .ap-overlay-info span{font-family:var(--term-font-family);font-size:2em;font-weight:700;padding:.5em .75em;text-transform:uppercase}.ap-player .ap-overlay-help{background-color:rgba(0,0,0,.8);container-type:inline-size}.ap-player .ap-overlay-help>div{font-family:var(--term-font-family);max-width:85%;max-height:85%;font-size:18px;color:var(--term-color-foreground);box-sizing:border-box;margin-bottom:32px}.ap-player .ap-overlay-help>div div{padding:calc(min(4cqw,40px));font-size:calc(min(1.9cqw,18px));border:1px solid color-mix(in oklab,var(--term-color-background) 90%,var(--term-color-foreground));border-radius:6px}.ap-player .ap-overlay-help>div div p{font-weight:700;margin:0 0 2em}.ap-player .ap-overlay-help>div div ul{list-style:none;padding:0}.ap-player .ap-overlay-help>div div ul li{margin:0 0 .75em}.ap-player .ap-overlay-help>div div kbd{padding:.2em .5em;border-radius:.2em;font-family:inherit;font-size:.85em;border:0;margin:0}.ap-player .ap-overlay-error span{font-size:8em}.ap-player .slide-enter-active{transition:opacity .2s}.ap-player .slide-enter-active.ap-was-playing{transition:top .2s ease-out,opacity .2s}.ap-player .slide-exit-active{transition:top .2s ease-in,opacity .2s}.ap-player .slide-enter{top:-50%;opacity:0}.ap-player .slide-enter-to{top:0}.ap-player .slide-enter,.ap-player .slide-enter-to,.ap-player .slide-exit,.ap-player .slide-exit-to{bottom:auto;height:100%}.ap-player .slide-exit{top:0}.ap-player .slide-exit-to{top:-50%;opacity:0}.asciinema-player-theme-asciinema{--term-color-foreground:#cccccc;--term-color-background:#121314;--term-color-0:#000000;--term-color-1:#dd3c69;--term-color-2:#4ebf22;--term-color-3:#ddaf3c;--term-color-4:#26b0d7;--term-color-5:#b954e1;--term-color-6:#54e1b9;--term-color-7:#d9d9d9;--term-color-8:#4d4d4d;--term-color-9:#dd3c69;--term-color-10:#4ebf22;--term-color-11:#ddaf3c;--term-color-12:#26b0d7;--term-color-13:#b954e1;--term-color-14:#54e1b9;--term-color-15:#ffffff}.asciinema-player-theme-dracula{--term-color-foreground:#f8f8f2;--term-color-background:#282a36;--term-color-0:#21222c;--term-color-1:#ff5555;--term-color-2:#50fa7b;--term-color-3:#f1fa8c;--term-color-4:#bd93f9;--term-color-5:#ff79c6;--term-color-6:#8be9fd;--term-color-7:#f8f8f2;--term-color-8:#6272a4;--term-color-9:#ff6e6e;--term-color-10:#69ff94;--term-color-11:#ffffa5;--term-color-12:#d6acff;--term-color-13:#ff92df;--term-color-14:#a4ffff;--term-color-15:#ffffff}.asciinema-player-theme-monokai{--term-color-foreground:#f8f8f2;--term-color-background:#272822;--term-color-0:#272822;--term-color-1:#f92672;--term-color-2:#a6e22e;--term-color-3:#f4bf75;--term-color-4:#66d9ef;--term-color-5:#ae81ff;--term-color-6:#a1efe4;--term-color-7:#f8f8f2;--term-color-8:#75715e;--term-color-15:#f9f8f5}.asciinema-player-theme-nord{--term-color-foreground:#eceff4;--term-color-background:#2e3440;--term-color-0:#3b4252;--term-color-1:#bf616a;--term-color-2:#a3be8c;--term-color-3:#ebcb8b;--term-color-4:#81a1c1;--term-color-5:#b48ead;--term-color-6:#88c0d0;--term-color-7:#eceff4}.asciinema-player-theme-seti{--term-color-foreground:#cacecd;--term-color-background:#111213;--term-color-0:#323232;--term-color-1:#c22832;--term-color-2:#8ec43d;--term-color-3:#e0c64f;--term-color-4:#43a5d5;--term-color-5:#8b57b5;--term-color-6:#8ec43d;--term-color-7:#eeeeee;--term-color-15:#ffffff}.asciinema-player-theme-solarized-dark,.asciinema-player-theme-solarized-light{--term-color-0:#073642;--term-color-1:#dc322f;--term-color-2:#859900;--term-color-3:#b58900;--term-color-4:#268bd2;--term-color-5:#d33682;--term-color-6:#2aa198;--term-color-7:#eee8d5;--term-color-8:#002b36;--term-color-9:#cb4b16;--term-color-10:#586e75;--term-color-12:#839496;--term-color-13:#6c71c4;--term-color-14:#93a1a1;--term-color-15:#fdf6e3}.asciinema-player-theme-solarized-dark{--term-color-foreground:#839496;--term-color-background:#002b36;--term-color-11:#657b83}.asciinema-player-theme-solarized-light{--term-color-foreground:#657b83;--term-color-background:#fdf6e3;--term-color-11:#657c83}.asciinema-player-theme-solarized-light .ap-overlay-start .ap-play-button svg .ap-play-btn-fill{fill:var(--term-color-1)}.asciinema-player-theme-solarized-light .ap-overlay-start .ap-play-button svg .ap-play-btn-stroke{stroke:var(--term-color-1)}.asciinema-player-theme-tango{--term-color-foreground:#cccccc;--term-color-background:#121314;--term-color-0:#000000;--term-color-1:#cc0000;--term-color-2:#4e9a06;--term-color-3:#c4a000;--term-color-4:#3465a4;--term-color-5:#75507b;--term-color-6:#06989a;--term-color-7:#d3d7cf;--term-color-8:#555753;--term-color-9:#ef2929;--term-color-10:#8ae234;--term-color-11:#fce94f;--term-color-12:#729fcf;--term-color-13:#ad7fa8;--term-color-14:#34e2e2;--term-color-15:#eeeeec}.asciinema-player-theme-gruvbox-dark{--term-color-foreground:#fbf1c7;--term-color-background:#282828;--term-color-0:#282828;--term-color-1:#cc241d;--term-color-2:#98971a;--term-color-3:#d79921;--term-color-4:#458588;--term-color-5:#b16286;--term-color-6:#689d6a;--term-color-7:#a89984;--term-color-8:#7c6f65;--term-color-9:#fb4934;--term-color-10:#b8bb26;--term-color-11:#fabd2f;--term-color-12:#83a598;--term-color-13:#d3869b;--term-color-14:#8ec07c;--term-color-15:#fbf1c7}"}],"page":{"pagePath":"api/records/append","slug":"/api/records/append","pageMetadata":{"openapi":"post /streams/{stream}/records","sidebarTitle":"append","description":"Append a batch of records atomically to an S2 stream, with optional append conditions.","title":"Append records.","href":"/api/records/append"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Append a batch of records atomically to an S2 stream, with optional append conditions.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,CodeGroup,Heading}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);return _jsxs(_Fragment,{children:[_jsxs(CardGroup,{cols:3,children:[_jsx(Card,{title:`Append concepts`,icon:`pen`,href:`/concepts/appends`,children:_jsx(_components.p,{children:`Understand append acknowledgements, batching, and durability.`})}),_jsx(Card,{title:`Concurrency control`,icon:`sliders`,href:`/concepts/concurrency-control`,children:_jsx(_components.p,{children:`Coordinate writers with match sequence numbers and fencing tokens.`})}),_jsx(Card,{title:`Appending SDK`,icon:`code`,href:`/sdk/appending`,children:_jsx(_components.p,{children:`Use append sessions, the Producer API, batching, and backpressure.`})})]}),`\n`,_jsx(Heading,{level:`2`,id:`stream-config-on-auto-creation`,children:`Stream config on auto-creation`}),`\n`,_jsxs(_components.p,{children:[`If the basin has `,_jsx(_components.code,{children:`create_stream_on_append`}),` `,_jsx(_components.a,{href:`/concepts/configs#basin-config`,children:`configured`}),`, a stream that does not exist is created on first append with the basin’s default stream config.`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`s2-stream-config`}),` header can override that default for the new stream. Its value is a JSON-encoded `,_jsx(_components.a,{href:`/concepts/configs#stream-config`,children:_jsx(_components.code,{children:`StreamConfig`})}),`, the same object accepted by `,_jsx(_components.a,{href:`/api/streams/create`,children:`create`}),`. Unset fields inherit the basin’s default stream config.`]}),`\n`,_jsxs(_components.p,{children:[`The header is only applied when the append creates the stream. It is ignored if the stream already exists, so it is safe to send on every request. To change the config of an existing stream, use `,_jsx(_components.a,{href:`/api/streams/reconfigure`,children:`reconfigure`}),`.`]}),`\n`,_jsx(CodeGroup,{children:_jsx(CodeBlock,{filename:`Request`,numberOfLines:`10`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://{basin}.b.s2.dev/v1/streams/{stream}/records'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' \"Authorization: Bearer ${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`S2_ACCESS_TOKEN`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 's2-stream-config: {\"retention_policy\":{\"age\":3600},\"delete_on_empty\":{\"min_age_secs\":300}}'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"records\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"body\": \"started\" }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})}),`\n`,_jsxs(_components.p,{children:[`A header value that is not a valid `,_jsx(_components.code,{children:`StreamConfig`}),` is rejected with a `,_jsx(_components.code,{children:`400`}),` `,_jsx(_components.a,{href:`/api/error-codes`,children:_jsx(_components.code,{children:`bad_header`})}),` error. The same header is accepted on `,_jsx(_components.a,{href:`/api/records/read#stream-config-on-auto-creation`,children:`read`}),` for basins with `,_jsx(_components.code,{children:`create_stream_on_read`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"openapi":"post /streams/{stream}/records","sidebarTitle":"append","description":"Append a batch of records atomically to an S2 stream, with optional append conditions.","title":"Append records.","href":"/api/records/append"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Stream config on auto-creation","slug":"stream-config-on-auto-creation","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/streamstore/00ba98d0ea337170/asciinema-init.js","/docs/_mintlify/custom/streamstore/9345475b878fd043/asciinema-player.min.js","/docs/_mintlify/custom/streamstore/cf00df61fe9b4388/copy-page-markdown.js"],"openApiReferenceData":{"operation":{"tags":["records"],"summary":"Append records.","operationId":"append","parameters":["e06e44f6-ca35-400d-b2e2-1f75902d3991","1698968e-5614-4ca4-a5a2-7e5fa401072d","d1fbea29-2ffd-4ab9-b00c-87616b224961","4ad6d18b-3cc9-4793-b28e-b4242e05e986"],"requestBody":"2990305e-00da-4b35-8cfe-2939f45d163b","responses":{"200":"b70526e4-0f67-4931-a091-d189a22ce1c4","400":"ba667c2b-39d9-4c0f-8518-85d04894c7e5","403":"fd09a80e-f07b-4044-8c23-17b73b3a7b56","404":"d0b805b3-2f02-452e-a452-9a8f3c0c3658","408":"ae715fa4-5407-4343-9520-d4f5fec6d1e5","409":"40c35621-79c9-41bd-8ea4-75f4bbc559d6","412":"b4e77a3a-66c5-4382-998e-6a91147c479c"},"method":"post","type":"path","servers":["3f981a3d-bdf4-402c-8a86-f8ddfe78bd48"],"security":["e702926f-6fd7-494a-af77-5be9a0e0a9dc"],"path":"/streams/{stream}/records","baseUrlOptions":["https://{basin}.b.s2.dev/v1"],"title":"Append records.","description":"Append a batch of records atomically to an S2 stream, with optional append conditions.","codeSamples":[],"requestExampleLanguages":["bash"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"e06e44f6-ca35-400d-b2e2-1f75902d3991":{"name":"stream","in":"path","description":"Stream name.","required":true,"schema":{"type":"string","maxLength":512,"minLength":1,"isRequired":true,"description":"Stream name.","uniqueKey":"","typeLabel":"string"}},"1698968e-5614-4ca4-a5a2-7e5fa401072d":{"name":"s2-format","in":"header","description":"Defines the interpretation of record data (header name, header value, and body) with the JSON content type.\nUse `raw` (default) for efficient transmission and storage of Unicode data — storage will be in UTF-8.\nUse `base64` for safe transmission with efficient storage of binary data.","required":false,"schema":{"type":"string","enum":["raw","base64"],"isRequired":false,"description":"Defines the interpretation of record data (header name, header value, and body) with the JSON content type.\nUse `raw` (default) for efficient transmission and storage of Unicode data — storage will be in UTF-8.\nUse `base64` for safe transmission with efficient storage of binary data.","uniqueKey":"","typeLabel":"enum\u003cstring>"}},"d1fbea29-2ffd-4ab9-b00c-87616b224961":{"name":"s2-encryption-key","in":"header","description":"Encryption key material for append and read operations.\nProvide base64-encoded key when stream encryption is enabled.","required":false,"schema":{"type":"string","isRequired":false,"description":"Encryption key material for append and read operations.\nProvide base64-encoded key when stream encryption is enabled.","uniqueKey":"","typeLabel":"string"}},"4ad6d18b-3cc9-4793-b28e-b4242e05e986":{"name":"s2-stream-config","in":"header","description":"JSON-encoded `StreamConfig` to apply if the stream is created on append or read.\nUnset fields inherit the basin's default stream configuration.\nIgnored if the stream already exists.\nCompact JSON is preferred.","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"delete_on_empty":{"oneOf":[{"type":"null","uniqueKey":"delete_on_empty.oneOf.0","typeLabel":"null"},{"type":"object","description":"Delete-on-empty configuration.","properties":{"min_age_secs":{"type":"integer","format":"int64","description":"Minimum age in seconds before an empty stream can be deleted.\nSet to 0 (default) to disable delete-on-empty (don't delete automatically).","minimum":0,"uniqueKey":"delete_on_empty.oneOf.1.min_age_secs","typeLabel":"integer\u003cint64>"}},"uniqueKey":"delete_on_empty.oneOf.1","typeLabel":"object"}],"uniqueKey":"delete_on_empty","typeLabel":"null | object"},"retention_policy":{"oneOf":[{"type":"null","uniqueKey":"retention_policy.oneOf.0","typeLabel":"null"},{"type":"object","description":"Retention policy for the stream.\nIf unspecified, the default is to retain records for 7 days.","required":["age"],"properties":{"age":{"type":"integer","format":"int64","description":"Age in seconds for automatic trimming of records older than this threshold.\nThis must be set to a value greater than 0 seconds.","minimum":0,"isRequired":true,"uniqueKey":"retention_policy.oneOf.1.age","typeLabel":"integer\u003cint64>"}},"uniqueKey":"retention_policy.oneOf.1","typeLabel":"object"},{"type":"object","description":"Retention policy for the stream.\nIf unspecified, the default is to retain records for 7 days.","required":["infinite"],"properties":{"infinite":{"type":"object","description":"Retain records unless explicitly trimmed.","isRequired":true,"uniqueKey":"retention_policy.oneOf.2.infinite","typeLabel":"object"}},"uniqueKey":"retention_policy.oneOf.2","typeLabel":"object"}],"uniqueKey":"retention_policy","typeLabel":"null · object · object"},"storage_class":{"oneOf":[{"type":"string","description":"[Storage class](https://s2.dev/docs/storage-classes) for recent writes.","uniqueKey":"storage_class.oneOf.0","typeLabel":"string"},{"type":"null","description":"[Storage class](https://s2.dev/docs/storage-classes) for recent writes.","uniqueKey":"storage_class.oneOf.1","typeLabel":"null"}],"uniqueKey":"storage_class","typeLabel":"string | null"},"timestamping":{"oneOf":[{"type":"null","uniqueKey":"timestamping.oneOf.0","typeLabel":"null"},{"type":"object","description":"Timestamping behavior.","properties":{"mode":{"oneOf":[{"type":"null","uniqueKey":"timestamping.oneOf.1.mode.oneOf.0","typeLabel":"null"},{"type":"string","description":"Timestamping mode for appends that influences how timestamps are handled.","enum":["client-prefer","client-require","arrival"],"uniqueKey":"timestamping.oneOf.1.mode.oneOf.1","typeLabel":"enum\u003cstring>"}],"uniqueKey":"timestamping.oneOf.1.mode","typeLabel":"null | enum\u003cstring>"},"uncapped":{"oneOf":[{"type":"boolean","description":"Allow client-specified timestamps to exceed the arrival time.\nIf this is `false` or not set, client timestamps will be capped at the arrival time.","uniqueKey":"timestamping.oneOf.1.uncapped.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Allow client-specified timestamps to exceed the arrival time.\nIf this is `false` or not set, client timestamps will be capped at the arrival time.","uniqueKey":"timestamping.oneOf.1.uncapped.oneOf.1","typeLabel":"null"}],"uniqueKey":"timestamping.oneOf.1.uncapped","typeLabel":"boolean | null"}},"uniqueKey":"timestamping.oneOf.1","typeLabel":"object"}],"uniqueKey":"timestamping","typeLabel":"null | object"}},"isRequired":false,"description":"JSON-encoded `StreamConfig` to apply if the stream is created on append or read.\nUnset fields inherit the basin's default stream configuration.\nIgnored if the stream already exists.\nCompact JSON is preferred.","uniqueKey":"","typeLabel":"object"},"example":{"delete_on_empty":{"min_age_secs":300},"retention_policy":{"age":3600}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"Payload of an `append` request.","required":["records"],"properties":{"records":{"type":"array","items":{"type":"object","description":"Record to be appended to a stream.","properties":{"body":{"type":"string","description":"Body of the record.","uniqueKey":"records.items.[INDEX].body","typeLabel":"string"},"headers":{"type":"array","items":{"type":"array","items":{"type":"string","uniqueKey":"records.items.[INDEX].headers.items.[INDEX].items.[INDEX]","typeLabel":"string"},"maxItems":2,"minItems":2,"uniqueKey":"records.items.[INDEX].headers.items.[INDEX]","typeLabel":"string[]"},"description":"Series of name-value pairs for this record.","uniqueKey":"records.items.[INDEX].headers","typeLabel":"string[][]"},"timestamp":{"oneOf":[{"type":"null","uniqueKey":"records.items.[INDEX].timestamp.oneOf.0","typeLabel":"null"},{"type":"integer","description":"Timestamp for this record.\nThe service will always ensure monotonicity by adjusting it up if necessary to the maximum observed timestamp.\nRefer to stream timestamping configuration for the finer semantics around whether a client-specified timestamp is required, and whether it will be capped at the arrival time.","format":"int64","minimum":0,"uniqueKey":"records.items.[INDEX].timestamp.oneOf.1","typeLabel":"integer\u003cint64>"}],"uniqueKey":"records.items.[INDEX].timestamp","typeLabel":"null | integer\u003cint64>"}},"uniqueKey":"records.items.[INDEX]","typeLabel":"object"},"description":"Batch of records to append atomically, which must contain at least one record, and no more than 1000.\nThe total size of a batch of records may not exceed 1 MiB of metered bytes.","isRequired":true,"uniqueKey":"records","typeLabel":"object[]"},"fencing_token":{"oneOf":[{"type":"null","uniqueKey":"fencing_token.oneOf.0","typeLabel":"null"},{"type":"string","description":"Enforce a fencing token, which starts out as an empty string that can be overridden by a `fence` command record.","maxLength":36,"uniqueKey":"fencing_token.oneOf.1","typeLabel":"string"}],"uniqueKey":"fencing_token","typeLabel":"null | string"},"match_seq_num":{"oneOf":[{"type":"null","uniqueKey":"match_seq_num.oneOf.0","typeLabel":"null"},{"type":"integer","description":"Enforce that the sequence number assigned to the first record matches.","format":"int64","minimum":0,"uniqueKey":"match_seq_num.oneOf.1","typeLabel":"integer\u003cint64>"}],"uniqueKey":"match_seq_num","typeLabel":"null | integer\u003cint64>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"records":[{"body":"\u003cstring>","headers":[["\u003cstring>"]],"timestamp":1}],"fencing_token":"\u003cstring>","match_seq_num":1}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"b70526e4-0f67-4931-a091-d189a22ce1c4":{"description":"","content":{"application/json":{"schema":{"type":"object","description":"Success response to an `append` request.","required":["start","end","tail"],"properties":{"end":{"type":"object","description":"Sequence number of the last record that was appended `+ 1`, and timestamp of the last record that was appended.\nThe difference between `end.seq_num` and `start.seq_num` will be the number of records appended.","required":["seq_num","timestamp"],"properties":{"seq_num":{"type":"integer","format":"int64","minimum":0,"description":"Sequence number assigned by the service.","isRequired":true,"uniqueKey":"end.seq_num","typeLabel":"integer\u003cint64>"},"timestamp":{"type":"integer","format":"int64","minimum":0,"description":"Timestamp, which may be client-specified or assigned by the service.\nIf it is assigned by the service, it will represent milliseconds since Unix epoch.","isRequired":true,"uniqueKey":"end.timestamp","typeLabel":"integer\u003cint64>"}},"isRequired":true,"uniqueKey":"end","typeLabel":"object"},"start":{"type":"object","description":"Sequence number and timestamp of the first record that was appended.","required":["seq_num","timestamp"],"properties":{"seq_num":{"type":"integer","format":"int64","minimum":0,"description":"Sequence number assigned by the service.","isRequired":true,"uniqueKey":"start.seq_num","typeLabel":"integer\u003cint64>"},"timestamp":{"type":"integer","format":"int64","minimum":0,"description":"Timestamp, which may be client-specified or assigned by the service.\nIf it is assigned by the service, it will represent milliseconds since Unix epoch.","isRequired":true,"uniqueKey":"start.timestamp","typeLabel":"integer\u003cint64>"}},"isRequired":true,"uniqueKey":"start","typeLabel":"object"},"tail":{"type":"object","description":"Sequence number that will be assigned to the next record on the stream, and timestamp of the last record on the stream.\nThis can be greater than the `end` position in case of concurrent appends.","required":["seq_num","timestamp"],"properties":{"seq_num":{"type":"integer","format":"int64","minimum":0,"description":"Sequence number assigned by the service.","isRequired":true,"uniqueKey":"tail.seq_num","typeLabel":"integer\u003cint64>"},"timestamp":{"type":"integer","format":"int64","minimum":0,"description":"Timestamp, which may be client-specified or assigned by the service.\nIf it is assigned by the service, it will represent milliseconds since Unix epoch.","isRequired":true,"uniqueKey":"tail.timestamp","typeLabel":"integer\u003cint64>"}},"isRequired":true,"uniqueKey":"tail","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"end":{"seq_num":1,"timestamp":1},"start":{"seq_num":1,"timestamp":1},"tail":{"seq_num":1,"timestamp":1}}}},"exampleType":"generated"}},"exampleType":"generated"},"ba667c2b-39d9-4c0f-8518-85d04894c7e5":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"\u003cstring>","message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"fd09a80e-f07b-4044-8c23-17b73b3a7b56":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"\u003cstring>","message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"d0b805b3-2f02-452e-a452-9a8f3c0c3658":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"\u003cstring>","message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"ae715fa4-5407-4343-9520-d4f5fec6d1e5":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"\u003cstring>","message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"40c35621-79c9-41bd-8ea4-75f4bbc559d6":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"\u003cstring>","message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"b4e77a3a-66c5-4382-998e-6a91147c479c":{"description":"","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"fencing token","description":"Aborted due to a failed condition.","required":["fencing_token_mismatch"],"properties":{"fencing_token_mismatch":{"type":"string","maxLength":36,"description":"Fencing token did not match.\nThe expected fencing token is returned.","isRequired":true,"uniqueKey":"oneOf.0.fencing_token_mismatch","typeLabel":"string"}},"uniqueKey":"oneOf.0","typeLabel":"fencing token · object"},{"type":"object","title":"seq num","description":"Aborted due to a failed condition.","required":["seq_num_mismatch"],"properties":{"seq_num_mismatch":{"type":"integer","format":"int64","minimum":0,"description":"Sequence number did not match the tail of the stream.\nThe expected next sequence number is returned.","isRequired":true,"uniqueKey":"oneOf.1.seq_num_mismatch","typeLabel":"integer\u003cint64>"}},"uniqueKey":"oneOf.1","typeLabel":"seq num · object"}],"uniqueKey":"","typeLabel":"fencing token · object | seq num · object"},"examples":{"Example":{"title":"Example","value":{"fencing_token_mismatch":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"e702926f-6fd7-494a-af77-5be9a0e0a9dc":{"access_token":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your access token.","scopes":[],"schemeName":"access_token"}}},"servers":{"3f981a3d-bdf4-402c-8a86-f8ddfe78bd48":{"url":"https://{basin}.b.s2.dev/v1","description":"Endpoint for the basin","variables":{"basin":{"default":"","description":"Basin name"}}}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your access token.","scopes":[],"schemeName":"access_token"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your access token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"access_token","name":"Authorization"}],"title":"access_token"}]},"originalFileLocation":"specs-denorm/v1/openapi.json"},"subdomain":"streamstore","siteName":"S2","title":"Append records. - S2","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-14T18:23:43.398Z","originalFileLocation":"api/records/append.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Append a batch of records atomically to an S2 stream, with optional append conditions.\">\u003cmeta data-mint-head name=\"application-name\" content=\"S2\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/streamstore/A9aRpo3I3-CnbGBz/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/streamstore/A9aRpo3I3-CnbGBz/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/streamstore/A9aRpo3I3-CnbGBz/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/streamstore/A9aRpo3I3-CnbGBz/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/streamstore/A9aRpo3I3-CnbGBz/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/streamstore/A9aRpo3I3-CnbGBz/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/streamstore/A9aRpo3I3-CnbGBz/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/streamstore/A9aRpo3I3-CnbGBz/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/streamstore/A9aRpo3I3-CnbGBz/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Append records. - S2\">\u003cmeta data-mint-head property=\"og:description\" content=\"Append a batch of records atomically to an S2 stream, with optional append conditions.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"S2\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://s2.dev/docs/api/records/append\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://streamstore.mintlify.app/_mintlify/api/og/v2?division=records\u0026amp;title=Append+records.\u0026amp;description=Append+a+batch+of+records+atomically+to+an+S2+stream%2C+with+optional+append+conditions.\u0026amp;theme=0bf2fcc0d6937ccab2e1eca2\u0026amp;signature=d5561a3996ba860dafca3943ecb8b1f748acf315b08dd204b6110924c75478fd\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Append records. - S2\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Append a batch of records atomically to an S2 stream, with optional append conditions.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://streamstore.mintlify.app/_mintlify/api/og/v2?division=records\u0026amp;title=Append+records.\u0026amp;description=Append+a+batch+of+records+atomically+to+an+S2+stream%2C+with+optional+append+conditions.\u0026amp;theme=0bf2fcc0d6937ccab2e1eca2\u0026amp;signature=d5561a3996ba860dafca3943ecb8b1f748acf315b08dd204b6110924c75478fd\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/streamstore/A9aRpo3I3-CnbGBz/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"S2\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#252525\">\u003clink data-mint-head rel=\"canonical\" href=\"https://s2.dev/docs/api/records/append\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api/records/append.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://s2.dev/#organization\",\"name\":\"S2\",\"url\":\"https://s2.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/streamstore/2KVWF55FbBFAHG9D/logo/s2-black.png?fit=max\u0026auto=format\u0026n=2KVWF55FbBFAHG9D\u0026q=85\u0026s=a21a60dc6c4cc961bb234a8eba956217\"}},{\"@type\":\"WebSite\",\"@id\":\"https://s2.dev/docs#website\",\"name\":\"S2\",\"url\":\"https://s2.dev/docs\",\"publisher\":{\"@id\":\"https://s2.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://s2.dev/docs/api/records/append#webpage\",\"url\":\"https://s2.dev/docs/api/records/append\",\"name\":\"Append records.\",\"description\":\"Append a batch of records atomically to an S2 stream, with optional append conditions.\",\"dateModified\":\"2026-09-14T18:23:43.398Z\",\"isPartOf\":{\"@id\":\"https://s2.dev/docs#website\"},\"breadcrumb\":{\"@id\":\"https://s2.dev/docs/api/records/append#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://s2.dev/docs/api/records/append#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"S2\",\"item\":\"https://s2.dev/docs\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Append records.\",\"item\":\"https://s2.dev/docs/api/records/append\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://s2.dev/docs/api/records/append#apireference\",\"headline\":\"Append records.\",\"name\":\"Append records.\",\"description\":\"Append a batch of records atomically to an S2 stream, with optional append conditions.\",\"url\":\"https://s2.dev/docs/api/records/append\",\"mainEntityOfPage\":{\"@id\":\"https://s2.dev/docs/api/records/append#webpage\"},\"dateModified\":\"2026-09-14T18:23:43.398Z\",\"publisher\":{\"@id\":\"https://s2.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://s2.dev/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"S2\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"S2","nav":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://s2.dev/blog"},{"anchor":"Talk to us","icon":"comments","href":"https://s2.dev/contact"}]},"tabs":[{"tab":"Start","pages":[{"title":"Start","href":"/intro"}]},{"tab":"Concepts","pages":[{"title":"Concepts","href":"/concepts/records"}]},{"tab":"Platform","pages":[{"title":"Platform","href":"/platform/cells"}]},{"tab":"SDKs","pages":[{"title":"SDKs","href":"/sdk/languages"}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli/overview"}]},{"tab":"API","pages":[{"title":"Protocol","icon":"link","href":"/api/protocol"},{"title":"Endpoints","icon":"globe-pointer","href":"/api/endpoints"},{"title":"Error Codes","description":"Error codes returned by the S2 API, including retryability and structured error bodies.","icon":"circle-exclamation","href":"/api/error-codes"},{"group":"records","pages":[{"openapi":"post /streams/{stream}/records","sidebarTitle":"append","title":"Append records.","href":"/api/records/append"},{"openapi":"get /streams/{stream}/records","sidebarTitle":"read","description":"Read records from an S2 stream by sequence number, timestamp, or tail offset.","title":"Read records.","href":"/api/records/read"},{"openapi":"get /streams/{stream}/records/tail","sidebarTitle":"check tail","title":"Check the tail.","href":"/api/records/check-tail"}]},{"group":"access tokens","pages":[{"openapi":"get /access-tokens","sidebarTitle":"list","title":"List access tokens.","href":"/api/access-tokens/list"},{"openapi":"post /access-tokens","sidebarTitle":"issue","title":"Issue a new access token.","href":"/api/access-tokens/issue"},{"openapi":"delete /access-tokens/{id}","sidebarTitle":"revoke","title":"Revoke an access token.","href":"/api/access-tokens/revoke"}]},{"group":"streams","pages":[{"openapi":"get /streams","sidebarTitle":"list","title":"List streams.","href":"/api/streams/list"},{"openapi":"post /streams","sidebarTitle":"create","title":"Create a stream.","href":"/api/streams/create"},{"openapi":"put /streams/{stream}","sidebarTitle":"ensure","title":"Ensure a stream.","href":"/api/streams/ensure"},{"openapi":"get /streams/{stream}","sidebarTitle":"get config","title":"Get stream configuration.","href":"/api/streams/get-config"},{"openapi":"patch /streams/{stream}","sidebarTitle":"reconfigure","title":"Reconfigure a stream.","href":"/api/streams/reconfigure"},{"openapi":"delete /streams/{stream}","sidebarTitle":"delete","title":"Delete a stream.","href":"/api/streams/delete"}]},{"group":"basins","pages":[{"openapi":"get /basins","sidebarTitle":"list","title":"List basins.","href":"/api/basins/list"},{"openapi":"post /basins","sidebarTitle":"create","title":"Create a basin.","href":"/api/basins/create"},{"openapi":"put /basins/{basin}","sidebarTitle":"ensure","title":"Ensure a basin.","href":"/api/basins/ensure"},{"openapi":"get /basins/{basin}","sidebarTitle":"get config","title":"Get basin configuration.","href":"/api/basins/get-config"},{"openapi":"patch /basins/{basin}","sidebarTitle":"reconfigure","title":"Reconfigure a basin.","href":"/api/basins/reconfigure"},{"openapi":"delete /basins/{basin}","sidebarTitle":"delete","title":"Delete a basin.","href":"/api/basins/delete"}]},{"group":"metrics","pages":[{"openapi":"get /metrics","sidebarTitle":"account-level","title":"Account-level metrics.","href":"/api/metrics/account"},{"openapi":"get /metrics/{basin}","sidebarTitle":"basin-level","title":"Basin-level metrics.","href":"/api/metrics/basin"},{"openapi":"get /metrics/{basin}/{stream}","sidebarTitle":"stream-level","title":"Stream-level metrics.","href":"/api/metrics/stream"}]},{"group":"locations","pages":[{"openapi":"get /locations","sidebarTitle":"list","title":"List locations.","href":"/api/locations/list"},{"openapi":"get /locations/default","sidebarTitle":"get default","title":"Get the default location.","href":"/api/locations/get-default"},{"openapi":"put /locations/default","sidebarTitle":"set default","title":"Set the default location.","href":"/api/locations/set-default"}]}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/overview"}]},{"tab":"Updates","pages":[{"title":"Updates","href":"/updates"}]}]},"title":"Append records. - S2","buildId":"dpl_AUojGTPodKNPTVaxVPcxnNvkSVqo","deploymentId":"dpl_AUojGTPodKNPTVaxVPcxnNvkSVqo","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-D2GYGXhJ.js","utils-BFd71lo2.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-i162M7Za.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-oUw0la6W.js","snippetPresets-DtIWL37f.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-BCMBbEQM.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-DC4RgS91.js","shallow-CgVeLRFv.js","getApiPlaygroundDisplay-D5biMY5x.js","CodeSnippet-BFsbT-Fu.js","CodeSnippets-zLLOIece.js","Page-Ddn8iQDL.js","getPastedJson-BrHW4jRt.js","icon-CkMCp-Tk.js","MethodPill-CCcSM-Ep.js","DuplicateIcon-4tBrFI-V.js","createIcon-YbZxtfvX.js","DynamicMarkdown-BQC1aHST.js","SectionHeading-Dyh8yRs0.js","axios-vUo_bRtp.js","Markdown-DnRxVfNy.js","clsx-BHwt7gjg.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CI1QhstW.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Ctpizp2W.js"]}