End a live notification
End a running activity, referenced by its instance_id. On iOS, the system dismisses the activity from the Lock Screen. On Android, the SDK normally renders the final content as a non-ongoing notification; it cancels the notification only when there's no final notification to render. You can include a final content_state to show before the activity ends.
push_payload is optional on the end call, whether Customer.io delivers directly through APNs or relays through Firebase Cloud Messaging (FCM). If you include a push_payload.alert, it must contain both a title and a body.
- Type: stringinstance
_id requiredThe activity's instance ID (ULID), returned when you started it.
- Type: objectattributes
Static activity fields, for renderers that need them alongside the content state.
- content
_state The final content state to show before the activity ends. Defaults to the last state you sent. The content state's shape depends on the activity's
notification_type. For iOS or a free form Android activity, pick the free form variant. For other Android notification types, pick the matching variant below.Your own dynamic fields. On iOS, field names must match your
ContentStatetype. For Android custom types, fields pass through to your app's renderer as-is. Date fields are epoch seconds.- propertyType: anything
Name
- Type: stringdeep
_link A link to open when the person taps the activity.
- Type: objectpush
_payload The alert to accompany the end event. Optional whether Customer.io delivers directly through APNs or relays through Firebase Cloud Messaging (FCM). If you include an alert, provide both its
titleandbody.
- application/json
- 400
The request was malformed,
instance_idisn't a valid ULID, or apush_payload.alertwas missing atitleorbody. - 404
Live notifications aren't enabled for this workspace.
curl https://api.customer.io/v1/live_notifications/end \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"instance_id": "",
"content_state": {
"additionalProperty": "anything"
},
"attributes": {
"additionalProperty": "anything"
},
"push_payload": {
"alert": {
"title": "",
"body": "",
"sound": ""
}
},
"deep_link": ""
}'
{
"instance_id": "string"
}The end event was queued.