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

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

`POST /Shockers/OperateById/{ShockerId}`

## Request

- Base URL: `https://api.pishock.com`
- URL: `https://api.pishock.com/Shockers/OperateById/{ShockerId}`
- Auth: one of:
  - API key in header `X-PiShock-Token`
  - API key in header `X-PiShock-UserId`
  - API key in header `X-PiShock-Server-Key`
  - API key in header `X-PiShock-Api-Key`

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` integer, required

## Request body

- OperateShockerRequest
  - `AgentName` string
  - `Operation` 0 | 1 | 2
  - `Duration` integer
  - `Intensity` integer
  - `MinimumDuration` integer, nullable
  - `MinimumIntensity` integer, nullable
  - `IntensityAsPercentage` boolean

## 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.

## Changes

- **2026-09-22** `e39f4566848b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/pishock/apis/pishock-public-api-v1/changes/Shockers/OperateById/:ShockerId/post.md)

---

[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.dev/pishock/apis/pishock-public-api-v1/revisions/6398a6a65c40?raw)
