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

# Session

> Start or retrieve a SmartMenu guest session

The `startSession` mutation creates or retrieves a stable guest session identifier used by SmartMenu for analytics and personalization. The returned `sessionId` should be stored on the client and sent back on subsequent requests via the `X-Session-ID` header.

## Mutation

```graphql theme={null}
mutation StartGuestSession {
  startSession(
    input: {
      guestId: "PARTNER_GUEST_ID"
      # OR passportId: "PASSPORT_ID"
      # OR email: "guest@example.com"
    }
  ) {
    sessionId
  }
}
```

<Info>
  This mutation requires an API key scoped to your chain in the `Authorization` header. On subsequent SmartMenu calls, include the returned `sessionId` in the `X-Session-ID` header to enable analytics and personalization.
</Info>

## Input

```graphql theme={null}
input StartSessionInput {
  """
  Partner guest identifier.
  """
  guestId: String

  """
  EveryBite Passport identifier.
  """
  passportId: String

  """
  Guest email address.
  """
  email: String
}
```

Exactly **one** of `guestId`, `passportId`, or `email` must be provided. If `email` is used, it is normalized (trimmed and lowercased) before computing the session.

## Response

```graphql theme={null}
type Session {
  """
  Stable, server-generated session identifier.
  """
  sessionId: String!
}
```

## Example

```graphql theme={null}
mutation StartGuestSession {
  startSession(
    input: {
      guestId: "guest_abc123"
    }
  ) {
    sessionId
  }
}
```

```json theme={null}
{
  "data": {
    "startSession": {
      "sessionId": "sess_7f3a9c2e-8b1d-4e5f-a6c0-9d2e8f1a3b5c"
    }
  }
}
```
