---
title: "Restore competitor"
method: POST
path: "/api/v1/tools/restore_competitor"
tags: ["default"]
---

# Restore competitor

`POST /api/v1/tools/restore_competitor`

## Request

- Base URL: `https://www.affiliatespy.io`
- URL: `https://www.affiliatespy.io/api/v1/tools/restore_competitor`
- Auth: HTTP bearer

Undo the last remove_competitor (or a swap) on a project: the competitor goes back where it was, exactly as stored. Refused with nothing_to_restore when a later removal replaced it, and too_many at the cap.

## Request body

- object
  - `app_id` string, uuid: Project id from list_apps. Omit to use your most recently added project.
  - `competitor` string, required: The exact value remove_competitor was given, or a swap's swap_out_id.
  - `replacing` string: Undoing a swap: the id of the competitor the swap put in, which leaves in the same write.
  - `confirm` boolean: Set true after the user confirmed an action the guard flagged as hard to undo.

## Response `200`

The tool's JSON result (same payload the MCP tool returns).

- unknown

## Other responses

- `400`: Arguments failed validation; body lists the issues.
- `401`: Missing or invalid API key.
- `403`: Guarded tool with Unrestricted MCP off.
- `429`: Rate limited (60 requests per minute per key).

---

[API](https://skmtc.dev/affiliatespy/apis/affiliatespy-api.md) · [All operations](https://skmtc.dev/affiliatespy/apis/affiliatespy-api/llms.txt) · [OpenAPI document](https://skmtc.dev/affiliatespy/apis/affiliatespy-api/revisions/0300d370b356?raw)
