Skip to content

API Reference

The Aivi API is intentionally small. You create and configure an activity once in the app, then drive it from anywhere with a single HTTP request. Anything that can make an HTTPS call can update a Live Activity.

All requests go to:

https://api.getaivi.app

Every request must include your API token in the Authorization header, using the Token scheme:

Authorization: Token YOUR_API_TOKEN

You get your token in the app: open the Account tab, sign in with your Apple account, and subscribe to a plan to unlock API access. The token stays the same until you rotate it.

PATCH /activity/{slug}

Updates the activity identified by slug and pushes the new state to every subscribed device. This is the only endpoint you need.

ParameterTypeDescription
slugstringThe unique ID you gave the activity in the app (e.g. dishwasher).

The body has two top-level fields: a lifecycle state and a content object that describes what to render.

FieldTypeDescriptionRequired?
stateStateWhether the activity should be live on devices.Yes
contentContentThe template payload to render.Yes
curl https://api.getaivi.app/activity/{slug} \
-X PATCH \
-H "Content-Type: application/json" \
-H "Authorization: Token YOUR_API_TOKEN" \
--data-binary @- << 'EOF'
{
"state": "ONGOING",
"content": {
"template": "progress",
"icon": "washer",
"progress": { "style": "simple", "value": 0.35 },
"header_left": { "value": "In progress", "text_color": "green" },
"header_right": { "value": "35 min" }
}
}
EOF

A successful update returns 200 OK and echoes the stored state and content:

{
"state": "ONGOING",
"content": {
"template": "progress",
"icon": "washer",
"progress": { "style": "simple", "value": 0.35 },
"header_left": { "value": "In progress", "text_color": "green" },
"header_right": { "value": "35 min" }
}
}

The state field controls the lifecycle of the Live Activity on every subscribed device. There are two values:

stateWhat it does
ONGOINGThe activity is live. The first ONGOING update starts it; later ones update it in place.
IDLEThe activity is not live. Sending IDLE ends an active Live Activity and dismisses it.

A typical flow sets state to ONGOING while a task is running, then to IDLE once it finishes. How long a finished activity lingers on screen before it disappears is controlled by the per-activity dismissal delay you configure in the app.

The content object is chosen by its template field, which decides both the layout and the rest of the fields it accepts. Three templates are available:

templateUse it for
progressProgress bars: cycles, charging, prints, downloads.
monitorOne or two columns of labeled live values.
genericThe original simple progress layout.Legacy

Each template’s full field list, example payloads, and rendered previews live on the Templates page. Shared building blocks such as colors, icons, value formatters, and the tap action URL are documented there too.

Errors use standard HTTP status codes and return a JSON body with a detail field describing what went wrong.

StatusdetailCause
400Template mismatchThe content.template does not match the template the activity was created with.
401Could not validate credentialsThe Authorization header is missing, malformed, or the token is unknown.
402No active subscription was foundThe token is valid but the account has no active subscription.
404Activity not foundNo activity with that slug exists on your account.
422Too many ongoing activitiesStarting this activity would exceed your concurrent-activity quota.
422array of field errorsThe request body is missing fields or has invalid values.

A machine-readable OpenAPI document is generated from the API itself and served at https://api.getaivi.app/openapi.json. Import it into an OpenAPI-compatible client such as Postman or Insomnia to explore the schema and make test requests.