previous_response_id. previous_response_id is a shortcut for the common case: it points a new request at a completed prior response so you don’t have to resend the conversation yourself.
Replay conversation turns yourself
Send the next turn as aninput array that includes the prior turns. Each turn is a message item with a role (user or assistant). Append the new question at the end.
Resume from a prior response
Instead of resending the conversation, point the next request at a completed prior response and send only the new turn.The Agent API persists response and conversation state server-side so responses can be retrieved (
store) or continued (previous_response_id). Setting store: false only hides a response from retrieval — it does not disable persistence, and the response can still be used as a continuation source. If your account has a Zero Data Retention (ZDR) agreement with Perplexity, check with your account team before relying on stateful features — contact api@perplexity.ai.- Create the first response and keep its
id. - Send the follow-up with
previous_response_idset to thatid. - Put only the new user turn in
input.
How continuity works
The new request continues from the prior response’s saved conversation state. That state includes the prior chain, so you can continue from the latest response in a multi-turn thread instead of manually replaying every earlier turn. Use this for conversational follow-ups where the next turn should build on earlier user and assistant messages. Continue sending any new instructions, tools, or model settings that you want to apply to the new response.Retrieve a response
Fetch a completed response later by itsid. This does not start a new turn; it returns a JSON snapshot of the original response.
store omitted or true; a store: false response returns a 404 on retrieval. For a response you need to be able to retrieve reliably, create it with background: true.
Storage behavior
store controls whether a response is visible through user-facing retrieval surfaces. It does not prevent that response from being used as a previous_response_id continuation source.
| Setting | Behavior |
|---|---|
Omitted or true | The response can be retrieved later and can be used as previous_response_id. |
false | The response is hidden from user-facing retrieval, but it can still be used as previous_response_id. |
store: false when you do not want the response exposed through retrieval, but still need the next request in your application flow to continue from it. For example, retrieving a store: false response returns a 404, but you can still continue from it with previous_response_id:
Requirements and errors
previous_response_idmust reference a prior Agent API response from the same account.- The prior response must be completed. If it is still running, has failed, or the id cannot be resolved, the API returns a
400error instead of starting a valid follow-up. - If you need to continue from a response that is still running, wait for it to complete and retry with the same
previous_response_id.
Next steps
Image Attachments
Attach images to a request.
Output Control
Control streaming, background runs, error handling, and structured output.