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
ignoredboolean
True when the stream was already ended and the request had no effect.
messagestring
forced_completionboolean
deliveredboolean
Present when the stream had a current Live Activity. True when the end was sent to at least one device, or queued for a device that has not registered yet. False when no device received it, so the Live Activity may stay on the Lock Screen until iOS removes it or someone dismisses it.
warningstring
Explains why the end may not have removed the Live Activity, for example because iOS had already ended a Live Activity that started more than 8 hours ago.
errorsarray of string
Per-device delivery errors when some devices could not be reached.

Additional Properties: false

ended

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

not delivered after ios limit

{
"success": true,
"operation": "ended",
"stream_key": "prod-web-1",
"activity_id": "h8QmSyYFTuwOIF6Wh3YcZlzHLhUcr034",
"forced_completion": true,
"delivered": false,
"warning": "This Live Activity started more than 8 hours ago, so iOS had already ended it and no device received the end. It stays on the Lock Screen until iOS removes it (up to 4 hours later) or someone dismisses it.",
"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 in this account for stream_key: prod-web-1. The stream may have already ended or been deleted."
}

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