# revokeAllDeviceSessions

mutation · in the family [Device fleet](/reference/device-fleet/)

## What it does

Kill every live session of one device — the lost-device sweep (usually with suspend).

THE LOST-DEVICE KILL SWITCH: revoke EVERY live device session of one Device in one privileged act (compose with suspendDevice to also block re-exchange); reason REQUIRED — a kill switch never fires silently. Template class A3_DEVICE (hand-derived v30).

## What happens

Requires a reason; answers how many sessions died.

## Who may call it

Capability area: **Device fleet** — Enrolling, pairing, suspending and retiring the devices at your registers.

- Owner
- Manager
- An API key whose scope allows `api:revokeAllDeviceSessions`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `input` | [RevokeAllDeviceSessionsInput](/types/RevokeAllDeviceSessionsInput/) `RevokeAllDeviceSessionsInput!` | yes | No further notes. |

## Returns

[RevokeAllDeviceSessionsResult](/types/RevokeAllDeviceSessionsResult/) `RevokeAllDeviceSessionsResult!` — The revokeAllDeviceSessions result.

## Example request

```graphql
mutation ExampleRevokeAllDeviceSessions($input: RevokeAllDeviceSessionsInput!) {
  revokeAllDeviceSessions(input: $input) {
    revokedSessions
  }
}
```

Variables:

```json
{
  "input": {
    "deviceId": "01900000-0000-7000-8000-7c291d9e0000",
    "reason": "Correcting a miscount."
  }
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

## Example response

```json
{
  "data": {
    "revokeAllDeviceSessions": {
      "revokedSessions": 1
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

## Errors this call can answer

- `VALIDATION/INVALID` — Something in the request is not valid. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
- `NOT_FOUND/*` — That record could not be found. ([NOT_FOUND](/errors/NOT_FOUND/))
- `CONFLICT/*` — The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. ([CONFLICT](/errors/CONFLICT/))
- `VALIDATION/VERSION_REQUIRED` — The request did not say which app version it came from. ([VALIDATION](/errors/VALIDATION/))
