Skip to main content
Pinecone Docs
current

Search documentation

Type to search this documentation.

Stream a query turn's events (SSE)

The turn's events as they land — the same type-named events POST /query emits with stream: true, as a standalone resumable subscription. Reconnect with Last-Event-ID to replay from where the stream dropped.

GET /queries/{id}/events

cURL
curl --request GET \
  --url https://{host}/api/queries/{id}/events \
  --header 'Authorization: Bearer <token>' \
  --header 'Last-Event-ID: <last-event-id>' \
  --header 'X-Pinecone-Api-Version: <x-pinecone-api-version>'
Python
import requests

url = "https://{host}/api/queries/{id}/events"

headers = {
    "Authorization": "Bearer <token>",
    "Last-Event-ID": "<last-event-id>",
    "X-Pinecone-Api-Version": "<x-pinecone-api-version>"
}

response = requests.get(url, headers=headers)

print(response.text)
JavaScript
const options = {method: "GET", headers: {"Authorization": "Bearer <token>", "Last-Event-ID": "<last-event-id>", "X-Pinecone-Api-Version": "<x-pinecone-api-version>"}};

fetch("https://{host}/api/queries/{id}/events", options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
PHP
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://{host}/api/queries/{id}/events",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Last-Event-ID: <last-event-id>",
    "X-Pinecone-Api-Version: <x-pinecone-api-version>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
Go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://{host}/api/queries/{id}/events"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Last-Event-ID", "<last-event-id>")
	req.Header.Add("X-Pinecone-Api-Version", "<x-pinecone-api-version>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
Java
HttpResponse<String> response = Unirest.get("https://{host}/api/queries/{id}/events")
  .header("Authorization", "Bearer <token>")
  .header("Last-Event-ID", "<last-event-id>")
  .header("X-Pinecone-Api-Version", "<x-pinecone-api-version>")
  .asString();
Ruby
require 'uri'
require 'net/http'

url = URI("https://{host}/api/queries/{id}/events")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Last-Event-ID"] = '<last-event-id>'
request["X-Pinecone-Api-Version"] = '<x-pinecone-api-version>'

response = http.request(request)
puts response.read_body
Authorizationstringrequired

Session token from POST /auth/login, sent as Authorization: Bearer <token>.

Last-Event-ID?string

Resume from this event seq; delivery is inclusive of the given id (re-sending the last event is harmless — clients merge steps idempotently by step_id).

Typestring
X-Pinecone-Api-Version?string

Date-based contract version, echoed back on the same header. Omit for the default (2026-07); send unstable for the in-development surface. An unrecognized value is rejected with 400 unsupported_api_version.

Typestring
Default2026-07
idstringrequired

Query turn id.

Typestring

200 — SSE event stream; each event: name is the event type and data: is its JSON payload.

The turn was accepted. First frame of every stream.

type?string

Identifies the event.

Typestring
query_id?string

The turn that was created.

Typestring
session_id?string

The session the turn runs in — the one it continued, or the one it just started.

Typestring
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu