Post Event
curl --request POST \
--url https://api.example.com/notifications/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_type": "<string>",
"entity_id": "<string>",
"entity_type": "deal",
"payload": {}
}
'import requests
url = "https://api.example.com/notifications/events"
payload = {
"event_type": "<string>",
"entity_id": "<string>",
"entity_type": "deal",
"payload": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event_type: '<string>',
entity_id: '<string>',
entity_type: 'deal',
payload: {}
})
};
fetch('https://api.example.com/notifications/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.example.com/notifications/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'event_type' => '<string>',
'entity_id' => '<string>',
'entity_type' => 'deal',
'payload' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/notifications/events"
payload := strings.NewReader("{\n \"event_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"entity_type\": \"deal\",\n \"payload\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.example.com/notifications/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"entity_type\": \"deal\",\n \"payload\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/notifications/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"entity_type\": \"deal\",\n \"payload\": {}\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Notifications
Emit a Notification Event
POST
/
notifications
/
events
Post Event
curl --request POST \
--url https://api.example.com/notifications/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_type": "<string>",
"entity_id": "<string>",
"entity_type": "deal",
"payload": {}
}
'import requests
url = "https://api.example.com/notifications/events"
payload = {
"event_type": "<string>",
"entity_id": "<string>",
"entity_type": "deal",
"payload": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event_type: '<string>',
entity_id: '<string>',
entity_type: 'deal',
payload: {}
})
};
fetch('https://api.example.com/notifications/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.example.com/notifications/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'event_type' => '<string>',
'entity_id' => '<string>',
'entity_type' => 'deal',
'payload' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/notifications/events"
payload := strings.NewReader("{\n \"event_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"entity_type\": \"deal\",\n \"payload\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.example.com/notifications/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"entity_type\": \"deal\",\n \"payload\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/notifications/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"entity_type\": \"deal\",\n \"payload\": {}\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}New to notifications? See the Notifications guide for how the system works end-to-end — this API only covers the manual producer escape hatch, not the in-app feed itself.
entity_type: "deal" is supported today — any other value is rejected with 400. Delivery is best-effort: this call queues the event onto the org’s per-org notification actor (a Temporal workflow) and returns immediately; it never renders or sends anything synchronously.
Anti-spoofing on deal events. Whatever
payload you send for a deal event is not trusted as-is. The backend looks up the real deal row for entity_id in the caller’s org and overwrites deal_id, deal_name, value, currency, owner_id, and new_owner_id with the actual database values before the event is delivered. This exists specifically so the escape hatch can’t be used to spoof a deal’s name/value/owner, or to fan an “assigned to you” notification at a user who isn’t really the deal’s owner. Non-sensitive display hints you send through (e.g. field, old, new, stage names) are preserved as-is. If the deal isn’t visible in the caller’s org, the call fails with 404 rather than silently accepting a fake payload.Auth
Requires a CRM manage scope and an active organization on the token. Any*:manage scope qualifies — in practice contacts:manage, deals:manage, companies:manage, or activities:manage.
Response
202 Accepted
| Field | Type | Description |
|---|---|---|
accepted | boolean | Whether the Temporal actor accepted the event. emit_event swallows its own errors (a queueing failure never surfaces as an HTTP error), so false means the event was silently dropped — check application logs, not this field, if events seem to be going missing. |
Errors
| Status | Cause |
|---|---|
400 Bad Request | event_type isn’t a known registered event, or entity_type isn’t "deal". |
403 Forbidden | No active organization on the token, or the token lacks a CRM manage scope. |
404 Not Found | entity_id doesn’t resolve to a deal visible in the caller’s org. |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
A registered event type, e.g. "deal.stage_changed" — see GET /notifications/event-catalog for the full list.
UUID of the entity the event is about — currently always a deal id.
The kind of entity entity_id refers to; only "deal" is supported today, anything else is rejected with 400.
Client-supplied event details; for deal events the sensitive fields (name/value/owner) are overwritten server-side from the real deal row before delivery.
Response
Successful Response
The response is of type Response Post Event Notifications Events Post · object.