Skip to main content

Unregister Device

Revoke a device so it stops receiving push notifications.

Endpoint​

POST /push/devices/unregister

Returns: 200 OK

Why POST and not DELETE

The installation id travels in the request body, and many HTTP clients and proxies drop bodies on DELETE requests.

Headers​

HeaderValueRequired
AuthorizationBearer <your-api-key>Yes
Content-Typeapplication/jsonYes

Body Parameters​

ParameterTypeRequiredDescription
installation_idstringYesThe installation to revoke.
{
"installation_id": "install-abc123"
}

The opt-out is durable​

The revocation is recorded as contact_opt_out, and a later Register Device call will not undo it: the device stays revoked and the register response reports opted_out: true. Re-registration happens on every app launch, so it must not override the user's choice.

The device row is kept as a tombstone instead of being deleted, which keeps the opt-out durable for that installation.

What happens across an app reinstall

The tombstone is keyed to installation_id. A reinstall generates a new one, so it registers as a new device.

An opt-out still survives a reinstall in the common case: revoking a contact's last active device also marks the contact unsubscribed from push, which is never reversed automatically. A reinstalled app on a fresh installation id is still not sendable.

The exception is a contact who keeps another active device. There the contact stays subscribed, and reinstalling on the opted-out handset makes it reachable again. Call this endpoint again after the reinstall if that handset must stay off.


Response​

{
"installation_id": "install-abc123",
"status": "REVOKED"
}
FieldTypeDescription
installation_idstringEchoed back
statusstringAlways REVOKED

Examples​

curl -X POST "https://api.arsel.sa/v1/push/devices/unregister" \
-H "Authorization: Bearer $ARSEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"installation_id": "install-abc123"
}'

Error Responses​

{
"status_code": 404,
"name": "not_found",
"message": "No device with this installation_id is registered for this organization."
}