> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gym.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reset Session

> Initialize or reset a session with optional data pack

Initialize a new session or reset an existing session. Optionally load a pre-configured data pack to populate the environment with realistic data.

## Request Body

<ParamField body="sessionId" type="string" required>
  Unique identifier for the session. Use this ID in subsequent API calls and when accessing the website.
</ParamField>

<ParamField body="dataPack" type="string">
  Name of the data pack to load. Available data packs vary by environment:

  * **Calendr**: `professional-swe`, `default`
  * **Cloudfile**: `professional-drive-v2`, `default`
  * **Shopora**: `default` (loads automatically)
  * **Pandora's Inbox**: `professional-inbox-v3`
</ParamField>

<ParamField body="baseWeek" type="string">
  Base date for relative time calculations (Calendr only). Format: `YYYY-MM-DD`. Sets the "base Monday" for variable date calculations.
</ParamField>

## Response

<ResponseField name="message" type="string">
  Success message confirming the reset
</ResponseField>

<ResponseField name="dataPack" type="string">
  Name of the data pack that was loaded
</ResponseField>

<ResponseField name="resetSummary" type="object">
  Count of items cleared during reset. Fields vary by environment (e.g., `events`, `calendars`, `users` for Calendr).
</ResponseField>

<ResponseField name="loadSummary" type="object">
  Count of items loaded from the data pack. Fields vary by environment (e.g., `events`, `calendars`, `users` for Calendr; `products` for Shopora; `messages` for Pandora's Inbox; `files` for Cloudfile).
</ResponseField>

<RequestExample>
  ```bash Calendr theme={null}
  curl -X POST http://localhost:3000/reset \
    -H "Content-Type: application/json" \
    -d '{
      "sessionId": "test-session-001",
      "dataPack": "professional-swe",
      "baseWeek": "2024-11-18"
    }'
  ```

  ```bash Cloudfile theme={null}
  curl -X POST http://localhost:3000/reset \
    -H "Content-Type: application/json" \
    -d '{
      "sessionId": "test-session-002",
      "dataPack": "professional-drive-v2"
    }'
  ```

  ```bash Shopora theme={null}
  curl -X POST http://localhost:3000/reset \
    -H "Content-Type: application/json" \
    -d '{
      "sessionId": "test-session-003"
    }'
  ```

  ```bash Pandora's Inbox theme={null}
  curl -X POST http://localhost:3000/reset \
    -H "Content-Type: application/json" \
    -d '{
      "sessionId": "test-session-004",
      "dataPack": "professional-inbox-v3"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Calendr Response theme={null}
  {
    "message": "Session reset successfully",
    "dataPack": "professional-swe",
    "resetSummary": {
      "events": 15,
      "calendars": 3,
      "users": 4
    },
    "loadSummary": {
      "users": 4,
      "calendars": 3,
      "events": 15
    }
  }
  ```

  ```json Error - Missing Session ID theme={null}
  {
    "error": "sessionId is required"
  }
  ```

  ```json Error - Invalid Data Pack theme={null}
  {
    "error": "Unknown data pack: invalid-pack-name"
  }
  ```
</ResponseExample>
