workos 9.5.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/block-generated-edits.yml +13 -0
  3. data/.github/workflows/ci.yml +1 -1
  4. data/.github/workflows/docs.yml +1 -1
  5. data/.github/workflows/lint.yml +1 -1
  6. data/.github/workflows/release-please.yml +7 -1
  7. data/.github/workflows/release.yml +1 -1
  8. data/.last-synced-sha +1 -1
  9. data/.oagen-manifest.json +197 -75
  10. data/.release-please-manifest.json +1 -1
  11. data/CHANGELOG.md +87 -0
  12. data/Gemfile.lock +2 -2
  13. data/README.md +15 -14
  14. data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request.rb +28 -0
  15. data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request_user.rb +22 -0
  16. data/lib/workos/agents/agent_admin_validate_credential_request.rb +25 -0
  17. data/lib/workos/agents/agent_credential_validation.rb +25 -0
  18. data/lib/workos/agents/agent_registration.rb +40 -0
  19. data/lib/workos/agents/agent_registration_agent_identity.rb +28 -0
  20. data/lib/workos/agents/agent_registration_claim.rb +31 -0
  21. data/lib/workos/agents/agent_registration_claim_claim_completion.rb +31 -0
  22. data/lib/workos/agents/claim_view_response.rb +28 -0
  23. data/lib/workos/agents/claim_view_response_organization.rb +7 -0
  24. data/lib/workos/agents.rb +93 -0
  25. data/lib/workos/api_keys/api_key_validation_response.rb +6 -2
  26. data/lib/workos/api_keys.rb +3 -4
  27. data/lib/workos/authorization/permission_created_data.rb +1 -34
  28. data/lib/workos/authorization/permission_deleted_data.rb +1 -1
  29. data/lib/workos/authorization/permission_updated_data.rb +1 -1
  30. data/lib/workos/authorization.rb +24 -24
  31. data/lib/workos/base_client.rb +4 -4
  32. data/lib/workos/client.rb +4 -0
  33. data/lib/workos/connect.rb +23 -19
  34. data/lib/workos/directory_sync.rb +10 -2
  35. data/lib/workos/groups.rb +7 -7
  36. data/lib/workos/inflections.rb +0 -1
  37. data/lib/workos/organization_domains.rb +4 -4
  38. data/lib/workos/organizations/organization_authorized_connect_application_list_data.rb +34 -0
  39. data/lib/workos/organizations.rb +57 -10
  40. data/lib/workos/pipes/api_key_installation.rb +25 -0
  41. data/lib/workos/pipes/{connected_account_dto.rb → connected_account_input.rb} +1 -1
  42. data/lib/workos/pipes/create_data_integration.rb +7 -1
  43. data/lib/workos/pipes/data_integration.rb +6 -0
  44. data/lib/workos/pipes/{data_integration_credentials_dto.rb → data_integration_credentials_input.rb} +1 -1
  45. data/lib/workos/pipes/data_integration_installation.rb +28 -0
  46. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +1 -19
  47. data/lib/workos/pipes/update_data_integration.rb +4 -1
  48. data/lib/workos/pipes.rb +25 -16
  49. data/lib/workos/pipes_provider.rb +2 -2
  50. data/lib/workos/shared/access_token_agent_registration_credential_issued_data_detail.rb +25 -0
  51. data/lib/workos/shared/agent_registration_claim_attempt_created.rb +34 -0
  52. data/lib/workos/shared/agent_registration_claim_attempt_created_data.rb +40 -0
  53. data/lib/workos/shared/agent_registration_claim_completed.rb +34 -0
  54. data/lib/workos/shared/agent_registration_claim_completed_data.rb +40 -0
  55. data/lib/workos/shared/agent_registration_claim_completed_data_claimed_by.rb +22 -0
  56. data/lib/workos/shared/agent_registration_created.rb +34 -0
  57. data/lib/workos/{organization_domains/organization_domain_stand_alone.rb → shared/agent_registration_created_data.rb} +13 -16
  58. data/lib/workos/shared/agent_registration_created_data_agent_identity.rb +25 -0
  59. data/lib/workos/shared/agent_registration_credential_issued.rb +34 -0
  60. data/lib/workos/shared/agent_registration_credential_issued_data.rb +34 -0
  61. data/lib/workos/shared/agent_registration_credential_issued_data_detail.rb +22 -0
  62. data/lib/workos/shared/agent_registration_deleted.rb +34 -0
  63. data/lib/workos/shared/agent_registration_deleted_data.rb +18 -0
  64. data/lib/workos/shared/agent_registration_expired.rb +34 -0
  65. data/lib/workos/shared/agent_registration_expired_data.rb +7 -0
  66. data/lib/workos/shared/agent_registration_organization_switched.rb +34 -0
  67. data/lib/workos/shared/agent_registration_organization_switched_data.rb +25 -0
  68. data/lib/workos/shared/agent_registration_revoked.rb +34 -0
  69. data/lib/workos/shared/agent_registration_revoked_data.rb +7 -0
  70. data/lib/workos/shared/pipes_connected_account_connection_failed.rb +34 -0
  71. data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +46 -0
  72. data/lib/workos/shared/radar_challenge_created.rb +34 -0
  73. data/lib/workos/shared/radar_challenge_created_data.rb +28 -0
  74. data/lib/workos/sso/connection.rb +3 -3
  75. data/lib/workos/types/agent_admin_validate_credential_request_type.rb +13 -0
  76. data/lib/workos/types/agent_registration_created_data_kind.rb +14 -0
  77. data/lib/workos/types/agent_registration_created_data_method.rb +14 -0
  78. data/lib/workos/types/agent_registration_created_data_status.rb +15 -0
  79. data/lib/workos/types/{data_integration_credentials_type.rb → agent_registration_kind.rb} +1 -1
  80. data/lib/workos/types/{organization_domain_stand_alone_state.rb → agent_registration_status.rb} +1 -1
  81. data/lib/workos/types/applications_registration_types.rb +13 -0
  82. data/lib/workos/types/{organization_domain_stand_alone_verification_strategy.rb → claim_view_response_status.rb} +1 -1
  83. data/lib/workos/types/connected_account_input_state.rb +13 -0
  84. data/lib/workos/types/connected_account_state.rb +2 -1
  85. data/lib/workos/types/create_data_integration_auth_methods.rb +9 -0
  86. data/lib/workos/types/create_user_password_hash_type.rb +2 -1
  87. data/lib/workos/types/create_webhook_endpoint_events.rb +5 -1
  88. data/lib/workos/types/data_integration_auth_methods.rb +9 -0
  89. data/lib/workos/types/data_integration_credentials_input_type.rb +9 -0
  90. data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +1 -6
  91. data/lib/workos/types/pipe_connected_account_state.rb +1 -5
  92. data/lib/workos/types/vault_kek_deleted_data_actor_source.rb +9 -0
  93. data/lib/workos/user_management/authentication_reauthentication_succeeded.rb +34 -0
  94. data/lib/workos/user_management/authentication_reauthentication_succeeded_data.rb +34 -0
  95. data/lib/workos/user_management/radar_challenge.rb +43 -0
  96. data/lib/workos/user_management.rb +59 -23
  97. data/lib/workos/vault/vault_kek_deleted.rb +34 -0
  98. data/lib/workos/vault/vault_kek_deleted_data.rb +31 -0
  99. data/lib/workos/vault.rb +4 -4
  100. data/lib/workos/version.rb +1 -1
  101. data/lib/workos/widgets.rb +2 -2
  102. data/lib/workos.rb +11 -0
  103. data/rbi/workos/access_token_agent_registration_credential_issued_data_detail.rbi +36 -0
  104. data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request.rbi +42 -0
  105. data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request_user.rbi +30 -0
  106. data/rbi/workos/agent_admin_validate_credential_request.rbi +36 -0
  107. data/rbi/workos/{sso_intent_options.rbi → agent_credential_validation.rbi} +11 -5
  108. data/rbi/workos/agent_registration.rbi +66 -0
  109. data/rbi/workos/agent_registration_agent_identity.rbi +42 -0
  110. data/rbi/workos/agent_registration_claim.rbi +48 -0
  111. data/rbi/workos/agent_registration_claim_attempt_created.rbi +54 -0
  112. data/rbi/workos/agent_registration_claim_attempt_created_data.rbi +66 -0
  113. data/rbi/workos/agent_registration_claim_claim_completion.rbi +48 -0
  114. data/rbi/workos/agent_registration_claim_completed.rbi +54 -0
  115. data/rbi/workos/agent_registration_claim_completed_data.rbi +66 -0
  116. data/rbi/workos/agent_registration_claim_completed_data_claimed_by.rbi +30 -0
  117. data/rbi/workos/agent_registration_created.rbi +54 -0
  118. data/rbi/workos/agent_registration_created_data.rbi +72 -0
  119. data/rbi/workos/agent_registration_created_data_agent_identity.rbi +36 -0
  120. data/rbi/workos/agent_registration_credential_issued.rbi +54 -0
  121. data/rbi/workos/agent_registration_credential_issued_data.rbi +54 -0
  122. data/rbi/workos/agent_registration_credential_issued_data_detail.rbi +30 -0
  123. data/rbi/workos/agent_registration_deleted.rbi +54 -0
  124. data/rbi/workos/{connection_option.rbi → agent_registration_deleted_data.rbi} +5 -5
  125. data/rbi/workos/agent_registration_expired.rbi +54 -0
  126. data/rbi/workos/{domain_verification_intent_options.rbi → agent_registration_expired_data.rbi} +5 -5
  127. data/rbi/workos/agent_registration_organization_switched.rbi +54 -0
  128. data/rbi/workos/agent_registration_organization_switched_data.rbi +36 -0
  129. data/rbi/workos/agent_registration_revoked.rbi +54 -0
  130. data/rbi/workos/agent_registration_revoked_data.rbi +24 -0
  131. data/rbi/workos/agents.rbi +42 -0
  132. data/rbi/workos/api_key_installation.rbi +36 -0
  133. data/rbi/workos/api_key_validation_response.rbi +6 -0
  134. data/rbi/workos/authentication_reauthentication_succeeded.rbi +54 -0
  135. data/rbi/workos/authentication_reauthentication_succeeded_data.rbi +54 -0
  136. data/rbi/workos/claim_view_response.rbi +42 -0
  137. data/rbi/workos/claim_view_response_organization.rbi +30 -0
  138. data/rbi/workos/client.rbi +3 -0
  139. data/rbi/workos/connect.rbi +2 -1
  140. data/rbi/workos/{connected_account_dto.rbi → connected_account_input.rbi} +1 -1
  141. data/rbi/workos/connection.rbi +4 -4
  142. data/rbi/workos/create_data_integration.rbi +14 -2
  143. data/rbi/workos/data_integration.rbi +12 -0
  144. data/rbi/workos/{data_integration_credentials_dto.rbi → data_integration_credentials_input.rbi} +1 -1
  145. data/rbi/workos/data_integration_installation.rbi +42 -0
  146. data/rbi/workos/directory_sync.rbi +3 -1
  147. data/rbi/workos/organization_authorized_connect_application_list_data.rbi +54 -0
  148. data/rbi/workos/organization_domains.rbi +2 -2
  149. data/rbi/workos/organizations.rbi +12 -0
  150. data/rbi/workos/permission_created_data.rbi +6 -0
  151. data/rbi/workos/permission_deleted_data.rbi +6 -0
  152. data/rbi/workos/permission_updated_data.rbi +6 -0
  153. data/rbi/workos/pipes.rbi +7 -4
  154. data/rbi/workos/pipes_connected_account_connection_failed.rbi +54 -0
  155. data/rbi/workos/{organization_domain_stand_alone.rbi → pipes_connected_account_connection_failed_data.rbi} +23 -23
  156. data/rbi/workos/radar_challenge.rbi +72 -0
  157. data/rbi/workos/radar_challenge_created.rbi +54 -0
  158. data/rbi/workos/radar_challenge_created_data.rbi +42 -0
  159. data/rbi/workos/update_data_integration.rbi +8 -2
  160. data/rbi/workos/user_management.rbi +16 -0
  161. data/rbi/workos/vault_kek_deleted.rbi +54 -0
  162. data/rbi/workos/vault_kek_deleted_data.rbi +48 -0
  163. data/rbi/workos/widget_session_token.rbi +2 -2
  164. data/rbi/workos/widgets.rbi +1 -1
  165. data/test/workos/test_agents.rb +49 -0
  166. data/test/workos/test_agents_model_round_trip.rb +165 -0
  167. data/test/workos/test_api_keys_model_round_trip.rb +307 -0
  168. data/test/workos/test_authorization_model_round_trip.rb +237 -0
  169. data/test/workos/test_base_client.rb +27 -0
  170. data/test/workos/test_client_api_model_round_trip.rb +31 -0
  171. data/test/workos/test_connect_model_round_trip.rb +175 -0
  172. data/test/workos/test_directory_sync_model_round_trip.rb +579 -0
  173. data/test/workos/test_feature_flags_model_round_trip.rb +580 -0
  174. data/test/workos/test_groups_model_round_trip.rb +56 -0
  175. data/test/workos/test_multi_factor_auth_model_round_trip.rb +192 -0
  176. data/test/workos/test_organization_domains_model_round_trip.rb +260 -0
  177. data/test/workos/test_organization_membership_model_round_trip.rb +89 -0
  178. data/test/workos/test_organizations.rb +9 -1
  179. data/test/workos/test_organizations_model_round_trip.rb +602 -0
  180. data/test/workos/test_pipes_model_round_trip.rb +40 -4
  181. data/test/workos/test_pipes_provider_model_round_trip.rb +75 -0
  182. data/test/workos/test_shared_model_round_trip.rb +787 -0
  183. data/test/workos/test_sso_model_round_trip.rb +422 -0
  184. data/test/workos/test_user_management.rb +16 -0
  185. data/test/workos/test_user_management_model_round_trip.rb +1501 -0
  186. data/test/workos/test_vault_model_round_trip.rb +571 -0
  187. data/test/workos/test_widgets.rb +2 -2
  188. data/test/workos/test_widgets_model_round_trip.rb +30 -0
  189. metadata +118 -19
  190. data/lib/workos/admin_portal/domain_verification_intent_options.rb +0 -18
  191. data/lib/workos/admin_portal/intent_options.rb +0 -22
  192. data/lib/workos/admin_portal/sso_intent_options.rb +0 -22
  193. data/lib/workos/sso/connection_option.rb +0 -18
  194. data/rbi/workos/intent_options.rbi +0 -30
  195. data/test/workos/test_model_round_trip.rb +0 -6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,92 @@
