Session Manager API
vtex · Company
This documentation goes in detail how to interact with Session Manager's API. For a more top-level approach, check the [design documentation](https://help.vtex.com/tutorial/using-session-manager-to-track-browsing-sessions-in-vtex-stores--1pA0tqsD4BFnJYhQ7ORQBd).
Authentication
Sample Requests
Items are the keys of the values you wish to get. It follows the format `namespace1.key1,namespace2.key2`. So if you wish to recover the data sent on the previous request, it should be `public.country,public.postalCode`. > The sessions API uses the `vtex_session` cookie to store the data required
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/sessions?items=namespace1.key1%2Cnamespace2.key2"
import requests
params = {
"items": "namespace1.key1,namespace2.key2"
}
response = requests.get(
"https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/sessions",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/sessions');
url.searchParams.set('items', 'namespace1.key1,namespace2.key2');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/sessions")
q := baseURL.Query()
q.Set("items", "namespace1.key1,namespace2.key2")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/sessions")
uri.query = URI.encode_www_form({
"items" => "namespace1.key1,namespace2.key2"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/sessions?" . http_build_query([
"items" => "namespace1.key1,namespace2.key2"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));You can add certain public fields in the query string and the system will attempt to fulfill it. Values such as `cultureInfo` and `utm` are overwriteable, just keep in mind such changes will not be reflected in the client's session. If you wish to change the value on the session (and thus be refl
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/segments"
import requests
response = requests.get(
"https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/segments",
)
print(response.json())const url = 'https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/segments'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/segments"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/segments")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/segments";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));The response should contain a session cookie. Further `POST` or `PATCH` requests will edit the existing session rather than creating a new one. All parameters in the body that are not within the public namespace will be ignored. Query string items will automatically be added to the public namespace.
Hover any highlighted part to learn what it does
curl -X POST "https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/sessions"
import requests
response = requests.post(
"https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/sessions",
)
print(response.json())const url = 'https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/sessions';
const response = await fetch(url, {
method: 'POST',
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/sessions"
req, _ := http.NewRequest("POST", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/sessions")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Post.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/vtex.local/Session-Manager-API/1.0/sessions";
$opts = ["http" => [
"method" => "POST",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- See official documentation for authentication and setup.
What can you build with Session Manager API?
Session Manager API is a Company API. Developers commonly use company APIs for:
- enriching CRM records with company firmographics
- building lead-generation and prospecting tools
- verifying business identity and registration details
- monitoring competitors and market intelligence
- powering B2B data enrichment pipelines
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. Session Manager API is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide · Learn about API keys · What is REST?