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

# How sessions ended, by exit reason

> Sessions that started in the range (default: the last 30 days), per exit reason (spec 6.4): how many, and per 1,000 sessions, overall and for the 20 releases with the most sessions. A session's reason is its final summary's; sessions whose summaries name none count in `sessions` only. `terminations` are iOS's own counts (MetricKit's termination counters, spec 7.3, by reason and foreground), which belong to no session: they are listed beside the sessions' reasons, not added to them.



## OpenAPI

````yaml /api-reference/openapi.json get /projects/{projectId}/exits
openapi: 3.1.0
info:
  title: Apsio API
  version: 0.1.0
  description: >-
    Read API v0: your projects, release health and comparisons, missing symbols,
    issues, sessions, vitals, cohort comparisons, performance (app start,
    screens, hangs, MetricKit) and network endpoints and traces for one project.
    Authenticate with a project token as a bearer token, with an OAuth access
    token from Apsio's authorization server (MCP clients), or, from the console,
    with the session cookie of a member of the project's organization.
servers:
  - url: https://api.apsio.io/v1
security: []
paths:
  /projects/{projectId}/exits:
    get:
      summary: How sessions ended, by exit reason
      description: >-
        Sessions that started in the range (default: the last 30 days), per exit
        reason (spec 6.4): how many, and per 1,000 sessions, overall and for the
        20 releases with the most sessions. A session's reason is its final
        summary's; sessions whose summaries name none count in `sessions` only.
        `terminations` are iOS's own counts (MetricKit's termination counters,
        spec 7.3, by reason and foreground), which belong to no session: they
        are listed beside the sessions' reasons, not added to them.
      parameters:
        - schema:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            example: 0192f3a4-0000-7000-8000-00000000a101
          required: true
          name: projectId
          in: path
        - schema:
            type: string
            format: date-time
            description: >-
              Start of the time range, inclusive (RFC 3339). Defaults to the
              range end minus the default length.
            example: '2026-10-01T00:00:00Z'
          required: false
          description: >-
            Start of the time range, inclusive (RFC 3339). Defaults to the range
            end minus the default length.
          name: from
          in: query
        - schema:
            type: string
            format: date-time
            description: End of the time range, exclusive (RFC 3339). Defaults to now.
            example: '2026-10-08T00:00:00Z'
          required: false
          description: End of the time range, exclusive (RFC 3339). Defaults to now.
          name: to
          in: query
        - schema:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            description: Only this app.
          required: false
          description: Only this app.
          name: app_id
          in: query
      responses:
        '200':
          description: Sessions by how they ended.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Exits'
        '400':
          description: The request is not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: No valid bearer token or console session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The credentials cannot read this project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: >-
            The project or its organization is being deleted (`erasing`):
            nothing more to read; do not retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Over a rate limit (the caller's, the client address's, or the
            plan's); Retry-After says when to retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearer: []
        - session: []
components:
  schemas:
    Exits:
      type: object
      properties:
        sessions:
          type: integer
        reasons:
          type: array
          items:
            $ref: '#/components/schemas/ExitReasonCount'
          description: Reasons with at least one session, the most first.
        releases:
          type: array
          items:
            type: object
            properties:
              release:
                type: string
                description: 'service.version. Written by the app: untrusted data.'
              sessions:
                type: integer
              reasons:
                type: array
                items:
                  $ref: '#/components/schemas/ExitReasonCount'
            required:
              - release
              - sessions
              - reasons
        terminations:
          type: array
          items:
            $ref: '#/components/schemas/ExitTermination'
        retention_days:
          type: integer
          description: >-
            How many days of crashes and release health the project's plan keeps
            (D94). Nothing older is returned, whatever the time range.
          example: 90
      required:
        - sessions
        - reasons
        - releases
        - terminations
        - retention_days
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_request
            message:
              type: string
            subject:
              type: string
              enum:
                - organization
                - project
              description: >-
                With `erasing` (410) only: what is being deleted, the
                organization or the project.
          required:
            - code
            - message
      required:
        - error
    ExitReasonCount:
      type: object
      properties:
        reason:
          type: string
          enum:
            - crash
            - memory
            - watchdog
            - background_task_timeout
            - cpu
            - locked_file
            - thermal
            - anr
            - signal
            - unknown
            - memory_pressure
            - user_quit
            - app_update
            - os_update
            - normal
          description: apsio.exit.reason (spec 6.4); a value outside the list is unknown.
        kind:
          type: string
          enum:
            - failure
            - not_a_failure
          description: >-
            A failure (it counts against the app) or not (a user quit, an
            update, an eviction).
        sessions:
          type: integer
        per_1k_sessions:
          type: number
          description: sessions / all sessions × 1,000.
      required:
        - reason
        - kind
        - sessions
        - per_1k_sessions
    ExitTermination:
      type: object
      properties:
        reason:
          type: string
          enum:
            - crash
            - memory
            - watchdog
            - background_task_timeout
            - cpu
            - locked_file
            - thermal
            - anr
            - signal
            - unknown
            - memory_pressure
            - user_quit
            - app_update
            - os_update
            - normal
          description: apsio.exit.reason (spec 6.4); a value outside the list is unknown.
        kind:
          type: string
          enum:
            - failure
            - not_a_failure
          description: >-
            A failure (it counts against the app) or not (a user quit, an
            update, an eviction).
        foreground:
          type:
            - boolean
            - 'null'
          description: 'apsio.exit.foreground: MetricKit''s foreground or background counter.'
        count:
          type: integer
      required:
        - reason
        - kind
        - foreground
        - count
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: >-
        A project token (apsio_pt_v0...), which reads exactly one project, or an
        OAuth access token issued for the API, which reads what its user can.
        Access tokens issued for Apsio's MCP server are accepted only from the
        MCP server itself.
    session:
      type: apiKey
      in: cookie
      name: apsio_session
      description: >-
        The console session, set by /v1/auth/callback (`__Host-apsio_session`
        when host-only).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.