Skip to main content
POST
/
sessions
/
{session_id}
/
cookies
python
import json
from notte_sdk import NotteClient

notte = NotteClient()
# load the cookies from json and inject them in the session
with open("cookies.json", "r") as f:
    cookies = json.load(f)

with notte.Session() as session:
    cookies = session.set_cookies(cookies)
import { NotteClient } from "notte-sdk";
import { readFileSync } from "fs";

const notte = new NotteClient();
// load the cookies from json and inject them in the session
const cookies = JSON.parse(readFileSync("cookies.json", "utf-8"));

await notte.Session().use(async (session) => {
await session.setCookies(cookies);
});
curl -X POST "https://api.notte.cc/sessions/$session_id/cookies" \
-H "Authorization: Bearer $NOTTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"cookies": [
{
"name": "name",
"value": "value",
"domain": ".googl.com",
"path": "/",
"httpOnly": false,
"hostOnly": null,
"sameSite": "Lax",
"secure": true,
"session": null,
"storeId": null,
"expires": -1
}
]
}'
{
  "success": true,
  "message": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

x-notte-request-origin
string | null
x-notte-sdk-version
string | null

Path Parameters

session_id
string
required

Query Parameters

update_metadata
boolean
default:true

Body

application/json
cookies
Cookie · object[]
required

Response

Successful Response

success
boolean
required

Whether the operation was successful

message
string
required

A message describing the operation