---
title: "Create new session"
method: POST
path: "/api/sessions"
tags: ["Session"]
---

# Create new session

`POST /api/sessions`

Creates a new session and returns a session token and a segment token. Also stores `vtex_session` and `vtex_segment` cookies, with the same values returned in the response.

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.

>⚠️ The Session Manager API uses the `vtex_session` and `vtex_segment` cookies to store the data required to identify the user and the session. These cookies are stored in the user's browser when the session is created and sent automatically in every request to that domain. You will have to reproduce that by sending these cookies as headers in other requests to Session Manager API in order for it to work outside of a browser environment.

## Permissions

This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).

## Request body

- CreateEditSessionRequest — Session information.
  - `public` object, required — Public information.
    - `additionalProperties` object — Custom property.
      - `value` string — Value of the custom property.

## Response `201`

Created

- CreateEditSessionResponse — Object containing session token and segment token.
  - `sessionToken` string — Token that identifies the user's individual session.
  - `segmentToken` string — Token that identifies the user's segment, shared with other users with similar navigation parameters.

## Changes

- **2024-06-12** `03d0fed7e24f` — 1 warning, 1 info
  - removed the request property `public/customProperty`
  - added the new optional request property `public/additionalProperties`
- **2024-06-12** `235ce3f45f18` — 1 warning, 1 info
  - removed the request property `public/additionalProperties`
  - added the new optional request property `public/customProperty`
- **2023-08-24** `28855b35a98d` — 2 info
  - api tag `Session` added
  - api tag `Sessions` removed
- **2023-08-24** `320ecdc2c7e4` — 1 breaking, 1 info
  - removed the success response with the status `200`
  - added the success response with the status `201`
- **2023-08-24** `3f2cd8baf8ec` — 2 warning, 2 info
  - removed the request property `public/country`
  - removed the request property `public/postalCode`
  - added the new optional request property `public/additionalProperties`
  - added the media type `application/json` for the response with the status `200`

[Full history](https://skmtc.dev/vtex/apis/session-manager-api/changes/api/sessions/post.md)

---

[API](https://skmtc.dev/vtex/apis/session-manager-api.md) · [All operations](https://skmtc.dev/vtex/apis/session-manager-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/vtex/session-manager-api/revisions/f4f1f2686364/schema)
