---
title: "PATCH /api/v1/secret-syncs/spacelift/{syncId}"
method: PATCH
path: "/api/v1/secret-syncs/spacelift/{syncId}"
tags: ["Secret Syncs"]
---

# PATCH /api/v1/secret-syncs/spacelift/{syncId}

`PATCH /api/v1/secret-syncs/spacelift/{syncId}`

Update the specified Spacelift Sync.

## Path parameters

- `syncId` string, uuid, required

## Request body

- object
  - `name` string — The updated name of the Spacelift Sync. Must be slug-friendly.
  - `connectionId` string, uuid — The updated ID of the Spacelift Connection to use for syncing.
  - `description` string, nullable — The updated description of the Spacelift Sync.
  - `environment` string — The updated slug of the project environment to sync secrets from.
  - `secretPath` string — The updated folder path to sync secrets from.
  - `isAutoSyncEnabled` boolean — Whether secrets should be automatically synced when changes occur at the source location or not.
  - `syncOptions` object — Optional parameters to modify how secrets are synced.
    - `initialSyncBehavior` 'overwrite-destination', required — Specify how Infisical should resolve the initial sync to the Spacelift destination.
    - `keySchema` string — Specify the format to use for structuring secret keys in the Spacelift destination.
    - `disableSecretDeletion` boolean — Enable this flag to prevent removal of secrets from the Spacelift destination when syncing.
    - `writeOnly` boolean — Whether secrets should be marked as secret in Spacelift. Secret values are only available to Runs and Tasks and are not accessible in the web GUI or through the API.
  - `destinationConfig` object
    - `contextId` string, required — The ID of the Spacelift context to sync secrets to.
    - `contextName` string, required — The name of the Spacelift context to sync secrets to.
    - `configType` 'environment-variable' | 'file-mount', required — The type of config element to create in Spacelift. Either 'environment-variable' for individual environment variables or 'file-mount' for a single .env file mount.
    - `mountPath` string — The file path for the mounted file relative to /mnt/workspace/. Required when configType is 'file-mount'. When fileMountFormat is 'secret-per-file', this is the directory path. Example: 'secrets.env' or 'secrets/'.
    - `fileMountFormat` 'dot-env' | 'secret-per-file' — The format for file mount config elements. Either 'dot-env' (default) to store all secrets in a single .env file, or 'secret-per-file' to create a separate file mount per secret under the mount path directory.

## Response `200`

Default Response

- object
  - `secretSync` object, required
    - `id` string, uuid, required
    - `name` string, required
    - `description` string, nullable
    - `isAutoSyncEnabled` boolean
    - `version` number
    - `projectId` string, required
    - `folderId` string, uuid, nullable
    - `connectionId` string, uuid, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `syncStatus` string, nullable
    - `lastSyncJobId` string, nullable
    - `lastSyncMessage` string, nullable
    - `lastSyncedAt` string, date-time, nullable
    - `importStatus` string, nullable
    - `lastImportJobId` string, nullable
    - `lastImportMessage` string, nullable
    - `lastImportedAt` string, date-time, nullable
    - `removeStatus` string, nullable
    - `lastRemoveJobId` string, nullable
    - `lastRemoveMessage` string, nullable
    - `lastRemovedAt` string, date-time, nullable
    - `syncOptions` object, required — Optional parameters to modify how secrets are synced.
      - `initialSyncBehavior` 'overwrite-destination', required — Specify how Infisical should resolve the initial sync to the Spacelift destination.
      - `keySchema` string — Specify the format to use for structuring secret keys in the Spacelift destination.
      - `disableSecretDeletion` boolean — Enable this flag to prevent removal of secrets from the Spacelift destination when syncing.
      - `writeOnly` boolean — Whether secrets should be marked as secret in Spacelift. Secret values are only available to Runs and Tasks and are not accessible in the web GUI or through the API.
    - `connection` object, required
      - `app` 'spacelift', required
      - `name` string, required
      - `id` string, uuid, required
    - `environment` object, nullable, required
      - `slug` string, required
      - `name` string, required
      - `id` string, uuid, required
    - `folder` object, nullable, required
      - `id` string, required
      - `path` string, required
    - `destination` 'spacelift', required
    - `destinationConfig` object, required
      - `contextId` string, required — The ID of the Spacelift context to sync secrets to.
      - `contextName` string, required — The name of the Spacelift context to sync secrets to.
      - `configType` 'environment-variable' | 'file-mount', required — The type of config element to create in Spacelift. Either 'environment-variable' for individual environment variables or 'file-mount' for a single .env file mount.
      - `mountPath` string — The file path for the mounted file relative to /mnt/workspace/. Required when configType is 'file-mount'. When fileMountFormat is 'secret-per-file', this is the directory path. Example: 'secrets.env' or 'secrets/'.
      - `fileMountFormat` 'dot-env' | 'secret-per-file' — The format for file mount config elements. Either 'dot-env' (default) to store all secrets in a single .env file, or 'secret-per-file' to create a separate file mount per secret under the mount path directory.

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response
- `404` — Default Response
- `422` — Default Response
- `500` — Default Response

---

[API](https://skmtc.net/infisical/apis/infisical-api.md) · [All operations](https://skmtc.net/infisical/apis/infisical-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/infisical/infisical-api/versions/885aef3e6c11/schema)
