v1

latestOpenAPI 3.0.02026-07-144431.2 KB
Session

Create new session

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 or permissions.

post/api/sessions

Request body

Example request

{
  "public": {
    "variable2": {
      "value": "value2"
    },
    "variable3": {
      "value": "value3"
    }
  }
}

Response

Created

sessionTokenstring

Token that identifies the user's individual session.

segmentTokenstring

Token that identifies the user's segment, shared with other users with similar navigation parameters.