> ## 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.

# List deleted connections

> Connections a create can restore with `restoreConnectionId`, newest first.



## OpenAPI

````yaml /openapi-public.json get /connections/deleted
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: Invitations
  - name: FirstSignIns
  - name: Connection accounts
  - name: Licenses
  - name: Policies
  - name: Secrets
  - name: Lookup tables
  - name: Scripts
  - name: Segments
  - name: Members
  - name: Workers
  - name: Inbox
  - name: Notifications
paths:
  /connections/deleted:
    get:
      tags:
        - Connections
      summary: List deleted connections
      description: >-
        Connections a create can restore with `restoreConnectionId`, newest
        first.
      operationId: ListDeletedConnections
      parameters:
        - name: connector
          in: query
          schema:
            $ref: '#/components/schemas/ConnectorExternalSystem'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ApiCollectionResponseOfDeletedConnectionResponse
        '400':
          description: Validation or business-rule error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: Permission denied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      security:
        - cookieAuth: []
        - apiKeyAuth: []
components:
  schemas:
    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
        - hi_bob
        - deel
      description: An external system a workspace can connect to.
    ApiCollectionResponseOfDeletedConnectionResponse:
      required:
        - results
        - errors
        - pagination
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/DeletedConnectionResponse'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiError'
        pagination:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/PageInfo'
      description: 'The envelope for a collection response: `results`.'
    ApiErrorResponse:
      required:
        - result
        - errors
      type: object
      properties:
        result: {}
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiError'
    DeletedConnectionResponse:
      required:
        - id
        - name
        - connector
        - deletedAt
        - managedAccounts
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        connector:
          $ref: '#/components/schemas/ConnectorExternalSystem'
        deletedAt:
          $ref: '#/components/schemas/Instant'
        managedAccounts:
          type: integer
          description: The accounts Klef managed through it, which restoring brings back.
          format: int32
    ApiError:
      required:
        - code
      type: object
      properties:
        code:
          $ref: '#/components/schemas/MessageCode'
        params:
          type:
            - 'null'
            - object
          additionalProperties:
            type: string
        causes:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/MessageResponse'
        target:
          type:
            - 'null'
            - string
      description: >-
        One error in an API response: what happened, as a message, and the
        request field it applies to.
    PageInfo:
      required:
        - nextCursor
        - limit
        - hasMore
      type: object
      properties:
        nextCursor:
          type:
            - 'null'
            - integer
          format: int32
        limit:
          type: integer
          format: int32
        hasMore:
          type: boolean
        total:
          type:
            - 'null'
            - integer
          format: int32
      description: >-
        Cursor-pagination metadata shared across every paged read. `nextCursor`
        is the offset of the next page, `null` on the last page.
    Instant:
      type: string
      format: date-time
    MessageCode:
      enum:
        - details_unavailable
        - unexpected_error
        - simulated_link_key_unsupported
        - simulated_grant_key_unsupported
        - simulated_grant_key_unread
        - simulated_user_not_found
        - target_operation_failed
        - target_upstream_text
        - target_http_failed
        - target_token_response_empty
        - target_unreachable
        - scim_create_returned_nothing
        - plan_catalog_unread
        - plan_grant_unread
        - plan_linked_worker_unmanaged
        - plan_failed
        - plan_script_missing
        - plan_script_failed
        - plan_field_not_boolean
        - plan_field_not_integer
        - plan_secret_missing
        - plan_secret_malformed
        - plan_draft_missing
        - adoption_worker_managed
        - adoption_account_gone
        - plan_source_unsynced
        - plan_draft_uncompilable
        - plan_connection_protected
        - plan_account_write_failed
        - plan_link_value_not_worker
        - plan_link_target_unmanaged
        - plan_composed_state_invalid
        - plan_create_found_account
        - plan_content_altered
        - payload_field_missing
        - payload_field_unknown
        - payload_field_wrong_type
        - payload_field_too_long
        - payload_value_not_allowed
        - payload_key_duplicated
        - payload_exclusive_conflict
        - payload_item_null
        - plan_elements_adopted
        - plan_element_unendable
        - plan_element_parent_unwritten
        - plan_grants_lost
        - plan_account_exists
        - plan_account_gone_recreated
        - plan_account_gone_forgotten
        - plan_policy_evaluation_failed
        - plan_released_evaluation_failed
        - plan_target_connections_ambiguous
        - plan_policies_conflict
        - 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_not_published
        - policy_modified
        - 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_digest_mismatch
        - sync_plan_content_altered
        - audit_log_delivery_not_found
        - audit_log_delivery_rejected
        - sync_plan_already_applying
        - sync_plan_not_applicable
        - 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
        - dropbox_admin_required
        - github_organization_required
        - connection_restore_choice_required
        - deleted_connection_not_found
        - connection_tenant_mismatch
        - 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_disabled
        - policy_edit_target_missing
        - policy_secret_disclosure_forbidden
        - notification_send_failed
        - invalid_workspace_secret
        - workspace_secret_referenced
        - workspace_secret_name_conflict
        - invalid_license_price
        - license_not_found
        - license_price_not_found
        - license_price_date_conflict
        - license_invoice_not_found
        - license_invoice_file_gone
        - license_invoice_too_large
        - license_invoice_too_many_pages
        - license_invoice_encrypted
        - license_invoice_unreadable
        - 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
        - plan_upgrade_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
        - draft_not_found
        - 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
        - audit_log_delivery_bucket_unwritable
        - audit_log_delivery_overwrites_allowed
        - audit_log_delivery_key_can_delete
        - audit_log_delivery_delete_unverified
        - audit_log_delivery_governance_bypass
        - audit_log_delivery_key_can_read
        - audit_log_delivery_key_can_list
        - audit_log_delivery_seal_missing
        - audit_log_delivery_batch_mismatch
        - audit_log_delivery_batch_foreign
        - audit_log_delivery_write_failed
        - invalid_s3_bucket_name
        - invalid_object_key_prefix
        - name_required
        - name_too_short
        - name_too_long
        - name_without_letter_or_digit
        - invalid_identifier
        - email_length_invalid
        - email_malformed
        - subdomain_length_invalid
        - subdomain_malformed
        - subdomain_reserved
        - worker_id_malformed
        - value_not_boolean
        - value_not_date
        - script_code_required
        - policy_category_required
        - password_length_invalid
        - password_character_sets_too_few
        - temporary_access_pass_lifetime_invalid
        - id_malformed
        - script_not_java_script
        - audit_after_id_without_sequence
        - audit_cursor_with_sequence
        - worker_field_unknown
        - segment_manual_with_rules
        - segment_worker_contradictory
        - segment_rule_invalid
        - segment_rule_left_not_attribute
        - segment_rule_value_kind_invalid
        - segment_rule_attribute_unknown
        - segment_rule_needs_values
        - segment_rule_needs_one_value
        - segment_rule_value_blank
        - segment_applied_by_policy
        - segment_applied_by_draft
        - license_price_lot_count
        - license_price_remainder_lot
        - license_price_lot_seats
        - license_price_lot_amount
        - license_invoice_file_name_invalid
        - adoption_worker_given_two_accounts
        - adoption_account_unknown
        - adoption_account_already_managed
        - assistant_not_configured
        - assistant_answer_truncated
        - assistant_refused
        - assistant_rate_limited
        - assistant_credentials_rejected
        - assistant_unreachable
        - assistant_timed_out
        - assistant_no_answer
        - assistant_too_many_steps
        - assistant_conversation_unknown
        - assistant_prompt_invalid
        - assistant_workspace_unresolved
        - assistant_workspace_busy
        - assistant_workspace_throttled
        - assistant_conversation_too_long
        - assistant_conversation_busy
        - credential_required
        - credential_not_https_url
        - credential_not_github_slug
        - credential_not_aws_region
        - credential_not_iam_role_arn
        - credential_requires_other
        - credential_not_base64
        - credential_certificate_without_key
        - credential_certificate_unreadable
        - credential_not_hubspot_account
        - credential_not_github_installation
        - credential_not_bamboohr_subdomain
        - credential_not_service_account_key
        - credential_not_json
        - credential_not_identity_center_arn
        - credential_not_azure_scope
        - credential_assignment_mode_invalid
        - credential_not_guid
        - policy_diagnostic
        - notification_recipients_without_address
        - notification_to_recipient_missing
        - notification_too_many_addresses
        - notification_first_sign_in_missing
        - notification_worker_departing
        - notification_account_pending
        - notification_interrupted
        - notification_delivery_failed
        - notification_channel_unsupported
        - notification_kind_unknown
        - notification_test_address_missing
        - notification_webhook_missing
        - notification_secret_id_invalid
        - notification_header_secret_missing
        - notification_webhook_secret_missing
        - notification_webhooks_partly_posted
        - notification_kind_not_emailed
        - notification_kind_not_configurable
        - inbox_setup_source
        - inbox_setup_target
        - inbox_setup_policy
        - inbox_plan_ready
        - inbox_plan_applied
        - inbox_plan_applied_with_errors
        - anthropic_role_required
        - anthropic_role_locked
        - anthropic_credentials_rejected
        - anthropic_invite_missing_after_create
        - anthropic_required_field_missing
        - anthropic_member_and_invite_gone
        - anthropic_member_and_invite_gone_for_grants
        - anthropic_grant_key_unsupported
        - anthropic_admin_key_required
        - atlassian_credentials_rejected
        - atlassian_required_field_missing
        - atlassian_account_not_owned
        - atlassian_invite_unnamed
        - atlassian_account_gone
        - atlassian_grant_key_unsupported
        - atlassian_directory_ambiguous
        - atlassian_directory_read_scope_missing
        - atlassian_user_write_scope_or_subscription_missing
        - atlassian_user_write_scope_missing
        - atlassian_group_write_scope_missing
        - atlassian_group_read_scope_missing
        - aws_root_unchecked
        - aws_policy_simulator_unreachable
        - aws_caller_identity_unread
        - aws_required_field_missing
        - aws_console_access_missing
        - aws_update_unconfirmed
        - aws_grant_key_unsupported
        - aws_grant_key_unread
        - aws_account_out_of_reach
        - aws_user_id_malformed
        - aws_user_gone
        - aws_authorization_details_read_missing
        - aws_user_read_missing
        - aws_user_create_missing
        - aws_user_update_missing
        - aws_grant_write_missing
        - aws_password_policy_read_missing
        - aws_password_write_missing
        - aws_identity_center_instance_unreachable
        - aws_identity_center_instance_missing
        - aws_identity_center_instance_ambiguous
        - aws_identity_center_instance_unread
        - aws_identity_center_required_field_missing
        - aws_identity_center_principal_unmatched
        - aws_identity_center_grant_key_unsupported
        - aws_identity_center_grant_key_unread
        - aws_identity_center_assignment_malformed
        - aws_identity_center_assignment_unsettled
        - aws_identity_center_assignment_timed_out
        - aws_identity_center_assignments_list_missing
        - aws_identity_center_principal_assignments_read_missing
        - aws_identity_center_user_lookup_missing
        - aws_identity_center_assignment_write_missing
        - aws_identity_center_assignment_read_missing
        - azure_role_assignments_unread
        - azure_token_without_principal
        - azure_sign_in_failed
        - azure_required_field_missing
        - azure_principal_unmatched
        - azure_grant_key_unsupported
        - azure_principal_id_malformed
        - azure_grant_key_unread
        - azure_role_assignment_read_missing
        - azure_role_assignment_write_missing
        - bitwarden_role_unknown
        - bitwarden_credentials_rejected
        - bitwarden_api_key_refused
        - bitwarden_invite_returned_nothing
        - bitwarden_required_field_missing
        - bitwarden_grant_key_unsupported
        - bitwarden_member_gone
        - bitwarden_organization_key_required
        - box_field_required
        - box_credentials_rejected
        - box_authorization_refused
        - box_create_returned_nothing
        - box_update_returned_nothing
        - box_token_user_missing
        - box_required_field_missing
        - box_user_gone
        - box_grant_key_unsupported
        - box_user_manager_required
        - box_group_manager_required
        - dropbox_name_missing
        - dropbox_name_required
        - dropbox_credentials_rejected
        - dropbox_authorization_refused
        - dropbox_member_add_refused
        - dropbox_member_add_failed
        - dropbox_authorizing_admin_missing
        - dropbox_job_timed_out
        - dropbox_required_field_missing
        - dropbox_member_gone
        - dropbox_member_gone_for_grants
        - dropbox_grant_key_unsupported
        - dropbox_user_admin_required
        - dropbox_member_update_admin_required
        - entra_pass_missing
        - entra_pass_start_missing
        - entra_pass_value_missing
        - entra_permissions_unread
        - entra_exchange_certificate_unreadable
        - entra_exchange_field_unconfigured
        - entra_create_returned_nothing
        - entra_user_gone_after_update
        - entra_link_key_unsupported
        - entra_grant_key_unsupported
        - entra_grant_key_unread
        - entra_user_gone_for_licenses
        - entra_license_unavailable
        - entra_usage_location_missing
        - entra_domain_federated
        - entra_user_read_missing
        - entra_user_write_missing
        - entra_user_update_missing
        - entra_license_write_missing
        - entra_group_member_write_missing
        - entra_password_write_missing
        - entra_temporary_access_pass_missing
        - exchange_runspace_unavailable
        - exchange_cmdlet_missing
        - exchange_mailboxes_unreadable
        - exchange_mailbox_unreadable
        - exchange_unconfigured
        - exchange_manage_as_app_missing
        - exchange_recipient_read_missing
        - exchange_recipient_write_missing
        - github_installation_token_missing
        - github_grant_key_unsupported
        - github_required_field_missing
        - github_members_read_missing
        - github_members_write_missing
        - github_enterprise_required_field_missing
        - github_enterprise_user_gone
        - github_enterprise_grant_key_unsupported
        - github_enterprise_scim_scope_missing
        - google_write_would_drop_fields
        - google_create_returned_nothing
        - google_user_gone_before_update
        - google_update_contended
        - google_link_key_unsupported
        - google_grant_key_unsupported
        - google_grant_key_unread
        - google_license_unknown
        - google_license_product_unsubscribed
        - google_user_scope_missing
        - google_user_create_missing
        - google_licensing_scope_missing
        - google_group_scope_missing
        - google_org_unit_create_missing
        - google_password_reset_missing
        - hubspot_field_required
        - hubspot_billing_access_missing
        - hubspot_credentials_rejected
        - hubspot_authorization_refused
        - hubspot_create_returned_nothing
        - hubspot_required_field_missing
        - hubspot_user_gone
        - hubspot_user_gone_for_grants
        - hubspot_grant_key_unsupported
        - hubspot_users_read_scope_missing
        - hubspot_users_write_scope_missing
        - hubspot_user_update_scopes_missing
        - hubspot_seat_scopes_missing
        - keeper_credentials_rejected
        - keeper_required_field_missing
        - keeper_user_gone
        - keeper_grant_key_unsupported
        - keeper_node_token_required
        - linear_name_required
        - linear_role_required
        - linear_credentials_rejected
        - linear_authorization_refused
        - linear_result_missing
        - linear_page_missing
        - linear_owner_missing
        - linear_mutation_result_missing
        - linear_change_not_applied
        - linear_data_missing
        - linear_required_field_missing
        - linear_member_and_invite_gone
        - linear_member_gone
        - linear_member_and_invite_gone_for_grants
        - linear_grant_key_unsupported
        - linear_admin_required
        - linear_admin_with_role_required
        - notion_role_unknown
        - notion_credentials_rejected
        - notion_required_field_missing
        - notion_member_gone
        - notion_grant_key_unsupported
        - notion_scim_token_required
        - notion_scim_token_or_domain_required
        - one_password_credentials_rejected
        - one_password_required_field_missing
        - one_password_member_gone
        - one_password_grant_key_unsupported
        - one_password_account_token_required
        - openai_role_required
        - openai_credentials_rejected
        - openai_invite_missing_after_create
        - openai_required_field_missing
        - openai_member_and_invite_gone
        - openai_member_and_invite_gone_for_grants
        - openai_grant_key_unsupported
        - openai_admin_key_required
        - oracle_fusion_base_url_insecure
        - oracle_fusion_flex_assignment_missing
        - oracle_fusion_flex_container_missing
        - oracle_fusion_row_ambiguous
        - oracle_fusion_row_key_missing
        - oracle_fusion_collection_missing
        - oracle_fusion_address_missing
        - oracle_fusion_flex_rows_unkeyed
        - oracle_fusion_flex_rows_not_multi_row
        - oracle_fusion_flexfield_context_unkeyed
        - oracle_fusion_pod_unreachable
        - oracle_fusion_credentials_rejected
        - oracle_fusion_write_before_row_start
        - oracle_fusion_date_malformed
        - oracle_fusion_row_start_malformed
        - oracle_fusion_flexfield_row_key_missing
        - oracle_fusion_flexfield_entry_key_missing
        - oracle_fusion_flexfields_undescribed
        - oracle_fusion_create_returned_nothing
        - oracle_fusion_relationship_terminated
        - oracle_fusion_assignment_inactive
        - oracle_fusion_location_unknown
        - oracle_fusion_global_name_missing
        - oracle_fusion_link_key_unsupported
        - oracle_fusion_manager_collection_missing
        - oracle_fusion_grant_key_unsupported
        - oracle_fusion_grant_key_unread
        - oracle_fusion_clear_before_row_start
        - oracle_fusion_manager_assignment_unnamed
        - oracle_fusion_manager_assignment_missing
        - oracle_fusion_manager_assignment_absent
        - oracle_fusion_manager_assignment_ambiguous
        - oracle_fusion_worker_gone
        - oracle_fusion_element_unendable
        - oracle_fusion_relationship_missing
        - oracle_fusion_assignment_missing
        - oracle_fusion_primary_assignment_end
        - oracle_fusion_last_assignment_end
        - oracle_fusion_assignment_address_missing
        - oracle_fusion_workers_and_locations_read_missing
        - oracle_fusion_workers_read_missing
        - oracle_fusion_integration_specialist_missing
        - oracle_fusion_integration_specialist_and_security_manager_missing
        - oracle_fusion_security_manager_missing
        - salesforce_entitlements_truncated
        - salesforce_credentials_rejected
        - salesforce_authorization_refused
        - salesforce_required_field_missing
        - salesforce_profile_required
        - salesforce_user_gone
        - salesforce_user_gone_for_grants
        - salesforce_grant_key_unsupported
        - salesforce_manage_users_missing
        - slack_refused
        - slack_channel_not_visible
        - slack_empty_body
        - slack_install_revoked_or_unscoped
        - slack_channel_scopes_missing
        - slack_channel_read_scope_missing
        - slack_required_field_missing
        - slack_member_gone
        - slack_member_gone_for_grants
        - slack_grant_key_unsupported
      description: >-
        The central catalog of every Message. A code keeps its meaning for good;
        a new meaning is a new code.
    MessageResponse:
      required:
        - code
      type: object
      properties:
        code:
          $ref: '#/components/schemas/MessageCode'
        params:
          type:
            - 'null'
            - object
          additionalProperties:
            type: string
        causes:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/MessageResponse'
  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_…

````

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