Send a stream event
curl --request POST \
--url https://api.reintersect.com/v0/streams/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.reintersect.com/v0/streams/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.reintersect.com/v0/streams/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.reintersect.com/v0/streams/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.reintersect.com/v0/streams/events"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reintersect.com/v0/streams/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reintersect.com/v0/streams/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyReplies, streams and notifications
Send a stream event
Post an event, such as a CI run, a deploy or an alert, to your app’s stream in a circle.
POST
/
v0
/
streams
/
events
Send a stream event
curl --request POST \
--url https://api.reintersect.com/v0/streams/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.reintersect.com/v0/streams/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.reintersect.com/v0/streams/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.reintersect.com/v0/streams/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.reintersect.com/v0/streams/events"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reintersect.com/v0/streams/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reintersect.com/v0/streams/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
Posts one event to your app’s stream in a circle. The first event in a circle creates the stream,
named after your app with its icon. Each event becomes an app conversation in the circle’s App streams
log, or a reply in one, and reaches the circle’s chat when a member engages with it. Use this for
event feeds; for conversational messages, use Create a reply. See
Writing to circles.
Authenticate with an install token that has the
Unknown fields fail the request.
With the SDK, call
replies:write scope. The circle must be within the install’s
reach, and each stream takes at most 60 events a minute.
Body
Send exactly one ofcontent and markdown.
| Field | Type | Required | Description |
|---|---|---|---|
circleId | string | Yes | The circle to post to. |
content | Document | One of | A structured document, such as the output of renderPayload. Mentions, files and images aren’t allowed. |
markdown | string | One of | Markdown, 1 to 40,000 characters. |
threadKey | string | No | At most 200 characters. The first event with a key starts a conversation; later events with the same key become replies in it. |
title | string | No | At most 300 characters. Used only when the event starts a conversation. |
persona | { name?, avatarUrl? } | No | Overrides your app’s name (at most 80 characters) and icon (an https:// URL) for this event. |
idempotencyKey | string | No | At most 200 characters. A resend with the same key within 24 hours returns the first answer and posts nothing. |
Response
| Field | Type | Description |
|---|---|---|
conversationId | string | The app conversation the event started or joined. |
url | string | A link to that conversation. |
created | boolean | false when the event became a reply in an existing conversation. |
Errors
_tag | Status | Cause |
|---|---|---|
ReintersectAppScopeMissingError | 403 | The install lacks replies:write. |
ReintersectAppCircleNotFoundError | 404 | The circle isn’t in the install’s workspace, your app can’t reach it, or it’s a connected circle that became read-only when its connection ended. Also returned if your app’s stream disappears while the event is saved. circleIds holds the circle you sent. |
ReintersectAppStreamRevokedError | 410 | Your app’s stream in this circle was revoked, checked before and while the event is saved. A circle that fails the 404 checks returns 404 even when its stream is revoked. |
ReintersectAppStreamInvalidPayloadError | 400 | The content was rejected; reason is invalid_document, unsupported_node or empty. |
ReintersectApiRateLimitExceededError | 429 | Over 60 events a minute. |
Example
curl -X POST https://api.reintersect.com/v0/streams/events \
-H "authorization: Bearer $INSTALL_TOKEN" \
-H "content-type: application/json" \
-d '{ "circleId": "circle_123", "threadKey": "deploy:api", "title": "Deploy api", "markdown": "Deploy **finished** in 4m 12s." }'
reintersect.streams.sendEvent({ circleId, threadKey, markdown }).