openapi: 3.1.0
info:
title: Typesense Analytics Analytics Events Analytics Operations API
description: The Typesense Analytics API allows developers to track and analyze search behavior by recording click, conversion, and visit events. It provides endpoints for creating analytics rules, logging events with metadata tags, and retrieving popular queries and queries with no results. This data can be used to improve search relevance through query suggestions, curations, and understanding user search patterns.
version: '30.1'
contact:
name: Typesense Support
url: https://typesense.org/support
license:
name: GPL-3.0
url: https://www.gnu.org/licenses/gpl-3.0.html
termsOfService: https://typesense.org/terms
servers:
- url: '{protocol}://{hostname}:{port}'
description: Typesense Server
variables:
protocol:
default: http
enum:
- http
- https
hostname:
default: localhost
port:
default: '8108'
security:
- api_key_header: []
tags:
- name: Analytics Operations
description: Operational endpoints for managing the analytics subsystem.
paths:
/analytics/flush:
post:
operationId: flushAnalytics
summary: Flush Analytics Data To Disk
description: Flushes in-memory analytics data to disk. Useful for ensuring analytics data is persisted before a server restart.
tags:
- Analytics Operations
responses:
'200':
description: Analytics data flushed
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
description: Whether the flush operation succeeded.
'401':
description: Unauthorized
/analytics/status:
get:
operationId: getAnalyticsStatus
summary: Get Analytics Subsystem Status
description: Returns the current status of the analytics subsystem including whether it is operational and any pending operations.
tags:
- Analytics Operations
responses:
'200':
description: Analytics status
content:
application/json:
schema:
$ref: '#/components/schemas/AnalyticsStatus'
'401':
description: Unauthorized
components:
schemas:
AnalyticsStatus:
type: object
properties:
state:
type: string
description: Current state of the analytics subsystem.
pending_operations:
type: integer
description: Number of pending analytics operations.
securitySchemes:
api_key_header:
type: apiKey
in: header
name: X-TYPESENSE-API-KEY
description: API key for authenticating requests to the Typesense server.
externalDocs:
description: Typesense Analytics Documentation
url: https://typesense.org/docs/30.1/api/analytics-query-suggestions.html