> ## 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.

# Count sessions

> The sessions a search with the same filters lists (default: the last 7 days, at most 30), counted (APS-301): by outcome, with errors (the `has_error=true` rule: at least one handled error), with a stored replay, and the median and 90th percentile of their length.



## OpenAPI

````yaml /api-reference/openapi.json get /projects/{projectId}/sessions/summary
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}/sessions/summary:
    get:
      summary: Count sessions
      description: >-
        The sessions a search with the same filters lists (default: the last 7
        days, at most 30), counted (APS-301): by outcome, with errors (the
        `has_error=true` rule: at least one handled error), with a stored
        replay, and the median and 90th percentile of their length.
      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
        - schema:
            type: string
            maxLength: 128
            description: Only this release.
          required: false
          description: Only this release.
          name: release
          in: query
        - schema:
            type: string
            enum:
              - crashed
              - abnormal_exit
              - ok
            description: >-
              `crashed`, `abnormal_exit`, or `ok` (every session that neither
              crashed nor ended abnormally).
          required: false
          description: >-
            `crashed`, `abnormal_exit`, or `ok` (every session that neither
            crashed nor ended abnormally).
          name: outcome
          in: query
        - schema:
            type: string
            maxLength: 128
            description: device.model.identifier, exactly.
            example: iPhone17,1
          required: false
          description: device.model.identifier, exactly.
          name: device_model
          in: query
        - schema:
            type: string
            maxLength: 64
            description: os.version, exactly.
          required: false
          description: os.version, exactly.
          name: os_version
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: Only sessions with (true) or without (false) handled errors.
          required: false
          description: Only sessions with (true) or without (false) handled errors.
          name: has_error
          in: query
        - schema:
            type: string
            pattern: ^[A-Za-z0-9._:-]{1,128}$
            description: Only sessions with an occurrence of this issue in the time range.
          required: false
          description: Only sessions with an occurrence of this issue in the time range.
          name: issue_id
          in: query
        - schema:
            type: string
            pattern: ^[A-Z_]{1,16}$
            description: 'With endpoint_host and endpoint_template: one network endpoint.'
          required: false
          description: 'With endpoint_host and endpoint_template: one network endpoint.'
          name: endpoint_method
          in: query
        - schema:
            type: string
            maxLength: 255
          required: false
          name: endpoint_host
          in: query
        - schema:
            type: string
            maxLength: 256
            description: >-
              Only sessions with a request to this endpoint in the time range
              (/network/endpoints lists them).
          required: false
          description: >-
            Only sessions with a request to this endpoint in the time range
            (/network/endpoints lists them).
          name: endpoint_template
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: >-
              With the endpoint: only sessions where a request to it failed (5xx
              or no response).
          required: false
          description: >-
            With the endpoint: only sessions where a request to it failed (5xx
            or no response).
          name: endpoint_failed
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 256
            description: >-
              Only sessions that loaded this screen (app.screen.name) in the
              time range.
          required: false
          description: >-
            Only sessions that loaded this screen (app.screen.name) in the time
            range.
          name: screen
          in: query
        - schema:
            type:
              - integer
              - 'null'
            minimum: 0
            maximum: 600000
            description: >-
              With screen: only loads of it with a TTID of at least this many
              milliseconds.
          required: false
          description: >-
            With screen: only loads of it with a TTID of at least this many
            milliseconds.
          name: min_ttid_ms
          in: query
        - schema:
            type:
              - integer
              - 'null'
            minimum: 0
            maximum: 600000
            description: >-
              With screen: only loads of it with a TTFD (app.screen.load.ttfd)
              of at least this many milliseconds; loads without one never match.
          required: false
          description: >-
            With screen: only loads of it with a TTFD (app.screen.load.ttfd) of
            at least this many milliseconds; loads without one never match.
          name: min_ttfd_ms
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 256
            description: >-
              Only sessions whose last screen load in the time range was this
              screen (app.screen.name): where they stopped, as Journeys'
              drop-offs.
          required: false
          description: >-
            Only sessions whose last screen load in the time range was this
            screen (app.screen.name): where they stopped, as Journeys'
            drop-offs.
          name: stopped
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: >-
              Only sessions with (true) or without (false) a failed HTTP request
              (5xx or no response).
          required: false
          description: >-
            Only sessions with (true) or without (false) a failed HTTP request
            (5xx or no response).
          name: has_failed_request
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: >-
              Only sessions with (true) or without (false) a hang (iOS) or ANR
              (Android) the SDK saw live (spec 6.3).
          required: false
          description: >-
            Only sessions with (true) or without (false) a hang (iOS) or ANR
            (Android) the SDK saw live (spec 6.3).
          name: has_hang
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: Only sessions with (true) or without (false) a stored replay.
          required: false
          description: Only sessions with (true) or without (false) a stored replay.
          name: has_replay
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 128
            description: >-
              Only sessions where this feature flag was evaluated
              (setFeatureFlag).
          required: false
          description: >-
            Only sessions where this feature flag was evaluated
            (setFeatureFlag).
          name: flag
          in: query
        - schema:
            type: string
            maxLength: 128
            description: 'With flag: only sessions where it had this variant.'
          required: false
          description: 'With flag: only sessions where it had this variant.'
          name: flag_variant
          in: query
      responses:
        '200':
          description: The counts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionCounts'
        '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'
        '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:
    SessionCounts:
      type: object
      properties:
        sessions:
          type: integer
        crashed:
          type: integer
        abnormal_exit:
          type: integer
          description: Ended by the system without a crash report (spec 6.4).
        ok:
          type: integer
          description: >-
            Ended normally, or still active: neither crashed nor ended
            abnormally.
        with_errors:
          type: integer
          description: 'With at least one handled error: what has_error=true lists.'
        with_replay:
          type: integer
        duration_ms:
          type: object
          properties:
            p50:
              type:
                - integer
                - 'null'
            p90:
              type:
                - integer
                - 'null'
          required:
            - p50
            - p90
      required:
        - sessions
        - crashed
        - abnormal_exit
        - ok
        - with_errors
        - with_replay
        - duration_ms
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_request
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
  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.