---
title: "Update a source-control integration."
method: PUT
path: "/v1/integrations/{id}"
tags: ["Integrations"]
---

# Update a source-control integration.

`PUT /v1/integrations/{id}`

## Request

- Base URL: `https://api.scalix.world`
- URL: `https://api.scalix.world/v1/integrations/{id}`
- Auth: HTTP bearer

Updates an integration's build/deploy settings (branch filter, auto-build,
auto-deploy, preview, status) and returns the updated record.

## Path parameters

- `id` string, required

## Request body

- UpdateIntegrationBody: Request body for `PUT /v1/integrations/{id}`.
  - `branch_filter` string, nullable
  - `auto_build` boolean, nullable
  - `auto_deploy` boolean, nullable
  - `service_id` string, nullable
  - `function_id` string, nullable: Tri-state like the functions crate's `cron_expression`: absent = keep the current link, null = clear it (the console's "None" option), and a string = set it. A plain Option cannot tell "clear" from "not sent", which made an un-picked function target impossible to remove. serde's derive alone is not enough: with a plain `Option<Option<String>>`, JSON `null` also deserializes to `None` (reads as "absent"), so the custom deserializer below lifts a present field — null included — into the outer Some.
  - `preview_enabled` boolean, nullable
  - `preview_ttl_hours` integer, nullable
  - `status` string, nullable

## Response `200`

The updated integration

- IntegrationResponse: Response for `GET`/`PUT /v1/integrations/{id}`.
  - `integration` IntegrationJson, required: A source-control integration (GitHub/GitLab/Bitbucket) attached to a project.
    - `id` string, required
    - `project_id` string, required
    - `provider` string, required
    - `repo_url` string, required
    - `branch_filter` string, required
    - `auto_build` boolean, required
    - `auto_deploy` boolean, required
    - `status` string, required
    - `service_id` string, nullable
    - `function_id` string, nullable
    - `preview_enabled` boolean, required
    - `preview_ttl_hours` integer, required
    - `created_at` string, required
    - `updated_at` string, required

## Other responses

- `401`: Missing or invalid credentials
- `404`: Integration not found
- `500`: Internal error

---

[API](https://skmtc.dev/scalix/apis/scalix-cloud-api.md) · [All operations](https://skmtc.dev/scalix/apis/scalix-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/scalix/apis/scalix-cloud-api/revisions/2c04ca0a90bb?raw)
