Skip to content

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/query
GET
/api/v1/timeline/events/query

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

stream*string

Stream name

filter?

Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.

sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: timestamp. Default: timestamp.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

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"    }  ],  "page": {    "has_more": true,    "next_cursor": "string",    "page": 0,    "total": 0  }}
GET/api/v1/timeline/streams
GET
/api/v1/timeline/streams

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

filter?

Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.

q?string

Full-text search over this list's searchable fields.

Length1 <= length <= 200
sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: event_count, created_at. Default: -created_at.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set to true to include the number of matching rows in page.total.

Response Body

application/json

curl -X GET "https://example.com/api/v1/timeline/streams"
{  "page": {    "has_more": true,    "next_cursor": "string",    "page": 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