Move a session to a project
curl --request PATCH \
--url https://api.tensorpro.ai/api/v1/sessions/{session_id}/project \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>"
}
'import requests
url = "https://api.tensorpro.ai/api/v1/sessions/{session_id}/project"
payload = { "project_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({project_id: '<string>'})
};
fetch('https://api.tensorpro.ai/api/v1/sessions/{session_id}/project', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tensorpro.ai/api/v1/sessions/{session_id}/project",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tensorpro.ai/api/v1/sessions/{session_id}/project"
payload := strings.NewReader("{\n \"project_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tensorpro.ai/api/v1/sessions/{session_id}/project")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorpro.ai/api/v1/sessions/{session_id}/project")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "chat-42",
"title": "Website planning",
"created_at": "2026-11-10T04:40:02+00:00",
"updated_at": "2026-11-10T04:43:25+00:00",
"message_count": 4,
"last_message_preview": "Sara manages the website project.",
"project_id": "b4c8e2f6-1a3d-4e5f-9b7c-2d6e8f0a1b3c",
"is_archived": false
}
Sessions
Move a session to a project
Move a session into a project, or pass project_id: null to make it general chat.
PATCH
/
api
/
v1
/
sessions
/
{session_id}
/
project
Move a session to a project
curl --request PATCH \
--url https://api.tensorpro.ai/api/v1/sessions/{session_id}/project \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>"
}
'import requests
url = "https://api.tensorpro.ai/api/v1/sessions/{session_id}/project"
payload = { "project_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({project_id: '<string>'})
};
fetch('https://api.tensorpro.ai/api/v1/sessions/{session_id}/project', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tensorpro.ai/api/v1/sessions/{session_id}/project",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tensorpro.ai/api/v1/sessions/{session_id}/project"
payload := strings.NewReader("{\n \"project_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tensorpro.ai/api/v1/sessions/{session_id}/project")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorpro.ai/api/v1/sessions/{session_id}/project")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "chat-42",
"title": "Website planning",
"created_at": "2026-11-10T04:40:02+00:00",
"updated_at": "2026-11-10T04:43:25+00:00",
"message_count": 4,
"last_message_preview": "Sara manages the website project.",
"project_id": "b4c8e2f6-1a3d-4e5f-9b7c-2d6e8f0a1b3c",
"is_archived": false
}
Use this endpoint to move a conversation into a project, or back to general chat.
See Error handling.
What EDN does
Changes which project the session belongs to and returns the updated session.Required headers
| Header | Value | Description |
|---|---|---|
Authorization | Bearer YOUR_API_KEY | Your EDN API key. Create keys in the Console. See Authentication |
Content-Type | application/json | The request body is JSON |
Request
Path parameters
| Parameter | Type | Description |
|---|---|---|
session_id | string | Identifier for the session to move |
Body
| Field | Type | Required | Description |
|---|---|---|---|
project_id | string or null | Yes | The project to move the session into, or null to make it general chat. Must be one of your projects |
curl -X PATCH "https://api.tensorpro.ai/api/v1/sessions/chat-42/project" \
-H "Authorization: Bearer $EDN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": "b4c8e2f6-1a3d-4e5f-9b7c-2d6e8f0a1b3c"
}'
import os
import requests
resp = requests.patch(
"https://api.tensorpro.ai/api/v1/sessions/chat-42/project",
headers={"Authorization": f"Bearer {os.environ['EDN_API_KEY']}"},
json={
"project_id": "b4c8e2f6-1a3d-4e5f-9b7c-2d6e8f0a1b3c"
},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.tensorpro.ai/api/v1/sessions/chat-42/project", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.EDN_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"project_id": "b4c8e2f6-1a3d-4e5f-9b7c-2d6e8f0a1b3c"
}),
});
console.log(await resp.json());
Response
200 OK
{
"id": "chat-42",
"title": "Website planning",
"created_at": "2026-11-10T04:40:02+00:00",
"updated_at": "2026-11-10T04:43:25+00:00",
"message_count": 4,
"last_message_preview": "Sara manages the website project.",
"project_id": "b4c8e2f6-1a3d-4e5f-9b7c-2d6e8f0a1b3c",
"is_archived": false
}
| Field | Type | Description |
|---|---|---|
id | string | Identifier for the session |
title | string | The session’s title |
created_at | string (date-time) | When the session was created |
updated_at | string (date-time) | When the session was last active |
message_count | integer | How many messages are stored in the session |
last_message_preview | string or null | The start of the latest saved turn, up to 200 characters |
project_id | string or null | The project the session belongs to, or null for general chat |
is_archived | boolean | true when the session was archived in the Console |
Important behavior
- Moving a session doesn’t move its memories. Which memory a request uses is set by
project_idon each call.
Errors
| Status | Code | When |
|---|---|---|
401 | UNAUTHORIZED | The API key is missing, invalid or revoked |
404 | NOT_FOUND | The session or project doesn’t exist or isn’t yours |
429 | RATE_LIMITED | Per-minute limit reached. Retry after Retry-After seconds |
500 | INTERNAL_ERROR | Something failed on EDN’s side. Retry later |
{
"id": "chat-42",
"title": "Website planning",
"created_at": "2026-11-10T04:40:02+00:00",
"updated_at": "2026-11-10T04:43:25+00:00",
"message_count": 4,
"last_message_preview": "Sara manages the website project.",
"project_id": "b4c8e2f6-1a3d-4e5f-9b7c-2d6e8f0a1b3c",
"is_archived": false
}
Authorizations
Body
application/json
Response
Successful Response
