Live Activities EndpointsView Markdown ↗

End Live Activity Stream

Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities.

DELETE https://activitysmith.com/api/live-activity/stream/{stream_key}

Authentication#

Use your API key in the request header.

Authorization: Bearer $YOUR_API_KEY

Parameters#

stream_key#

path parameter. Required.

Stable identifier for one ongoing thing. Allowed characters: letters, numbers, underscores, and hyphens.

Type: string

Max Length: 255; Pattern: ^[A-Za-z0-9_-]+$

Request examples#

import ActivitySmith from "activitysmith";
const activitysmith = new ActivitySmith({
apiKey: process.env.ACTIVITYSMITH_API_KEY,
});
await activitysmith.liveActivities.endStream("prod-web-1", {
content_state: {
title: "Server Health",
subtitle: "prod-web-1",
type: "metrics",
metrics: [
{ label: "CPU", value: 7, unit: "%" },
{ label: "MEM", value: 38, unit: "%" },
],
},
});

Bodyapplication/json

Optional payload for ending a managed stream. When omitted, ActivitySmith ends the stream using the latest known state when possible.

metadataMetadata
tagsTagSlugs
Omit to preserve Tags, supply a list to replace them, or [] to clear them in the final activity history.
content_stateStreamContentState
actionLiveActivityAction
secondary_actionLiveActivityAction
Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
alertAlertPayload

Additional Properties: false

default

{}

with content state

{
"content_state": {
"title": "Server Health",
"subtitle": "prod-web-1",
"type": "metrics",
"metrics": [
{
"label": "CPU",
"value": 0,
"unit": "%"
},
{
"label": "MEM",
"value": 0,
"unit": "%"
}
],
"auto_dismiss_minutes": 2
}
}

Responses#

200#

Managed stream ended

Content type: application/json

Schema: LiveActivityStreamDeleteResponse#

Returned after a managed stream is ended and removed.

successbooleanrequired
operationstringrequired
Enum: ["ended"]
stream_keystringrequired
activity_idstring or null
devices_queuedinteger
devices_notifiedinteger
timestampstring<date-time>required

Additional Properties: false

ended

{
"success": true,
"operation": "ended",
"stream_key": "prod-web-1",
"activity_id": "h8QmSyYFTuwOIF6Wh3YcZlzHLhUcr034",
"devices_queued": 1,
"timestamp": "2025-08-12T12:10:00.000Z"
}

already inactive

{
"success": true,
"operation": "ended",
"stream_key": "prod-web-1",
"activity_id": null,
"timestamp": "2025-08-12T12:10:00.000Z"
}

400#

Bad request (invalid stream_key or action)

Content type: application/json

Schema: BadRequestError#

errorstringrequired
messagestringrequired

Additional Properties: true

invalid stream key

{
"error": "Invalid stream_key",
"message": "stream_key must contain only letters, numbers, underscores, and hyphens"
}

404#

Managed stream not found

Content type: application/json

Schema: NotFoundError#

errorstringrequired
messagestringrequired

Additional Properties: true

not found

{
"error": "Live Activity stream not found",
"message": "No Live Activity stream found for stream_key: prod-web-1"
}

429#

Rate limit exceeded

Content type: application/json

Schema: RateLimitError#

codestring
Enum: ["rate_limited"]
errorstringrequired
messagestringrequired

Additional Properties: false

rate limited

{
"error": "Rate limit exceeded",
"message": "Too many requests, please try again later."
}

Download the OpenAPI specification