1
1
  # Changelog
2
2
 
3
+ ## [10.0.0](https://github.com/workos/workos-ruby/compare/v9.5.0...v10.0.0) (2026-07-22)
4
+
5
+ ### Bug Fixes
6
+
7
+ * Preserve explicit nil in request bodies as JSON null ([#522](https://github.com/workos/workos-ruby/issues/522)) ([5b06e32](https://github.com/workos/workos-ruby/commit/5b06e329ffe25b97ac9299571586ce2ecdca4a96))
8
+
9
+ * [#524](https://github.com/workos/workos-ruby/pull/524) feat(generated)!: regenerate from spec (3 changes)
10
+
11
+ **Features**
12
+ * **agents**:
13
+ * Added model `ClaimViewResponse`
14
+ * Added model `ClaimViewResponseOrganization`
15
+ * Added model `AgentAdminLinkClaimAttemptToExternalUserRequest`
16
+ * Added model `AgentAdminLinkClaimAttemptToExternalUserRequestUser`
17
+ * Added enum `ClaimViewResponseStatus`
18
+ * Added endpoint `PATCH /agents/claims/attempts`
19
+ * Added model `AgentRegistration`
20
+ * Added model `AgentCredentialValidation`
21
+ * Added model `AgentRegistrationAgentIdentity`
22
+ * Added model `AgentRegistrationClaim`
23
+ * Added model `AgentAdminValidateCredentialRequest`
24
+ * Added model `AgentRegistrationClaimClaimCompletion`
25
+ * Added enum `AgentRegistrationStatus`
26
+ * Added enum `AgentRegistrationKind`
27
+ * Added enum `AgentAdminValidateCredentialRequestType`
28
+ * Added service `Agents`
29
+ * **[api_keys](https://workos.com/docs/reference/authkit/api-keys)**:
30
+ * Added `agent_registration_id` to `ApiKeyValidationResponse`
31
+ * **[connect](https://workos.com/docs/reference/workos-connect/standalone)**:
32
+ * Added enum `ApplicationsRegistrationTypes`
33
+ * Added parameter `Applications.list.registration_types`
34
+ * **[directory_sync](https://workos.com/docs/reference/directory-sync)**:
35
+ * Added parameter `DirectoryUsers.list.idp_id`
36
+ * Added parameter `DirectoryUsers.list.email`
37
+ * **[organizations](https://workos.com/docs/reference/organization)**:
38
+ * Added model `OrganizationAuthorizedConnectApplicationList`
39
+ * Added model `OrganizationAuthorizedConnectApplicationListData`
40
+ * Added model `OrganizationAuthorizedConnectApplicationListListMetadata`
41
+ * Added service `OrganizationsAuthorizedApplications`
42
+ * **[pipes](https://workos.com/docs/reference/pipes)**:
43
+ * Added model `DataIntegrationInstallation`
44
+ * Added `auth_methods` to `CreateDataIntegration`
45
+ * Added `api_key` to `CreateDataIntegration`
46
+ * Added `api_key` to `UpdateDataIntegration`
47
+ * Added `auth_methods` to `DataIntegration`
48
+ * Added `installation` to `DataIntegration`
49
+ * Added enum `CreateDataIntegrationAuthMethods`
50
+ * Added enum `DataIntegrationAuthMethods`
51
+ * Added model `DataIntegrationCredentialsResponse`
52
+ * Added model `DataIntegrationCredentialsResponseCredential`
53
+ * Added model `DataIntegrationsUpsertApiKeyRequest`
54
+ * Added model `DataIntegrationsVendCredentialsRequest`
55
+ * Added enum `DataIntegrationCredentialsResponseError`
56
+ * Added endpoint `PUT /data-integrations/{slug}/api-key`
57
+ * Added endpoint `POST /data-integrations/{slug}/credentials`
58
+ * **[sso](https://workos.com/docs/reference/sso)**:
59
+ * Added parameter `SSO.authorize.prompt`
60
+ * **[user_management](https://workos.com/docs/reference/authkit/user)**:
61
+ * Added `ssha256` to `CreateUserPasswordHashType`
62
+ * Added `ssha256` to `UpdateUserPasswordHashType`
63
+ * Added endpoint `GET /user_management/radar_challenges/{id}`
64
+ * **[webhooks](https://workos.com/docs/reference/webhooks)**:
65
+ * Added `agent.registration.revoked` to `CreateWebhookEndpointEvents`
66
+ * Added `agent.registration.revoked` to `UpdateWebhookEndpointEvents`
67
+ * Added `agent.registration.deleted` to `CreateWebhookEndpointEvents`
68
+ * Added `agent.registration.deleted` to `UpdateWebhookEndpointEvents`
69
+ * Added `radar.challenge_created` to `CreateWebhookEndpointEvents`
70
+ * Added `radar.challenge_created` to `UpdateWebhookEndpointEvents`
71
+ * Added `agent.registration.expired` to `CreateWebhookEndpointEvents`
72
+ * Added `agent.registration.expired` to `UpdateWebhookEndpointEvents`
73
+ * **[widgets](https://workos.com/docs/reference/widgets)**:
74
+ * Made `WidgetSessionToken.organization_id` optional
75
+
76
+ * [#527](https://github.com/workos/workos-ruby/pull/527) feat(generated)!: regenerate from spec (5 changes)
77
+
78
+ **⚠️ Breaking**
79
+ * **[admin_portal](https://workos.com/docs/reference/admin-portal)**:
80
+ * SDK surface change: Symbol "IntentOptions" was removed
81
+ * **[connect](https://workos.com/docs/reference/workos-connect/standalone)**:
82
+ * SDK surface change: Symbol "ConnectedAccountDto" was removed
83
+ * **[organization_domains](https://workos.com/docs/reference/domain-verification)**:
84
+ * SDK surface change: Symbol "DomainVerificationIntentOptions" was removed
85
+ * **[pipes](https://workos.com/docs/reference/pipes)**:
86
+ * SDK surface change: Symbol "DataIntegrationCredentialsDto" was removed
87
+ * **[sso](https://workos.com/docs/reference/sso)**:
88
+ * SDK surface change: Symbol "SSOIntentOptions" was removed
89
+
3
90
  ## [9.5.0](https://github.com/workos/workos-ruby/compare/v9.4.0...v9.5.0) (2026-07-06)
4
91
 
5
92
  * [#514](https://github.com/workos/workos-ruby/pull/514) fix(generated): regenerate from spec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (9.5.0)
4
+ workos (10.0.0)
5
5
  jwt (~> 3.1)
6
6
  logger (~> 1.7)
7
7
  zeitwerk (~> 2.6)
@@ -153,7 +153,7 @@ CHECKSUMS
153
153
  unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
154
154
  webmock (3.26.2) sha256=774556f2ea6371846cca68c01769b2eac0d134492d21f6d0ab5dd643965a4c90
155
155
  webrick (1.9.2) sha256=beb4a15fc474defed24a3bda4ffd88a490d517c9e4e6118c3edce59e45864131
156
- workos (9.5.0)
156
+ workos (10.0.0)
157
157
  yard (0.9.44) sha256=eb087e9b631ccd887b049f303d489963945452d5e2a7eb49a5a74a7cf6887f28
158
158
  yard-markdown (0.7.1) sha256=06c378632dfe7ba053be9ba469eb4701aa0470e36bcf7e5546f353eb90c1bfd1
159
159
  zeitwerk (2.7.5) sha256=d8da92128c09ea6ec62c949011b00ed4a20242b255293dd66bf41545398f73dd
data/README.md CHANGED
@@ -25,13 +25,7 @@ gem "workos"
25
25
 
26
26
  ## Configuration
27
27
 
28
- To use the library, provide your WorkOS API key as `WORKOS_API_KEY` and, for AuthKit and SSO flows, your client ID as `WORKOS_CLIENT_ID`:
29
-
30
- ```sh
31
- WORKOS_API_KEY=sk_test_123 WORKOS_CLIENT_ID=client_123 ruby app.rb
32
- ```
33
-
34
- Or configure the SDK in an initializer:
28
+ Store your WorkOS API key (and, for AuthKit and SSO flows, your client ID) in environment variables such as `WORKOS_API_KEY` and `WORKOS_CLIENT_ID`, then pass them to the SDK explicitly. The SDK does not read these environment variables automatically — configure it in an initializer:
35
29
 
36
30
  ```ruby
37
31
  # /config/initializers/workos.rb
@@ -77,6 +71,7 @@ tenant_b.organizations.list_organizations
77
71
  ```ruby
78
72
  public_client = WorkOS::PublicClient.create(client_id: "client_123")
79
73
  url, verifier, state = public_client.user_management.get_authorization_url_with_pkce(
74
+ provider: "authkit",
80
75
  redirect_uri: "https://example.com/callback"
81
76
  )
82
77
  ```
@@ -93,20 +88,22 @@ on_worker_boot { WorkOS.reset_client }
93
88
 
94
89
  ## Per-request options
95
90
 
96
- Every API call accepts `request_options:` for per-call overrides:
91
+ Every method that makes an HTTP request accepts `request_options:` for per-call overrides (local URL-building helpers such as `get_authorization_url` and `get_logout_url` do not):
97
92
 
98
93
  ```ruby
99
94
  organization = WorkOS.client.organizations.get_organization(
100
95
  id: "org_123",
101
96
  request_options: {
102
97
  timeout: 10,
103
- extra_headers: {"X-Request-Source" => "admin"},
104
- idempotency_key: "org-create-123"
98
+ extra_headers: {"X-Request-Source" => "admin"}
105
99
  }
106
100
  )
107
101
  ```
108
102
 
109
- `Idempotency-Key` is only sent when you provide `request_options[:idempotency_key]`, or when the SDK retries a mutating request after a transient failure.
103
+ `Idempotency-Key` is only sent on `POST`, `PUT`, and `PATCH` requests — either when you provide `request_options[:idempotency_key]`, or auto-generated when the SDK retries one of those requests after a transient failure. It is never attached to `GET` or `DELETE` requests.
104
+
105
+ > [!NOTE]
106
+ > The WorkOS API currently honors `Idempotency-Key` only on the [Create Audit Log Event](https://workos.com/docs/reference/audit-logs/event) endpoint (`audit_logs.create_event`). Other endpoints accept the header but do not deduplicate requests, so a retried mutation elsewhere can still create a duplicate.
110
107
 
111
108
  ## Usage Examples
112
109
 
@@ -155,8 +152,8 @@ ruby -rsecurerandom -e 'puts SecureRandom.base64(32)'
155
152
  ```
156
153
 
157
154
  Anything shorter than 32 bytes (including `nil` or `""`) raises
158
- `ArgumentError` at SDK init time sealing or unsealing will not silently
159
- proceed with a weakened key.
155
+ `ArgumentError` as soon as you load, seal, or unseal a session — sealing or
156
+ unsealing will not silently proceed with a weakened key.
160
157
 
161
158
  ### Verify a webhook
162
159
 
@@ -196,7 +193,9 @@ end
196
193
 
197
194
  ## Error Handling
198
195
 
199
- The SDK raises typed errors for API and transport failures.
196
+ The SDK raises typed errors for API failures (`WorkOS::APIError` and
197
+ subclasses) and transport failures (`WorkOS::APIConnectionError`). Both
198
+ inherit from `WorkOS::Error`.
200
199
 
201
200
  ```ruby
202
201
  begin
@@ -204,6 +203,8 @@ begin
204
203
  rescue WorkOS::APIError => e
205
204
  warn "#{e.class}: #{e.message}"
206
205
  warn "status=#{e.http_status} request_id=#{e.request_id} code=#{e.code}"
206
+ rescue WorkOS::APIConnectionError => e
207
+ warn "connection failure: #{e.message}"
207
208
  end
208
209
  ```
209
210
 
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentAdminLinkClaimAttemptToExternalUserRequest < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ type: :type,
9
+ claim_attempt_token: :claim_attempt_token,
10
+ user: :user,
11
+ organization_id: :organization_id
12
+ }.freeze
13
+
14
+ attr_accessor \
15
+ :type,
16
+ :claim_attempt_token,
17
+ :user,
18
+ :organization_id
19
+
20
+ def initialize(json)
21
+ hash = self.class.normalize(json)
22
+ @type = hash[:type]
23
+ @claim_attempt_token = hash[:claim_attempt_token]
24
+ @user = hash[:user] ? WorkOS::AgentAdminLinkClaimAttemptToExternalUserRequestUser.new(hash[:user]) : nil
25
+ @organization_id = hash[:organization_id]
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentAdminLinkClaimAttemptToExternalUserRequestUser < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ email: :email,
9
+ external_id: :external_id
10
+ }.freeze
11
+
12
+ attr_accessor \
13
+ :email,
14
+ :external_id
15
+
16
+ def initialize(json)
17
+ hash = self.class.normalize(json)
18
+ @email = hash[:email]
19
+ @external_id = hash[:external_id]
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentAdminValidateCredentialRequest < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ type: :type,
9
+ credential: :credential,
10
+ audience: :audience
11
+ }.freeze
12
+
13
+ attr_accessor \
14
+ :type,
15
+ :credential,
16
+ :audience
17
+
18
+ def initialize(json)
19
+ hash = self.class.normalize(json)
20
+ @type = hash[:type]
21
+ @credential = hash[:credential]
22
+ @audience = hash[:audience]
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentCredentialValidation < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ valid: :valid,
9
+ registration_id: :registration_id,
10
+ expires_at: :expires_at
11
+ }.freeze
12
+
13
+ attr_accessor \
14
+ :valid,
15
+ :registration_id,
16
+ :expires_at
17
+
18
+ def initialize(json)
19
+ hash = self.class.normalize(json)
20
+ @valid = hash[:valid]
21
+ @registration_id = hash[:registration_id]
22
+ @expires_at = hash[:expires_at]
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentRegistration < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ id: :id,
9
+ agent_identity: :agent_identity,
10
+ organization_id: :organization_id,
11
+ status: :status,
12
+ kind: :kind,
13
+ claim: :claim,
14
+ created_at: :created_at,
15
+ updated_at: :updated_at
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :id,
20
+ :agent_identity,
21
+ :organization_id,
22
+ :status,
23
+ :kind,
24
+ :claim,
25
+ :created_at,
26
+ :updated_at
27
+
28
+ def initialize(json)
29
+ hash = self.class.normalize(json)
30
+ @id = hash[:id]
31
+ @agent_identity = hash[:agent_identity] ? WorkOS::AgentRegistrationAgentIdentity.new(hash[:agent_identity]) : nil
32
+ @organization_id = hash[:organization_id]
33
+ @status = hash[:status]
34
+ @kind = hash[:kind]
35
+ @claim = hash[:claim] ? WorkOS::AgentRegistrationClaim.new(hash[:claim]) : nil
36
+ @created_at = hash[:created_at]
37
+ @updated_at = hash[:updated_at]
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentRegistrationAgentIdentity < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ id: :id,
9
+ userland_user_id: :userland_user_id,
10
+ created_at: :created_at,
11
+ updated_at: :updated_at
12
+ }.freeze
13
+
14
+ attr_accessor \
15
+ :id,
16
+ :userland_user_id,
17
+ :created_at,
18
+ :updated_at
19
+
20
+ def initialize(json)
21
+ hash = self.class.normalize(json)
22
+ @id = hash[:id]
23
+ @userland_user_id = hash[:userland_user_id]
24
+ @created_at = hash[:created_at]
25
+ @updated_at = hash[:updated_at]
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentRegistrationClaim < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ id: :id,
9
+ claim_completion: :claim_completion,
10
+ created_at: :created_at,
11
+ updated_at: :updated_at,
12
+ expires_at: :expires_at
13
+ }.freeze
14
+
15
+ attr_accessor \
16
+ :id,
17
+ :claim_completion,
18
+ :created_at,
19
+ :updated_at,
20
+ :expires_at
21
+
22
+ def initialize(json)
23
+ hash = self.class.normalize(json)
24
+ @id = hash[:id]
25
+ @claim_completion = hash[:claim_completion] ? WorkOS::AgentRegistrationClaimClaimCompletion.new(hash[:claim_completion]) : nil
26
+ @created_at = hash[:created_at]
27
+ @updated_at = hash[:updated_at]
28
+ @expires_at = hash[:expires_at]
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentRegistrationClaimClaimCompletion < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ id: :id,
9
+ created_at: :created_at,
10
+ updated_at: :updated_at,
11
+ expires_at: :expires_at,
12
+ claimed_at: :claimed_at
13
+ }.freeze
14
+
15
+ attr_accessor \
16
+ :id,
17
+ :created_at,
18
+ :updated_at,
19
+ :expires_at,
20
+ :claimed_at
21
+
22
+ def initialize(json)
23
+ hash = self.class.normalize(json)
24
+ @id = hash[:id]
25
+ @created_at = hash[:created_at]
26
+ @updated_at = hash[:updated_at]
27
+ @expires_at = hash[:expires_at]
28
+ @claimed_at = hash[:claimed_at]
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class ClaimViewResponse < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ id: :id,
9
+ status: :status,
10
+ user_code: :user_code,
11
+ organizations: :organizations
12
+ }.freeze
13
+
14
+ attr_accessor \
15
+ :id,
16
+ :status,
17
+ :user_code,
18
+ :organizations
19
+
20
+ def initialize(json)
21
+ hash = self.class.normalize(json)
22
+ @id = hash[:id]
23
+ @status = hash[:status]
24
+ @user_code = hash[:user_code]
25
+ @organizations = (hash[:organizations] || []).map { |item| item ? WorkOS::ClaimViewResponseOrganization.new(item) : nil }
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ ClaimViewResponseOrganization = Actor
7
+ end
@@ -0,0 +1,93 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ require "json"
6
+
7
+ module WorkOS
8
+ class Agents
9
+ def initialize(client)
10
+ @client = client
11
+ end
12
+
13
+ # Link a claim attempt to an external user
14
+ # @param type [String] The operation to perform on the claim attempt. Currently only `link_external_user` is supported.
15
+ # @param claim_attempt_token [String] The token identifying the claim attempt.
16
+ # @param user [WorkOS::AgentAdminLinkClaimAttemptToExternalUserRequestUser] The user to attach to the claim attempt, identified by email and external ID.
17
+ # @param organization_id [String, nil] The organization to place the agent in. Required when the user belongs to more than one organization.
18
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
19
+ # @return [WorkOS::ClaimViewResponse]
20
+ def update_attempts(
21
+ type:,
22
+ claim_attempt_token:,
23
+ user:,
24
+ organization_id: nil,
25
+ request_options: {}
26
+ )
27
+ body = {
28
+ "type" => type,
29
+ "claim_attempt_token" => claim_attempt_token,
30
+ "user" => user,
31
+ "organization_id" => organization_id
32
+ }.compact
33
+ response = @client.request(
34
+ method: :patch,
35
+ path: "/agents/claims/attempts",
36
+ auth: true,
37
+ body: body,
38
+ request_options: request_options
39
+ )
40
+ result = WorkOS::ClaimViewResponse.new(response.body)
41
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
42
+ result
43
+ end
44
+
45
+ # Validate an agent credential
46
+ # @param type [WorkOS::Types::AgentAdminValidateCredentialRequestType] The kind of credential being validated — an agent API key or an agent access token.
47
+ # @param credential [String] The credential value to validate: the API key value for `api_key`, or the access token (JWT) for `access_token`.
48
+ # @param audience [String, nil] When provided, the access token's `aud` claim is verified against this value. Tokens issued for a different resource are rejected.
49
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
50
+ # @return [WorkOS::AgentCredentialValidation]
51
+ def create_validate(
52
+ type:,
53
+ credential:,
54
+ audience: nil,
55
+ request_options: {}
56
+ )
57
+ body = {
58
+ "type" => type,
59
+ "credential" => credential,
60
+ "audience" => audience
61
+ }.compact
62
+ response = @client.request(
63
+ method: :post,
64
+ path: "/agents/credentials/validate",
65
+ auth: true,
66
+ body: body,
67
+ request_options: request_options
68
+ )
69
+ result = WorkOS::AgentCredentialValidation.new(response.body)
70
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
71
+ result
72
+ end
73
+
74
+ # Get an agent registration
75
+ # @param id [String] The unique ID of the agent registration.
76
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
77
+ # @return [WorkOS::AgentRegistration]
78
+ def get_registration(
79
+ id:,
80
+ request_options: {}
81
+ )
82
+ response = @client.request(
83
+ method: :get,
84
+ path: "/agents/registrations/#{WorkOS::Util.encode_path(id)}",
85
+ auth: true,
86
+ request_options: request_options
87
+ )
88
+ result = WorkOS::AgentRegistration.new(response.body)
89
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
90
+ result
91
+ end
92
+ end
93
+ end
@@ -5,14 +5,18 @@
5
5
  module WorkOS
6
6
  class ApiKeyValidationResponse < WorkOS::Types::BaseModel
7
7
  HASH_ATTRS = {
8
- api_key: :api_key
8
+ api_key: :api_key,
9
+ agent_registration_id: :agent_registration_id
9
10
  }.freeze
10
11
 
11
- attr_accessor :api_key
12
+ attr_accessor \
13
+ :api_key,
14
+ :agent_registration_id
12
15
 
13
16
  def initialize(json)
14
17
  hash = self.class.normalize(json)
15
18
  @api_key = hash[:api_key] ? WorkOS::ApiKey.new(hash[:api_key]) : nil
19
+ @agent_registration_id = hash[:agent_registration_id]
16
20
  end
17
21
  end
18
22
  end
@@ -135,12 +135,11 @@ module WorkOS
135
135
  # @return [WorkOS::ApiKey]
136
136
  def create_api_key_expire(
137
137
  id:,
138
- expires_at: nil,
138
+ expires_at: WorkOS::OMIT,
139
139
  request_options: {}
140
140
  )
141
- body = {
142
- "expires_at" => expires_at
143
- }.compact
141
+ body = {}
142
+ body["expires_at"] = expires_at unless expires_at.equal?(WorkOS::OMIT)
144
143
  response = @client.request(
145
144
  method: :post,
146
145
  path: "/api_keys/#{WorkOS::Util.encode_path(id)}/expire",
@@ -3,38 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module WorkOS
6
- class PermissionCreatedData < WorkOS::Types::BaseModel
7
- HASH_ATTRS = {
8
- object: :object,
9
- id: :id,
10
- slug: :slug,
11
- name: :name,
12
- description: :description,
13
- system: :system,
14
- created_at: :created_at,
15
- updated_at: :updated_at
16
- }.freeze
17
-
18
- attr_accessor \
19
- :object,
20
- :id,
21
- :slug,
22
- :name,
23
- :description,
24
- :system,
25
- :created_at,
26
- :updated_at
27
-
28
- def initialize(json)
29
- hash = self.class.normalize(json)
30
- @object = hash[:object]
31
- @id = hash[:id]
32
- @slug = hash[:slug]
33
- @name = hash[:name]
34
- @description = hash[:description]
35
- @system = hash[:system]
36
- @created_at = hash[:created_at]
37
- @updated_at = hash[:updated_at]
38
- end
39
- end
6
+ PermissionCreatedData = AuthorizationPermission
40
7
  end
@@ -3,5 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module WorkOS
6
- PermissionDeletedData = PermissionCreatedData
6
+ PermissionDeletedData = AuthorizationPermission
7
7
  end
@@ -3,5 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module WorkOS
6
- PermissionUpdatedData = PermissionCreatedData
6
+ PermissionUpdatedData = AuthorizationPermission
7
7
  end