---
title: "P&L based exit"
method: POST
path: "/pnlExit"
tags: ["Trader's Control"]
---

# P&L based exit

`POST /pnlExit`

The P&L Based Exit API allows users to configure automatic exit rules based on cumulative profit or loss thresholds. When the defined limits are breached, all applicable positions are exited.  
**Notes** :
 The configured P&L based exit remains active for the current trading day and is reset at the end of the session

## Headers

- `access-token` string, required

## Request body

- PnlBasedExitRequest
  - `dhanClientId` string — User specific identification generated by Dhan
  - `profitValue` number, float — User-defined target profit amount for the PNL exit
  - `lossValue` number, float — User-defined target loss amount for the PNL exit
  - `enableKillSwitch` boolean — Indicates if the kill switch is enabled for this PNL exit
  - `productType` string[] — | **Enum Values** | **Description** | |-----------------|----------------| | INTRADAY | Intraday for Equity, Futures & Options | | DELIVERY | Delivery for equity deliveries |

## Response `200`

Successful operation

- PnlExitResponse
  - `message` string
  - `pnlExitStatus` string — | **Enum Values** | **Description** | |-----------------|----------------| | ACTIVE | P&L based exit configured successfully | | INACTIVE | No active P&L based exit configured for the current trading day |

---

[API](https://skmtc.dev/dhan/apis/dhanhq-api.md) · [All operations](https://skmtc.dev/dhan/apis/dhanhq-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/dhan/dhanhq-api/revisions/2d368b9ed32d/schema)
