---
title: "Remove a project-to-repository mapping"
method: POST
path: "/api/v2/securityCompass/removeProjectMapping"
tags: ["Security Compass"]
---

# Remove a project-to-repository mapping

`POST /api/v2/securityCompass/removeProjectMapping`

## Request

- Base URL: `https://zeropath.com`
- URL: `https://zeropath.com/api/v2/securityCompass/removeProjectMapping`
- Auth: API key in header `X-ZeroPath-API-Token-Id` and API key in header `X-ZeroPath-API-Token-Secret`

Detach a mapping and its queued sync work. Generated natural-language rules are deleted only when this was the last mapping targeting the repository; otherwise they are kept for the remaining mappings and the response reports deletedRuleCount 0.

## Request body

- SecurityCompassRemoveProjectMappingRequest
  - `organizationId` string, required: Organization that owns the integration.
  - `mappingId` string, required: cuid of the project mapping to remove. Obtainable via securityCompass.getIntegration.

## Response `200`

Removal result

- SecurityCompassRemoveProjectMappingResponse
  - `success` boolean, required
  - `deletedRuleCount` integer, required: Number of generated rules deleted. Non-zero only when the removed mapping was the last one targeting its repository; otherwise the rules are kept for the remaining mappings.

## Other responses

- `400`: Error Response
- `401`: Error Response
- `404`: Error Response
- `409`: Error Response

---

[API](https://skmtc.dev/zeropath/apis/zeropath-api.md) - [All operations](https://skmtc.dev/zeropath/apis/zeropath-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zeropath/apis/zeropath-api/revisions/126e9c80ba0d?raw)
