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

# End a session

> End a session for a user.



## OpenAPI

````yaml POST /bc/v1/events/event/end-session
openapi: 3.0.0
info:
  title: Mindlytics API
  version: 1.0.0
servers:
  - url: https://app.mindlytics.ai
security:
  - APIKey: []
    APPId: []
paths:
  /bc/v1/events/event/end-session:
    post:
      tags:
        - Events
      summary: End a session
      description: End a session for a user.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                session_id:
                  type: string
                  description: A unique session ID generated by caller
                timestamp:
                  type: string
                  description: >-
                    The timestamp of the event, defaults to "now" if not
                    specified.
                user_id:
                  type: string
                  description: The unique ID of the user
                device_id:
                  type: string
                  description: The ID of the device, if applicable
                type:
                  type: string
                  enum:
                    - end_session
                  description: The event that ends a session
                attributes:
                  type: object
                  additionalProperties:
                    anyOf:
                      - type: string
                      - type: number
                      - type: boolean
                  description: Any additional attributes to be associated with the session
              required:
                - session_id
                - type
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - start_session
                        - end_session
                        - identify
                        - alias
                        - track
                      title: Event Type
                      description: The type of event being sent.
                  required:
                    - type
                  additionalProperties:
                    anyOf:
                      - type: string
                      - type: number
                      - type: boolean
                  title: Other properties
                  description: Propties that depend on the event type.
                title: Events
                description: >-
                  The events that were generated by the Mindlytics service as a
                  result of this event.
components:
  securitySchemes:
    APIKey:
      type: apiKey
      in: header
      name: Authorization
      description: API Key for your organization
    APPId:
      type: apiKey
      in: header
      name: X-App-ID
      description: Project ID

````