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

# Get sync plan



## OpenAPI

````yaml /openapi-public.json get /sync-plans/{id}
openapi: 3.1.1
info:
  title: Klef API
  description: Klef's multi-tenant HRIS sync platform API.
  version: v1
servers:
  - url: https://{workspace}.klef.ai/api
    variables:
      workspace:
        default: acme
        description: Your workspace's subdomain.
security: []
tags:
  - name: Users
  - name: Connections
  - name: Adoption
  - name: Policy resources
  - name: Audit
  - name: Catalog
  - name: Sync
  - name: Search
  - name: SyncPlans
  - name: Agent
  - name: Auth
  - name: Workspaces
  - name: Billing
  - name: Invitations
  - name: FirstSignIns
  - name: Connection accounts
  - name: Policies
  - name: Secrets
  - name: Lookup tables
  - name: Scripts
  - name: Segments
  - name: ApiKeys
  - name: Members
  - name: Workers
  - name: Inbox
  - name: Notifications
paths:
  /sync-plans/{id}:
    get:
      tags:
        - SyncPlans
      summary: Get sync plan
      operationId: GetSyncPlan
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseOfSyncPlanResponse'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                required:
                  - result
                  - errors
                type: object
                properties:
                  result: {}
                  errors:
                    type: array
                    items:
                      required:
                        - errorCode
                        - errorMessage
                      type: object
                      properties:
                        errorCode:
                          enum:
                            - validation_error
                            - unauthorized
                            - forbidden
                            - not_found
                            - internal_error
                            - error
                            - precondition_required
                            - precondition_failed
                            - invalid_if_match
                            - worker_not_found
                            - worker_version_not_found
                            - connection_not_found
                            - policy_not_found
                            - policy_revision_not_found
                            - lookup_table_not_found
                            - script_not_found
                            - segment_not_found
                            - workspace_secret_not_found
                            - member_not_found
                            - invitation_not_found
                            - user_not_found
                            - workspace_not_found
                            - api_key_not_found
                            - inbox_item_not_found
                            - sync_plan_not_found
                            - connection_account_not_found
                            - managed_account_not_found
                            - adoption_run_not_found
                            - sync_plan_not_ready
                            - sync_plan_stale
                            - sync_plan_already_applying
                            - subdomain_taken
                            - invalid_subdomain
                            - invalid_invite
                            - last_owner_protected
                            - owner_protected
                            - already_member
                            - already_invited
                            - role_not_assignable
                            - invalid_email
                            - email_required
                            - email_mismatch
                            - invitation_gone
                            - invalid_connector_credentials
                            - wrong_connector_type
                            - connection_not_syncable
                            - connector_o_auth_not_configured
                            - connector_authorization_failed
                            - salesforce_manage_users_required
                            - box_admin_required
                            - linear_admin_required
                            - dropbox_admin_required
                            - invalid_match_rule
                            - adoption_run_composed
                            - adoption_run_empty
                            - adoption_selection_refused
                            - invalid_policy
                            - policy_does_not_compile
                            - policy_secret_missing
                            - policy_lookup_table_missing
                            - policy_script_missing
                            - policy_segment_missing
                            - policy_edit_target_missing
                            - policy_secret_disclosure_forbidden
                            - notification_send_failed
                            - invalid_workspace_secret
                            - workspace_secret_referenced
                            - workspace_secret_name_conflict
                            - invalid_lookup_table
                            - lookup_table_referenced
                            - lookup_table_name_conflict
                            - invalid_script
                            - script_name_conflict
                            - script_referenced
                            - invalid_segment
                            - segment_name_conflict
                            - segment_referenced
                            - segment_worker_missing
                            - api_key_scope_not_granted
                            - api_key_limit_reached
                            - subscription_required
                            - already_subscribed
                            - no_billing_customer
                            - workspace_pending_deletion
                            - workspace_deletion_confirmation_mismatch
                            - workspace_deletion_already_scheduled
                            - workspace_deletion_not_scheduled
                            - workspace_export_expired
                            - workspace_export_not_found
                            - agent_conversation_not_found
                            - agent_proposal_not_found
                            - agent_proposal_outdated
                            - agent_proposal_expired
                            - agent_proposal_already_applied
                            - agent_proposal_rejected
                            - notification_kind_unsupported
                            - first_sign_in_not_found
                            - first_sign_in_gone
                            - first_sign_in_not_a_recipient
                            - first_sign_in_recipient_unknown
                            - first_sign_in_locked
                            - first_sign_in_code_refused
                            - first_sign_in_proof_invalid
                            - password_reset_unsupported
                            - invalid_password_rules
                            - avatar_not_owned
                            - unsupported_image_type
                            - image_too_large
                          description: >-
                            The central catalog of every error returned by the
                            API.
                        errorMessage:
                          type: string
                        target:
                          type:
                            - 'null'
                            - string
                      description: "One error in an API response: a specific ApiErrorCode, a human-readable message,\r\n    and an optional string? ApiError.Target (the field a validation error applies to)."
                description: "The envelope for a single-resource response: T? ApiResponse&lt;T&gt;.Result on success, otherwise `null`\r\n    with one or more IReadOnlyList&lt;ApiError&gt; ApiResponse&lt;T&gt;.Errors."
        '403':
          description: Permission denied.
          content:
            application/json:
              schema:
                required:
                  - result
                  - errors
                type: object
                properties:
                  result: {}
                  errors:
                    type: array
                    items:
                      required:
                        - errorCode
                        - errorMessage
                      type: object
                      properties:
                        errorCode:
                          enum:
                            - validation_error
                            - unauthorized
                            - forbidden
                            - not_found
                            - internal_error
                            - error
                            - precondition_required
                            - precondition_failed
                            - invalid_if_match
                            - worker_not_found
                            - worker_version_not_found
                            - connection_not_found
                            - policy_not_found
                            - policy_revision_not_found
                            - lookup_table_not_found
                            - script_not_found
                            - segment_not_found
                            - workspace_secret_not_found
                            - member_not_found
                            - invitation_not_found
                            - user_not_found
                            - workspace_not_found
                            - api_key_not_found
                            - inbox_item_not_found
                            - sync_plan_not_found
                            - connection_account_not_found
                            - managed_account_not_found
                            - adoption_run_not_found
                            - sync_plan_not_ready
                            - sync_plan_stale
                            - sync_plan_already_applying
                            - subdomain_taken
                            - invalid_subdomain
                            - invalid_invite
                            - last_owner_protected
                            - owner_protected
                            - already_member
                            - already_invited
                            - role_not_assignable
                            - invalid_email
                            - email_required
                            - email_mismatch
                            - invitation_gone
                            - invalid_connector_credentials
                            - wrong_connector_type
                            - connection_not_syncable
                            - connector_o_auth_not_configured
                            - connector_authorization_failed
                            - salesforce_manage_users_required
                            - box_admin_required
                            - linear_admin_required
                            - dropbox_admin_required
                            - invalid_match_rule
                            - adoption_run_composed
                            - adoption_run_empty
                            - adoption_selection_refused
                            - invalid_policy
                            - policy_does_not_compile
                            - policy_secret_missing
                            - policy_lookup_table_missing
                            - policy_script_missing
                            - policy_segment_missing
                            - policy_edit_target_missing
                            - policy_secret_disclosure_forbidden
                            - notification_send_failed
                            - invalid_workspace_secret
                            - workspace_secret_referenced
                            - workspace_secret_name_conflict
                            - invalid_lookup_table
                            - lookup_table_referenced
                            - lookup_table_name_conflict
                            - invalid_script
                            - script_name_conflict
                            - script_referenced
                            - invalid_segment
                            - segment_name_conflict
                            - segment_referenced
                            - segment_worker_missing
                            - api_key_scope_not_granted
                            - api_key_limit_reached
                            - subscription_required
                            - already_subscribed
                            - no_billing_customer
                            - workspace_pending_deletion
                            - workspace_deletion_confirmation_mismatch
                            - workspace_deletion_already_scheduled
                            - workspace_deletion_not_scheduled
                            - workspace_export_expired
                            - workspace_export_not_found
                            - agent_conversation_not_found
                            - agent_proposal_not_found
                            - agent_proposal_outdated
                            - agent_proposal_expired
                            - agent_proposal_already_applied
                            - agent_proposal_rejected
                            - notification_kind_unsupported
                            - first_sign_in_not_found
                            - first_sign_in_gone
                            - first_sign_in_not_a_recipient
                            - first_sign_in_recipient_unknown
                            - first_sign_in_locked
                            - first_sign_in_code_refused
                            - first_sign_in_proof_invalid
                            - password_reset_unsupported
                            - invalid_password_rules
                            - avatar_not_owned
                            - unsupported_image_type
                            - image_too_large
                          description: >-
                            The central catalog of every error returned by the
                            API.
                        errorMessage:
                          type: string
                        target:
                          type:
                            - 'null'
                            - string
                      description: "One error in an API response: a specific ApiErrorCode, a human-readable message,\r\n    and an optional string? ApiError.Target (the field a validation error applies to)."
                description: "The envelope for a single-resource response: T? ApiResponse&lt;T&gt;.Result on success, otherwise `null`\r\n    with one or more IReadOnlyList&lt;ApiError&gt; ApiResponse&lt;T&gt;.Errors."
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                required:
                  - result
                  - errors
                type: object
                properties:
                  result: {}
                  errors:
                    type: array
                    items:
                      required:
                        - errorCode
                        - errorMessage
                      type: object
                      properties:
                        errorCode:
                          enum:
                            - validation_error
                            - unauthorized
                            - forbidden
                            - not_found
                            - internal_error
                            - error
                            - precondition_required
                            - precondition_failed
                            - invalid_if_match
                            - worker_not_found
                            - worker_version_not_found
                            - connection_not_found
                            - policy_not_found
                            - policy_revision_not_found
                            - lookup_table_not_found
                            - script_not_found
                            - segment_not_found
                            - workspace_secret_not_found
                            - member_not_found
                            - invitation_not_found
                            - user_not_found
                            - workspace_not_found
                            - api_key_not_found
                            - inbox_item_not_found
                            - sync_plan_not_found
                            - connection_account_not_found
                            - managed_account_not_found
                            - adoption_run_not_found
                            - sync_plan_not_ready
                            - sync_plan_stale
                            - sync_plan_already_applying
                            - subdomain_taken
                            - invalid_subdomain
                            - invalid_invite
                            - last_owner_protected
                            - owner_protected
                            - already_member
                            - already_invited
                            - role_not_assignable
                            - invalid_email
                            - email_required
                            - email_mismatch
                            - invitation_gone
                            - invalid_connector_credentials
                            - wrong_connector_type
                            - connection_not_syncable
                            - connector_o_auth_not_configured
                            - connector_authorization_failed
                            - salesforce_manage_users_required
                            - box_admin_required
                            - linear_admin_required
                            - dropbox_admin_required
                            - invalid_match_rule
                            - adoption_run_composed
                            - adoption_run_empty
                            - adoption_selection_refused
                            - invalid_policy
                            - policy_does_not_compile
                            - policy_secret_missing
                            - policy_lookup_table_missing
                            - policy_script_missing
                            - policy_segment_missing
                            - policy_edit_target_missing
                            - policy_secret_disclosure_forbidden
                            - notification_send_failed
                            - invalid_workspace_secret
                            - workspace_secret_referenced
                            - workspace_secret_name_conflict
                            - invalid_lookup_table
                            - lookup_table_referenced
                            - lookup_table_name_conflict
                            - invalid_script
                            - script_name_conflict
                            - script_referenced
                            - invalid_segment
                            - segment_name_conflict
                            - segment_referenced
                            - segment_worker_missing
                            - api_key_scope_not_granted
                            - api_key_limit_reached
                            - subscription_required
                            - already_subscribed
                            - no_billing_customer
                            - workspace_pending_deletion
                            - workspace_deletion_confirmation_mismatch
                            - workspace_deletion_already_scheduled
                            - workspace_deletion_not_scheduled
                            - workspace_export_expired
                            - workspace_export_not_found
                            - agent_conversation_not_found
                            - agent_proposal_not_found
                            - agent_proposal_outdated
                            - agent_proposal_expired
                            - agent_proposal_already_applied
                            - agent_proposal_rejected
                            - notification_kind_unsupported
                            - first_sign_in_not_found
                            - first_sign_in_gone
                            - first_sign_in_not_a_recipient
                            - first_sign_in_recipient_unknown
                            - first_sign_in_locked
                            - first_sign_in_code_refused
                            - first_sign_in_proof_invalid
                            - password_reset_unsupported
                            - invalid_password_rules
                            - avatar_not_owned
                            - unsupported_image_type
                            - image_too_large
                          description: >-
                            The central catalog of every error returned by the
                            API.
                        errorMessage:
                          type: string
                        target:
                          type:
                            - 'null'
                            - string
                      description: "One error in an API response: a specific ApiErrorCode, a human-readable message,\r\n    and an optional string? ApiError.Target (the field a validation error applies to)."
                description: "The envelope for a single-resource response: T? ApiResponse&lt;T&gt;.Result on success, otherwise `null`\r\n    with one or more IReadOnlyList&lt;ApiError&gt; ApiResponse&lt;T&gt;.Errors."
      security:
        - cookieAuth: []
        - apiKeyAuth: []
