TypeScript SDK
import { Client } from "@notionhq/client"
const notion = new Client({ auth: process.env.NOTION_API_KEY })
const response = await notion.sessions.retrieve({
session_id: "2a1c7c06-781b-4987-9986-5c8dd3028014"
})curl --request GET \
--url https://api.notion.com/v1/sessions/{session_id} \
--header 'Authorization: Bearer <token>' \
--header 'Notion-Version: <notion-version>'import requests
url = "https://api.notion.com/v1/sessions/{session_id}"
headers = {
"Notion-Version": "<notion-version>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.notion.com/v1/sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Notion-Version: <notion-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.notion.com/v1/sessions/{session_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Notion-Version", "<notion-version>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.notion.com/v1/sessions/{session_id}")
.header("Notion-Version", "<notion-version>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notion.com/v1/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Notion-Version"] = '<notion-version>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "session",
"id": "<string>",
"agent_id": "<string>",
"title": "<string>",
"status": "queued",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"type": "user"
},
"agent_version": {
"id": "<string>",
"number": 2,
"published_at": "2023-11-07T05:31:56Z"
},
"models": {
"type": "auto"
},
"required_actions": [
{
"action_id": "<string>",
"title": "<string>",
"options": [
{
"id": "approve",
"label": "<string>"
}
]
}
],
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true
},
"trigger_type": "<string>",
"type_labels": [
"<string>"
],
"chat_user_emails": [
"<string>"
],
"tool_types": [
"<string>"
],
"tool_call_count": 1,
"credits_used": 123,
"runs_completed": 1,
"message_count": 1
}{
"object": "error",
"message": "<string>",
"code": "invalid_json",
"status": 400,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "unauthorized",
"status": 401,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "restricted_resource",
"status": 403,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "object_not_found",
"status": 404,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "row_limit_exceeded",
"status": 406,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "conflict_error",
"status": 409,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "rate_limited",
"status": 429,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "internal_server_error",
"status": 500,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "service_unavailable",
"status": 503,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "gateway_timeout",
"status": 504,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "service_overload",
"status": 529,
"additional_data": {}
}Agents
Retrieve a session
Retrieve the status, metadata, and required actions for a session.
GET
/
v1
/
sessions
/
{session_id}
TypeScript SDK
import { Client } from "@notionhq/client"
const notion = new Client({ auth: process.env.NOTION_API_KEY })
const response = await notion.sessions.retrieve({
session_id: "2a1c7c06-781b-4987-9986-5c8dd3028014"
})curl --request GET \
--url https://api.notion.com/v1/sessions/{session_id} \
--header 'Authorization: Bearer <token>' \
--header 'Notion-Version: <notion-version>'import requests
url = "https://api.notion.com/v1/sessions/{session_id}"
headers = {
"Notion-Version": "<notion-version>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.notion.com/v1/sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Notion-Version: <notion-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.notion.com/v1/sessions/{session_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Notion-Version", "<notion-version>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.notion.com/v1/sessions/{session_id}")
.header("Notion-Version", "<notion-version>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.notion.com/v1/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Notion-Version"] = '<notion-version>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "session",
"id": "<string>",
"agent_id": "<string>",
"title": "<string>",
"status": "queued",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"type": "user"
},
"agent_version": {
"id": "<string>",
"number": 2,
"published_at": "2023-11-07T05:31:56Z"
},
"models": {
"type": "auto"
},
"required_actions": [
{
"action_id": "<string>",
"title": "<string>",
"options": [
{
"id": "approve",
"label": "<string>"
}
]
}
],
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true
},
"trigger_type": "<string>",
"type_labels": [
"<string>"
],
"chat_user_emails": [
"<string>"
],
"tool_types": [
"<string>"
],
"tool_call_count": 1,
"credits_used": 123,
"runs_completed": 1,
"message_count": 1
}{
"object": "error",
"message": "<string>",
"code": "invalid_json",
"status": 400,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "unauthorized",
"status": 401,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "restricted_resource",
"status": 403,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "object_not_found",
"status": 404,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "row_limit_exceeded",
"status": 406,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "conflict_error",
"status": 409,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "rate_limited",
"status": 429,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "internal_server_error",
"status": 500,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "service_unavailable",
"status": 503,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "gateway_timeout",
"status": 504,
"additional_data": {}
}{
"object": "error",
"message": "<string>",
"code": "service_overload",
"status": 529,
"additional_data": {}
}The response carries the session’s status and metadata, including any actions waiting on you. To read a session’s messages and agent thinking, use Query session events.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The API version to use for this request. The latest version is 2026-03-11.
Available options:
2026-03-11 Path Parameters
The ID of the session to retrieve.
Response
Always session
Allowed value:
"session"One of: queued, in_progress, requires_action, completed, failed, canceled, terminated
Available options:
queued, in_progress, requires_action, completed, failed, canceled, terminated Show child attributes
Show child attributes
Show child attributes
Show child attributes
- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0