---
title: "Apply a previewed sync rule"
method: PATCH
path: "/integration-sync/project/{projectId}/{provider}"
tags: ["Integration sync"]
---

# Apply a previewed sync rule

`PATCH /integration-sync/project/{projectId}/{provider}`

## Request

- Base URL: `https://cloud.kaneo.app/api`
- URL: `https://cloud.kaneo.app/api/integration-sync/project/{projectId}/{provider}`
- Auth: HTTP bearer

Save shared integration rules only if the preview is still current. Excluded links are paused, never deleted. Newly matching unlinked tasks are exported through the integration event path. Paused links require explicit review to resume.

## Path parameters

- `projectId` string, required
- `provider` 'github' | 'gitea' | 'gitlab', required

## Request body

- object
  - `rules` object, required
    - `outgoing` union, required: Kaneo workspace label IDs controlling task sync. Missing labels pause sync.
      - object
        - `mode` 'all', required
      - object
        - `mode` 'labels', required
        - `match` 'any' | 'all', required
        - `labels` string[], required
    - `incoming` union, required: Exact repository label names controlling which issues can be imported.
      - object
        - `mode` 'all', required
      - object
        - `mode` 'labels', required
        - `match` 'any' | 'all', required
        - `labels` string[], required
  - `previewToken` string, required

## Response `200`

Saved rules and current scope

- IntegrationSyncPreview
  - `isActive` boolean, required
  - `rules` object, required
    - `outgoing` union, required: Kaneo workspace label IDs controlling task sync. Missing labels pause sync.
      - object
        - `mode` 'all', required
      - object
        - `mode` 'labels', required
        - `match` 'any' | 'all', required
        - `labels` string[], required
    - `incoming` union, required: Exact repository label names controlling which issues can be imported.
      - object
        - `mode` 'all', required
      - object
        - `mode` 'labels', required
        - `match` 'any' | 'all', required
        - `labels` string[], required
  - `labels` object[], required
    - `id` string, required
    - `name` string, required
    - `color` string, required
  - `missingLabels` string[], required
  - `total` number, required
  - `matching` number, required
  - `willCreate` number, required
  - `willPause` number, required
  - `needsReview` number, required
  - `paused` number, required
  - `matchingTasks` object[], required
    - `id` string, required
    - `number` number, nullable, required
    - `title` string, required
  - `pausedNextCursor` string, nullable, required
  - `pausedTasks` object[], required
    - `id` string, required
    - `number` number, nullable, required
    - `title` string, required
    - `linkId` string, required
    - `url` string, required
    - `eligible` boolean, required
  - `previewToken` string, required

## Other responses

- `400`: Invalid rule or workspace label
- `401`: Missing or invalid credentials
- `403`: No access to the project, or missing required permission
- `404`: Project, integration, or linked task not found
- `409`: Configuration, impact or comparison changed; review again
- `429`: The API key exceeded its rate limit or usage quota. Wait the number of seconds in Retry-After before retrying. The X-RateLimit headers are sent only when the rate limit was hit.

## Changes

- **2026-10-08** `c7b8a842601b`: 5 breaking, 6 info
  - removed the media type `text/plain` for the response with the status `400`
  - removed the media type `text/plain` for the response with the status `403`
  - removed the media type `text/plain` for the response with the status `404`
  - removed the media type `text/plain` for the response with the status `409`
  - …7 more
- **2026-10-08** `2ed51b8af657`: 5 breaking, 5 info
  - removed the media type `application/json` for the response with the status `400`
  - removed the media type `application/json` for the response with the status `401`
  - removed the media type `application/json` for the response with the status `403`
  - removed the media type `application/json` for the response with the status `404`
  - …6 more
- **2026-10-07** `df1439c724ee`: 4 breaking, 5 info
  - removed the media type `text/plain` for the response with the status `400`
  - removed the media type `text/plain` for the response with the status `403`
  - removed the media type `text/plain` for the response with the status `404`
  - removed the media type `text/plain` for the response with the status `409`
  - …5 more
- **2026-10-03** `a753d5484cf5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/usekaneo/apis/kaneo-api/changes/integration-sync/project/:projectId/:provider/patch.md)

---

[API](https://skmtc.dev/usekaneo/apis/kaneo-api.md) - [All operations](https://skmtc.dev/usekaneo/apis/kaneo-api/llms.txt) - [OpenAPI document](https://skmtc.dev/usekaneo/apis/kaneo-api/revisions/93f78789100c?raw)