components:
  schemas:
    ApiResponseOfSyncPlanResponse:
      required:
        - result
        - errors
      type: object
      properties:
        result:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SyncPlanResponse'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiError'
      description: "The envelope for a single-resource response: T? ApiResponse&lt;T&gt;.Result on success, otherwise `null`\r\n    with one or more IReadOnlyList&lt;ApiError&gt; ApiResponse&lt;T&gt;.Errors."
    SyncPlanResponse:
      required:
        - id
        - status
        - requestedByUserId
        - requestedAt
        - generatedAt
        - approvedByUserId
        - approvedAt
        - completedAt
        - errorMessage
        - supersededBySyncPlanId
        - stateSerial
        - isStale
        - policies
        - connections
        - headline
        - operations
        - findings
        - notifications
        - affectedWorkers
      type: object
      properties:
        id:
          type: string
        status:
          $ref: '#/components/schemas/SyncPlanStatus'
        requestedByUserId:
          type: string
        requestedAt:
          $ref: '#/components/schemas/Instant'
        generatedAt:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Instant'
        approvedByUserId:
          type:
            - 'null'
            - string
        approvedAt:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Instant'
        completedAt:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Instant'
        errorMessage:
          type:
            - 'null'
            - string
        supersededBySyncPlanId:
          type:
            - 'null'
            - string
        stateSerial:
          type:
            - 'null'
            - integer
          format: int64
        isStale:
          type: boolean
        policies:
          type: array
          items:
            $ref: '#/components/schemas/SyncPlanPolicyResponse'
        connections:
          type: array
          items:
            $ref: '#/components/schemas/SyncPlanConnectionResponse'
        headline:
          $ref: '#/components/schemas/SyncPlanHeadlineResponse'
        operations:
          type: array
          items:
            $ref: '#/components/schemas/SyncPlanOperationResponse'
        findings:
          type: array
          items:
            $ref: '#/components/schemas/SyncPlanFindingResponse'
        notifications:
          type: array
          items:
            $ref: '#/components/schemas/SyncPlanNotificationResponse'
        affectedWorkers:
          type: array
          items:
            $ref: '#/components/schemas/AffectedWorkerResponse'
    ApiError:
      required:
        - errorCode
        - errorMessage
      type: object
      properties:
        errorCode:
          $ref: '#/components/schemas/ApiErrorCode'
        errorMessage:
          type: string
        target:
          type:
            - 'null'
            - string
      description: "One error in an API response: a specific ApiErrorCode, a human-readable message,\r\n    and an optional string? ApiError.Target (the field a validation error applies to)."
    SyncPlanStatus:
      enum:
        - generating
        - ready
        - approved
        - executing
        - done
        - failed
        - done_with_errors
        - invalidated
      description: Lifecycle state of a SyncPlan.
    Instant:
      type: string
      format: date-time
    SyncPlanPolicyResponse:
      required:
        - id
        - name
        - version
        - revision
        - status
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        version:
          type: integer
          format: int32
        revision:
          type:
            - 'null'
            - integer
          description: "The revision of the policy's document the plan evaluated, or `null` for a plan\r\ngenerated before revisions were kept."
          format: int32
        status:
          $ref: '#/components/schemas/PolicyStatus'
    SyncPlanConnectionResponse:
      required:
        - id
        - system
        - name
        - protected
        - rosterRead
        - readError
      type: object
      properties:
        id:
          type: string
        system:
          $ref: '#/components/schemas/ConnectorExternalSystem'
        name:
          type: string
        protected:
          type: boolean
        rosterRead:
          type: boolean
        readError:
          type:
            - 'null'
            - string
    SyncPlanHeadlineResponse:
      required:
        - creates
        - changes
        - undo
        - forgets
        - blocked
        - failed
        - skipped
        - findings
        - conflicts
        - drift
        - unresolved
        - unreadConnections
      type: object
      properties:
        creates:
          type: integer
          format: int32
        changes:
          type: integer
          format: int32
        undo:
          type: integer
          format: int32
        forgets:
          type: integer
          format: int32
        blocked:
          type: integer
          format: int32
        failed:
          type: integer
          format: int32
        skipped:
          type: integer
          format: int32
        findings:
          type: integer
          format: int32
        conflicts:
          type: integer
          format: int32
        drift:
          type: integer
          format: int32
        unresolved:
          type: integer
          format: int32
        unreadConnections:
          type: integer
          format: int32
    SyncPlanOperationResponse:
      required:
        - id
        - connectionId
        - targetSystem
        - kind
        - workerId
        - workerVersion
        - externalUserId
        - policies
        - cause
        - causeDetail
        - isUndo
        - before
        - after
        - record
        - status
        - blockedReason
        - skippedReason
        - skippedAfterOperationId
        - error
        - executedAt
        - effects
      type: object
      properties:
        id:
          type: string
        connectionId:
          type: string
        targetSystem:
          $ref: '#/components/schemas/ConnectorExternalSystem'
        kind:
          $ref: '#/components/schemas/SyncPlanOperationKind'
        workerId:
          type: string
        workerVersion:
          type:
            - 'null'
            - integer
          format: int32
        externalUserId:
          type:
            - 'null'
            - string
        policies:
          type: array
          items:
            type: string
        cause:
          $ref: '#/components/schemas/SyncPlanOperationCause'
        causeDetail:
          type:
            - 'null'
            - string
        isUndo:
          type: boolean
        before:
          type:
            - 'null'
            - string
        after:
          type:
            - 'null'
            - string
        record:
          type:
            - 'null'
            - string
        status:
          $ref: '#/components/schemas/SyncPlanOperationStatus'
        blockedReason:
          type:
            - 'null'
            - string
        skippedReason:
          type:
            - 'null'
            - string
        skippedAfterOperationId:
          type:
            - 'null'
            - string
        error:
          type:
            - 'null'
            - string
        executedAt:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Instant'
        effects:
          type: array
          items:
            $ref: '#/components/schemas/SyncPlanEffectResponse'
    SyncPlanFindingResponse:
      required:
        - id
        - kind
        - targetSystem
        - connectionId
        - workerId
        - policies
        - field
        - externalUserId
        - message
        - detail
      type: object
      properties:
        id:
          type: string
        kind:
          $ref: '#/components/schemas/SyncPlanFindingKind'
        targetSystem:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ConnectorExternalSystem'
        connectionId:
          type:
            - 'null'
            - string
        workerId:
          type:
            - 'null'
            - string
        policies:
          type: array
          items:
            type: string
        field:
          type:
            - 'null'
            - string
        externalUserId:
          type:
            - 'null'
            - string
        message:
          type: string
        detail:
          type:
            - 'null'
            - string
    SyncPlanNotificationResponse:
      required:
        - id
        - policyId
        - name
        - stage
        - channel
        - title
        - subject
        - body
        - uri
        - method
        - aggregation
        - workers
        - to
        - cc
        - bcc
        - status
        - error
        - sentAt
      type: object
      properties:
        id:
          type: string
        policyId:
          type:
            - 'null'
            - string
        name:
          type: string
        stage:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/PolicyStage'
        channel:
          $ref: '#/components/schemas/NotificationChannel'
        title:
          type: string
        subject:
          type:
            - 'null'
            - string
        body:
          type:
            - 'null'
            - string
        uri:
          type:
            - 'null'
            - string
        method:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/HttpRequestMethod'
        aggregation:
          $ref: '#/components/schemas/NotificationAggregation'
        workers:
          type: array
          items:
            type: string
        to:
          type: array
          items:
            type: string
        cc:
          type: array
          items:
            type: string
        bcc:
          type: array
          items:
            type: string
        status:
          $ref: '#/components/schemas/SyncPlanNotificationStatus'
        error:
          type:
            - 'null'
            - string
        sentAt:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/Instant'
    AffectedWorkerResponse:
      required:
        - workerId
        - workerName
      type: object
      properties:
        workerId:
          type: string
        workerName:
          type: string
    ApiErrorCode:
      enum:
        - validation_error
        - unauthorized
        - forbidden
        - not_found
        - internal_error
        - error
        - precondition_required
        - precondition_failed
        - invalid_if_match
        - worker_not_found
        - worker_version_not_found
        - connection_not_found
        - policy_not_found
        - policy_revision_not_found
        - lookup_table_not_found
        - script_not_found
        - segment_not_found
        - workspace_secret_not_found
        - member_not_found
        - invitation_not_found
        - user_not_found
        - workspace_not_found
        - api_key_not_found
        - inbox_item_not_found
        - sync_plan_not_found
        - connection_account_not_found
        - managed_account_not_found
        - adoption_run_not_found
        - sync_plan_not_ready
        - sync_plan_stale
        - sync_plan_already_applying
        - subdomain_taken
        - invalid_subdomain
        - invalid_invite
        - last_owner_protected
        - owner_protected
        - already_member
        - already_invited
        - role_not_assignable
        - invalid_email
        - email_required
        - email_mismatch
        - invitation_gone
        - invalid_connector_credentials
        - wrong_connector_type
        - connection_not_syncable
        - connector_o_auth_not_configured
        - connector_authorization_failed
        - salesforce_manage_users_required
        - box_admin_required
        - linear_admin_required
        - dropbox_admin_required
        - invalid_match_rule
        - adoption_run_composed
        - adoption_run_empty
        - adoption_selection_refused
        - invalid_policy
        - policy_does_not_compile
        - policy_secret_missing
        - policy_lookup_table_missing
        - policy_script_missing
        - policy_segment_missing
        - policy_edit_target_missing
        - policy_secret_disclosure_forbidden
        - notification_send_failed
        - invalid_workspace_secret
        - workspace_secret_referenced
        - workspace_secret_name_conflict
        - invalid_lookup_table
        - lookup_table_referenced
        - lookup_table_name_conflict
        - invalid_script
        - script_name_conflict
        - script_referenced
        - invalid_segment
        - segment_name_conflict
        - segment_referenced
        - segment_worker_missing
        - api_key_scope_not_granted
        - api_key_limit_reached
        - subscription_required
        - already_subscribed
        - no_billing_customer
        - workspace_pending_deletion
        - workspace_deletion_confirmation_mismatch
        - workspace_deletion_already_scheduled
        - workspace_deletion_not_scheduled
        - workspace_export_expired
        - workspace_export_not_found
        - agent_conversation_not_found
        - agent_proposal_not_found
        - agent_proposal_outdated
        - agent_proposal_expired
        - agent_proposal_already_applied
        - agent_proposal_rejected
        - notification_kind_unsupported
        - first_sign_in_not_found
        - first_sign_in_gone
        - first_sign_in_not_a_recipient
        - first_sign_in_recipient_unknown
        - first_sign_in_locked
        - first_sign_in_code_refused
        - first_sign_in_proof_invalid
        - password_reset_unsupported
        - invalid_password_rules
        - avatar_not_owned
        - unsupported_image_type
        - image_too_large
      description: The central catalog of every error returned by the API.
    PolicyStatus:
      enum:
        - active
        - paused
        - disabled
      description: 'Operational state of a policy: running, temporarily paused, or disabled.'
    ConnectorExternalSystem:
      enum:
        - adp_workforce_now
        - oracle_fusion
        - microsoft_entra
        - gusto
        - microsoft365
        - google_workspace
        - oracle_oci
        - worker_model
        - aws
        - azure
        - aws_identity_center
        - bamboo_hr
        - slack
        - github
        - github_enterprise
        - salesforce
        - hubspot
        - box
        - linear
        - dropbox
        - openai
        - anthropic
        - one_password
        - keeper
        - bitwarden
        - atlassian
        - notion
      description: An external system a workspace can connect to.
    SyncPlanOperationKind:
      enum:
        - create
        - update
        - set_link
        - set_grants
        - forget
        - set_claims
        - adopt
        - detach
        - set_elements
        - end_element
        - reset_password
      description: >-
        What change the operation proposes against the target system, or against
        the record.
    SyncPlanOperationCause:
      enum:
        - declared
        - released
        - worker_left_segment
        - target_left_policy
        - policy_deleted
        - worker_gone
        - account_gone
        - matched
        - unlinked
        - rehired
        - manually_requested
      description: Why a plan proposes an operation.
    SyncPlanOperationStatus:
      enum:
        - pending
        - succeeded
        - failed
        - blocked
        - skipped
        - retrying
      description: Per-operation execution state, recorded when the plan runs.
    SyncPlanEffectResponse:
      required:
        - id
        - kind
        - path
        - elementKey
        - before
        - after
      type: object
      properties:
        id:
          type: string
        kind:
          $ref: '#/components/schemas/SyncPlanEffectKind'
        path:
          type:
            - 'null'
            - string
        elementKey:
          type:
            - 'null'
            - string
        before:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/JsonNode'
        after:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/JsonNode'
    SyncPlanFindingKind:
      enum:
        - conflict
        - drift
        - link_unresolved
        - target_skipped
        - evaluation_failed
        - account_exists
        - element_adopted
        - element_unended
      description: What a plan reports beside its operations.
    PolicyStage:
      enum:
        - pre_start
        - active
        - leave
        - suspended
        - departing
        - terminated
        - released
      description: "A stage a policy authors a block for: one of the worker's lifecycle stages, or\r\nPolicyStage.Released, which is relative to the policy rather than to the worker."
    NotificationChannel:
      enum:
        - email
        - slack
        - http
        - teams
      description: The channel a policy notification is delivered over.
    HttpRequestMethod:
      enum:
        - get
        - post
        - put
        - patch
        - delete
        - null
    NotificationAggregation:
      enum:
        - worker
        - run
      description: >-
        Whether a notification fires once per affected worker or once per sync
        run.
    SyncPlanNotificationStatus:
      enum:
        - pending
        - sent
        - failed
        - skipped
        - sending
    SyncPlanEffectKind:
      enum:
        - account_created
        - account_disabled
        - account_enabled
        - field_changed
        - element_added
        - element_changed
        - element_ended
        - grant_added
        - grant_removed
        - link_changed
        - record_changed
        - claim_added
        - claim_removed
        - password_reset
      description: What one consequence of a plan does to the thing it addresses.
    JsonNode: {}
  securitySchemes:
    cookieAuth:
      type: apiKey
      description: >-
        Cookie-based session. Obtain by completing the `/auth/login/{provider}`
        OAuth flow; the `/auth/callback` response sets the `klef.session` cookie
        that subsequent requests send automatically.
      name: klef.session
      in: cookie
    apiKeyAuth:
      type: http
      description: >-
        An API key from **Settings > API keys**, sent as `Authorization: Bearer
        klef_sk_…`. A key works only on its own workspace's subdomain, and only
        with the permissions its scopes grant.
      scheme: bearer
      bearerFormat: klef_sk_…

````