Stream Operations

get
Get List of All Streams

https://api.sentenai.com/streams
Returns a list of streams, including each stream's name and any user-set metadata.
Request
Response
Request
Headers
Auth-Key
required
string
Your Sentenai API key
Query Parameters
name
optional
string
Regular expression to search on name
skip
optional
number
Skip this many before starting to return streams
limit
optional
number
Maximum number of streams to return
Response
200: OK
[
{
"name": "mystream",
"meta": {
"mkey1": "MetadataValue",
"mkey2": "NextValue"
}
}
]

post
Create a Stream

https://api.sentenai.com/streams/<stream-name>
Creates an empty stream.
Request
Response
Request
Path Parameters
stream-name
required
string
Name of the stream
Headers
Auth-Key
required
string
Your Sentenai API key
Response
201: Created
409: Conflict
{
"code": 409,
"message": "Stream already exists"
}

put
Create a Stream

https://api.sentenai.com/streams/<stream-name>
Also creates an empty stream, but it will still return a `201` when the stream already exists.
Request
Response
Request
Path Parameters
stream-name
required
string
Name of the stream
Headers
Auth-Key
required
string
Your Sentenai API key
Response
201: Created

delete
Destroy a Stream

https://api.sentenai.com/streams/<stream-name>
Destroying a stream removes the stream and all events it contains from Sentenai.
Request
Response
Request
Path Parameters
stream-name
required
string
Name of the stream
Headers
Auth-Key
required
string
Your Sentenai API key
Response
204: No Content

get
Get a Stream's Values

https://api.sentenai.com/streams/<stream-name>
Get the value for each field in a stream.
Request
Response
Request
Path Parameters
stream-name
required
string
Values from this stream
Headers
Auth-Key
required
string
Your Sentenai API key
Query Parameters
at
optional
string
If provided, the values will be taken from this timestamp. Otherwise, the latest values will be returned.
Response
200: OK
[
{
"ts": "2018-01-01T00:00:00Z",
"path": [
"foo",
"bar"
],
"value": 123,
"id": "eventId"
}
]

get
Get a Field's Value

https://api.sentenai.com/streams/<stream-name>/values/<field>
Request
Response
Request
Path Parameters
field
required
string
A field key present in the given stream
stream-name
required
string
Field from this stream
Query Parameters
at
optional
string
Value at this timestamp. Defaults to the latest value
Response
200: OK

get
Stream Fields

https://api.sentenai.com/streams/<stream-name>/fields
List of fields in a stream, including the timestamp and id of the earliest event with that field.
Request
Response
Request
Path Parameters
stream-name
required
string
Fields from this stream
Headers
Auth-Key
required
string
Your Sentenai API key
Response
200: OK
[
{
"path": ['humidity'],
"start": "2018-01-01T00:00:00Z",
"id": "eventId"
}
]

get
Get Field Stats

https://api.sentenai.com/streams/<stream-name>/stats/<field>
Request
Response
Request
Path Parameters
stream-name
required
string
Events from this stream
field
required
string
A field key present in the given stream
Headers
Auth-Key
required
string
Your Sentenai API key
Query Parameters
start
optional
string
Only consider events after this timestamp
end
optional
string
Only consider events before this timestamp
Response
200: OK
{
"categorical": {
"count": 345,
"freq": 163,
"missing": 0,
"top": "partly-cloudy-day",
"unique": 8
},
"numerical": {}
}

get
Get Unique Values

https://api.sentenai.com/streams/<stream-name>/uniques/<field>
Request
Response
Request
Path Parameters
stream-name
required
string
Events from this stream
field
required
string
A field key present in the given stream
Headers
Auth-Key
required
string
Your Sentenai API key
Query Parameters
start
optional
string
Only consider events after this timestamp
end
optional
string
Only consider events before this timestamp
Response
200: OK
{
"categorical": [
[
"partly-cloudy-day",
163
],
[
"rain",
94
],
[
"partly-cloudy-night",
48
],
[
"clear-day",
21
],
[
"snow",
6
],
[
"fog",
5
],
[
"cloudy",
4
],
[
"wind",
4
]
],
"numerical": []
}

post
Rename Stream

https://api.sentenai.com/streams/<old-stream-name>/move/<new-stream-name>
Request
Response
Request
Path Parameters
old-stream-name
required
string
Current stream name
new-stream-name
required
string
New stream name
Headers
Auth-Key
required
string
Your Sentenai API key
Response
204: No Content