Send message
Send a message (event) to all active endpoints of an application.
POST
/applications/{appId}/messages
Send a message (event) to all active endpoints of an application.
Authentication
API Key (header: X-API-Key) API Key (cookie: better-auth.session_token)
Path Parameters
appId
string
required
path
Application ID
Example:
"a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6"Request Body required
Request body
application/jsonevent_type
string
REQUIRED
Event type name
payload
unknown | null
Event payload (object or string)
Responses
201
Message created and delivery initiated
application/jsonmessage
object | null
REQUIRED
id
string
REQUIRED
org_id
string
REQUIRED
env_id
string
REQUIRED
application_id
string
REQUIRED
event_type
string
REQUIRED
payload
string
REQUIRED
status
string
REQUIRED
created_at
string
REQUIRED
updated_at
string
REQUIRED
400
Bad request or application inactive
401
Unauthorized
404
Application not found
curl -X POST 'https://hookstream.io/v1/applications/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6/messages' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"event_type": "invoice.paid",
"payload": null
}'
const response = await fetch('https://hookstream.io/v1/applications/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6/messages', {
method: 'POST',
headers: {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"event_type": "invoice.paid",
"payload": null
})
});
const data = await response.json();
console.log(data);
import requests
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
response = requests.post('https://hookstream.io/v1/applications/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6/messages', headers=headers, json={
"event_type": "invoice.paid",
"payload": null
})
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"event_type": "invoice.paid",
"payload": null
}`)
req, _ := http.NewRequest("POST", "https://hookstream.io/v1/applications/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6/messages", body)
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
result, _ := io.ReadAll(resp.Body)
fmt.Println(string(result))
}
201
Response
{
"message": {
"id": "<string>",
"org_id": "<string>",
"env_id": "<string>",
"application_id": "<string>",
"event_type": "<string>",
"payload": "<string>",
"status": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
}
POST
/applications/{appId}/messages