Pattern Operations

get
Search Pattern

https://api.sentenai.com/patterns/<pattern-name>/search
Find all spans of time matching the given pattern.
Request
Response
Request
Path Parameters
pattern-name
required
string
Name of pattern
Headers
Auth-Key
required
string
Your Sentenai API key
Query Parameters
limit
optional
integer
Maximum number of spans returned
start
optional
string
Only find spans after this timestamp
end
optional
string
Only find spans before this timestamp
timeout
optional
number
Maximum number of seconds to spend finding spans
Response
200: OK
[
{
"end": "2010-01-09T00:00:00Z",
"start": "2010-01-01T00:00:00Z"
},
{
"end": "2010-01-13T00:00:00Z",
"start": "2010-01-11T00:00:00Z"
}
]
404: Not Found
No pattern exists with the given name.
{
"code": 404
}

get
Get List of Named Patterns

https://api.sentenai.com/patterns
Request
Response
Request
Headers
Auth-Key
required
string
Your Sentenai API key
Query Parameters
desc
optional
string
Filter list by regex matching pattern `description`.
name
optional
string
Filter list by regex matching pattern `name`.
limit
optional
integer
Maximum number of patterns returned.
containing
optional
string
The name of a stream. Filters list of patterns to those containing this stream.
Response
200: OK
[
{
"anonymous": false,
"created": "2019-08-28T17:39:08.435276043Z",
"description": "",
"name": "my-cool-pattern",
"query": "weather when ('humidity' > 0.5)",
"streams": [
{
"name": "weather"
}
]
}
]

get
Get Pattern by Name

https://api.sentenai.com/patterns/<pattern-name>
Request
Response
Request
Path Parameters
pattern-name
required
string
Name of pattern
Headers
Auth-Key
required
string
Your Sentenai API key
Response
200: OK
{
"anonymous": false,
"created": "2019-08-28T17:39:08.435276043Z",
"description": "",
"name": "my-cool-pattern",
"query": "weather when ('humidity' > 0.5)",
"streams": [
{
"name": "weather"
}
]
}
404: Not Found
No pattern exists with the given name.
{
"code": 404
}

delete
Delete Pattern by Name

https://api.sentenai.com/patterns/<pattern-name>
Request
Response
Request
Path Parameters
pattern-name
optional
string
Name of pattern
Headers
Auth-Key
required
string
Your Sentenai API key
Response
204: No Content
‚Äč