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 a fair number of HTTP clients and proxies silently drop bodies on DELETE requests. POST is the reliable choice.

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 resurrect it — the device stays revoked and the register response reports opted_out: true.

This is intentional. Re-registration happens on every app launch, and a revocation that any of those calls could undo would silently override the user's choice.

The device row is kept as a tombstone rather than deleted, which is what makes 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 rather than matching the tombstone.

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, and that is never reversed automatically — so 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 be_your_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."
}