# API Keys
Source: https://activitysmith.com/docs/api-keys
Create and manage API keys
API Keys are secret tokens used to authenticate your requests. They are unique to your account and should be kept confidential.
## Create an API Key
To create an API key, go to the [API Keys](https://activitysmith.com/app/keys) page and click the **Create API Key** button.
1. Click **Create API Key**.
2. Give your API Key a name (maximum 100 characters).
3. Select **All Recipients** or **Channel Scoped** as the Scope.
4. If you select **Channel Scoped**, you can choose the channels you want to restrict access to.
For security reasons, you can only view the API Key once.
## API Key Scopes
There are two different API Key Scopes you can choose from:
* **All Recipients**: The API key can target all recipients in the account.
* **Channel Scoped**: The API key is restricted to channels assigned to that key.
You can configure scope when creating or editing a key on the [API Keys](https://activitysmith.com/app/keys) page.
## Edit API Key details
After creating an API Key, you can edit the following details:
* Name
* Scope
* Scope Channels (only available if Scope is **Channel Scoped**)
To edit an API Key, click the **Edit API Key** button.
## View all API Keys
To manage your API keys, go to the [API Keys](https://activitysmith.com/app/keys) page. The page shows you all the API Keys you have created along with their details
## Scope behavior with `target.channels`
* Scope `all` + no `target.channels`: sends to all recipients in your account.
* Scope `all` + `target.channels`: sends only to the provided channel slugs.
* Scope `channels` + no `target.channels`: sends to channels assigned to that API key.
* Scope `channels` + `target.channels`: requested channel slugs must be a subset of channels assigned to that API key.
Channels in request payloads use channel slugs, for example, `["marketing", "test-devices"]`.
## Scope enforcement and errors
If a channel-scoped key (`channels`) tries to target channel slugs outside its assignment, the request fails with `403 Forbidden` and a clear scope-violation error message.
Use the [channels guide](/channels) for channel setup and targeting examples.
# End Live Activity
Source: https://activitysmith.com/docs/api-reference/endpoint/live-activity-end
POST /live-activity/end
Ends a Live Activity and archives its lifecycle.
# Start Live Activity
Source: https://activitysmith.com/docs/api-reference/endpoint/live-activity-start
POST /live-activity/start
Starts a Live Activity on devices matched by API key scope and optional target channels.
# Update Live Activity
Source: https://activitysmith.com/docs/api-reference/endpoint/live-activity-update
POST /live-activity/update
Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued.
# Send Push Notification
Source: https://activitysmith.com/docs/api-reference/endpoint/push-notification
POST /push-notification
Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL (tap) and up to 4 interactive actions (long-press on iOS).
# Introduction
Source: https://activitysmith.com/docs/api-reference/introduction
ActivitySmith API reference
## Features
Send a push notification to all of your paired devices.
Start, update and end a Live Activity.
## Base URL
All requests contain the following base URL:
```bash theme={null}
https://activitysmith.com/api/
```
## Authentication
For authentication, it's required to include an Authorization header. The header should contain `Bearer ask_123456789`, where `ask_123456789` represents your [API Key](/api-keys).
```bash theme={null}
Authorization: Bearer ask_123456789
```
## Response codes
ActivitySmith employs conventional HTTP status codes to signify the outcome of your requests.
Typically, 2xx HTTP status codes denote success, 4xx codes represent failures related to the user, and 5xx codes signal infrastructure problems.
| Status | Description |
| ------ | -------------------------------------------- |
| 200 | Request was successful. |
| 400 | Verify the correctness of the parameters. |
| 401 | The API key is invalid or was not provided. |
| 404 | The requested resource could not be located. |
| 429 | The rate limit has been surpassed. |
| 5xx | Signifies a server error with ActivitySmith. |
Refer to the Error Codes section for a detailed explanation of all potential API errors.
## Channels
Channels let you target specific subsets of recipients instead of broadcasting to everyone in an account.
* Use channels when teams, environments, or workflows need separate delivery groups.
* Keep [API keys](/api-keys) broad or channel-scoped depending on how strict you want targeting to be.
Read the full [channels guide](/channels).
## Rate limit
The ActivitySmith API has a [rate limit](/rate-limits) to ensure the stability and reliability of the service. The rate limit is applied to all endpoints and is based on the number of requests made within a specific time frame.
When you exceed the rate limit, you will receive a 429 response code.
# Channels
Source: https://activitysmith.com/docs/channels
Use channels to target specific users and devices.
Channels let you target specific groups of recipients instead of sending to everyone in an account.
Common use case:
* Different teams should receive different notifications (for example, `marketing`, `developers`, `devops`, `sre`).
Channels are flexible:
* You can assign users, devices, or both to a channel.
* You can choose channels per request using `target.channels`.
* You can keep some [API key](/api-keys) broad and scope other [API key](/api-keys) to specific channels.
## How Targeting Works
Use channel slugs in `target.channels`:
```json theme={null}
{
"target": {
"channels": ["ios-beta", "ops"]
}
}
```
* If `target` is omitted and API key scope is `all`, delivery goes to all recipients in the account.
* If `target` is omitted and API key scope is `channels`, delivery goes to channels assigned to that [API key](/api-keys).
* If `target.channels` is provided, only those channel slugs are targeted.
## Push Notifications
```json theme={null}
{
"title": "New subscription 💸",
"message": "Customer upgraded to Pro plan",
"target": {
"channels": ["ios-beta", "ops"]
}
}
```
## Live Activities
```json theme={null}
{
"content_state": {
"title": "Nightly database backup",
"number_of_steps": 3,
"current_step": 1,
"type": "segmented_progress"
},
"target": {
"channels": ["ios-beta", "ops"]
}
}
```
See endpoint docs for full request and response fields:
* [/api-reference/endpoint/push-notification](/api-reference/endpoint/push-notification)
* [/api-reference/endpoint/live-activity-start](/api-reference/endpoint/live-activity-start)
# Live Activity Colors
Source: https://activitysmith.com/docs/colors
Colors can be used to customize the appearance of your Live Activities. You can choose from the following colors(default is `blue`):
### `lime`
### `green`
### `cyan`
### `blue`
### `purple`
### `magenta`
### `red`
### `orange`
### `yellow`
# Quickstart
Source: https://activitysmith.com/docs/index
Send Live Activities and push notifications to your iOS devices from any backend
## Welcome to ActivitySmith
[ActivitySmith](https://activitysmith.com) is API service that lets you trigger and update Live Activities and send push notifications directly from your own infrastructure.
Pair your iOS device(s), authenticate with an [API key](/api-keys), and send real-time alerts from any backend, cron, agent, or automation. Without building or maintaining your own iOS app or dealing directly with APNs.
Check out the following resources to get started:
* **API**: [Documentation](https://activitysmith.com/docs/api-reference/introduction)
* **SDKs**: [Node](https://activitysmith.com/docs/sdks/node), [Python](https://activitysmith.com/docs/sdks/python), [Go](https://activitysmith.com/docs/sdks/go), [PHP](https://activitysmith.com/docs/sdks/php), [Ruby](https://activitysmith.com/docs/sdks/ruby), [CLI](https://activitysmith.com/docs/sdks/cli)
* **Others**: [Zapier](https://zapier.com/apps/activitysmith/integrations)
Want an SDK or Integration? Let us know at [adam@activitysmith.com](mailto:adam@activitysmith.com).
### Prerequisites
* [Create an API key](https://activitysmith.com/app/keys)
* [Download our iOS app](https://apps.apple.com/us/app/activitysmith/id6752254835) and pair your device(s)
### Features
* [**Push Notifications**](#push-notifications): send push notifications to all paired devices or target specific channels.
* [**Live Activities**](#live-activities): start, update and end a Live Activity on your lock screen or dynamic island, with optional channel targeting.
### Powerful Capabilities
* **Glanceable observability**: monitor real-time system state and long-running operations directly on your lock screen or dynamic island.
* **The hard stuff**: APNs(Apple Push Notification service), certificates, orchestration
* **Customizability**: adapt the experience to fit your unique needs.
* **Works with any backend**: use with any backend, cron, agent, automation or AI tool.
* **iOS app**: ready to use native iOS app for your iPhone or iPad. No need to build your own.
## Push Notifications
To send a push notification, use the `push-notification` endpoint. It takes `title` and optional fields like `message`, `payload`, `redirection`, `actions`, and `target.channels`.\
`target.channels` accepts channel slugs (for example `["devs", "ops"]`).
* `redirection` opens on normal tap.
* `actions` (up to 4) show on long-press in iOS expanded notification UI.
```bash cURL theme={null}
curl -X POST https://activitysmith.com/api/push-notification \
-H "Authorization: Bearer $ACTIVITYSMITH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "New subscription 💸",
"message": "Customer upgraded to Pro plan"
}'
```
```js Node theme={null}
import ActivitySmith from "activitysmith";
const activitysmith = new ActivitySmith({
apiKey: process.env.ACTIVITYSMITH_API_KEY,
});
const response = await activitysmith.notifications.send({
title: "New subscription 💸",
message: "Customer upgraded to Pro plan",
});
console.log(response);
```
```python Python theme={null}
import os
from activitysmith import ActivitySmith
activitysmith = ActivitySmith(
api_key=os.environ.get("ACTIVITYSMITH_API_KEY", "YOUR-API-KEY")
)
response = activitysmith.notifications.send(
{
"title": "New subscription 💸",
"message": "Customer upgraded to Pro plan",
}
)
print(response)
```
```go Go theme={null}
package main
import (
"log"
"os"
activitysmithsdk "github.com/ActivitySmithHQ/activitysmith-go"
)
func main() {
activitysmith, err := activitysmithsdk.New(os.Getenv("ACTIVITYSMITH_API_KEY"))
if err != nil {
log.Fatal(err)
}
input := activitysmithsdk.PushNotificationInput{
Title: "New subscription 💸",
Message: "Customer upgraded to Pro plan",
}
response, err := activitysmith.Notifications.Send(input)
if err != nil {
log.Fatal(err)
}
log.Println(response)
}
```
```php PHP theme={null}
notifications->send([
'title' => 'New subscription 💸',
'message' => 'Customer upgraded to Pro plan',
]);
var_dump($response);
```
```ruby Ruby theme={null}
require "activitysmith"
activitysmith = ActivitySmith::Client.new(
api_key: ENV.fetch("ACTIVITYSMITH_API_KEY", "YOUR-API-KEY")
)
response = activitysmith.notifications.send(
{
title: "New subscription 💸",
message: "Customer upgraded to Pro plan"
}
)
p response
```
```bash CLI theme={null}
activitysmith push \
--title "New subscription 💸" \
--message "Customer upgraded to Pro plan"
```
**Response**
```json theme={null}
{
"success": true,
"devices_notified": 3,
"users_notified": 1,
"timestamp": "2025-08-12T12:00:00.000Z"
}
```
## Live Activities
### /start endpoint
To start a Live Activity, use the `live-activity/start` endpoint. It takes a `content_state` payload and starts a Live Activity on your lock screen or dynamic island.\
You can optionally pass `target.channels` with channel slugs to scope recipients.
For a segmented progress activity, include `title`, `current_step`, `type`, and `number_of_steps`.
```bash cURL theme={null}
curl -X POST https://activitysmith.com/api/live-activity/start \
-H "Authorization: Bearer $ACTIVITYSMITH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content_state": {
"title": "Nightly database backup",
"subtitle": "create snapshot",
"number_of_steps": 3,
"current_step": 1,
"type": "segmented_progress",
"color": "yellow"
}
}'
```
```js Node theme={null}
import ActivitySmith from "activitysmith";
const activitysmith = new ActivitySmith({
apiKey: process.env.ACTIVITYSMITH_API_KEY,
});
const start = await activitysmith.liveActivities.start({
content_state: {
title: "Nightly database backup",
subtitle: "create snapshot",
number_of_steps: 3,
current_step: 1,
type: "segmented_progress",
color: "yellow",
},
});
const activityId = start.activity_id;
```
```python Python theme={null}
import os
from activitysmith import ActivitySmith
activitysmith = ActivitySmith(
api_key=os.environ.get("ACTIVITYSMITH_API_KEY", "YOUR-API-KEY")
)
start = activitysmith.live_activities.start(
{
"content_state": {
"title": "Nightly database backup",
"subtitle": "create snapshot",
"number_of_steps": 3,
"current_step": 1,
"type": "segmented_progress",
"color": "yellow",
}
}
)
activity_id = start.activity_id
```
```go Go theme={null}
package main
import (
"log"
"os"
activitysmithsdk "github.com/ActivitySmithHQ/activitysmith-go"
)
func main() {
activitysmith, err := activitysmithsdk.New(os.Getenv("ACTIVITYSMITH_API_KEY"))
if err != nil {
log.Fatal(err)
}
startInput := activitysmithsdk.LiveActivityStartInput{
Title: "Nightly database backup",
Subtitle: "create snapshot",
NumberOfSteps: 3,
CurrentStep: 1,
Type: "segmented_progress",
Color: "yellow",
}
start, err := activitysmith.LiveActivities.Start(startInput)
if err != nil {
log.Fatal(err)
}
activityID := start.GetActivityId()
log.Println(activityID)
}
```
```php PHP theme={null}
liveActivities->start([
'content_state' => [
'title' => 'Nightly database backup',
'subtitle' => 'create snapshot',
'number_of_steps' => 3,
'current_step' => 1,
'type' => 'segmented_progress',
'color' => 'yellow',
],
]);
$activityId = $start->getActivityId();
```
```ruby Ruby theme={null}
require "activitysmith"
activitysmith = ActivitySmith::Client.new(
api_key: ENV.fetch("ACTIVITYSMITH_API_KEY", "YOUR-API-KEY")
)
start = activitysmith.live_activities.start(
{
content_state: {
title: "Nightly database backup",
subtitle: "create snapshot",
number_of_steps: 3,
current_step: 1,
type: "segmented_progress",
color: "yellow"
}
}
)
activity_id = start.activity_id
```
```bash CLI theme={null}
activitysmith activity start \
--content-state '{"title":"Nightly database backup","subtitle":"create snapshot","numberOfSteps":3,"currentStep":1,"type":"segmented_progress","color":"yellow"}'
```
### Response
It returns a `activity_id` that you can use to update or end the Live Activity.
```json theme={null}
{
"success": true,
"activity_id": "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW",
"devices_notified": 2,
"users_notified": 1,
"timestamp": "2026-01-28T09:57:22.929Z"
}
```
### /update endpoint
To update the Live Activity, call `live-activity/update` with the `activity_id` and a `content_state` payload (minimum: `title`, `current_step`).
```bash cURL theme={null}
curl -X POST https://activitysmith.com/api/live-activity/update \
-H "Authorization: Bearer $ACTIVITYSMITH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"activity_id": "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW",
"content_state": {
"title": "Nightly database backup",
"subtitle": "upload archive",
"current_step": 2
}
}'
```
```js Node theme={null}
import ActivitySmith from "activitysmith";
const activitysmith = new ActivitySmith({
apiKey: process.env.ACTIVITYSMITH_API_KEY,
});
await activitysmith.liveActivities.update({
activity_id: "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW",
content_state: {
title: "Nightly database backup",
subtitle: "upload archive",
current_step: 2,
},
});
```
```python Python theme={null}
import os
from activitysmith import ActivitySmith
activitysmith = ActivitySmith(
api_key=os.environ.get("ACTIVITYSMITH_API_KEY", "YOUR-API-KEY")
)
activitysmith.live_activities.update(
{
"activity_id": "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW",
"content_state": {
"title": "Nightly database backup",
"subtitle": "upload archive",
"current_step": 2,
},
}
)
```
```go Go theme={null}
package main
import (
"log"
"os"
activitysmithsdk "github.com/ActivitySmithHQ/activitysmith-go"
)
func main() {
activitysmith, err := activitysmithsdk.New(os.Getenv("ACTIVITYSMITH_API_KEY"))
if err != nil {
log.Fatal(err)
}
updateInput := activitysmithsdk.LiveActivityUpdateInput{
ActivityID: "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW",
Title: "Nightly database backup",
Subtitle: "upload archive",
CurrentStep: 2,
}
_, err = activitysmith.LiveActivities.Update(updateInput)
if err != nil {
log.Fatal(err)
}
}
```
```php PHP theme={null}
liveActivities->update([
'activity_id' => 'pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW',
'content_state' => [
'title' => 'Nightly database backup',
'subtitle' => 'upload archive',
'current_step' => 2,
],
]);
```
```ruby Ruby theme={null}
require "activitysmith"
activitysmith = ActivitySmith::Client.new(
api_key: ENV.fetch("ACTIVITYSMITH_API_KEY", "YOUR-API-KEY")
)
activitysmith.live_activities.update(
{
activity_id: "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW",
content_state: {
title: "Nightly database backup",
subtitle: "upload archive",
current_step: 2
}
}
)
```
```bash CLI theme={null}
activitysmith activity update \
--activity-id "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW" \
--content-state '{"title":"Nightly database backup","subtitle":"upload archive","currentStep":2}'
```
### Response
```json theme={null}
{
"success": true,
"activity_id": "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW",
"devices_notified": 2,
"timestamp": "2026-01-28T09:57:26.056Z"
}
```
### /end endpoint
To end the Live Activity, call `live-activity/end` with the `activity_id` and the content state.
```bash cURL theme={null}
curl -X POST https://activitysmith.com/api/live-activity/end \
-H "Authorization: Bearer $ACTIVITYSMITH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"activity_id": "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW",
"content_state": {
"title": "Nightly database backup",
"subtitle": "verify restore",
"current_step": 3
}
}'
```
```js Node theme={null}
import ActivitySmith from "activitysmith";
const activitysmith = new ActivitySmith({
apiKey: process.env.ACTIVITYSMITH_API_KEY,
});
await activitysmith.liveActivities.end({
activity_id: "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW",
content_state: {
title: "Nightly database backup",
subtitle: "verify restore",
current_step: 3,
auto_dismiss_minutes: 2,
},
});
```
```python Python theme={null}
import os
from activitysmith import ActivitySmith
activitysmith = ActivitySmith(
api_key=os.environ.get("ACTIVITYSMITH_API_KEY", "YOUR-API-KEY")
)
activitysmith.live_activities.end(
{
"activity_id": "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW",
"content_state": {
"title": "Nightly database backup",
"subtitle": "verify restore",
"current_step": 3,
"auto_dismiss_minutes": 2,
},
}
)
```
```go Go theme={null}
package main
import (
"log"
"os"
activitysmithsdk "github.com/ActivitySmithHQ/activitysmith-go"
)
func main() {
activitysmith, err := activitysmithsdk.New(os.Getenv("ACTIVITYSMITH_API_KEY"))
if err != nil {
log.Fatal(err)
}
endInput := activitysmithsdk.LiveActivityEndInput{
ActivityID: "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW",
Title: "Nightly database backup",
Subtitle: "verify restore",
CurrentStep: 3,
AutoDismissMinutes: 2,
}
_, err = activitysmith.LiveActivities.End(endInput)
if err != nil {
log.Fatal(err)
}
}
```
```php PHP theme={null}
liveActivities->end([
'activity_id' => 'pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW',
'content_state' => [
'title' => 'Nightly database backup',
'subtitle' => 'verify restore',
'current_step' => 3,
'auto_dismiss_minutes' => 2,
],
]);
```
```ruby Ruby theme={null}
require "activitysmith"
activitysmith = ActivitySmith::Client.new(
api_key: ENV.fetch("ACTIVITYSMITH_API_KEY", "YOUR-API-KEY")
)
activitysmith.live_activities.end(
{
activity_id: "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW",
content_state: {
title: "Nightly database backup",
subtitle: "verify restore",
current_step: 3,
auto_dismiss_minutes: 2
}
}
)
```
```bash CLI theme={null}
activitysmith activity end \
--activity-id "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW" \
--content-state '{"title":"Nightly database backup","subtitle":"verify restore","currentStep":3,"autoDismissMinutes":2}'
```
### Response
```json theme={null}
{
"success": true,
"activity_id": "pLAr-Hnq9ZFW4sxlk43Lhbuok4GLh7UW",
"devices_notified": 2,
"timestamp": "2026-01-28T09:57:29.258Z"
}
```
## Channel Targeting
You can scope delivery with channel slugs:
```json theme={null}
{
"target": {
"channels": ["devs", "ops"]
}
}
```
* If `target` is omitted and API key scope is `all`: send to all account recipients.
* If `target` is omitted and API key scope is `channels`: send to channels assigned to that key.
* If `target.channels` is present: only those channel slugs are used.
# Rate Limits
Source: https://activitysmith.com/docs/rate-limits
Rate limits for API requests
## Concurrent Live Activities Limits
Concurrent Live Activities represent how many live activities ActivitySmith can process for you at the same time.
Number of concurrent live activities is limited to 4. This limit mimics the number of concurrent live activities that can be processed by the iOS. If you exceed this limit, additional live activities will be ignored until resources become available.
In the future, we will allow you to increase this limit by upgrading to a paid plan.
If you require higher concurrency limits, please contact us at [adam@activitysmith.com](mailto:adam@activitysmith.com).
## API Rate Limits
Rate limits are measured in requests per minute and are primarily in place to prevent abuse. When configured correctly, your real bottleneck will be concurrent live activities.
**Shared account limit**: 60 requests per minute across these endpoints:
* `POST /push-notification`
* `POST /live-activity/start`
* `POST /live-activity/update`
* `POST /live-activity/end`
These rate limits are enforced to ensure fair usage and availability of the API for all users. If you require higher limits, please contact us at [adam@activitysmith.com](mailto:adam@activitysmith.com).
# CLI
Source: https://activitysmith.com/docs/sdks/cli
ActivitySmith CLI lets you send push notifications and manage Live Activities from the terminal.
## Installation
Install the ActivitySmith CLI globally using npm:
```bash CLI theme={null}
# Install globally with npm
npm install -g activitysmith-cli
```
## Usage
1. [Create an API key](https://activitysmith.com/app/keys)
2. Authenticate with either `ACTIVITYSMITH_API_KEY` or `--api-key`.
```bash CLI theme={null}
# Option 1: set env var (recommended)
export ACTIVITYSMITH_API_KEY="YOUR-API-KEY"
# Verify authentication
activitysmith --status
```
```bash CLI theme={null}
# Option 2: pass key per command
activitysmith --api-key "YOUR-API-KEY" --status
```
## Commands
### Push Notification
Sends a push notification to every paired device in your account.
```bash CLI theme={null}
activitysmith push \
--title "Build Failed 🚨" \
--message "CI pipeline failed on main branch" \
--subtitle "main"
```
### Live Activity: Start
Start a Live Activity and get back an `activityId` for updates.
```bash CLI theme={null}
activitysmith activity start \
--content-state '{"title":"ActivitySmith API Deployment","subtitle":"start","numberOfSteps":4,"currentStep":1,"type":"segmented_progress","color":"yellow"}'
```
Or use flags:
```bash CLI theme={null}
activitysmith activity start \
--title "ActivitySmith API Deployment" \
--subtitle "start" \
--number-of-steps 4 \
--current-step 1 \
--type segmented_progress \
--color yellow
```
### Live Activity: Update
Update an existing Live Activity using its `activityId`.
```bash CLI theme={null}
activitysmith activity update \
--activity-id "" \
--content-state '{"title":"ActivitySmith API Deployment","subtitle":"npm i & pm2","currentStep":3}'
```
Or use flags:
```bash CLI theme={null}
activitysmith activity update \
--activity-id "" \
--title "ActivitySmith API Deployment" \
--subtitle "npm i & pm2" \
--current-step 3
```
### Live Activity: End
End a Live Activity and optionally control its dismissal timing.
```bash CLI theme={null}
activitysmith activity end \
--activity-id "" \
--content-state '{"title":"ActivitySmith API Deployment","subtitle":"done","currentStep":4,"autoDismissMinutes":3}'
```
Or use flags:
```bash CLI theme={null}
activitysmith activity end \
--activity-id "" \
--title "ActivitySmith API Deployment" \
--subtitle "done" \
--current-step 4 \
--auto-dismiss-minutes 3
```
## Content State
You can provide content state in two ways:
* JSON: `--content-state '{...}'` or `--content-state-file path/to/payload.json`
* Flags: `--title`, `--subtitle`, `--type`, `--number-of-steps`, `--current-step`, `--color`, `--step-color`, `--auto-dismiss-minutes`
Use camelCase keys in JSON (for example: `numberOfSteps`, `currentStep`, `autoDismissMinutes`).
### Required Fields
* `activity start`: `title`, `numberOfSteps`, `currentStep`, `type`
* `activity update`: `title`, `currentStep`
* `activity end`: `title`, `currentStep`
### Field Reference
| Field | Description |
| -------------------- | ----------------------------------------------------------------------------------------------- |
| `title` | Primary label shown in the Live Activity. |
| `subtitle` | Secondary label shown in the Live Activity. |
| `type` | Layout type. For now: `segmented_progress`. |
| `numberOfSteps` | Total steps in the progress flow. |
| `currentStep` | Current step index (1-based). |
| `color` | Accent color (`lime`, `green`, `cyan`, `blue`, `purple`, `magenta`, `red`, `orange`, `yellow`). |
| `stepColor` | Color for step segments (same values as `color`). |
| `autoDismissMinutes` | Minutes before dismissal after ending (default `3`, `0` for immediate). |
## Output
Use `--json` to output machine-readable JSON.
## Channels
You can target specific channels for `push` and `activity start` using `--channels`.
```bash CLI theme={null}
activitysmith push \
--title "Build Failed 🚨" \
--message "CI pipeline failed on main branch" \
--channels "ios-builds,engineering"
```
```bash CLI theme={null}
activitysmith activity start \
--title "ActivitySmith API Deployment" \
--number-of-steps 4 \
--current-step 1 \
--type segmented_progress \
--channels "ios-builds"
```
## Error Handling
The CLI exits non-zero on non-2xx responses and prints the API error body (for example, rate limit or Live Activity limit errors).
## Additional Resources
Download and install the ActivitySmith CLI on NPM
View the complete source code for the ActivitySmith CLI
# Go
Source: https://activitysmith.com/docs/sdks/go
ActivitySmith Go SDK is a wrapper around the ActivitySmith API to help you easily send push notifications and Live Activities to your iOS devices.
## Installation
To install the ActivitySmith Go SDK, you can use `go get`:
```go Go theme={null}
go get github.com/ActivitySmithHQ/activitysmith-go
```
## Usage
1. [Create an API key](https://activitysmith.com/app/keys)
2. Pass the API key into `activitysmith.New`.
Here's an example of how to use the SDK with error handling:
```go Go theme={null}
package main
import (
"log"
activitysmithsdk "github.com/ActivitySmithHQ/activitysmith-go"
)
func main() {
activitysmith, err := activitysmithsdk.New("YOUR-API-KEY")
if err != nil {
log.Fatal(err)
}
}
```
### Send a Push Notification
Use `activitysmith.Notifications.Send` with an `activitysmithsdk.PushNotificationInput`.
```go Go theme={null}
input := activitysmithsdk.PushNotificationInput{
Title: "New subscription 💸",
Message: "Customer upgraded to Pro plan",
}
response, err := activitysmith.Notifications.
Send(input)
if err != nil {
log.Fatal(err)
}
log.Println(response.GetSuccess())
log.Println(response.GetDevicesNotified())
```
### Start a Live Activity
Start a Live Activity with `activitysmith.LiveActivities.Start`. For a segmented progress activity, include `title`, `number_of_steps`, `current_step`, and `type`.
```go Go theme={null}
startInput := activitysmithsdk.LiveActivityStartInput{
Title: "Nightly database backup",
Subtitle: "create snapshot",
NumberOfSteps: 3,
CurrentStep: 1,
Type: "segmented_progress",
Color: "yellow",
}
start, err := activitysmith.LiveActivities.
Start(startInput)
if err != nil {
log.Fatal(err)
}
activityID := start.GetActivityId()
```
### Update a Live Activity
Update a Live Activity with `activitysmith.LiveActivities.Update` using the `activityID`.
```go Go theme={null}
updateInput := activitysmithsdk.LiveActivityUpdateInput{
ActivityID: activityID,
Title: "Nightly database backup",
Subtitle: "upload archive",
CurrentStep: 2,
}
update, err := activitysmith.LiveActivities.
Update(updateInput)
if err != nil {
log.Fatal(err)
}
log.Println(update.GetDevicesNotified())
```
### End a Live Activity
End a Live Activity with `activitysmith.LiveActivities.End`.
If `AutoDismissMinutes` is omitted, backend default `3` is used.
```go Go theme={null}
endInput := activitysmithsdk.LiveActivityEndInput{
ActivityID: activityID,
Title: "Nightly database backup",
Subtitle: "verify restore",
CurrentStep: 3,
AutoDismissMinutes: 2,
}
end, err := activitysmith.LiveActivities.
End(endInput)
if err != nil {
log.Fatal(err)
}
log.Println(end.GetSuccess())
```
## Channels
You can target specific channels when sending a push or starting a Live Activity.
```go Go theme={null}
pushInput := activitysmithsdk.PushNotificationInput{
Title: "New subscription 💸",
Message: "Customer upgraded to Pro plan",
Channels: []string{"ios-builds", "engineering"},
}
_, err = activitysmith.Notifications.Send(pushInput)
if err != nil {
log.Fatal(err)
}
startInput := activitysmithsdk.LiveActivityStartInput{
Title: "Nightly database backup",
NumberOfSteps: 3,
CurrentStep: 1,
Type: "segmented_progress",
Channels: []string{"ios-builds"},
}
_, err = activitysmith.LiveActivities.Start(startInput)
if err != nil {
log.Fatal(err)
}
```
## Error Handling
Handle API errors by checking the returned `error` from SDK calls.
## Additional Resources
View the complete source code for the ActivitySmith Go SDK
# Node
Source: https://activitysmith.com/docs/sdks/node
ActivitySmith Node SDK is a wrapper around the ActivitySmith API to help you easily send push notifications and Live Activities to your iOS devices.
## Installation
To install the ActivitySmith Node SDK, you can use npm:
```js Node theme={null}
npm install activitysmith
```
## Usage
1. [Create an API key](https://activitysmith.com/app/keys)
2. Set the API key as an environment variable named `ACTIVITYSMITH_API_KEY` or pass it as `apiKey` when creating the client.
Here's an example of how to use the SDK with error handling:
```js Node theme={null}
import ActivitySmith from "activitysmith";
const activitysmith = new ActivitySmith({
apiKey: process.env.ACTIVITYSMITH_API_KEY,
});
```
### Send a Push Notification
Use `activitysmith.notifications.send` with a push payload. `title` is required; `message` and `subtitle` are optional.
```js Node theme={null}
const response = await activitysmith.notifications.send({
title: "New subscription 💸",
message: "Customer upgraded to Pro plan",
});
console.log(response.devices_notified, response.timestamp);
```
### Start a Live Activity
Use `activitysmith.liveActivities.start` with a `content_state` payload. For the segmented progress type, `title`, `number_of_steps`, `current_step`, and `type` are required.
```js Node theme={null}
const start = await activitysmith.liveActivities.start({
content_state: {
title: "Nightly database backup",
subtitle: "create snapshot",
number_of_steps: 3,
current_step: 1,
type: "segmented_progress",
color: "yellow",
},
});
const activityId = start.activity_id;
```
### Update a Live Activity
Use `activitysmith.liveActivities.update` with the `activity_id` you received from `start`.
```js Node theme={null}
await activitysmith.liveActivities.update({
activity_id: activityId,
content_state: {
title: "Nightly database backup",
subtitle: "upload archive",
current_step: 2,
},
});
```
### End a Live Activity
Use `activitysmith.liveActivities.end` with the `activity_id`. You can optionally control how long the ended Live Activity stays visible using `auto_dismiss_minutes` (default `3`, `0` for immediate dismissal).
```js Node theme={null}
await activitysmith.liveActivities.end({
activity_id: activityId,
content_state: {
title: "Nightly database backup",
subtitle: "verify restore",
current_step: 3,
auto_dismiss_minutes: 2,
},
});
```
## Channels
You can target specific channels when sending a push or starting a Live Activity.
```js Node theme={null}
await activitysmith.notifications.send({
title: "New subscription 💸",
message: "Customer upgraded to Pro plan",
channels: ["ios-builds", "engineering"],
});
await activitysmith.liveActivities.start({
channels: ["ios-builds"],
content_state: {
title: "Nightly database backup",
number_of_steps: 3,
current_step: 1,
type: "segmented_progress",
},
});
```
## Error Handling
Handle errors with `try/catch` around API calls:
```js Node theme={null}
try {
await activitysmith.notifications.send({ title: "Hello" });
} catch (error) {
console.error(error);
}
```
## Additional Resources
Download and install the ActivitySmith Node SDK on NPM
View the complete source code for the ActivitySmith Node SDK
# Overview
Source: https://activitysmith.com/docs/sdks/overview
ActivitySmith SDKs are wrappers around the ActivitySmith API to help you easily send push notifications and Live Activities to your iOS devices.
## Official SDKs
Explore the Node SDK for ActivitySmith.
Explore the Python SDK for ActivitySmith.
Explore the Go SDK for ActivitySmith.
Explore the PHP SDK for ActivitySmith.
Explore the Ruby SDK for ActivitySmith.
Use ActivitySmith directly from the command line.
# PHP
Source: https://activitysmith.com/docs/sdks/php
ActivitySmith PHP SDK is a wrapper around the ActivitySmith API to help you easily send push notifications and Live Activities to your iOS devices.
## Installation
To install the ActivitySmith PHP SDK, you can use Composer:
```php PHP theme={null}
composer require activitysmith/activitysmith
```
## Usage
1. [Create an API key](https://activitysmith.com/app/keys)
2. Set the API key as an environment variable named `ACTIVITYSMITH_API_KEY` or pass it directly to `ActivitySmith`.
Here's an example of how to use the SDK with error handling:
```php PHP theme={null}
notifications->send` with a push payload. `title` is required; `message` and `subtitle` are optional.
```php PHP theme={null}
$response = $activitysmith->notifications->send([
'title' => 'New subscription 💸',
'message' => 'Customer upgraded to Pro plan',
]);
echo $response->getSuccess() ? 'true' : 'false';
echo PHP_EOL;
echo $response->getDevicesNotified();
```
### Start a Live Activity
Start a Live Activity with `\$activitysmith->liveActivities->start`. For a segmented progress activity, include `title`, `number_of_steps`, `current_step`, and `type`.
```php PHP theme={null}
$start = $activitysmith->liveActivities->start([
'content_state' => [
'title' => 'Nightly database backup',
'subtitle' => 'create snapshot',
'number_of_steps' => 3,
'current_step' => 1,
'type' => 'segmented_progress',
'color' => 'yellow',
],
]);
$activityId = $start->getActivityId();
```
### Update a Live Activity
Update a Live Activity with `\$activitysmith->liveActivities->update` using the `activity_id`.
```php PHP theme={null}
$update = $activitysmith->liveActivities->update([
'activity_id' => $activityId,
'content_state' => [
'title' => 'Nightly database backup',
'subtitle' => 'upload archive',
'current_step' => 2,
],
]);
echo $update->getDevicesNotified();
```
### End a Live Activity
End a Live Activity with `\$activitysmith->liveActivities->end`. You can optionally set `auto_dismiss_minutes` in the `content_state`.
```php PHP theme={null}
$end = $activitysmith->liveActivities->end([
'activity_id' => $activityId,
'content_state' => [
'title' => 'Nightly database backup',
'subtitle' => 'verify restore',
'current_step' => 3,
'auto_dismiss_minutes' => 2,
],
]);
echo $end->getSuccess() ? 'true' : 'false';
```
## Channels
You can target specific channels when sending a push or starting a Live Activity.
```php PHP theme={null}
$activitysmith->notifications->send([
'title' => 'New subscription 💸',
'message' => 'Customer upgraded to Pro plan',
'channels' => ['ios-builds', 'engineering'],
]);
$activitysmith->liveActivities->start([
'channels' => ['ios-builds'],
'content_state' => [
'title' => 'Nightly database backup',
'number_of_steps' => 3,
'current_step' => 1,
'type' => 'segmented_progress',
],
]);
```
## Error Handling
Handle API errors with `try/catch` around SDK calls.
## Additional Resources
Download and install the ActivitySmith PHP SDK on Packagist
View the complete source code for the ActivitySmith PHP SDK
# Python
Source: https://activitysmith.com/docs/sdks/python
ActivitySmith Python SDK is a wrapper around the ActivitySmith API to help you easily send push notifications and Live Activities to your iOS devices.
## Installation
To install the ActivitySmith Python SDK, you can use pip:
```python Python theme={null}
pip install activitysmith
```
## Usage
1. [Create an API key](https://activitysmith.com/app/keys)
2. Set the API key as an environment variable named `ACTIVITYSMITH_API_KEY` or pass it as a parameter to the `ActivitySmith` class.
Here's an example of how to use the SDK with error handling:
```python Python theme={null}
import os
from activitysmith import ActivitySmith
activitysmith = ActivitySmith(api_key=os.environ.get("ACTIVITYSMITH_API_KEY", "YOUR-API-KEY"))
```
### Send a Push Notification
Use `activitysmith.notifications.send` with a push payload. `title` is required; `message` and `subtitle` are optional.
```python Python theme={null}
response = activitysmith.notifications.send(
{
"title": "New subscription 💸",
"message": "Customer upgraded to Pro plan",
}
)
print(response.success)
print(response.devices_notified)
```
### Start a Live Activity
Start a Live Activity with `activitysmith.live_activities.start`. For a segmented progress activity, include `title`, `number_of_steps`, `current_step`, and `type`.
```python Python theme={null}
start = activitysmith.live_activities.start(
{
"content_state": {
"title": "Nightly database backup",
"subtitle": "create snapshot",
"number_of_steps": 3,
"current_step": 1,
"type": "segmented_progress",
"color": "yellow",
}
}
)
activity_id = start.activity_id
```
### Update a Live Activity
Update a Live Activity with `activitysmith.live_activities.update`. The `content_state` requires at least `title` and `current_step`.
```python Python theme={null}
update = activitysmith.live_activities.update(
{
"activity_id": activity_id,
"content_state": {
"title": "Nightly database backup",
"subtitle": "upload archive",
"current_step": 2,
}
}
)
print(update.devices_notified)
```
### End a Live Activity
End a Live Activity with `activitysmith.live_activities.end`. You can optionally set `auto_dismiss_minutes` in the `content_state`.
```python Python theme={null}
end = activitysmith.live_activities.end(
{
"activity_id": activity_id,
"content_state": {
"title": "Nightly database backup",
"subtitle": "verify restore",
"current_step": 3,
"auto_dismiss_minutes": 2,
}
}
)
print(end.success)
```
## Channels
You can target specific channels when sending a push or starting a Live Activity.
```python Python theme={null}
activitysmith.notifications.send(
{
"title": "New subscription 💸",
"message": "Customer upgraded to Pro plan",
"channels": ["ios-builds", "engineering"],
}
)
activitysmith.live_activities.start(
{
"channels": ["ios-builds"],
"content_state": {
"title": "Nightly database backup",
"number_of_steps": 3,
"current_step": 1,
"type": "segmented_progress",
},
}
)
```
## Error Handling
The SDK raises exceptions for non-2xx responses. Rate limit errors use the `error` and `message` fields, and Live Activity limits include `limit` and `active`. See [Rate Limits](/rate-limits) for details.
## Additional Resources
Download and install the ActivitySmith Python SDK on PyPI
View the complete source code for the ActivitySmith Python SDK
# Ruby
Source: https://activitysmith.com/docs/sdks/ruby
ActivitySmith Ruby SDK is a wrapper around the ActivitySmith API to help you easily send push notifications and Live Activities to your iOS devices.
## Installation
To install the ActivitySmith Ruby SDK, you can use RubyGems:
```ruby Ruby theme={null}
gem install activitysmith
```
## Usage
1. [Create an API key](https://activitysmith.com/app/keys)
2. Set the API key as an environment variable named `ACTIVITYSMITH_API_KEY` or pass it directly to `ActivitySmith::Client`.
Here's an example of how to use the SDK with error handling:
```ruby Ruby theme={null}
require "activitysmith"
api_key = ENV["ACTIVITYSMITH_API_KEY"] || "YOUR-API-KEY"
activitysmith = ActivitySmith::Client.new(api_key: api_key)
```
### Send a Push Notification
Use `activitysmith.notifications.send` with a push payload. `title` is required; `message` and `subtitle` are optional.
```ruby Ruby theme={null}
response = activitysmith.notifications.send(
{
title: "New subscription 💸",
message: "Customer upgraded to Pro plan"
}
)
puts response.success
puts response.devices_notified
```
### Start a Live Activity
Start a Live Activity with `activitysmith.live_activities.start`.
```ruby Ruby theme={null}
start = activitysmith.live_activities.start(
{
content_state: {
title: "Nightly database backup",
subtitle: "create snapshot",
number_of_steps: 3,
current_step: 1,
type: "segmented_progress",
color: "yellow"
}
}
)
activity_id = start.activity_id
```
### Update a Live Activity
Update a Live Activity with `activitysmith.live_activities.update` using the `activity_id`.
```ruby Ruby theme={null}
update = activitysmith.live_activities.update(
{
activity_id: activity_id,
content_state: {
title: "Nightly database backup",
subtitle: "upload archive",
current_step: 2
}
}
)
puts update.devices_notified
```
### End a Live Activity
End a Live Activity with `activitysmith.live_activities.end`. You can optionally set `auto_dismiss_minutes` in the `content_state`.
```ruby Ruby theme={null}
finish = activitysmith.live_activities.end(
{
activity_id: activity_id,
content_state: {
title: "Nightly database backup",
subtitle: "verify restore",
current_step: 3,
auto_dismiss_minutes: 2
}
}
)
puts finish.success
```
## Channels
You can target specific channels when sending a push or starting a Live Activity.
```ruby Ruby theme={null}
activitysmith.notifications.send(
{
title: "New subscription 💸",
message: "Customer upgraded to Pro plan",
channels: ["ios-builds", "engineering"]
}
)
activitysmith.live_activities.start(
{
channels: ["ios-builds"],
content_state: {
title: "Nightly database backup",
number_of_steps: 3,
current_step: 1,
type: "segmented_progress"
}
}
)
```
## Error Handling
Handle API errors with `begin/rescue` around SDK calls:
```ruby Ruby theme={null}
begin
activitysmith.notifications.send(
{ title: "Hello" }
)
rescue OpenapiClient::ApiError => err
puts "Request failed: #{err.code} #{err.message}"
end
```
## Additional Resources
Download and install the ActivitySmith Ruby SDK on RubyGems
View the complete source code for the ActivitySmith Ruby SDK
# Team Members
Source: https://activitysmith.com/docs/team
Manage your team from one place: invite members, track pending invites, and remove access.
## Managing Team Members
The **Members** page is where team owners manage access for the whole workspace.
You can:
* Invite one or many people at once
* See active users and their role
* Track pending invitations and expiration dates
* Remove members when they no longer need access
## Roles
ActivitySmith currently supports two team roles:
| Role | Access |
| -------- | ------------------------------------------------------------- |
| `owner` | Full access, including inviting and removing members |
| `member` | Standard workspace access without team management permissions |
## Invite Team Members
Only team owners can invite new members.
1. Open your ActivitySmith dashboard.
2. Go to **Members** in the left sidebar.
3. Click **Invite members**.
4. Enter one or more email addresses in the invite modal.
5. Separate multiple emails with commas or new lines.
6. Click **Send Invites**.
Newly invited users appear in the **Invited users** table with:
* `pending` status until accepted
* Invite date (`Invited`)
* Expiration date (`Expires`)
Members are added to **Active users** only after they accept the invite.
## Remove a Member
Only team owners can remove members.
1. Open **Members**.
2. Find the user in **Active users**.
3. Click **Remove** in the **Actions** column.
4. Confirm the removal.
The removed member loses team access immediately.