HTTP API

Timeline

POST/api/v1/timeline/events
POST
/api/v1/timeline/events

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to create a single event

Response Body

application/json

curl -X POST "https://example.com/api/v1/timeline/events" \  -H "Content-Type: application/json" \  -d '{    "data": null,    "stream": "string",    "type": "string"  }'
{  "event_id": "string",  "sequence": 0,  "stream": "string",  "timestamp": 0}
GET/api/v1/timeline/events/aggregate
GET
/api/v1/timeline/events/aggregate

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

stream*string
start*string
end*string
aggregation*string
field*string
group_by?string

Response Body

application/json

curl -X GET "https://example.com/api/v1/timeline/events/aggregate?stream=string&start=string&end=string&aggregation=string&field=string"
{  "aggregation": "string",  "field": "string",  "groups": [    {      "key": "string",      "value": 0.1    }  ],  "result": 0.1}
POST/api/v1/timeline/events/batch
POST
/api/v1/timeline/events/batch

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to create multiple events

Response Body

application/json

curl -X POST "https://example.com/api/v1/timeline/events/batch" \  -H "Content-Type: application/json" \  -d '{    "events": [      {        "data": null,        "type": "string"      }    ],    "stream": "string"  }'
{  "events": [    {      "event_id": "string",      "sequence": 0    }  ],  "stored": 0}
GET/api/v1/timeline/events/count
GET
/api/v1/timeline/events/count

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

stream*string
start*string
end*string
interval*string
type?string
group_by?string

Response Body

application/json

curl -X GET "https://example.com/api/v1/timeline/events/count?stream=string&start=string&end=string&interval=string"
{  "counts": [    {      "count": 0,      "end": "string",      "start": "string",      "timestamp": 0    }  ],  "interval": "string",  "total": 0}
GET/api/v1/timeline/events/latest
GET
/api/v1/timeline/events/latest

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

stream*string
limit?integer
Range0 <= value
type?string

Response Body

application/json

curl -X GET "https://example.com/api/v1/timeline/events/latest?stream=string"
[  {    "data": null,    "id": "string",    "sequence": 0,    "stream": "string",    "tags": [      "string"    ],    "timestamp": 0,    "type": "string"  }]
GET/api/v1/timeline/events/query
GET
/api/v1/timeline/events/query

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

stream*string
start?string
end?string
type?string
filter?string
tags?string
limit?integer
Range0 <= value
cursor?string

Response Body

application/json

curl -X GET "https://example.com/api/v1/timeline/events/query?stream=string"
{  "events": [    {      "data": null,      "id": "string",      "sequence": 0,      "stream": "string",      "tags": [        "string"      ],      "timestamp": 0,      "type": "string"    }  ],  "pagination": {    "cursor": "string",    "has_more": true,    "total_in_range": 0  },  "time_range": {    "end": 0,    "start": 0  }}
POST/api/v1/timeline/events/search
POST
/api/v1/timeline/events/search

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Advanced search request

Response Body

application/json

curl -X POST "https://example.com/api/v1/timeline/events/search" \  -H "Content-Type: application/json" \  -d '{    "filters": [      {        "field": "string",        "operator": "equals",        "value": null      }    ],    "stream": "string",    "time_range": {      "end": 0,      "start": 0    }  }'
{  "events": [    {      "data": null,      "id": "string",      "sequence": 0,      "stream": "string",      "tags": [        "string"      ],      "timestamp": 0,      "type": "string"    }  ],  "pagination": {    "cursor": "string",    "has_more": true,    "total_in_range": 0  },  "time_range": {    "end": 0,    "start": 0  }}
GET/api/v1/timeline/streams
GET
/api/v1/timeline/streams

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

page?integer

Page number (1-based)

Formatint64
Range0 <= value
page_size?integer

Number of streams per page

Formatint64
Range0 <= value

Response Body

application/json

curl -X GET "https://example.com/api/v1/timeline/streams"
{  "pagination": {    "has_more": true,    "page": 0,    "page_size": 0,    "total": 0  },  "streams": [    {      "event_count": 0,      "name": "string",      "newest_event": 0,      "oldest_event": 0,      "retention_days": 0,      "size_bytes": 0,      "tags": [        "string"      ]    }  ]}
POST/api/v1/timeline/streams
POST
/api/v1/timeline/streams

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Create stream request

Response Body

curl -X POST "https://example.com/api/v1/timeline/streams" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
Empty
DELETE/api/v1/timeline/streams/{name}
DELETE
/api/v1/timeline/streams/{name}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

name*string

Stream name to delete

Response Body

curl -X DELETE "https://example.com/api/v1/timeline/streams/string"
Empty
GET/api/v1/timeline/streams/{name}/stats
GET
/api/v1/timeline/streams/{name}/stats

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

name*string

Stream name

Response Body

application/json

curl -X GET "https://example.com/api/v1/timeline/streams/string/stats"
null
GET/api/v1/timeline/streams/{stream}/follow
GET
/api/v1/timeline/streams/{stream}/follow

After a successful upgrade the server pushes a [TimelineWebSocketMessage::Event] for every event appended to the stream from the moment of subscription. The client may send an unsubscribe control message or close the socket to stop.

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

stream*string

Stream name to follow

Query Parameters

token?string

JWT token (alternative to the Authorization header for browser clients)

Response Body

curl -X GET "https://example.com/api/v1/timeline/streams/string/follow"
Empty

On this page