Skip to main content

Events API Documentation

REST API for querying, filtering, and retrieving real-time and historical network events across Celona network infrastructure.

P
Written by Puneet Shetty
Updated over 2 weeks ago

Overview

The Celona Network Events API provides REST endpoints to query and retrieve network events from your Celona network infrastructure. This API allows you to search, filter, and analyze network events with powerful querying capabilities.

Base URL: <https://api.celona.io/v2/api/events>


Table of Contents


Query Events

POST /query

Query network events within a specified time interval with optional filtering.

Query Parameters

Parameter

Type

Required

Description

customer_id

integer

Yes

Your unique customer identifier

startTime

integer

Yes

Start time in Unix timestamp (milliseconds)

endTime

integer

Yes

End time in Unix timestamp (milliseconds)

pageSize

integer

Yes

Number of records per page (min: 1, max: 1000)

pageIndex

integer

No

Page number (default: 1)

order

string

No

Sort order: ascending or descending (default: descending)

Request Body

Basic Filters

Filter

Type

Description

siteId

array[string]

Filter by site identifiers

clusterId

array[string]

Filter by cluster identifiers

moxnClusterId

array[string]

Filter by MOXN cluster identifiers

serialNumber

array[string]

Filter by Access Point serial numbers

imsi

array[string]

Filter by IMSI (International Mobile Subscriber Identity)

type

array[string]

Filter by event type

severity

array[string]

Filter by event severity

Advanced Search Filters

Use the search array for more complex filtering with various operators.

Search Filter Structure

{
"context": "field_name",
"value": "search_value",
"operator": "operator_type",
"case-sensitive": false
}

Available Operators

Operator

Description

Value Type

Example

eq

Exact match

string

"value": "error"

noteq

Not equal to

string

"value": "info"

in

Value in list

array

"value": ["error", "warning"]

notin

Value not in list

array

"value": ["debug", "info"]

contains

Substring match

string

"value": "timeout"

notcontains

Does not contain

string

"value": "success"

gt

Greater than

number

"value": "100"

gte

Greater than or equal

number

"value": "100"

lt

Less than

number

"value": "50"

lte

Less than or equal

number

"value": "50"

regex

Regular expression

regex string

"value": "^error.*"

Note: contains and notcontains operators are case-sensitive

Response

Response Fields:

  • count: Total number of records matching the time range and customer_id

  • filtered: Number of records after applying filters (only present if filters were used)

  • records: Array of event objects with dynamic properties

Example response

{
"code": 200,
"success": true,
"data": {
"count": 1500,
"filtered": 42,
"records": [
{

"timestamp": 1768900464628,
"type": "ALERT",
"category": "DPALERT",
"platformType": "SITE",
"clusterID": "1-0-1-1234567",
"ip": "10.32.7.25",
"siteID": "1",
"edgeName": "test",
"severity": "CRITICAL",
"dpAlert.alertId": "SASTLSAUTHSTATE",
"cause": "connection with https://test.sas.goog/v1.2/heartbeat failed with --- Post \"https://test.sas.goog/v1.2/heartbeat\": network is unreachable"

},
...
]
},
"error": null
}

Get Search Context

GET /context

Retrieve the list of available search contexts that can be used in filter queries.

Use Case: Call this endpoint first to discover what fields you can filter on in your search queries.

Response

Status 200 - Success

{
"code": 200,
"success": true,
"data": [
"action",
"actualImei",
"alertId",
"allocated",
"appID",
"availableMemoryGB",
"avgCpuPercentage",
...
],
"error": null
}

Examples

Example 1: Basic Event Query

Query events from the last 24 hours without filters.

curl -X POST "https://api.celona.io/v2/api/events/query?customer_id=12345&startTime=1737244800000&endTime=1737331200000&pageSize=100&pageIndex=1&order=descending" \
-H "X-API-Key: <your-key>" \
-H "Content-Type: application/json"

Example 2: Filtered Query for different types of events (site,edge,MOXN,Device)

Query events based on platfrom type.

curl -X POST "https://api.celona.io/v2/api/events/query?customer_id=12345&startTime=1737244800000&endTime=1737331200000&pageSize=100" \
-H "X-API-Key: <your-key>" \
-H "Content-Type: application/json" \
-d '{
"search":[
{
"context":"platformType",
"value":["SITE"],
"operator":"in"
}
]
}'

Value for platformType can be one of these 'SITE','PSE' ,'MOCN' or 'DEVICE'

Example 3: Pagination

Retrieve the second page of results.

curl -X POST "https://api.celona.io/v2/api/events/query?customer_id=12345&startTime=1737244800000&endTime=1737331200000&pageSize=100&pageIndex=2" \
-H "X-API-Key: <your-key>" \
-H "Content-Type: application/json"

Example 4: Get Available Search Contexts

curl -X GET "https://api.celona.io/v2/api/events/context" \
-H "X-API-Key: <your-key>"

Example 5: Using Regular Expression Filter

Find events where the message matches a specific pattern.

curl -X POST "https://api.celona.io/v2/api/events/query?customer_id=12345&startTime=1737244800000&endTime=1737331200000&pageSize=100" \
-H "X-API-Key: <your-key>" \
-H "Content-Type: application/json" \
-d '{
"search": [
{"context":"nodeID",
"value":"151a75d0.*",
"operator":"regex"
}
]
}'

Error Handling

The API uses standard HTTP status codes and returns detailed error information.

HTTP Status Codes

Code

Description

200

Success

400

Bad Request - Invalid parameters or malformed request

403

Forbidden - Invalid or missing authentication credentials

500

Internal Server Error - Server-side error occurred

Error Response Format

{
"code": 400,
"success": false,
"data": null,
"error": "Invalid time range: endTime must be greater than startTime"
}

Common Error Scenarios

  1. Invalid Authentication

    • Status: 403

    • Cause: Missing or invalid API token/key

    • Solution: Verify your authentication headers

  2. Invalid Time Range

    • Status: 400

    • Cause: endTime <= startTime or timestamps in wrong format

    • Solution: Ensure endTime is after startTime and both are Unix timestamps in milliseconds

  3. Invalid Page Size

    • Status: 400

    • Cause: pageSize < 1 or > 1000

    • Solution: Keep pageSize between 1 and 1000

  4. Missing Required Parameters

    • Status: 400

    • Cause: Missing customer_id, startTime, endTime, or pageSize

    • Solution: Include all required query parameters

Did this answer your question?