Storing and Deleting Events

Storing an event in a stream creates that stream if it does not exist, so there is no need to “pre-configure” streams before starting to send events to them.

If you provide a timestamp header formatted as an ISO8601 date, that timestamp will be used as the canonical timestamp for the event. If you do not provide a timestamp header, a timestamp will be automatically generated for the event.

post
Store Event with an auto-generated unique ID

https://api.sentenai.com/streams/<stream-name>/events
Provide a JSON event in the body of the request to insert that event into the specified stream. Specify when the event happened with the `timestamp` header. If it's not provided, the time of upload will be used as the timestamp. For events that span a duration of time, provide both a `start` and `end` header.
Request
Response
Request
Path Parameters
stream-name
required
string
Name of the stream to post events too.
Headers
Content-Type
required
string
application/json
Auth-Key
required
string
Your Sentenai API key
timestamp
optional
string
ISO 8601 encoded datetime
start
optional
string
ISO 8601 encoded datetime
end
optional
string
ISO 8601 encoded datetime
Response
201: Created
Event successfully saved.

put
Store Event with your own unique ID

https://api.sentenai.com/streams/<stream-name>/events/<event-id>
This endpoint behaves like the one above except the event gets created with the specified Event ID. It can be used to overwrite an existing event.
Request
Response
Request
Path Parameters
event-id
optional
string
Your own unique ID for the event
stream-name
optional
string
Name of the stream to post events too
Headers
Content-Type
required
string
application/json
Auth-Key
required
string
Your Sentenai API key
timestamp
optional
string
ISO 8601 encoded datetime
start
optional
string
ISO 8601 encoded datetime
end
optional
string
ISO 8601 encoded datetime
Response
201: Created
Event successfully saved.

delete
Delete Event by ID

https://api.sentenai.com/streams/<stream-name>/events/<event-id>
Request
Response
Request
Path Parameters
stream-name
required
string
Stream that contains the event
event-id
required
string
ID of the event to be deleted
Headers
Auth-Key
required
string
Your Sentenai API key
Response
204: No Content
404: Not Found