> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync secrets

> Trigger a sync for the specified Spacelift Sync.



## OpenAPI

````yaml POST /api/v1/secret-syncs/spacelift/{syncId}/sync-secrets
openapi: 3.0.3
info:
  title: Infisical API
  description: List of all available APIs that can be consumed
  version: 0.0.1
servers:
  - url: https://us.infisical.com
    description: Production server (US)
  - url: https://eu.infisical.com
    description: Production server (EU)
  - url: http://localhost:8080
    description: Local server
security: []
paths:
  /api/v1/secret-syncs/spacelift/{syncId}/sync-secrets:
    post:
      tags:
        - Secret Syncs
      description: Trigger a sync for the specified Spacelift Sync.
      operationId: syncSpaceliftSecretSync
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: syncId
          required: true
          description: The ID of the Spacelift Sync to trigger a sync for.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  secretSync:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      description:
                        type: string
                        nullable: true
                      isAutoSyncEnabled:
                        type: boolean
                        default: true
                      version:
                        type: number
                        default: 1
                      projectId:
                        type: string
                      folderId:
                        type: string
                        format: uuid
                        nullable: true
                      connectionId:
                        type: string
                        format: uuid
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                      syncStatus:
                        type: string
                        nullable: true
                      lastSyncJobId:
                        type: string
                        nullable: true
                      lastSyncMessage:
                        type: string
                        nullable: true
                      lastSyncedAt:
                        type: string
                        format: date-time
                        nullable: true
                      importStatus:
                        type: string
                        nullable: true
                      lastImportJobId:
                        type: string
                        nullable: true
                      lastImportMessage:
                        type: string
                        nullable: true
                      lastImportedAt:
                        type: string
                        format: date-time
                        nullable: true
                      removeStatus:
                        type: string
                        nullable: true
                      lastRemoveJobId:
                        type: string
                        nullable: true
                      lastRemoveMessage:
                        type: string
                        nullable: true
                      lastRemovedAt:
                        type: string
                        format: date-time
                        nullable: true
                      lastSyncResult:
                        type: string
                        nullable: true
                      syncOptions:
                        type: object
                        properties:
                          initialSyncBehavior:
                            type: string
                            enum:
                              - overwrite-destination
                            description: >-
                              Specify how Infisical should resolve the initial
                              sync to the Spacelift destination.
                          keySchema:
                            type: string
                            maxLength: 255
                            description: >-
                              Specify the format to use for structuring secret
                              keys in the Spacelift destination.
                          disableSecretDeletion:
                            type: boolean
                            description: >-
                              Enable this flag to prevent removal of secrets
                              from the Spacelift destination when syncing.
                          includeAllSubFolders:
                            type: boolean
                            description: >-
                              Whether to sync secrets from folders beneath the
                              source path as well.
                          writeOnly:
                            type: boolean
                            default: false
                            description: >-
                              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.
                        required:
                          - initialSyncBehavior
                        additionalProperties: false
                        description: Optional parameters to modify how secrets are synced.
                      connection:
                        type: object
                        properties:
                          app:
                            type: string
                            enum:
                              - spacelift
                          name:
                            type: string
                          id:
                            type: string
                            format: uuid
                        required:
                          - app
                          - name
                          - id
                        additionalProperties: false
                      environment:
                        type: object
                        properties:
                          slug:
                            type: string
                          name:
                            type: string
                          id:
                            type: string
                            format: uuid
                        required:
                          - slug
                          - name
                          - id
                        additionalProperties: false
                        nullable: true
                      folder:
                        type: object
                        properties:
                          id:
                            type: string
                          path:
                            type: string
                        required:
                          - id
                          - path
                        additionalProperties: false
                        nullable: true
                      destination:
                        type: string
                        enum:
                          - spacelift
                      destinationConfig:
                        type: object
                        properties:
                          contextId:
                            type: string
                            minLength: 1
                            description: >-
                              The ID of the Spacelift context to sync secrets
                              to.
                          contextName:
                            type: string
                            minLength: 1
                            description: >-
                              The name of the Spacelift context to sync secrets
                              to.
                          configType:
                            type: string
                            enum:
                              - environment-variable
                              - file-mount
                            description: >-
                              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:
                            type: string
                            description: >-
                              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:
                            type: string
                            enum:
                              - dot-env
                              - secret-per-file
                            description: >-
                              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.
                        required:
                          - contextId
                          - contextName
                          - configType
                        additionalProperties: false
                    required:
                      - id
                      - name
                      - projectId
                      - connectionId
                      - createdAt
                      - updatedAt
                      - syncOptions
                      - connection
                      - environment
                      - folder
                      - destination
                      - destinationConfig
                    additionalProperties: false
                    title: Spacelift
                required:
                  - secretSync
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 400
                  message:
                    type: string
                  error:
                    type: string
                  details: {}
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 401
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 403
                  message:
                    type: string
                  details: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 404
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 422
                  message: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - error
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 500
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.