# /api/v2/private/toggle_portfolio_margining stops working

Calls to /api/v2/private/toggle_portfolio_margining on Deribit API stopped working on December 3, 2024.

## What to use instead

Use /api/v2/private/change_margin_model.

- API: Deribit API (www.deribit.com)
- Kind: Endpoint removal
- Announced: December 3, 2024
- Takes effect: December 3, 2024
- Calls after that day: fail
- Calls it hits: `/api/v2/private/toggle_portfolio_margining`
- Source: [Announcement](https://docs.deribit.com/changelogs/jsonrpc)
- Verified: November 6, 2026, against Deribit API's own pages
- Page: https://www.okapi.bot/providers/deribit-api/breaking-changes/api-v2-private-toggle-portfolio-margining-stops-working/

## Deribit API's words

> We have removed the legacy method private/toggle_portfolio_margining . Clients are advised to use private/change_margin_model instead.

Okapi finds the calls this change hits in your repo and opens the pull request with the fix: https://github.com/apps/okapi-agent
