Stateful API calls can make a multi-turn application simpler, but they also move part of the conversation record outside your system. Treat that as a storage and recovery decision—not merely a convenience feature.
Start with the retention boundary
The Interactions API documentation says that Interaction objects are stored by default (store=true). It documents a 55-day retention period for the paid tier and one day for the free tier. Those are provider-documented defaults, not a retention test and not a promise about another provider or an API gateway.
The first design record for a stateful integration should therefore include:
- the project or service tier;
- the active retention setting and its effective boundary;
- which party owns application copies, deletion requests, and any operational export; and
- what the application does when the referenced history expires or is deleted.
Do not describe store=false as a universal zero-retention guarantee. The documentation says it opts the interaction out of storage, is incompatible with background execution, and prevents using previous_interaction_id for later turns. It addresses Interaction storage, not every possible log, backup, or copy.
Make recovery an explicit choice
Using previous_interaction_id retrieves conversation history, but it does not make the whole application state durable. The documentation says that tools, system_instruction, and generation_config remain interaction-scoped and must be supplied again when needed. A stateless design instead sends the full conversation history on each request.
That creates two defensible patterns:
- Bounded server-history dependency. Keep the interaction identifier, document the expiry window, and define a user-visible restart or rehydration path when history is unavailable.
- Governed application history. Keep only the transcript or state your policy permits, with ownership, deletion, access, and recovery rules defined by the application.
Neither pattern is automatically safer. A second transcript can increase exposure and deletion work; relying entirely on remote history can make expiry or deletion a product failure. Choose based on the data, recovery requirement, and acceptable operational burden.
Test the missing-history path before rollout
Use non-sensitive fixtures to exercise an expired or deleted interaction, a missing identifier, and a request that needs interaction-scoped configuration again. Verify that the application fails clearly, does not silently invent context, and gives the user a bounded way to continue. Record the observed behavior as a test result; do not infer it from a retention setting.
The practical rule is simple: before adopting server-side interaction state, write down where history lives, how long the documented boundary lasts, who can request deletion, and how the application recovers when the record is gone. That checklist remains useful when comparing APIs, because similar-looking conversation identifiers do not establish equivalent retention or recovery semantics.