---
title: "Allows the operation of a PiShock Shocker from an API Key."
method: POST
path: "/Shockers/{ShockerId}"
tags: ["Shockers", "Shockers"]
---

# Allows the operation of a PiShock Shocker from an API Key.

`POST /Shockers/{ShockerId}`

The ShockerId is specified as a path parameter, whereas the rest is in the body.  
The parameter "AgentName" will be removed in a future version however is still present for now -- Expect this to be replaced by the name of the actioning API Key in future.

## Path parameters

- `ShockerId` string, required

## Request body

- OperateShockerRequest — Message containing properties required for the operation of a shocker via the API.
  - `AgentName` string — [Deprecated]: Name of the actor on the device, this will reflect in the logs and be replaced with the name of the API Key at a later stage.
  - `Operation` 0 | 1 | 2
  - `Duration` integer — Maximum duration of the operation in miliseconds, will clamp to the share's maximum duration if lower.
  - `Intensity` integer — Maximum intensity of the operation, will clamp to the share's maximum intensity if lower.
  - `MinimumDuration` integer, nullable — [Optional] To randomise duration, specify a minimum duration.
  - `MinimumIntensity` integer, nullable — [Optional] To randomise intensity, specify a minimum intensity.
  - `IntensityAsPercentage` boolean — Previously called "Scale", treats the incoming intensity as a % of the share's maximum.

## Response `204`

Command has been sent to the device.

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Could not find share.
- `405` — An operation was provided that the share has not allowed the device to perform (such as shocking while shocking is disabled on the share)
- `406` — Device is not V3 -- Please encourage the user to flash V3 on the device or seek Tech Support assistance.
- `410` — Share is locked
- `412` — Intensity is out of bounds (<0, >100, Higher than max intensity for a shock)
- `416` — Duration exceeds limits on share, is lower than 16ms (due to legacy concerns) or higher than 15,000ms
- `503` — Share or shocker is paused.

---

[API](https://skmtc.dev/pishock/apis/pishock-public-api-v1.md) · [All operations](https://skmtc.dev/pishock/apis/pishock-public-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pishock/pishock-public-api-v1/revisions/271272058af7/schema)
