---
title: "Sync rules for a mapping"
method: POST
path: "/api/v2/securityCompass/syncRules"
tags: ["Security Compass"]
---

# Sync rules for a mapping

`POST /api/v2/securityCompass/syncRules`

## Request

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

Enqueue a background rule sync for one mapping: SD Elements countermeasures are fetched, classified (built-in SAST coverage / natural-language rule / unsupported), and ZeroPath rules are created or updated. Returns immediately with status 'enqueued'; poll securityCompass.getIntegration (ruleSync.state) or securityCompass.getMappingAudit for the outcome. Fails with 409 while a sync is already running for the mapping.

## Request body

- SecurityCompassSyncRulesRequest
  - `organizationId` string, required: Organization that owns the integration.
  - `mappingId` string, required: cuid of the project mapping to sync.

## Response `200`

Enqueue confirmation

- SecurityCompassSyncRulesResponse
  - `status` 'enqueued', required: The sync runs in the background. Poll securityCompass.getIntegration (ruleSync.state) or securityCompass.getMappingAudit for the result.

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