Class: FusionAuth::FusionAuthClient

Inherits:
Object
  • Object
show all
Defined in:
lib/fusionauth/fusionauth_client.rb

Overview

This class is the the Ruby client library for the FusionAuth CIAM Platform https://fusionauth.io

Each method on this class calls one of the APIs for FusionAuth. In most cases, the methods will take either a Hash, an OpenStruct or any object that can be safely converted to JSON that conforms to the FusionAuth API interface. Likewise, most methods will return an OpenStruct that contains the response JSON from FusionAuth.

noinspection RubyInstanceMethodNamingConvention,RubyTooManyMethodsInspection,RubyParameterNamingConvention

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, base_url) ⇒ FusionAuthClient

Returns a new instance of FusionAuthClient.



32
33
34
35
36
37
38
# File 'lib/fusionauth/fusionauth_client.rb', line 32

def initialize(api_key, base_url)
  @api_key = api_key
  @base_url = base_url
  @connect_timeout = 1000
  @read_timeout = 2000
  @tenant_id = nil
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



30
31
32
# File 'lib/fusionauth/fusionauth_client.rb', line 30

def api_key
  @api_key
end

#base_urlObject

Returns the value of attribute base_url.



30
31
32
# File 'lib/fusionauth/fusionauth_client.rb', line 30

def base_url
  @base_url
end

#connect_timeoutObject

Returns the value of attribute connect_timeout.



30
31
32
# File 'lib/fusionauth/fusionauth_client.rb', line 30

def connect_timeout
  @connect_timeout
end

#read_timeoutObject

Returns the value of attribute read_timeout.



30
31
32
# File 'lib/fusionauth/fusionauth_client.rb', line 30

def read_timeout
  @read_timeout
end

#tenant_idObject

Returns the value of attribute tenant_id.



30
31
32
# File 'lib/fusionauth/fusionauth_client.rb', line 30

def tenant_id
  @tenant_id
end

Instance Method Details

#action_user(request) ⇒ FusionAuth::ClientResponse

Takes an action on a user. The user being actioned is called the “actionee” and the user taking the action is called the “actioner”. Both user ids are required in the request object.

Parameters:

  • request (OpenStruct, Hash)

    The action request that includes all the information about the action being taken including the Id of the action, any options and the duration (if applicable).

Returns:



51
52
53
54
55
56
# File 'lib/fusionauth/fusionauth_client.rb', line 51

def action_user(request)
  start.uri('/api/user/action')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#activate_reactor(request) ⇒ FusionAuth::ClientResponse

Activates the FusionAuth Reactor using a license Id and optionally a license text (for air-gapped deployments)

Parameters:

  • request (OpenStruct, Hash)

    An optional request that contains the license text to activate Reactor (useful for air-gap deployments of FusionAuth).

Returns:



63
64
65
66
67
68
# File 'lib/fusionauth/fusionauth_client.rb', line 63

def activate_reactor(request)
  start.uri('/api/reactor')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#add_user_to_family(family_id, request) ⇒ FusionAuth::ClientResponse

Adds a user to an existing family. The family Id must be specified.

Parameters:

  • family_id (string)

    The Id of the family.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to determine which user to add to the family.

Returns:



76
77
78
79
80
81
82
# File 'lib/fusionauth/fusionauth_client.rb', line 76

def add_user_to_family(family_id, request)
  start.uri('/api/user/family')
      .url_segment(family_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#approve_device(client_id, client_secret, token, user_code) ⇒ FusionAuth::ClientResponse

Approve a device grant.

Parameters:

  • client_id (string)

    (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate.

  • client_secret (string)

    (Optional) The client secret. This value will be required if client authentication is enabled.

  • token (string)

    The access token used to identify the user.

  • user_code (string)

    The end-user verification code.

Returns:



92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/fusionauth/fusionauth_client.rb', line 92

def approve_device(client_id, client_secret, token, user_code)
  body = {
    "client_id" => client_id,
    "client_secret" => client_secret,
    "token" => token,
    "user_code" => user_code
  }
  start.uri('/oauth2/device/approve')
      .body_handler(FusionAuth::FormDataBodyHandler.new(body))
      .post
      .go
end

#cancel_action(action_id, request) ⇒ FusionAuth::ClientResponse

Cancels the user action.

Parameters:

  • action_id (string)

    The action Id of the action to cancel.

  • request (OpenStruct, Hash)

    The action request that contains the information about the cancellation.

Returns:



111
112
113
114
115
116
117
# File 'lib/fusionauth/fusionauth_client.rb', line 111

def cancel_action(action_id, request)
  start.uri('/api/user/action')
      .url_segment(action_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .delete
      .go
end

#change_password(change_password_id, request) ⇒ FusionAuth::ClientResponse

Changes a user’s password using the change password Id. This usually occurs after an email has been sent to the user and they clicked on a link to reset their password.

As of version 1.32.2, prefer sending the changePasswordId in the request body. To do this, omit the first parameter, and set the value in the request body.

Parameters:

  • change_password_id (string)

    The change password Id used to find the user. This value is generated by FusionAuth once the change password workflow has been initiated.

  • request (OpenStruct, Hash)

    The change password request that contains all the information used to change the password.

Returns:



129
130
131
132
133
134
135
# File 'lib/fusionauth/fusionauth_client.rb', line 129

def change_password(change_password_id, request)
  startAnonymous.uri('/api/user/change-password')
      .url_segment(change_password_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#change_password_by_identity(request) ⇒ FusionAuth::ClientResponse

Changes a user’s password using their identity (loginId and password). Using a loginId instead of the changePasswordId bypasses the email verification and allows a password to be changed directly without first calling the #forgotPassword method.

Parameters:

  • request (OpenStruct, Hash)

    The change password request that contains all the information used to change the password.

Returns:



162
163
164
165
166
167
# File 'lib/fusionauth/fusionauth_client.rb', line 162

def change_password_by_identity(request)
  start.uri('/api/user/change-password')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#change_password_by_jwt(encoded_jwt, request) ⇒ FusionAuth::ClientResponse

Deprecated.

This method has been renamed to change_password_using_jwt, use that method instead.

Changes a user’s password using their access token (JWT) instead of the changePasswordId A common use case for this method will be if you want to allow the user to change their own password.

Remember to send refreshToken in the request body if you want to get a new refresh token when login using the returned oneTimePassword.

Parameters:

  • encoded_jwt (string)

    The encoded JWT (access token).

  • request (OpenStruct, Hash)

    The change password request that contains all the information used to change the password.

Returns:



147
148
149
150
151
152
153
# File 'lib/fusionauth/fusionauth_client.rb', line 147

def change_password_by_jwt(encoded_jwt, request)
  startAnonymous.uri('/api/user/change-password')
      .authorization('Bearer ' + encoded_jwt)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#change_password_using_jwt(encoded_jwt, request) ⇒ FusionAuth::ClientResponse

Changes a user’s password using their access token (JWT) instead of the changePasswordId A common use case for this method will be if you want to allow the user to change their own password.

Remember to send refreshToken in the request body if you want to get a new refresh token when login using the returned oneTimePassword.

Parameters:

  • encoded_jwt (string)

    The encoded JWT (access token).

  • request (OpenStruct, Hash)

    The change password request that contains all the information used to change the password.

Returns:



178
179
180
181
182
183
184
# File 'lib/fusionauth/fusionauth_client.rb', line 178

def change_password_using_jwt(encoded_jwt, request)
  startAnonymous.uri('/api/user/change-password')
      .authorization('Bearer ' + encoded_jwt)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#check_change_password_using_id(change_password_id) ⇒ FusionAuth::ClientResponse

Check to see if the user must obtain a Trust Token Id in order to complete a change password request. When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change your password, you must obtain a Trust Token by completing a Two-Factor Step-Up authentication.

An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.

Parameters:

  • change_password_id (string)

    The change password Id used to find the user. This value is generated by FusionAuth once the change password workflow has been initiated.

Returns:



195
196
197
198
199
200
# File 'lib/fusionauth/fusionauth_client.rb', line 195

def check_change_password_using_id(change_password_id)
  startAnonymous.uri('/api/user/change-password')
      .url_segment(change_password_id)
      .get
      .go
end

#check_change_password_using_jwt(encoded_jwt) ⇒ FusionAuth::ClientResponse

Check to see if the user must obtain a Trust Token Id in order to complete a change password request. When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change your password, you must obtain a Trust Token by completing a Two-Factor Step-Up authentication.

An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.

Parameters:

  • encoded_jwt (string)

    The encoded JWT (access token).

Returns:



211
212
213
214
215
216
# File 'lib/fusionauth/fusionauth_client.rb', line 211

def check_change_password_using_jwt(encoded_jwt)
  startAnonymous.uri('/api/user/change-password')
      .authorization('Bearer ' + encoded_jwt)
      .get
      .go
end

#check_change_password_using_login_id(login_id) ⇒ FusionAuth::ClientResponse

Check to see if the user must obtain a Trust Request Id in order to complete a change password request. When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication.

An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.

Parameters:

  • login_id (string)

    The loginId (email or username) of the User that you intend to change the password for.

Returns:



227
228
229
230
231
232
# File 'lib/fusionauth/fusionauth_client.rb', line 227

def ()
  start.uri('/api/user/change-password')
      .url_parameter('loginId', )
      .get
      .go
end

#check_change_password_using_login_id_and_login_id_types(login_id, login_id_types) ⇒ FusionAuth::ClientResponse

Check to see if the user must obtain a Trust Request Id in order to complete a change password request. When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication.

An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.

Parameters:

  • login_id (string)

    The loginId of the User that you intend to change the password for.

  • login_id_types (Array)

    The identity types that FusionAuth will compare the loginId to.

Returns:



244
245
246
247
248
249
250
# File 'lib/fusionauth/fusionauth_client.rb', line 244

def (, )
  start.uri('/api/user/change-password')
      .url_parameter('loginId', )
      .url_parameter('loginIdTypes', )
      .get
      .go
end

#client_credentials_grant(client_id, client_secret, scope) ⇒ FusionAuth::ClientResponse

Make a Client Credentials grant request to obtain an access token.

Parameters:

  • client_id (string)

    (Optional) The client identifier. The client Id is the Id of the FusionAuth Entity in which you are attempting to authenticate. This parameter is optional when Basic Authorization is used to authenticate this request.

  • client_secret (string)

    (Optional) The client secret used to authenticate this request. This parameter is optional when Basic Authorization is used to authenticate this request.

  • scope (string)

    (Optional) This parameter is used to indicate which target entity you are requesting access. To request access to an entity, use the format target-entity:<target-entity-id>:<roles>. Roles are an optional comma separated list.

Returns:



261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/fusionauth/fusionauth_client.rb', line 261

def client_credentials_grant(client_id, client_secret, scope)
  body = {
    "client_id" => client_id,
    "client_secret" => client_secret,
    "grant_type" => "client_credentials",
    "scope" => scope
  }
  startAnonymous.uri('/oauth2/token')
      .body_handler(FusionAuth::FormDataBodyHandler.new(body))
      .post
      .go
end

#comment_on_user(request) ⇒ FusionAuth::ClientResponse

Adds a comment to the user’s account.

Parameters:

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the user comment.

Returns:



279
280
281
282
283
284
# File 'lib/fusionauth/fusionauth_client.rb', line 279

def comment_on_user(request)
  start.uri('/api/user/comment')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#complete_verify_identity(request) ⇒ FusionAuth::ClientResponse

Completes verification of an identity using verification codes from the Verify Start API.

Parameters:

  • request (OpenStruct, Hash)

    The identity verify complete request that contains all the information used to verify the identity.

Returns:



291
292
293
294
295
296
# File 'lib/fusionauth/fusionauth_client.rb', line 291

def complete_verify_identity(request)
  start.uri('/api/identity/verify/complete')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#complete_web_authn_assertion(request) ⇒ FusionAuth::ClientResponse

Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge without logging the user in

Parameters:

  • request (OpenStruct, Hash)

    An object containing data necessary for completing the authentication ceremony

Returns:



303
304
305
306
307
308
# File 'lib/fusionauth/fusionauth_client.rb', line 303

def complete_web_authn_assertion(request)
  startAnonymous.uri('/api/webauthn/assert')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#complete_web_authn_login(request) ⇒ FusionAuth::ClientResponse

Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge and then login the user in

Parameters:

  • request (OpenStruct, Hash)

    An object containing data necessary for completing the authentication ceremony

Returns:



315
316
317
318
319
320
# File 'lib/fusionauth/fusionauth_client.rb', line 315

def (request)
  startAnonymous.uri('/api/webauthn/login')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#complete_web_authn_registration(request) ⇒ FusionAuth::ClientResponse

Complete a WebAuthn registration ceremony by validating the client request and saving the new credential

Parameters:

  • request (OpenStruct, Hash)

    An object containing data necessary for completing the registration ceremony

Returns:



327
328
329
330
331
332
# File 'lib/fusionauth/fusionauth_client.rb', line 327

def complete_web_authn_registration(request)
  start.uri('/api/webauthn/register/complete')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_api_key(key_id, request) ⇒ FusionAuth::ClientResponse

Creates an API key. You can optionally specify a unique Id for the key, if not provided one will be generated. an API key can only be created with equal or lesser authority. An API key cannot create another API key unless it is granted to that API key.

If an API key is locked to a tenant, it can only create API Keys for that same tenant.

Parameters:

  • key_id (string)

    (Optional) The unique Id of the API key. If not provided a secure random Id will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information needed to create the APIKey.

Returns:



344
345
346
347
348
349
350
# File 'lib/fusionauth/fusionauth_client.rb', line 344

def create_api_key(key_id, request)
  start.uri('/api/api-key')
      .url_segment(key_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_application(application_id, request) ⇒ FusionAuth::ClientResponse

Creates an application. You can optionally specify an Id for the application, if not provided one will be generated.

Parameters:

  • application_id (string)

    (Optional) The Id to use for the application. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the application.

Returns:



358
359
360
361
362
363
364
# File 'lib/fusionauth/fusionauth_client.rb', line 358

def create_application(application_id, request)
  start.uri('/api/application')
      .url_segment(application_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_application_role(application_id, role_id, request) ⇒ FusionAuth::ClientResponse

Creates a new role for an application. You must specify the Id of the application you are creating the role for. You can optionally specify an Id for the role inside the ApplicationRole object itself, if not provided one will be generated.

Parameters:

  • application_id (string)

    The Id of the application to create the role on.

  • role_id (string)

    (Optional) The Id of the role. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the application role.

Returns:



374
375
376
377
378
379
380
381
382
# File 'lib/fusionauth/fusionauth_client.rb', line 374

def create_application_role(application_id, role_id, request)
  start.uri('/api/application')
      .url_segment(application_id)
      .url_segment("role")
      .url_segment(role_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_audit_log(request) ⇒ FusionAuth::ClientResponse

Creates an audit log with the message and user name (usually an email). Audit logs should be written anytime you make changes to the FusionAuth database. When using the FusionAuth App web interface, any changes are automatically written to the audit log. However, if you are accessing the API, you must write the audit logs yourself.

Parameters:

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the audit log entry.

Returns:



391
392
393
394
395
396
# File 'lib/fusionauth/fusionauth_client.rb', line 391

def create_audit_log(request)
  start.uri('/api/system/audit-log')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_connector(connector_id, request) ⇒ FusionAuth::ClientResponse

Creates a connector. You can optionally specify an Id for the connector, if not provided one will be generated.

Parameters:

  • connector_id (string)

    (Optional) The Id for the connector. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the connector.

Returns:



404
405
406
407
408
409
410
# File 'lib/fusionauth/fusionauth_client.rb', line 404

def create_connector(connector_id, request)
  start.uri('/api/connector')
      .url_segment(connector_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.

Parameters:

  • consent_id (string)

    (Optional) The Id for the consent. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the consent.

Returns:



418
419
420
421
422
423
424
# File 'lib/fusionauth/fusionauth_client.rb', line 418

def create_consent(consent_id, request)
  start.uri('/api/consent')
      .url_segment(consent_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_email_template(email_template_id, request) ⇒ FusionAuth::ClientResponse

Creates an email template. You can optionally specify an Id for the template, if not provided one will be generated.

Parameters:

  • email_template_id (string)

    (Optional) The Id for the template. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the email template.

Returns:



432
433
434
435
436
437
438
# File 'lib/fusionauth/fusionauth_client.rb', line 432

def create_email_template(email_template_id, request)
  start.uri('/api/email/template')
      .url_segment(email_template_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_entity(entity_id, request) ⇒ FusionAuth::ClientResponse

Creates an Entity. You can optionally specify an Id for the Entity. If not provided one will be generated.

Parameters:

  • entity_id (string)

    (Optional) The Id for the Entity. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the Entity.

Returns:



446
447
448
449
450
451
452
# File 'lib/fusionauth/fusionauth_client.rb', line 446

def create_entity(entity_id, request)
  start.uri('/api/entity')
      .url_segment(entity_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_entity_type(entity_type_id, request) ⇒ FusionAuth::ClientResponse

Creates a Entity Type. You can optionally specify an Id for the Entity Type, if not provided one will be generated.

Parameters:

  • entity_type_id (string)

    (Optional) The Id for the Entity Type. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the Entity Type.

Returns:



460
461
462
463
464
465
466
# File 'lib/fusionauth/fusionauth_client.rb', line 460

def create_entity_type(entity_type_id, request)
  start.uri('/api/entity/type')
      .url_segment(entity_type_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_entity_type_permission(entity_type_id, permission_id, request) ⇒ FusionAuth::ClientResponse

Creates a new permission for an entity type. You must specify the Id of the entity type you are creating the permission for. You can optionally specify an Id for the permission inside the EntityTypePermission object itself, if not provided one will be generated.

Parameters:

  • entity_type_id (string)

    The Id of the entity type to create the permission on.

  • permission_id (string)

    (Optional) The Id of the permission. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the permission.

Returns:



476
477
478
479
480
481
482
483
484
# File 'lib/fusionauth/fusionauth_client.rb', line 476

def create_entity_type_permission(entity_type_id, permission_id, request)
  start.uri('/api/entity/type')
      .url_segment(entity_type_id)
      .url_segment("permission")
      .url_segment(permission_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_family(family_id, request) ⇒ FusionAuth::ClientResponse

Creates a family with the user Id in the request as the owner and sole member of the family. You can optionally specify an Id for the family, if not provided one will be generated.

Parameters:

  • family_id (string)

    (Optional) The Id for the family. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the family.

Returns:



493
494
495
496
497
498
499
# File 'lib/fusionauth/fusionauth_client.rb', line 493

def create_family(family_id, request)
  start.uri('/api/user/family')
      .url_segment(family_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_form(form_id, request) ⇒ FusionAuth::ClientResponse

Creates a form. You can optionally specify an Id for the form, if not provided one will be generated.

Parameters:

  • form_id (string)

    (Optional) The Id for the form. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the form.

Returns:



507
508
509
510
511
512
513
# File 'lib/fusionauth/fusionauth_client.rb', line 507

def create_form(form_id, request)
  start.uri('/api/form')
      .url_segment(form_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_form_field(field_id, request) ⇒ FusionAuth::ClientResponse

Creates a form field. You can optionally specify an Id for the form, if not provided one will be generated.

Parameters:

  • field_id (string)

    (Optional) The Id for the form field. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the form field.

Returns:



521
522
523
524
525
526
527
# File 'lib/fusionauth/fusionauth_client.rb', line 521

def create_form_field(field_id, request)
  start.uri('/api/form/field')
      .url_segment(field_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_group(group_id, request) ⇒ FusionAuth::ClientResponse

Creates a group. You can optionally specify an Id for the group, if not provided one will be generated.

Parameters:

  • group_id (string)

    (Optional) The Id for the group. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the group.

Returns:



535
536
537
538
539
540
541
# File 'lib/fusionauth/fusionauth_client.rb', line 535

def create_group(group_id, request)
  start.uri('/api/group')
      .url_segment(group_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_group_members(request) ⇒ FusionAuth::ClientResponse

Creates a member in a group.

Parameters:

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the group member(s).

Returns:



548
549
550
551
552
553
# File 'lib/fusionauth/fusionauth_client.rb', line 548

def create_group_members(request)
  start.uri('/api/group/member')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_identity_provider(identity_provider_id, request) ⇒ FusionAuth::ClientResponse

Creates an identity provider. You can optionally specify an Id for the identity provider, if not provided one will be generated.

Parameters:

  • identity_provider_id (string)

    (Optional) The Id of the identity provider. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the identity provider.

Returns:



575
576
577
578
579
580
581
# File 'lib/fusionauth/fusionauth_client.rb', line 575

def create_identity_provider(identity_provider_id, request)
  start.uri('/api/identity-provider')
      .url_segment(identity_provider_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_ip_access_control_list(access_control_list_id, request) ⇒ FusionAuth::ClientResponse

Creates an IP Access Control List. You can optionally specify an Id on this create request, if one is not provided one will be generated.

Parameters:

  • access_control_list_id (string)

    (Optional) The Id for the IP Access Control List. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the IP Access Control List.

Returns:



561
562
563
564
565
566
567
# File 'lib/fusionauth/fusionauth_client.rb', line 561

def create_ip_access_control_list(access_control_list_id, request)
  start.uri('/api/ip-acl')
      .url_segment(access_control_list_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_lambda(lambda_id, request) ⇒ FusionAuth::ClientResponse

Creates a Lambda. You can optionally specify an Id for the lambda, if not provided one will be generated.

Parameters:

  • lambda_id (string)

    (Optional) The Id for the lambda. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the lambda.

Returns:



589
590
591
592
593
594
595
# File 'lib/fusionauth/fusionauth_client.rb', line 589

def create_lambda(lambda_id, request)
  start.uri('/api/lambda')
      .url_segment(lambda_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_message_template(message_template_id, request) ⇒ FusionAuth::ClientResponse

Creates an message template. You can optionally specify an Id for the template, if not provided one will be generated.

Parameters:

  • message_template_id (string)

    (Optional) The Id for the template. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the message template.

Returns:



603
604
605
606
607
608
609
# File 'lib/fusionauth/fusionauth_client.rb', line 603

def create_message_template(message_template_id, request)
  start.uri('/api/message/template')
      .url_segment(message_template_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_messenger(messenger_id, request) ⇒ FusionAuth::ClientResponse

Creates a messenger. You can optionally specify an Id for the messenger, if not provided one will be generated.

Parameters:

  • messenger_id (string)

    (Optional) The Id for the messenger. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the messenger.

Returns:



617
618
619
620
621
622
623
# File 'lib/fusionauth/fusionauth_client.rb', line 617

def create_messenger(messenger_id, request)
  start.uri('/api/messenger')
      .url_segment(messenger_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_o_auth_scope(application_id, scope_id, request) ⇒ FusionAuth::ClientResponse

Creates a new custom OAuth scope for an application. You must specify the Id of the application you are creating the scope for. You can optionally specify an Id for the OAuth scope on the URL, if not provided one will be generated.

Parameters:

  • application_id (string)

    The Id of the application to create the OAuth scope on.

  • scope_id (string)

    (Optional) The Id of the OAuth scope. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the OAuth OAuth scope.

Returns:



633
634
635
636
637
638
639
640
641
# File 'lib/fusionauth/fusionauth_client.rb', line 633

def create_o_auth_scope(application_id, scope_id, request)
  start.uri('/api/application')
      .url_segment(application_id)
      .url_segment("scope")
      .url_segment(scope_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_tenant(tenant_id, request) ⇒ FusionAuth::ClientResponse

Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.

Parameters:

  • tenant_id (string)

    (Optional) The Id for the tenant. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the tenant.

Returns:



649
650
651
652
653
654
655
# File 'lib/fusionauth/fusionauth_client.rb', line 649

def create_tenant(tenant_id, request)
  start.uri('/api/tenant')
      .url_segment(tenant_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_theme(theme_id, request) ⇒ FusionAuth::ClientResponse

Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.

Parameters:

  • theme_id (string)

    (Optional) The Id for the theme. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the theme.

Returns:



663
664
665
666
667
668
669
# File 'lib/fusionauth/fusionauth_client.rb', line 663

def create_theme(theme_id, request)
  start.uri('/api/theme')
      .url_segment(theme_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_user(user_id, request) ⇒ FusionAuth::ClientResponse

Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.

Parameters:

  • user_id (string)

    (Optional) The Id for the user. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the user.

Returns:



677
678
679
680
681
682
683
# File 'lib/fusionauth/fusionauth_client.rb', line 677

def create_user(user_id, request)
  start.uri('/api/user')
      .url_segment(user_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_user_action(user_action_id, request) ⇒ FusionAuth::ClientResponse

Creates a user action. This action cannot be taken on a user until this call successfully returns. Anytime after that the user action can be applied to any user.

Parameters:

  • user_action_id (string)

    (Optional) The Id for the user action. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the user action.

Returns:



692
693
694
695
696
697
698
# File 'lib/fusionauth/fusionauth_client.rb', line 692

def create_user_action(user_action_id, request)
  start.uri('/api/user-action')
      .url_segment(user_action_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_user_action_reason(user_action_reason_id, request) ⇒ FusionAuth::ClientResponse

Creates a user reason. This user action reason cannot be used when actioning a user until this call completes successfully. Anytime after that the user action reason can be used.

Parameters:

  • user_action_reason_id (string)

    (Optional) The Id for the user action reason. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the user action reason.

Returns:



707
708
709
710
711
712
713
# File 'lib/fusionauth/fusionauth_client.rb', line 707

def create_user_action_reason(user_action_reason_id, request)
  start.uri('/api/user-action-reason')
      .url_segment(user_action_reason_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

Creates a single User consent.

Parameters:

  • user_consent_id (string)

    (Optional) The Id for the User consent. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request that contains the user consent information.

Returns:



721
722
723
724
725
726
727
# File 'lib/fusionauth/fusionauth_client.rb', line 721

def create_user_consent(user_consent_id, request)
  start.uri('/api/user/consent')
      .url_segment(user_consent_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

Link an external user from a 3rd party identity provider to a FusionAuth user.

Parameters:

  • request (OpenStruct, Hash)

    The request object that contains all the information used to link the FusionAuth user.

Returns:



734
735
736
737
738
739
# File 'lib/fusionauth/fusionauth_client.rb', line 734

def create_user_link(request)
  start.uri('/api/identity-provider/link')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#create_webhook(webhook_id, request) ⇒ FusionAuth::ClientResponse

Creates a webhook. You can optionally specify an Id for the webhook, if not provided one will be generated.

Parameters:

  • webhook_id (string)

    (Optional) The Id for the webhook. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the webhook.

Returns:



747
748
749
750
751
752
753
# File 'lib/fusionauth/fusionauth_client.rb', line 747

def create_webhook(webhook_id, request)
  start.uri('/api/webhook')
      .url_segment(webhook_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#deactivate_application(application_id) ⇒ FusionAuth::ClientResponse

Deactivates the application with the given Id.

Parameters:

  • application_id (string)

    The Id of the application to deactivate.

Returns:



760
761
762
763
764
765
# File 'lib/fusionauth/fusionauth_client.rb', line 760

def deactivate_application(application_id)
  start.uri('/api/application')
      .url_segment(application_id)
      .delete
      .go
end

#deactivate_reactorFusionAuth::ClientResponse

Deactivates the FusionAuth Reactor.

Returns:



771
772
773
774
775
# File 'lib/fusionauth/fusionauth_client.rb', line 771

def deactivate_reactor
  start.uri('/api/reactor')
      .delete
      .go
end

#deactivate_user(user_id) ⇒ FusionAuth::ClientResponse

Deactivates the user with the given Id.

Parameters:

  • user_id (string)

    The Id of the user to deactivate.

Returns:



782
783
784
785
786
787
# File 'lib/fusionauth/fusionauth_client.rb', line 782

def deactivate_user(user_id)
  start.uri('/api/user')
      .url_segment(user_id)
      .delete
      .go
end

#deactivate_user_action(user_action_id) ⇒ FusionAuth::ClientResponse

Deactivates the user action with the given Id.

Parameters:

  • user_action_id (string)

    The Id of the user action to deactivate.

Returns:



794
795
796
797
798
799
# File 'lib/fusionauth/fusionauth_client.rb', line 794

def deactivate_user_action(user_action_id)
  start.uri('/api/user-action')
      .url_segment(user_action_id)
      .delete
      .go
end

#deactivate_users(user_ids) ⇒ FusionAuth::ClientResponse

Deprecated.

This method has been renamed to deactivate_users_by_ids, use that method instead.

Deactivates the users with the given Ids.

Parameters:

  • user_ids (Array)

    The ids of the users to deactivate.

Returns:



807
808
809
810
811
812
813
814
# File 'lib/fusionauth/fusionauth_client.rb', line 807

def deactivate_users(user_ids)
  start.uri('/api/user/bulk')
      .url_parameter('userId', user_ids)
      .url_parameter('dryRun', false)
      .url_parameter('hardDelete', false)
      .delete
      .go
end

#deactivate_users_by_ids(user_ids) ⇒ FusionAuth::ClientResponse

Deactivates the users with the given Ids.

Parameters:

  • user_ids (Array)

    The ids of the users to deactivate.

Returns:



821
822
823
824
825
826
827
828
# File 'lib/fusionauth/fusionauth_client.rb', line 821

def deactivate_users_by_ids(user_ids)
  start.uri('/api/user/bulk')
      .url_parameter('userId', user_ids)
      .url_parameter('dryRun', false)
      .url_parameter('hardDelete', false)
      .delete
      .go
end

#delete_api_key(key_id) ⇒ FusionAuth::ClientResponse

Deletes the API key for the given Id.

Parameters:

  • key_id (string)

    The Id of the authentication API key to delete.

Returns:



835
836
837
838
839
840
# File 'lib/fusionauth/fusionauth_client.rb', line 835

def delete_api_key(key_id)
  start.uri('/api/api-key')
      .url_segment(key_id)
      .delete
      .go
end

#delete_application(application_id) ⇒ FusionAuth::ClientResponse

Hard deletes an application. This is a dangerous operation and should not be used in most circumstances. This will delete the application, any registrations for that application, metrics and reports for the application, all the roles for the application, and any other data associated with the application. This operation could take a very long time, depending on the amount of data in your database.

Parameters:

  • application_id (string)

    The Id of the application to delete.

Returns:



850
851
852
853
854
855
856
# File 'lib/fusionauth/fusionauth_client.rb', line 850

def delete_application(application_id)
  start.uri('/api/application')
      .url_segment(application_id)
      .url_parameter('hardDelete', true)
      .delete
      .go
end

#delete_application_role(application_id, role_id) ⇒ FusionAuth::ClientResponse

Hard deletes an application role. This is a dangerous operation and should not be used in most circumstances. This permanently removes the given role from all users that had it.

Parameters:

  • application_id (string)

    The Id of the application that the role belongs to.

  • role_id (string)

    The Id of the role to delete.

Returns:



865
866
867
868
869
870
871
872
# File 'lib/fusionauth/fusionauth_client.rb', line 865

def delete_application_role(application_id, role_id)
  start.uri('/api/application')
      .url_segment(application_id)
      .url_segment("role")
      .url_segment(role_id)
      .delete
      .go
end

#delete_connector(connector_id) ⇒ FusionAuth::ClientResponse

Deletes the connector for the given Id.

Parameters:

  • connector_id (string)

    The Id of the connector to delete.

Returns:



879
880
881
882
883
884
# File 'lib/fusionauth/fusionauth_client.rb', line 879

def delete_connector(connector_id)
  start.uri('/api/connector')
      .url_segment(connector_id)
      .delete
      .go
end

Deletes the consent for the given Id.

Parameters:

  • consent_id (string)

    The Id of the consent to delete.

Returns:



891
892
893
894
895
896
# File 'lib/fusionauth/fusionauth_client.rb', line 891

def delete_consent(consent_id)
  start.uri('/api/consent')
      .url_segment(consent_id)
      .delete
      .go
end

#delete_email_template(email_template_id) ⇒ FusionAuth::ClientResponse

Deletes the email template for the given Id.

Parameters:

  • email_template_id (string)

    The Id of the email template to delete.

Returns:



903
904
905
906
907
908
# File 'lib/fusionauth/fusionauth_client.rb', line 903

def delete_email_template(email_template_id)
  start.uri('/api/email/template')
      .url_segment(email_template_id)
      .delete
      .go
end

#delete_entity(entity_id) ⇒ FusionAuth::ClientResponse

Deletes the Entity for the given Id.

Parameters:

  • entity_id (string)

    The Id of the Entity to delete.

Returns:



915
916
917
918
919
920
# File 'lib/fusionauth/fusionauth_client.rb', line 915

def delete_entity(entity_id)
  start.uri('/api/entity')
      .url_segment(entity_id)
      .delete
      .go
end

#delete_entity_grant(entity_id, recipient_entity_id, user_id) ⇒ FusionAuth::ClientResponse

Deletes an Entity Grant for the given User or Entity.

Parameters:

  • entity_id (string)

    The Id of the Entity that the Entity Grant is being deleted for.

  • recipient_entity_id (string)

    (Optional) The Id of the Entity that the Entity Grant is for.

  • user_id (string)

    (Optional) The Id of the User that the Entity Grant is for.

Returns:



929
930
931
932
933
934
935
936
937
# File 'lib/fusionauth/fusionauth_client.rb', line 929

def delete_entity_grant(entity_id, recipient_entity_id, user_id)
  start.uri('/api/entity')
      .url_segment(entity_id)
      .url_segment("grant")
      .url_parameter('recipientEntityId', recipient_entity_id)
      .url_parameter('userId', user_id)
      .delete
      .go
end

#delete_entity_type(entity_type_id) ⇒ FusionAuth::ClientResponse

Deletes the Entity Type for the given Id.

Parameters:

  • entity_type_id (string)

    The Id of the Entity Type to delete.

Returns:



944
945
946
947
948
949
# File 'lib/fusionauth/fusionauth_client.rb', line 944

def delete_entity_type(entity_type_id)
  start.uri('/api/entity/type')
      .url_segment(entity_type_id)
      .delete
      .go
end

#delete_entity_type_permission(entity_type_id, permission_id) ⇒ FusionAuth::ClientResponse

Hard deletes a permission. This is a dangerous operation and should not be used in most circumstances. This permanently removes the given permission from all grants that had it.

Parameters:

  • entity_type_id (string)

    The Id of the entityType the the permission belongs to.

  • permission_id (string)

    The Id of the permission to delete.

Returns:



958
959
960
961
962
963
964
965
# File 'lib/fusionauth/fusionauth_client.rb', line 958

def delete_entity_type_permission(entity_type_id, permission_id)
  start.uri('/api/entity/type')
      .url_segment(entity_type_id)
      .url_segment("permission")
      .url_segment(permission_id)
      .delete
      .go
end

#delete_form(form_id) ⇒ FusionAuth::ClientResponse

Deletes the form for the given Id.

Parameters:

  • form_id (string)

    The Id of the form to delete.

Returns:



972
973
974
975
976
977
# File 'lib/fusionauth/fusionauth_client.rb', line 972

def delete_form(form_id)
  start.uri('/api/form')
      .url_segment(form_id)
      .delete
      .go
end

#delete_form_field(field_id) ⇒ FusionAuth::ClientResponse

Deletes the form field for the given Id.

Parameters:

  • field_id (string)

    The Id of the form field to delete.

Returns:



984
985
986
987
988
989
# File 'lib/fusionauth/fusionauth_client.rb', line 984

def delete_form_field(field_id)
  start.uri('/api/form/field')
      .url_segment(field_id)
      .delete
      .go
end

#delete_group(group_id) ⇒ FusionAuth::ClientResponse

Deletes the group for the given Id.

Parameters:

  • group_id (string)

    The Id of the group to delete.

Returns:



996
997
998
999
1000
1001
# File 'lib/fusionauth/fusionauth_client.rb', line 996

def delete_group(group_id)
  start.uri('/api/group')
      .url_segment(group_id)
      .delete
      .go
end

#delete_group_members(request) ⇒ FusionAuth::ClientResponse

Removes users as members of a group.

Parameters:

  • request (OpenStruct, Hash)

    The member request that contains all the information used to remove members to the group.

Returns:



1008
1009
1010
1011
1012
1013
# File 'lib/fusionauth/fusionauth_client.rb', line 1008

def delete_group_members(request)
  start.uri('/api/group/member')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .delete
      .go
end

#delete_identity_provider(identity_provider_id) ⇒ FusionAuth::ClientResponse

Deletes the identity provider for the given Id.

Parameters:

  • identity_provider_id (string)

    The Id of the identity provider to delete.

Returns:



1032
1033
1034
1035
1036
1037
# File 'lib/fusionauth/fusionauth_client.rb', line 1032

def delete_identity_provider(identity_provider_id)
  start.uri('/api/identity-provider')
      .url_segment(identity_provider_id)
      .delete
      .go
end

#delete_ip_access_control_list(ip_access_control_list_id) ⇒ FusionAuth::ClientResponse

Deletes the IP Access Control List for the given Id.

Parameters:

  • ip_access_control_list_id (string)

    The Id of the IP Access Control List to delete.

Returns:



1020
1021
1022
1023
1024
1025
# File 'lib/fusionauth/fusionauth_client.rb', line 1020

def delete_ip_access_control_list(ip_access_control_list_id)
  start.uri('/api/ip-acl')
      .url_segment(ip_access_control_list_id)
      .delete
      .go
end

#delete_key(key_id) ⇒ FusionAuth::ClientResponse

Deletes the key for the given Id.

Parameters:

  • key_id (string)

    The Id of the key to delete.

Returns:



1044
1045
1046
1047
1048
1049
# File 'lib/fusionauth/fusionauth_client.rb', line 1044

def delete_key(key_id)
  start.uri('/api/key')
      .url_segment(key_id)
      .delete
      .go
end

#delete_lambda(lambda_id) ⇒ FusionAuth::ClientResponse

Deletes the lambda for the given Id.

Parameters:

  • lambda_id (string)

    The Id of the lambda to delete.

Returns:



1056
1057
1058
1059
1060
1061
# File 'lib/fusionauth/fusionauth_client.rb', line 1056

def delete_lambda(lambda_id)
  start.uri('/api/lambda')
      .url_segment(lambda_id)
      .delete
      .go
end

#delete_message_template(message_template_id) ⇒ FusionAuth::ClientResponse

Deletes the message template for the given Id.

Parameters:

  • message_template_id (string)

    The Id of the message template to delete.

Returns:



1068
1069
1070
1071
1072
1073
# File 'lib/fusionauth/fusionauth_client.rb', line 1068

def delete_message_template(message_template_id)
  start.uri('/api/message/template')
      .url_segment(message_template_id)
      .delete
      .go
end

#delete_messenger(messenger_id) ⇒ FusionAuth::ClientResponse

Deletes the messenger for the given Id.

Parameters:

  • messenger_id (string)

    The Id of the messenger to delete.

Returns:



1080
1081
1082
1083
1084
1085
# File 'lib/fusionauth/fusionauth_client.rb', line 1080

def delete_messenger(messenger_id)
  start.uri('/api/messenger')
      .url_segment(messenger_id)
      .delete
      .go
end

#delete_o_auth_scope(application_id, scope_id) ⇒ FusionAuth::ClientResponse

Hard deletes a custom OAuth scope. OAuth workflows that are still requesting the deleted OAuth scope may fail depending on the application’s unknown scope policy.

Parameters:

  • application_id (string)

    The Id of the application that the OAuth scope belongs to.

  • scope_id (string)

    The Id of the OAuth scope to delete.

Returns:



1094
1095
1096
1097
1098
1099
1100
1101
# File 'lib/fusionauth/fusionauth_client.rb', line 1094

def delete_o_auth_scope(application_id, scope_id)
  start.uri('/api/application')
      .url_segment(application_id)
      .url_segment("scope")
      .url_segment(scope_id)
      .delete
      .go
end

#delete_registration(user_id, application_id) ⇒ FusionAuth::ClientResponse

Deletes the user registration for the given user and application.

Parameters:

  • user_id (string)

    The Id of the user whose registration is being deleted.

  • application_id (string)

    The Id of the application to remove the registration for.

Returns:



1109
1110
1111
1112
1113
1114
1115
# File 'lib/fusionauth/fusionauth_client.rb', line 1109

def delete_registration(user_id, application_id)
  start.uri('/api/user/registration')
      .url_segment(user_id)
      .url_segment(application_id)
      .delete
      .go
end

#delete_registration_with_request(user_id, application_id, request) ⇒ FusionAuth::ClientResponse

Deletes the user registration for the given user and application along with the given JSON body that contains the event information.

Parameters:

  • user_id (string)

    The Id of the user whose registration is being deleted.

  • application_id (string)

    The Id of the application to remove the registration for.

  • request (OpenStruct, Hash)

    The request body that contains the event information.

Returns:



1124
1125
1126
1127
1128
1129
1130
1131
# File 'lib/fusionauth/fusionauth_client.rb', line 1124

def delete_registration_with_request(user_id, application_id, request)
  start.uri('/api/user/registration')
      .url_segment(user_id)
      .url_segment(application_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .delete
      .go
end

#delete_tenant(tenant_id) ⇒ FusionAuth::ClientResponse

Deletes the tenant based on the given Id on the URL. This permanently deletes all information, metrics, reports and data associated with the tenant and everything under the tenant (applications, users, etc).

Parameters:

  • tenant_id (string)

    The Id of the tenant to delete.

Returns:



1139
1140
1141
1142
1143
1144
# File 'lib/fusionauth/fusionauth_client.rb', line 1139

def delete_tenant(tenant_id)
  start.uri('/api/tenant')
      .url_segment(tenant_id)
      .delete
      .go
end

#delete_tenant_async(tenant_id) ⇒ FusionAuth::ClientResponse

Deletes the tenant for the given Id asynchronously. This method is helpful if you do not want to wait for the delete operation to complete.

Parameters:

  • tenant_id (string)

    The Id of the tenant to delete.

Returns:



1152
1153
1154
1155
1156
1157
1158
# File 'lib/fusionauth/fusionauth_client.rb', line 1152

def delete_tenant_async(tenant_id)
  start.uri('/api/tenant')
      .url_segment(tenant_id)
      .url_parameter('async', true)
      .delete
      .go
end

#delete_tenant_with_request(tenant_id, request) ⇒ FusionAuth::ClientResponse

Deletes the tenant based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated with the tenant and everything under the tenant (applications, users, etc).

Parameters:

  • tenant_id (string)

    The Id of the tenant to delete.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to delete the user.

Returns:



1167
1168
1169
1170
1171
1172
1173
# File 'lib/fusionauth/fusionauth_client.rb', line 1167

def delete_tenant_with_request(tenant_id, request)
  start.uri('/api/tenant')
      .url_segment(tenant_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .delete
      .go
end

#delete_theme(theme_id) ⇒ FusionAuth::ClientResponse

Deletes the theme for the given Id.

Parameters:

  • theme_id (string)

    The Id of the theme to delete.

Returns:



1180
1181
1182
1183
1184
1185
# File 'lib/fusionauth/fusionauth_client.rb', line 1180

def delete_theme(theme_id)
  start.uri('/api/theme')
      .url_segment(theme_id)
      .delete
      .go
end

#delete_user(user_id) ⇒ FusionAuth::ClientResponse

Deletes the user for the given Id. This permanently deletes all information, metrics, reports and data associated with the user.

Parameters:

  • user_id (string)

    The Id of the user to delete.

Returns:



1193
1194
1195
1196
1197
1198
1199
# File 'lib/fusionauth/fusionauth_client.rb', line 1193

def delete_user(user_id)
  start.uri('/api/user')
      .url_segment(user_id)
      .url_parameter('hardDelete', true)
      .delete
      .go
end

#delete_user_action(user_action_id) ⇒ FusionAuth::ClientResponse

Deletes the user action for the given Id. This permanently deletes the user action and also any history and logs of the action being applied to any users.

Parameters:

  • user_action_id (string)

    The Id of the user action to delete.

Returns:



1207
1208
1209
1210
1211
1212
1213
# File 'lib/fusionauth/fusionauth_client.rb', line 1207

def delete_user_action(user_action_id)
  start.uri('/api/user-action')
      .url_segment(user_action_id)
      .url_parameter('hardDelete', true)
      .delete
      .go
end

#delete_user_action_reason(user_action_reason_id) ⇒ FusionAuth::ClientResponse

Deletes the user action reason for the given Id.

Parameters:

  • user_action_reason_id (string)

    The Id of the user action reason to delete.

Returns:



1220
1221
1222
1223
1224
1225
# File 'lib/fusionauth/fusionauth_client.rb', line 1220

def delete_user_action_reason(user_action_reason_id)
  start.uri('/api/user-action-reason')
      .url_segment(user_action_reason_id)
      .delete
      .go
end

Remove an existing link that has been made from a 3rd party identity provider to a FusionAuth user.

Parameters:

  • identity_provider_id (string)

    The unique Id of the identity provider.

  • identity_provider_user_id (string)

    The unique Id of the user in the 3rd party identity provider to unlink.

  • user_id (string)

    The unique Id of the FusionAuth user to unlink.

Returns:



1234
1235
1236
1237
1238
1239
1240
1241
# File 'lib/fusionauth/fusionauth_client.rb', line 1234

def delete_user_link(identity_provider_id, identity_provider_user_id, user_id)
  start.uri('/api/identity-provider/link')
      .url_parameter('identityProviderId', identity_provider_id)
      .url_parameter('identityProviderUserId', identity_provider_user_id)
      .url_parameter('userId', user_id)
      .delete
      .go
end

#delete_user_with_request(user_id, request) ⇒ FusionAuth::ClientResponse

Deletes the user based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated with the user.

Parameters:

  • user_id (string)

    The Id of the user to delete (required).

  • request (OpenStruct, Hash)

    The request object that contains all the information used to delete the user.

Returns:



1250
1251
1252
1253
1254
1255
1256
# File 'lib/fusionauth/fusionauth_client.rb', line 1250

def delete_user_with_request(user_id, request)
  start.uri('/api/user')
      .url_segment(user_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .delete
      .go
end

#delete_users(request) ⇒ FusionAuth::ClientResponse

Deprecated.

This method has been renamed to delete_users_by_query, use that method instead.

Deletes the users with the given Ids, or users matching the provided JSON query or queryString. The order of preference is Ids, query and then queryString, it is recommended to only provide one of the three for the request.

This method can be used to deactivate or permanently delete (hard-delete) users based upon the hardDelete boolean in the request body. Using the dryRun parameter you may also request the result of the action without actually deleting or deactivating any users.

Parameters:

  • request (OpenStruct, Hash)

    The UserDeleteRequest.

Returns:



1268
1269
1270
1271
1272
1273
# File 'lib/fusionauth/fusionauth_client.rb', line 1268

def delete_users(request)
  start.uri('/api/user/bulk')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .delete
      .go
end

#delete_users_by_query(request) ⇒ FusionAuth::ClientResponse

Deletes the users with the given Ids, or users matching the provided JSON query or queryString. The order of preference is Ids, query and then queryString, it is recommended to only provide one of the three for the request.

This method can be used to deactivate or permanently delete (hard-delete) users based upon the hardDelete boolean in the request body. Using the dryRun parameter you may also request the result of the action without actually deleting or deactivating any users.

Parameters:

  • request (OpenStruct, Hash)

    The UserDeleteRequest.

Returns:



1284
1285
1286
1287
1288
1289
# File 'lib/fusionauth/fusionauth_client.rb', line 1284

def delete_users_by_query(request)
  start.uri('/api/user/bulk')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .delete
      .go
end

#delete_web_authn_credential(id) ⇒ FusionAuth::ClientResponse

Deletes the WebAuthn credential for the given Id.

Parameters:

  • id (string)

    The Id of the WebAuthn credential to delete.

Returns:



1296
1297
1298
1299
1300
1301
# File 'lib/fusionauth/fusionauth_client.rb', line 1296

def delete_web_authn_credential(id)
  start.uri('/api/webauthn')
      .url_segment(id)
      .delete
      .go
end

#delete_webhook(webhook_id) ⇒ FusionAuth::ClientResponse

Deletes the webhook for the given Id.

Parameters:

  • webhook_id (string)

    The Id of the webhook to delete.

Returns:



1308
1309
1310
1311
1312
1313
# File 'lib/fusionauth/fusionauth_client.rb', line 1308

def delete_webhook(webhook_id)
  start.uri('/api/webhook')
      .url_segment(webhook_id)
      .delete
      .go
end

#disable_two_factor(user_id, method_id, code) ⇒ FusionAuth::ClientResponse

Disable two-factor authentication for a user.

Parameters:

  • user_id (string)

    The Id of the User for which you’re disabling two-factor authentication.

  • method_id (string)

    The two-factor method identifier you wish to disable

  • code (string)

    The two-factor code used verify the the caller knows the two-factor secret.

Returns:



1322
1323
1324
1325
1326
1327
1328
1329
# File 'lib/fusionauth/fusionauth_client.rb', line 1322

def disable_two_factor(user_id, method_id, code)
  start.uri('/api/user/two-factor')
      .url_segment(user_id)
      .url_parameter('methodId', method_id)
      .url_parameter('code', code)
      .delete
      .go
end

#disable_two_factor_with_request(user_id, request) ⇒ FusionAuth::ClientResponse

Disable two-factor authentication for a user using a JSON body rather than URL parameters.

Parameters:

  • user_id (string)

    The Id of the User for which you’re disabling two-factor authentication.

  • request (OpenStruct, Hash)

    The request information that contains the code and methodId along with any event information.

Returns:



1337
1338
1339
1340
1341
1342
1343
# File 'lib/fusionauth/fusionauth_client.rb', line 1337

def disable_two_factor_with_request(user_id, request)
  start.uri('/api/user/two-factor')
      .url_segment(user_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .delete
      .go
end

#enable_two_factor(user_id, request) ⇒ FusionAuth::ClientResponse

Enable two-factor authentication for a user.

Parameters:

  • user_id (string)

    The Id of the user to enable two-factor authentication.

  • request (OpenStruct, Hash)

    The two-factor enable request information.

Returns:



1351
1352
1353
1354
1355
1356
1357
# File 'lib/fusionauth/fusionauth_client.rb', line 1351

def enable_two_factor(user_id, request)
  start.uri('/api/user/two-factor')
      .url_segment(user_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#exchange_o_auth_code_for_access_token(code, client_id, client_secret, redirect_uri) ⇒ FusionAuth::ClientResponse

Exchanges an OAuth authorization code for an access token. Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint for an access token.

Parameters:

  • code (string)

    The authorization code returned on the /oauth2/authorize response.

  • client_id (string)

    (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate. This parameter is optional when Basic Authorization is used to authenticate this request.

  • client_secret (string)

    (Optional) The client secret. This value will be required if client authentication is enabled.

  • redirect_uri (string)

    The URI to redirect to upon a successful request.

Returns:



1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
# File 'lib/fusionauth/fusionauth_client.rb', line 1369

def exchange_o_auth_code_for_access_token(code, client_id, client_secret, redirect_uri)
  body = {
    "code" => code,
    "client_id" => client_id,
    "client_secret" => client_secret,
    "grant_type" => "authorization_code",
    "redirect_uri" => redirect_uri
  }
  startAnonymous.uri('/oauth2/token')
      .body_handler(FusionAuth::FormDataBodyHandler.new(body))
      .post
      .go
end

#exchange_o_auth_code_for_access_token_using_pkce(code, client_id, client_secret, redirect_uri, code_verifier) ⇒ FusionAuth::ClientResponse

Exchanges an OAuth authorization code and code_verifier for an access token. Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint and a code_verifier for an access token.

Parameters:

  • code (string)

    The authorization code returned on the /oauth2/authorize response.

  • client_id (string)

    (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate. This parameter is optional when the Authorization header is provided. This parameter is optional when Basic Authorization is used to authenticate this request.

  • client_secret (string)

    (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.

  • redirect_uri (string)

    The URI to redirect to upon a successful request.

  • code_verifier (string)

    The random string generated previously. Will be compared with the code_challenge sent previously, which allows the OAuth provider to authenticate your app.

Returns:



1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
# File 'lib/fusionauth/fusionauth_client.rb', line 1394

def exchange_o_auth_code_for_access_token_using_pkce(code, client_id, client_secret, redirect_uri, code_verifier)
  body = {
    "code" => code,
    "client_id" => client_id,
    "client_secret" => client_secret,
    "grant_type" => "authorization_code",
    "redirect_uri" => redirect_uri,
    "code_verifier" => code_verifier
  }
  startAnonymous.uri('/oauth2/token')
      .body_handler(FusionAuth::FormDataBodyHandler.new(body))
      .post
      .go
end

#exchange_refresh_token_for_access_token(refresh_token, client_id, client_secret, scope, user_code) ⇒ FusionAuth::ClientResponse

Exchange a Refresh Token for an Access Token. If you will be using the Refresh Token Grant, you will make a request to the Token endpoint to exchange the user’s refresh token for an access token.

Parameters:

  • refresh_token (string)

    The refresh token that you would like to use to exchange for an access token.

  • client_id (string)

    (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate. This parameter is optional when the Authorization header is provided. This parameter is optional when Basic Authorization is used to authenticate this request.

  • client_secret (string)

    (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.

  • scope (string)

    (Optional) This parameter is optional and if omitted, the same scope requested during the authorization request will be used. If provided the scopes must match those requested during the initial authorization request.

  • user_code (string)

    (Optional) The end-user verification code. This code is required if using this endpoint to approve the Device Authorization.

Returns:



1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
# File 'lib/fusionauth/fusionauth_client.rb', line 1420

def exchange_refresh_token_for_access_token(refresh_token, client_id, client_secret, scope, user_code)
  body = {
    "refresh_token" => refresh_token,
    "client_id" => client_id,
    "client_secret" => client_secret,
    "grant_type" => "refresh_token",
    "scope" => scope,
    "user_code" => user_code
  }
  startAnonymous.uri('/oauth2/token')
      .body_handler(FusionAuth::FormDataBodyHandler.new(body))
      .post
      .go
end

#exchange_refresh_token_for_jwt(request) ⇒ FusionAuth::ClientResponse

Exchange a refresh token for a new JWT.

Parameters:

  • request (OpenStruct, Hash)

    The refresh request.

Returns:



1440
1441
1442
1443
1444
1445
# File 'lib/fusionauth/fusionauth_client.rb', line 1440

def exchange_refresh_token_for_jwt(request)
  startAnonymous.uri('/api/jwt/refresh')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#exchange_user_credentials_for_access_token(username, password, client_id, client_secret, scope, user_code) ⇒ FusionAuth::ClientResponse

Exchange User Credentials for a Token. If you will be using the Resource Owner Password Credential Grant, you will make a request to the Token endpoint to exchange the user’s email and password for an access token.

Parameters:

  • username (string)

    The login identifier of the user. The login identifier can be either the email or the username.

  • password (string)

    The user’s password.

  • client_id (string)

    (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate. This parameter is optional when the Authorization header is provided. This parameter is optional when Basic Authorization is used to authenticate this request.

  • client_secret (string)

    (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.

  • scope (string)

    (Optional) This parameter is optional and if omitted, the same scope requested during the authorization request will be used. If provided the scopes must match those requested during the initial authorization request.

  • user_code (string)

    (Optional) The end-user verification code. This code is required if using this endpoint to approve the Device Authorization.

Returns:



1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
# File 'lib/fusionauth/fusionauth_client.rb', line 1459

def exchange_user_credentials_for_access_token(username, password, client_id, client_secret, scope, user_code)
  body = {
    "username" => username,
    "password" => password,
    "client_id" => client_id,
    "client_secret" => client_secret,
    "grant_type" => "password",
    "scope" => scope,
    "user_code" => user_code
  }
  startAnonymous.uri('/oauth2/token')
      .body_handler(FusionAuth::FormDataBodyHandler.new(body))
      .post
      .go
end

#forgot_password(request) ⇒ FusionAuth::ClientResponse

Begins the forgot password sequence, which kicks off an email to the user so that they can reset their password.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains the information about the user so that they can be emailed.

Returns:



1480
1481
1482
1483
1484
1485
# File 'lib/fusionauth/fusionauth_client.rb', line 1480

def forgot_password(request)
  start.uri('/api/user/forgot-password')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#generate_email_verification_id(email) ⇒ FusionAuth::ClientResponse

Generate a new Email Verification Id to be used with the Verify Email API. This API will not attempt to send an email to the User. This API may be used to collect the verificationId for use with a third party system.

Parameters:

  • email (string)

    The email address of the user that needs a new verification email.

Returns:



1493
1494
1495
1496
1497
1498
1499
# File 'lib/fusionauth/fusionauth_client.rb', line 1493

def generate_email_verification_id(email)
  start.uri('/api/user/verify-email')
      .url_parameter('email', email)
      .url_parameter('sendVerifyEmail', false)
      .put
      .go
end

#generate_key(key_id, request) ⇒ FusionAuth::ClientResponse

Generate a new RSA or EC key pair or an HMAC secret.

Parameters:

  • key_id (string)

    (Optional) The Id for the key. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the key.

Returns:



1507
1508
1509
1510
1511
1512
1513
# File 'lib/fusionauth/fusionauth_client.rb', line 1507

def generate_key(key_id, request)
  start.uri('/api/key/generate')
      .url_segment(key_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#generate_registration_verification_id(email, application_id) ⇒ FusionAuth::ClientResponse

Generate a new Application Registration Verification Id to be used with the Verify Registration API. This API will not attempt to send an email to the User. This API may be used to collect the verificationId for use with a third party system.

Parameters:

  • email (string)

    The email address of the user that needs a new verification email.

  • application_id (string)

    The Id of the application to be verified.

Returns:



1522
1523
1524
1525
1526
1527
1528
1529
# File 'lib/fusionauth/fusionauth_client.rb', line 1522

def generate_registration_verification_id(email, application_id)
  start.uri('/api/user/verify-registration')
      .url_parameter('email', email)
      .url_parameter('sendVerifyPasswordEmail', false)
      .url_parameter('applicationId', application_id)
      .put
      .go
end

#generate_two_factor_recovery_codes(user_id) ⇒ FusionAuth::ClientResponse

Generate two-factor recovery codes for a user. Generating two-factor recovery codes will invalidate any existing recovery codes.

Parameters:

  • user_id (string)

    The Id of the user to generate new Two Factor recovery codes.

Returns:



1536
1537
1538
1539
1540
1541
# File 'lib/fusionauth/fusionauth_client.rb', line 1536

def generate_two_factor_recovery_codes(user_id)
  start.uri('/api/user/two-factor/recovery-code')
      .url_segment(user_id)
      .post
      .go
end

#generate_two_factor_secretFusionAuth::ClientResponse

Generate a Two Factor secret that can be used to enable Two Factor authentication for a User. The response will contain both the secret and a Base32 encoded form of the secret which can be shown to a User when using a 2 Step Authentication application such as Google Authenticator.

Returns:



1549
1550
1551
1552
1553
# File 'lib/fusionauth/fusionauth_client.rb', line 1549

def generate_two_factor_secret
  start.uri('/api/two-factor/secret')
      .get
      .go
end

#generate_two_factor_secret_using_jwt(encoded_jwt) ⇒ FusionAuth::ClientResponse

Generate a Two Factor secret that can be used to enable Two Factor authentication for a User. The response will contain both the secret and a Base32 encoded form of the secret which can be shown to a User when using a 2 Step Authentication application such as Google Authenticator.

Parameters:

  • encoded_jwt (string)

    The encoded JWT (access token).

Returns:



1562
1563
1564
1565
1566
1567
# File 'lib/fusionauth/fusionauth_client.rb', line 1562

def generate_two_factor_secret_using_jwt(encoded_jwt)
  startAnonymous.uri('/api/two-factor/secret')
      .authorization('Bearer ' + encoded_jwt)
      .get
      .go
end

#identity_provider_login(request) ⇒ FusionAuth::ClientResponse

Handles login via third-parties including Social login, external OAuth and OpenID Connect, and other login systems.

Parameters:

  • request (OpenStruct, Hash)

    The third-party login request that contains information from the third-party login providers that FusionAuth uses to reconcile the user’s account.

Returns:



1576
1577
1578
1579
1580
1581
# File 'lib/fusionauth/fusionauth_client.rb', line 1576

def (request)
  startAnonymous.uri('/api/identity-provider/login')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#import_key(key_id, request) ⇒ FusionAuth::ClientResponse

Import an existing RSA or EC key pair or an HMAC secret.

Parameters:

  • key_id (string)

    (Optional) The Id for the key. If not provided a secure random UUID will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the key.

Returns:



1589
1590
1591
1592
1593
1594
1595
# File 'lib/fusionauth/fusionauth_client.rb', line 1589

def import_key(key_id, request)
  start.uri('/api/key/import')
      .url_segment(key_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#import_refresh_tokens(request) ⇒ FusionAuth::ClientResponse

Bulk imports refresh tokens. This request performs minimal validation and runs batch inserts of refresh tokens with the expectation that each token represents a user that already exists and is registered for the corresponding FusionAuth Application. This is done to increases the insert performance.

Therefore, if you encounter an error due to a database key violation, the response will likely offer a generic explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response body with specific validation errors. This will slow the request down but will allow you to identify the cause of the failure. See the validateDbConstraints request parameter.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains all the information about all the refresh tokens to import.

Returns:



1609
1610
1611
1612
1613
1614
# File 'lib/fusionauth/fusionauth_client.rb', line 1609

def import_refresh_tokens(request)
  start.uri('/api/user/refresh-token/import')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#import_users(request) ⇒ FusionAuth::ClientResponse

Bulk imports users. This request performs minimal validation and runs batch inserts of users with the expectation that each user does not yet exist and each registration corresponds to an existing FusionAuth Application. This is done to increases the insert performance.

Therefore, if you encounter an error due to a database key violation, the response will likely offer a generic explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response body with specific validation errors. This will slow the request down but will allow you to identify the cause of the failure. See the validateDbConstraints request parameter.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains all the information about all the users to import.

Returns:



1628
1629
1630
1631
1632
1633
# File 'lib/fusionauth/fusionauth_client.rb', line 1628

def import_users(request)
  start.uri('/api/user/import')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#import_web_authn_credential(request) ⇒ FusionAuth::ClientResponse

Import a WebAuthn credential

Parameters:

  • request (OpenStruct, Hash)

    An object containing data necessary for importing the credential

Returns:



1640
1641
1642
1643
1644
1645
# File 'lib/fusionauth/fusionauth_client.rb', line 1640

def import_web_authn_credential(request)
  start.uri('/api/webauthn/import')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#introspect_access_token(client_id, token) ⇒ FusionAuth::ClientResponse

Inspect an access token issued as the result of the User based grant such as the Authorization Code Grant, Implicit Grant, the User Credentials Grant or the Refresh Grant.

Parameters:

  • client_id (string)

    The unique client identifier. The client Id is the Id of the FusionAuth Application for which this token was generated.

  • token (string)

    The access token returned by this OAuth provider as the result of a successful client credentials grant.

Returns:



1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
# File 'lib/fusionauth/fusionauth_client.rb', line 1653

def introspect_access_token(client_id, token)
  body = {
    "client_id" => client_id,
    "token" => token
  }
  startAnonymous.uri('/oauth2/introspect')
      .body_handler(FusionAuth::FormDataBodyHandler.new(body))
      .post
      .go
end

#introspect_client_credentials_access_token(token) ⇒ FusionAuth::ClientResponse

Inspect an access token issued as the result of the Client Credentials Grant.

Parameters:

  • token (string)

    The access token returned by this OAuth provider as the result of a successful client credentials grant.

Returns:



1669
1670
1671
1672
1673
1674
1675
1676
1677
# File 'lib/fusionauth/fusionauth_client.rb', line 1669

def introspect_client_credentials_access_token(token)
  body = {
    "token" => token
  }
  startAnonymous.uri('/oauth2/introspect')
      .body_handler(FusionAuth::FormDataBodyHandler.new(body))
      .post
      .go
end

#issue_jwt(application_id, encoded_jwt, refresh_token) ⇒ FusionAuth::ClientResponse

Issue a new access token (JWT) for the requested Application after ensuring the provided JWT is valid. A valid access token is properly signed and not expired. <p> This API may be used in an SSO configuration to issue new tokens for another application after the user has obtained a valid token from authentication.

Parameters:

  • application_id (string)

    The Application Id for which you are requesting a new access token be issued.

  • encoded_jwt (string)

    The encoded JWT (access token).

  • refresh_token (string)

    (Optional) An existing refresh token used to request a refresh token in addition to a JWT in the response. <p>The target application represented by the applicationId request parameter must have refresh tokens enabled in order to receive a refresh token in the response.</p>

Returns:



1692
1693
1694
1695
1696
1697
1698
1699
# File 'lib/fusionauth/fusionauth_client.rb', line 1692

def issue_jwt(application_id, encoded_jwt, refresh_token)
  startAnonymous.uri('/api/jwt/issue')
      .authorization('Bearer ' + encoded_jwt)
      .url_parameter('applicationId', application_id)
      .url_parameter('refreshToken', refresh_token)
      .get
      .go
end

#login(request) ⇒ FusionAuth::ClientResponse

Authenticates a user to FusionAuth.

This API optionally requires an API key. See Application.loginConfiguration.requireAuthentication.

Parameters:

  • request (OpenStruct, Hash)

    The login request that contains the user credentials used to log them in.

Returns:



1708
1709
1710
1711
1712
1713
# File 'lib/fusionauth/fusionauth_client.rb', line 1708

def (request)
  start.uri('/api/login')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#login_ping(user_id, application_id, caller_ip_address) ⇒ FusionAuth::ClientResponse

Sends a ping to FusionAuth indicating that the user was automatically logged into an application. When using FusionAuth’s SSO or your own, you should call this if the user is already logged in centrally, but accesses an application where they no longer have a session. This helps correctly track login counts, times and helps with reporting.

Parameters:

  • user_id (string)

    The Id of the user that was logged in.

  • application_id (string)

    The Id of the application that they logged into.

  • caller_ip_address (string)

    (Optional) The IP address of the end-user that is logging in. If a null value is provided the IP address will be that of the client or last proxy that sent the request.

Returns:



1726
1727
1728
1729
1730
1731
1732
1733
# File 'lib/fusionauth/fusionauth_client.rb', line 1726

def (user_id, application_id, caller_ip_address)
  start.uri('/api/login')
      .url_segment(user_id)
      .url_segment(application_id)
      .url_parameter('ipAddress', caller_ip_address)
      .put
      .go
end

#login_ping_with_request(request) ⇒ FusionAuth::ClientResponse

Sends a ping to FusionAuth indicating that the user was automatically logged into an application. When using FusionAuth’s SSO or your own, you should call this if the user is already logged in centrally, but accesses an application where they no longer have a session. This helps correctly track login counts, times and helps with reporting.

Parameters:

  • request (OpenStruct, Hash)

    The login request that contains the user credentials used to log them in.

Returns:



1743
1744
1745
1746
1747
1748
# File 'lib/fusionauth/fusionauth_client.rb', line 1743

def (request)
  start.uri('/api/login')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#logout(global, refresh_token) ⇒ FusionAuth::ClientResponse

The Logout API is intended to be used to remove the refresh token and access token cookies if they exist on the client and revoke the refresh token stored. This API does nothing if the request does not contain an access token or refresh token cookies.

Parameters:

  • global (Boolean)

    When this value is set to true all the refresh tokens issued to the owner of the provided token will be revoked.

  • refresh_token (string)

    (Optional) The refresh_token as a request parameter instead of coming in via a cookie. If provided this takes precedence over the cookie.

Returns:



1760
1761
1762
1763
1764
1765
1766
# File 'lib/fusionauth/fusionauth_client.rb', line 1760

def logout(global, refresh_token)
  startAnonymous.uri('/api/logout')
      .url_parameter('global', global)
      .url_parameter('refreshToken', refresh_token)
      .post
      .go
end

#logout_with_request(request) ⇒ FusionAuth::ClientResponse

The Logout API is intended to be used to remove the refresh token and access token cookies if they exist on the client and revoke the refresh token stored. This API takes the refresh token in the JSON body.

Parameters:

  • request (OpenStruct, Hash)

    The request object that contains all the information used to logout the user.

Returns:



1774
1775
1776
1777
1778
1779
# File 'lib/fusionauth/fusionauth_client.rb', line 1774

def logout_with_request(request)
  startAnonymous.uri('/api/logout')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#lookup_identity_provider(domain) ⇒ FusionAuth::ClientResponse

Retrieves the identity provider for the given domain. A 200 response code indicates the domain is managed by a registered identity provider. A 404 indicates the domain is not managed.

Parameters:

  • domain (string)

    The domain or email address to lookup.

Returns:



1787
1788
1789
1790
1791
1792
# File 'lib/fusionauth/fusionauth_client.rb', line 1787

def lookup_identity_provider(domain)
  start.uri('/api/identity-provider/lookup')
      .url_parameter('domain', domain)
      .get
      .go
end

#modify_action(action_id, request) ⇒ FusionAuth::ClientResponse

Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the action.

Parameters:

  • action_id (string)

    The Id of the action to modify. This is technically the user action log Id.

  • request (OpenStruct, Hash)

    The request that contains all the information about the modification.

Returns:



1801
1802
1803
1804
1805
1806
1807
# File 'lib/fusionauth/fusionauth_client.rb', line 1801

def modify_action(action_id, request)
  start.uri('/api/user/action')
      .url_segment(action_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#passwordless_login(request) ⇒ FusionAuth::ClientResponse

Complete a login request using a passwordless code

Parameters:

  • request (OpenStruct, Hash)

    The passwordless login request that contains all the information used to complete login.

Returns:



1814
1815
1816
1817
1818
1819
# File 'lib/fusionauth/fusionauth_client.rb', line 1814

def (request)
  startAnonymous.uri('/api/passwordless/login')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#patch_api_key(key_id, request) ⇒ FusionAuth::ClientResponse

Updates an API key with the given Id.

Parameters:

  • key_id (string)

    The Id of the API key. If not provided a secure random api key will be generated.

  • request (OpenStruct, Hash)

    The request object that contains all the information needed to create the API key.

Returns:



1827
1828
1829
1830
1831
1832
1833
# File 'lib/fusionauth/fusionauth_client.rb', line 1827

def patch_api_key(key_id, request)
  start.uri('/api/api-key')
      .url_segment(key_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_application(application_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the application with the given Id.

Parameters:

  • application_id (string)

    The Id of the application to update.

  • request (OpenStruct, Hash)

    The request that contains just the new application information.

Returns:



1841
1842
1843
1844
1845
1846
1847
# File 'lib/fusionauth/fusionauth_client.rb', line 1841

def patch_application(application_id, request)
  start.uri('/api/application')
      .url_segment(application_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_application_role(application_id, role_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the application role with the given Id for the application.

Parameters:

  • application_id (string)

    The Id of the application that the role belongs to.

  • role_id (string)

    The Id of the role to update.

  • request (OpenStruct, Hash)

    The request that contains just the new role information.

Returns:



1856
1857
1858
1859
1860
1861
1862
1863
1864
# File 'lib/fusionauth/fusionauth_client.rb', line 1856

def patch_application_role(application_id, role_id, request)
  start.uri('/api/application')
      .url_segment(application_id)
      .url_segment("role")
      .url_segment(role_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_connector(connector_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the connector with the given Id.

Parameters:

  • connector_id (string)

    The Id of the connector to update.

  • request (OpenStruct, Hash)

    The request that contains just the new connector information.

Returns:



1872
1873
1874
1875
1876
1877
1878
# File 'lib/fusionauth/fusionauth_client.rb', line 1872

def patch_connector(connector_id, request)
  start.uri('/api/connector')
      .url_segment(connector_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

Updates, via PATCH, the consent with the given Id.

Parameters:

  • consent_id (string)

    The Id of the consent to update.

  • request (OpenStruct, Hash)

    The request that contains just the new consent information.

Returns:



1886
1887
1888
1889
1890
1891
1892
# File 'lib/fusionauth/fusionauth_client.rb', line 1886

def patch_consent(consent_id, request)
  start.uri('/api/consent')
      .url_segment(consent_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_email_template(email_template_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the email template with the given Id.

Parameters:

  • email_template_id (string)

    The Id of the email template to update.

  • request (OpenStruct, Hash)

    The request that contains just the new email template information.

Returns:



1900
1901
1902
1903
1904
1905
1906
# File 'lib/fusionauth/fusionauth_client.rb', line 1900

def patch_email_template(email_template_id, request)
  start.uri('/api/email/template')
      .url_segment(email_template_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_entity(entity_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the Entity with the given Id.

Parameters:

  • entity_id (string)

    The Id of the Entity Type to update.

  • request (OpenStruct, Hash)

    The request that contains just the new Entity information.

Returns:



1914
1915
1916
1917
1918
1919
1920
# File 'lib/fusionauth/fusionauth_client.rb', line 1914

def patch_entity(entity_id, request)
  start.uri('/api/entity')
      .url_segment(entity_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_entity_type(entity_type_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the Entity Type with the given Id.

Parameters:

  • entity_type_id (string)

    The Id of the Entity Type to update.

  • request (OpenStruct, Hash)

    The request that contains just the new Entity Type information.

Returns:



1928
1929
1930
1931
1932
1933
1934
# File 'lib/fusionauth/fusionauth_client.rb', line 1928

def patch_entity_type(entity_type_id, request)
  start.uri('/api/entity/type')
      .url_segment(entity_type_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_entity_type_permission(entity_type_id, permission_id, request) ⇒ FusionAuth::ClientResponse

Patches the permission with the given Id for the entity type.

Parameters:

  • entity_type_id (string)

    The Id of the entityType that the permission belongs to.

  • permission_id (string)

    The Id of the permission to patch.

  • request (OpenStruct, Hash)

    The request that contains the new permission information.

Returns:



1943
1944
1945
1946
1947
1948
1949
1950
1951
# File 'lib/fusionauth/fusionauth_client.rb', line 1943

def patch_entity_type_permission(entity_type_id, permission_id, request)
  start.uri('/api/entity/type')
      .url_segment(entity_type_id)
      .url_segment("permission")
      .url_segment(permission_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_form(form_id, request) ⇒ FusionAuth::ClientResponse

Patches the form with the given Id.

Parameters:

  • form_id (string)

    The Id of the form to patch.

  • request (OpenStruct, Hash)

    The request object that contains the new form information.

Returns:



1959
1960
1961
1962
1963
1964
1965
# File 'lib/fusionauth/fusionauth_client.rb', line 1959

def patch_form(form_id, request)
  start.uri('/api/form')
      .url_segment(form_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_form_field(field_id, request) ⇒ FusionAuth::ClientResponse

Patches the form field with the given Id.

Parameters:

  • field_id (string)

    The Id of the form field to patch.

  • request (OpenStruct, Hash)

    The request object that contains the new form field information.

Returns:



1973
1974
1975
1976
1977
1978
1979
# File 'lib/fusionauth/fusionauth_client.rb', line 1973

def patch_form_field(field_id, request)
  start.uri('/api/form/field')
      .url_segment(field_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_group(group_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the group with the given Id.

Parameters:

  • group_id (string)

    The Id of the group to update.

  • request (OpenStruct, Hash)

    The request that contains just the new group information.

Returns:



1987
1988
1989
1990
1991
1992
1993
# File 'lib/fusionauth/fusionauth_client.rb', line 1987

def patch_group(group_id, request)
  start.uri('/api/group')
      .url_segment(group_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_identity_provider(identity_provider_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the identity provider with the given Id.

Parameters:

  • identity_provider_id (string)

    The Id of the identity provider to update.

  • request (OpenStruct, Hash)

    The request object that contains just the updated identity provider information.

Returns:



2015
2016
2017
2018
2019
2020
2021
# File 'lib/fusionauth/fusionauth_client.rb', line 2015

def patch_identity_provider(identity_provider_id, request)
  start.uri('/api/identity-provider')
      .url_segment(identity_provider_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_integrations(request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the available integrations.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains just the new integration information.

Returns:



2028
2029
2030
2031
2032
2033
# File 'lib/fusionauth/fusionauth_client.rb', line 2028

def patch_integrations(request)
  start.uri('/api/integration')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_ip_access_control_list(access_control_list_id, request) ⇒ FusionAuth::ClientResponse

Update the IP Access Control List with the given Id.

Parameters:

  • access_control_list_id (string)

    The Id of the IP Access Control List to patch.

  • request (OpenStruct, Hash)

    The request that contains the new IP Access Control List information.

Returns:



2001
2002
2003
2004
2005
2006
2007
# File 'lib/fusionauth/fusionauth_client.rb', line 2001

def patch_ip_access_control_list(access_control_list_id, request)
  start.uri('/api/ip-acl')
      .url_segment(access_control_list_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_lambda(lambda_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the lambda with the given Id.

Parameters:

  • lambda_id (string)

    The Id of the lambda to update.

  • request (OpenStruct, Hash)

    The request that contains just the new lambda information.

Returns:



2041
2042
2043
2044
2045
2046
2047
# File 'lib/fusionauth/fusionauth_client.rb', line 2041

def patch_lambda(lambda_id, request)
  start.uri('/api/lambda')
      .url_segment(lambda_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_message_template(message_template_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the message template with the given Id.

Parameters:

  • message_template_id (string)

    The Id of the message template to update.

  • request (OpenStruct, Hash)

    The request that contains just the new message template information.

Returns:



2055
2056
2057
2058
2059
2060
2061
# File 'lib/fusionauth/fusionauth_client.rb', line 2055

def patch_message_template(message_template_id, request)
  start.uri('/api/message/template')
      .url_segment(message_template_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_messenger(messenger_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the messenger with the given Id.

Parameters:

  • messenger_id (string)

    The Id of the messenger to update.

  • request (OpenStruct, Hash)

    The request that contains just the new messenger information.

Returns:



2069
2070
2071
2072
2073
2074
2075
# File 'lib/fusionauth/fusionauth_client.rb', line 2069

def patch_messenger(messenger_id, request)
  start.uri('/api/messenger')
      .url_segment(messenger_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_o_auth_scope(application_id, scope_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the custom OAuth scope with the given Id for the application.

Parameters:

  • application_id (string)

    The Id of the application that the OAuth scope belongs to.

  • scope_id (string)

    The Id of the OAuth scope to update.

  • request (OpenStruct, Hash)

    The request that contains just the new OAuth scope information.

Returns:



2084
2085
2086
2087
2088
2089
2090
2091
2092
# File 'lib/fusionauth/fusionauth_client.rb', line 2084

def patch_o_auth_scope(application_id, scope_id, request)
  start.uri('/api/application')
      .url_segment(application_id)
      .url_segment("scope")
      .url_segment(scope_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_registration(user_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the registration for the user with the given Id and the application defined in the request.

Parameters:

  • user_id (string)

    The Id of the user whose registration is going to be updated.

  • request (OpenStruct, Hash)

    The request that contains just the new registration information.

Returns:



2100
2101
2102
2103
2104
2105
2106
# File 'lib/fusionauth/fusionauth_client.rb', line 2100

def patch_registration(user_id, request)
  start.uri('/api/user/registration')
      .url_segment(user_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_system_configuration(request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the system configuration.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains just the new system configuration information.

Returns:



2113
2114
2115
2116
2117
2118
# File 'lib/fusionauth/fusionauth_client.rb', line 2113

def patch_system_configuration(request)
  start.uri('/api/system-configuration')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_tenant(tenant_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the tenant with the given Id.

Parameters:

  • tenant_id (string)

    The Id of the tenant to update.

  • request (OpenStruct, Hash)

    The request that contains just the new tenant information.

Returns:



2126
2127
2128
2129
2130
2131
2132
# File 'lib/fusionauth/fusionauth_client.rb', line 2126

def patch_tenant(tenant_id, request)
  start.uri('/api/tenant')
      .url_segment(tenant_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_theme(theme_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the theme with the given Id.

Parameters:

  • theme_id (string)

    The Id of the theme to update.

  • request (OpenStruct, Hash)

    The request that contains just the new theme information.

Returns:



2140
2141
2142
2143
2144
2145
2146
# File 'lib/fusionauth/fusionauth_client.rb', line 2140

def patch_theme(theme_id, request)
  start.uri('/api/theme')
      .url_segment(theme_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_user(user_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the user with the given Id.

Parameters:

  • user_id (string)

    The Id of the user to update.

  • request (OpenStruct, Hash)

    The request that contains just the new user information.

Returns:



2154
2155
2156
2157
2158
2159
2160
# File 'lib/fusionauth/fusionauth_client.rb', line 2154

def patch_user(user_id, request)
  start.uri('/api/user')
      .url_segment(user_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_user_action(user_action_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the user action with the given Id.

Parameters:

  • user_action_id (string)

    The Id of the user action to update.

  • request (OpenStruct, Hash)

    The request that contains just the new user action information.

Returns:



2168
2169
2170
2171
2172
2173
2174
# File 'lib/fusionauth/fusionauth_client.rb', line 2168

def patch_user_action(user_action_id, request)
  start.uri('/api/user-action')
      .url_segment(user_action_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_user_action_reason(user_action_reason_id, request) ⇒ FusionAuth::ClientResponse

Updates, via PATCH, the user action reason with the given Id.

Parameters:

  • user_action_reason_id (string)

    The Id of the user action reason to update.

  • request (OpenStruct, Hash)

    The request that contains just the new user action reason information.

Returns:



2182
2183
2184
2185
2186
2187
2188
# File 'lib/fusionauth/fusionauth_client.rb', line 2182

def patch_user_action_reason(user_action_reason_id, request)
  start.uri('/api/user-action-reason')
      .url_segment(user_action_reason_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

Updates, via PATCH, a single User consent by Id.

Parameters:

  • user_consent_id (string)

    The User Consent Id

  • request (OpenStruct, Hash)

    The request that contains just the new user consent information.

Returns:



2196
2197
2198
2199
2200
2201
2202
# File 'lib/fusionauth/fusionauth_client.rb', line 2196

def patch_user_consent(user_consent_id, request)
  start.uri('/api/user/consent')
      .url_segment(user_consent_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#patch_webhook(webhook_id, request) ⇒ FusionAuth::ClientResponse

Patches the webhook with the given Id.

Parameters:

  • webhook_id (string)

    The Id of the webhook to update.

  • request (OpenStruct, Hash)

    The request that contains the new webhook information.

Returns:



2210
2211
2212
2213
2214
2215
2216
# File 'lib/fusionauth/fusionauth_client.rb', line 2210

def patch_webhook(webhook_id, request)
  start.uri('/api/webhook')
      .url_segment(webhook_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .patch
      .go
end

#reactivate_application(application_id) ⇒ FusionAuth::ClientResponse

Reactivates the application with the given Id.

Parameters:

  • application_id (string)

    The Id of the application to reactivate.

Returns:



2223
2224
2225
2226
2227
2228
2229
# File 'lib/fusionauth/fusionauth_client.rb', line 2223

def reactivate_application(application_id)
  start.uri('/api/application')
      .url_segment(application_id)
      .url_parameter('reactivate', true)
      .put
      .go
end

#reactivate_user(user_id) ⇒ FusionAuth::ClientResponse

Reactivates the user with the given Id.

Parameters:

  • user_id (string)

    The Id of the user to reactivate.

Returns:



2236
2237
2238
2239
2240
2241
2242
# File 'lib/fusionauth/fusionauth_client.rb', line 2236

def reactivate_user(user_id)
  start.uri('/api/user')
      .url_segment(user_id)
      .url_parameter('reactivate', true)
      .put
      .go
end

#reactivate_user_action(user_action_id) ⇒ FusionAuth::ClientResponse

Reactivates the user action with the given Id.

Parameters:

  • user_action_id (string)

    The Id of the user action to reactivate.

Returns:



2249
2250
2251
2252
2253
2254
2255
# File 'lib/fusionauth/fusionauth_client.rb', line 2249

def reactivate_user_action(user_action_id)
  start.uri('/api/user-action')
      .url_segment(user_action_id)
      .url_parameter('reactivate', true)
      .put
      .go
end

#reconcile_jwt(request) ⇒ FusionAuth::ClientResponse

Reconcile a User to FusionAuth using JWT issued from another Identity Provider.

Parameters:

  • request (OpenStruct, Hash)

    The reconcile request that contains the data to reconcile the User.

Returns:



2262
2263
2264
2265
2266
2267
# File 'lib/fusionauth/fusionauth_client.rb', line 2262

def reconcile_jwt(request)
  startAnonymous.uri('/api/jwt/reconcile')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#refresh_entity_search_indexFusionAuth::ClientResponse

Request a refresh of the Entity search index. This API is not generally necessary and the search index will become consistent in a reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be if you are using the Search API or Delete Tenant API immediately following a Entity Create etc, you may wish to request a refresh to

ensure the index immediately current before making a query request to the search index.

Returns:



2276
2277
2278
2279
2280
# File 'lib/fusionauth/fusionauth_client.rb', line 2276

def refresh_entity_search_index
  start.uri('/api/entity/search')
      .put
      .go
end

#refresh_user_search_indexFusionAuth::ClientResponse

Request a refresh of the User search index. This API is not generally necessary and the search index will become consistent in a reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be if you are using the Search API or Delete Tenant API immediately following a User Create etc, you may wish to request a refresh to

ensure the index immediately current before making a query request to the search index.

Returns:



2289
2290
2291
2292
2293
# File 'lib/fusionauth/fusionauth_client.rb', line 2289

def refresh_user_search_index
  start.uri('/api/user/search')
      .put
      .go
end

#regenerate_reactor_keysFusionAuth::ClientResponse

Regenerates any keys that are used by the FusionAuth Reactor.

Returns:



2299
2300
2301
2302
2303
# File 'lib/fusionauth/fusionauth_client.rb', line 2299

def regenerate_reactor_keys
  start.uri('/api/reactor')
      .put
      .go
end

#register(user_id, request) ⇒ FusionAuth::ClientResponse

Registers a user for an application. If you provide the User and the UserRegistration object on this request, it will create the user as well as register them for the application. This is called a Full Registration. However, if you only provide the UserRegistration object, then the user must already exist and they will be registered for the application. The user Id can also be provided and it will either be used to look up an existing user or it will be used for the newly created User.

Parameters:

  • user_id (string)

    (Optional) The Id of the user being registered for the application and optionally created.

  • request (OpenStruct, Hash)

    The request that optionally contains the User and must contain the UserRegistration.

Returns:



2315
2316
2317
2318
2319
2320
2321
# File 'lib/fusionauth/fusionauth_client.rb', line 2315

def register(user_id, request)
  start.uri('/api/user/registration')
      .url_segment(user_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#reindex(request) ⇒ FusionAuth::ClientResponse

Requests Elasticsearch to delete and rebuild the index for FusionAuth users or entities. Be very careful when running this request as it will increase the CPU and I/O load on your database until the operation completes. Generally speaking you do not ever need to run this operation unless instructed by FusionAuth support, or if you are migrating a database another system and you are not brining along the Elasticsearch index.

You have been warned.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains the index name.

Returns:



2332
2333
2334
2335
2336
2337
# File 'lib/fusionauth/fusionauth_client.rb', line 2332

def reindex(request)
  start.uri('/api/system/reindex')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#remove_user_from_family(family_id, user_id) ⇒ FusionAuth::ClientResponse

Removes a user from the family with the given Id.

Parameters:

  • family_id (string)

    The Id of the family to remove the user from.

  • user_id (string)

    The Id of the user to remove from the family.

Returns:



2345
2346
2347
2348
2349
2350
2351
# File 'lib/fusionauth/fusionauth_client.rb', line 2345

def remove_user_from_family(family_id, user_id)
  start.uri('/api/user/family')
      .url_segment(family_id)
      .url_segment(user_id)
      .delete
      .go
end

#resend_email_verification(email) ⇒ FusionAuth::ClientResponse

Re-sends the verification email to the user.

Parameters:

  • email (string)

    The email address of the user that needs a new verification email.

Returns:



2358
2359
2360
2361
2362
2363
# File 'lib/fusionauth/fusionauth_client.rb', line 2358

def resend_email_verification(email)
  start.uri('/api/user/verify-email')
      .url_parameter('email', email)
      .put
      .go
end

#resend_email_verification_with_application_template(application_id, email) ⇒ FusionAuth::ClientResponse

Re-sends the verification email to the user. If the Application has configured a specific email template this will be used instead of the tenant configuration.

Parameters:

  • application_id (string)

    The unique Application Id to used to resolve an application specific email template.

  • email (string)

    The email address of the user that needs a new verification email.

Returns:



2372
2373
2374
2375
2376
2377
2378
# File 'lib/fusionauth/fusionauth_client.rb', line 2372

def resend_email_verification_with_application_template(application_id, email)
  start.uri('/api/user/verify-email')
      .url_parameter('applicationId', application_id)
      .url_parameter('email', email)
      .put
      .go
end

#resend_registration_verification(email, application_id) ⇒ FusionAuth::ClientResponse

Re-sends the application registration verification email to the user.

Parameters:

  • email (string)

    The email address of the user that needs a new verification email.

  • application_id (string)

    The Id of the application to be verified.

Returns:



2386
2387
2388
2389
2390
2391
2392
# File 'lib/fusionauth/fusionauth_client.rb', line 2386

def resend_registration_verification(email, application_id)
  start.uri('/api/user/verify-registration')
      .url_parameter('email', email)
      .url_parameter('applicationId', application_id)
      .put
      .go
end

#retrieve_action(action_id) ⇒ FusionAuth::ClientResponse

Retrieves a single action log (the log of a user action that was taken on a user previously) for the given Id.

Parameters:

  • action_id (string)

    The Id of the action to retrieve.

Returns:



2411
2412
2413
2414
2415
2416
# File 'lib/fusionauth/fusionauth_client.rb', line 2411

def retrieve_action(action_id)
  start.uri('/api/user/action')
      .url_segment(action_id)
      .get
      .go
end

#retrieve_actions(user_id) ⇒ FusionAuth::ClientResponse

Retrieves all the actions for the user with the given Id. This will return all time based actions that are active, and inactive as well as non-time based actions.

Parameters:

  • user_id (string)

    The Id of the user to fetch the actions for.

Returns:



2424
2425
2426
2427
2428
2429
# File 'lib/fusionauth/fusionauth_client.rb', line 2424

def retrieve_actions(user_id)
  start.uri('/api/user/action')
      .url_parameter('userId', user_id)
      .get
      .go
end

#retrieve_actions_preventing_login(user_id) ⇒ FusionAuth::ClientResponse

Retrieves all the actions for the user with the given Id that are currently preventing the User from logging in.

Parameters:

  • user_id (string)

    The Id of the user to fetch the actions for.

Returns:



2436
2437
2438
2439
2440
2441
2442
# File 'lib/fusionauth/fusionauth_client.rb', line 2436

def (user_id)
  start.uri('/api/user/action')
      .url_parameter('userId', user_id)
      .url_parameter('preventingLogin', true)
      .get
      .go
end

#retrieve_active_actions(user_id) ⇒ FusionAuth::ClientResponse

Retrieves all the actions for the user with the given Id that are currently active. An active action means one that is time based and has not been canceled, and has not ended.

Parameters:

  • user_id (string)

    The Id of the user to fetch the actions for.

Returns:



2450
2451
2452
2453
2454
2455
2456
# File 'lib/fusionauth/fusionauth_client.rb', line 2450

def retrieve_active_actions(user_id)
  start.uri('/api/user/action')
      .url_parameter('userId', user_id)
      .url_parameter('active', true)
      .get
      .go
end

#retrieve_api_key(key_id) ⇒ FusionAuth::ClientResponse

Retrieves an authentication API key for the given Id.

Parameters:

  • key_id (string)

    The Id of the API key to retrieve.

Returns:



2399
2400
2401
2402
2403
2404
# File 'lib/fusionauth/fusionauth_client.rb', line 2399

def retrieve_api_key(key_id)
  start.uri('/api/api-key')
      .url_segment(key_id)
      .get
      .go
end

#retrieve_application(application_id) ⇒ FusionAuth::ClientResponse

Retrieves the application for the given Id or all the applications if the Id is null.

Parameters:

  • application_id (string)

    (Optional) The application Id.

Returns:



2463
2464
2465
2466
2467
2468
# File 'lib/fusionauth/fusionauth_client.rb', line 2463

def retrieve_application(application_id)
  start.uri('/api/application')
      .url_segment(application_id)
      .get
      .go
end

#retrieve_applicationsFusionAuth::ClientResponse

Retrieves all the applications.

Returns:



2474
2475
2476
2477
2478
# File 'lib/fusionauth/fusionauth_client.rb', line 2474

def retrieve_applications
  start.uri('/api/application')
      .get
      .go
end

#retrieve_audit_log(audit_log_id) ⇒ FusionAuth::ClientResponse

Retrieves a single audit log for the given Id.

Parameters:

  • audit_log_id (Numeric)

    The Id of the audit log to retrieve.

Returns:



2485
2486
2487
2488
2489
2490
# File 'lib/fusionauth/fusionauth_client.rb', line 2485

def retrieve_audit_log(audit_log_id)
  start.uri('/api/system/audit-log')
      .url_segment(audit_log_id)
      .get
      .go
end

#retrieve_connector(connector_id) ⇒ FusionAuth::ClientResponse

Retrieves the connector with the given Id.

Parameters:

  • connector_id (string)

    The Id of the connector.

Returns:



2497
2498
2499
2500
2501
2502
# File 'lib/fusionauth/fusionauth_client.rb', line 2497

def retrieve_connector(connector_id)
  start.uri('/api/connector')
      .url_segment(connector_id)
      .get
      .go
end

#retrieve_connectorsFusionAuth::ClientResponse

Retrieves all the connectors.

Returns:



2508
2509
2510
2511
2512
# File 'lib/fusionauth/fusionauth_client.rb', line 2508

def retrieve_connectors
  start.uri('/api/connector')
      .get
      .go
end

Retrieves the Consent for the given Id.

Parameters:

  • consent_id (string)

    The Id of the consent.

Returns:



2519
2520
2521
2522
2523
2524
# File 'lib/fusionauth/fusionauth_client.rb', line 2519

def retrieve_consent(consent_id)
  start.uri('/api/consent')
      .url_segment(consent_id)
      .get
      .go
end

#retrieve_consentsFusionAuth::ClientResponse

Retrieves all the consent.

Returns:



2530
2531
2532
2533
2534
# File 'lib/fusionauth/fusionauth_client.rb', line 2530

def retrieve_consents
  start.uri('/api/consent')
      .get
      .go
end

#retrieve_daily_active_report(application_id, start, _end) ⇒ FusionAuth::ClientResponse

Retrieves the daily active user report between the two instants. If you specify an application Id, it will only return the daily active counts for that application.

Parameters:

  • application_id (string)

    (Optional) The application Id.

  • start (OpenStruct, Hash)

    The start instant as UTC milliseconds since Epoch.

  • _end (OpenStruct, Hash)

    The end instant as UTC milliseconds since Epoch.

Returns:



2544
2545
2546
2547
2548
2549
2550
2551
# File 'lib/fusionauth/fusionauth_client.rb', line 2544

def retrieve_daily_active_report(application_id, start, _end)
  start.uri('/api/report/daily-active-user')
      .url_parameter('applicationId', application_id)
      .url_parameter('start', start)
      .url_parameter('end', _end)
      .get
      .go
end

#retrieve_email_template(email_template_id) ⇒ FusionAuth::ClientResponse

Retrieves the email template for the given Id. If you don’t specify the Id, this will return all the email templates.

Parameters:

  • email_template_id (string)

    (Optional) The Id of the email template.

Returns:



2558
2559
2560
2561
2562
2563
# File 'lib/fusionauth/fusionauth_client.rb', line 2558

def retrieve_email_template(email_template_id)
  start.uri('/api/email/template')
      .url_segment(email_template_id)
      .get
      .go
end

#retrieve_email_template_preview(request) ⇒ FusionAuth::ClientResponse

Creates a preview of the email template provided in the request. This allows you to preview an email template that hasn’t been saved to the database yet. The entire email template does not need to be provided on the request. This will create the preview based on whatever is given.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains the email template and optionally a locale to render it in.

Returns:



2572
2573
2574
2575
2576
2577
# File 'lib/fusionauth/fusionauth_client.rb', line 2572

def retrieve_email_template_preview(request)
  start.uri('/api/email/template/preview')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#retrieve_email_templatesFusionAuth::ClientResponse

Retrieves all the email templates.

Returns:



2583
2584
2585
2586
2587
# File 'lib/fusionauth/fusionauth_client.rb', line 2583

def retrieve_email_templates
  start.uri('/api/email/template')
      .get
      .go
end

#retrieve_entity(entity_id) ⇒ FusionAuth::ClientResponse

Retrieves the Entity for the given Id.

Parameters:

  • entity_id (string)

    The Id of the Entity.

Returns:



2594
2595
2596
2597
2598
2599
# File 'lib/fusionauth/fusionauth_client.rb', line 2594

def retrieve_entity(entity_id)
  start.uri('/api/entity')
      .url_segment(entity_id)
      .get
      .go
end

#retrieve_entity_grant(entity_id, recipient_entity_id, user_id) ⇒ FusionAuth::ClientResponse

Retrieves an Entity Grant for the given Entity and User/Entity.

Parameters:

  • entity_id (string)

    The Id of the Entity.

  • recipient_entity_id (string)

    (Optional) The Id of the Entity that the Entity Grant is for.

  • user_id (string)

    (Optional) The Id of the User that the Entity Grant is for.

Returns:



2608
2609
2610
2611
2612
2613
2614
2615
2616
# File 'lib/fusionauth/fusionauth_client.rb', line 2608

def retrieve_entity_grant(entity_id, recipient_entity_id, user_id)
  start.uri('/api/entity')
      .url_segment(entity_id)
      .url_segment("grant")
      .url_parameter('recipientEntityId', recipient_entity_id)
      .url_parameter('userId', user_id)
      .get
      .go
end

#retrieve_entity_type(entity_type_id) ⇒ FusionAuth::ClientResponse

Retrieves the Entity Type for the given Id.

Parameters:

  • entity_type_id (string)

    The Id of the Entity Type.

Returns:



2623
2624
2625
2626
2627
2628
# File 'lib/fusionauth/fusionauth_client.rb', line 2623

def retrieve_entity_type(entity_type_id)
  start.uri('/api/entity/type')
      .url_segment(entity_type_id)
      .get
      .go
end

#retrieve_entity_typesFusionAuth::ClientResponse

Retrieves all the Entity Types.

Returns:



2634
2635
2636
2637
2638
# File 'lib/fusionauth/fusionauth_client.rb', line 2634

def retrieve_entity_types
  start.uri('/api/entity/type')
      .get
      .go
end

#retrieve_event_log(event_log_id) ⇒ FusionAuth::ClientResponse

Retrieves a single event log for the given Id.

Parameters:

  • event_log_id (Numeric)

    The Id of the event log to retrieve.

Returns:



2645
2646
2647
2648
2649
2650
# File 'lib/fusionauth/fusionauth_client.rb', line 2645

def retrieve_event_log(event_log_id)
  start.uri('/api/system/event-log')
      .url_segment(event_log_id)
      .get
      .go
end

#retrieve_families(user_id) ⇒ FusionAuth::ClientResponse

Retrieves all the families that a user belongs to.

Parameters:

  • user_id (string)

    The User’s id

Returns:



2657
2658
2659
2660
2661
2662
# File 'lib/fusionauth/fusionauth_client.rb', line 2657

def retrieve_families(user_id)
  start.uri('/api/user/family')
      .url_parameter('userId', user_id)
      .get
      .go
end

#retrieve_family_members_by_family_id(family_id) ⇒ FusionAuth::ClientResponse

Retrieves all the members of a family by the unique Family Id.

Parameters:

  • family_id (string)

    The unique Id of the Family.

Returns:



2669
2670
2671
2672
2673
2674
# File 'lib/fusionauth/fusionauth_client.rb', line 2669

def retrieve_family_members_by_family_id(family_id)
  start.uri('/api/user/family')
      .url_segment(family_id)
      .get
      .go
end

#retrieve_form(form_id) ⇒ FusionAuth::ClientResponse

Retrieves the form with the given Id.

Parameters:

  • form_id (string)

    The Id of the form.

Returns:



2681
2682
2683
2684
2685
2686
# File 'lib/fusionauth/fusionauth_client.rb', line 2681

def retrieve_form(form_id)
  start.uri('/api/form')
      .url_segment(form_id)
      .get
      .go
end

#retrieve_form_field(field_id) ⇒ FusionAuth::ClientResponse

Retrieves the form field with the given Id.

Parameters:

  • field_id (string)

    The Id of the form field.

Returns:



2693
2694
2695
2696
2697
2698
# File 'lib/fusionauth/fusionauth_client.rb', line 2693

def retrieve_form_field(field_id)
  start.uri('/api/form/field')
      .url_segment(field_id)
      .get
      .go
end

#retrieve_form_fieldsFusionAuth::ClientResponse

Retrieves all the forms fields

Returns:



2704
2705
2706
2707
2708
# File 'lib/fusionauth/fusionauth_client.rb', line 2704

def retrieve_form_fields
  start.uri('/api/form/field')
      .get
      .go
end

#retrieve_formsFusionAuth::ClientResponse

Retrieves all the forms.

Returns:



2714
2715
2716
2717
2718
# File 'lib/fusionauth/fusionauth_client.rb', line 2714

def retrieve_forms
  start.uri('/api/form')
      .get
      .go
end

#retrieve_group(group_id) ⇒ FusionAuth::ClientResponse

Retrieves the group for the given Id.

Parameters:

  • group_id (string)

    The Id of the group.

Returns:



2725
2726
2727
2728
2729
2730
# File 'lib/fusionauth/fusionauth_client.rb', line 2725

def retrieve_group(group_id)
  start.uri('/api/group')
      .url_segment(group_id)
      .get
      .go
end

#retrieve_groupsFusionAuth::ClientResponse

Retrieves all the groups.

Returns:



2736
2737
2738
2739
2740
# File 'lib/fusionauth/fusionauth_client.rb', line 2736

def retrieve_groups
  start.uri('/api/group')
      .get
      .go
end

#retrieve_identity_provider(identity_provider_id) ⇒ FusionAuth::ClientResponse

Retrieves the identity provider for the given Id or all the identity providers if the Id is null.

Parameters:

  • identity_provider_id (string)

    The identity provider Id.

Returns:



2759
2760
2761
2762
2763
2764
# File 'lib/fusionauth/fusionauth_client.rb', line 2759

def retrieve_identity_provider(identity_provider_id)
  start.uri('/api/identity-provider')
      .url_segment(identity_provider_id)
      .get
      .go
end

#retrieve_identity_provider_by_type(type) ⇒ FusionAuth::ClientResponse

Retrieves one or more identity provider for the given type. For types such as Google, Facebook, Twitter and LinkedIn, only a single identity provider can exist. For types such as OpenID Connect and SAMLv2 more than one identity provider can be configured so this request may return multiple identity providers.

Parameters:

  • type (string)

    The type of the identity provider.

Returns:



2773
2774
2775
2776
2777
2778
# File 'lib/fusionauth/fusionauth_client.rb', line 2773

def retrieve_identity_provider_by_type(type)
  start.uri('/api/identity-provider')
      .url_parameter('type', type)
      .get
      .go
end

#retrieve_identity_providersFusionAuth::ClientResponse

Retrieves all the identity providers.

Returns:



2784
2785
2786
2787
2788
# File 'lib/fusionauth/fusionauth_client.rb', line 2784

def retrieve_identity_providers
  start.uri('/api/identity-provider')
      .get
      .go
end

#retrieve_inactive_actions(user_id) ⇒ FusionAuth::ClientResponse

Retrieves all the actions for the user with the given Id that are currently inactive. An inactive action means one that is time based and has been canceled or has expired, or is not time based.

Parameters:

  • user_id (string)

    The Id of the user to fetch the actions for.

Returns:



2796
2797
2798
2799
2800
2801
2802
# File 'lib/fusionauth/fusionauth_client.rb', line 2796

def retrieve_inactive_actions(user_id)
  start.uri('/api/user/action')
      .url_parameter('userId', user_id)
      .url_parameter('active', false)
      .get
      .go
end

#retrieve_inactive_applicationsFusionAuth::ClientResponse

Retrieves all the applications that are currently inactive.

Returns:



2808
2809
2810
2811
2812
2813
# File 'lib/fusionauth/fusionauth_client.rb', line 2808

def retrieve_inactive_applications
  start.uri('/api/application')
      .url_parameter('inactive', true)
      .get
      .go
end

#retrieve_inactive_user_actionsFusionAuth::ClientResponse

Retrieves all the user actions that are currently inactive.

Returns:



2819
2820
2821
2822
2823
2824
# File 'lib/fusionauth/fusionauth_client.rb', line 2819

def 
  start.uri('/api/user-action')
      .url_parameter('inactive', true)
      .get
      .go
end

#retrieve_integrationFusionAuth::ClientResponse

Retrieves the available integrations.

Returns:



2830
2831
2832
2833
2834
# File 'lib/fusionauth/fusionauth_client.rb', line 2830

def retrieve_integration
  start.uri('/api/integration')
      .get
      .go
end

#retrieve_ip_access_control_list(ip_access_control_list_id) ⇒ FusionAuth::ClientResponse

Retrieves the IP Access Control List with the given Id.

Parameters:

  • ip_access_control_list_id (string)

    The Id of the IP Access Control List.

Returns:



2747
2748
2749
2750
2751
2752
# File 'lib/fusionauth/fusionauth_client.rb', line 2747

def retrieve_ip_access_control_list(ip_access_control_list_id)
  start.uri('/api/ip-acl')
      .url_segment(ip_access_control_list_id)
      .get
      .go
end

#retrieve_json_web_key_setFusionAuth::ClientResponse

Returns public keys used by FusionAuth to cryptographically verify JWTs using the JSON Web Key format.

Returns:



2874
2875
2876
2877
2878
# File 'lib/fusionauth/fusionauth_client.rb', line 2874

def retrieve_json_web_key_set
  startAnonymous.uri('/.well-known/jwks.json')
      .get
      .go
end

#retrieve_jwt_public_key(key_id) ⇒ FusionAuth::ClientResponse

Retrieves the Public Key configured for verifying JSON Web Tokens (JWT) by the key Id (kid).

Parameters:

  • key_id (string)

    The Id of the public key (kid).

Returns:



2841
2842
2843
2844
2845
2846
# File 'lib/fusionauth/fusionauth_client.rb', line 2841

def retrieve_jwt_public_key(key_id)
  startAnonymous.uri('/api/jwt/public-key')
      .url_parameter('kid', key_id)
      .get
      .go
end

#retrieve_jwt_public_key_by_application_id(application_id) ⇒ FusionAuth::ClientResponse

Retrieves the Public Key configured for verifying the JSON Web Tokens (JWT) issued by the Login API by the Application Id.

Parameters:

  • application_id (string)

    The Id of the Application for which this key is used.

Returns:



2853
2854
2855
2856
2857
2858
# File 'lib/fusionauth/fusionauth_client.rb', line 2853

def retrieve_jwt_public_key_by_application_id(application_id)
  startAnonymous.uri('/api/jwt/public-key')
      .url_parameter('applicationId', application_id)
      .get
      .go
end

#retrieve_jwt_public_keysFusionAuth::ClientResponse

Retrieves all Public Keys configured for verifying JSON Web Tokens (JWT).

Returns:



2864
2865
2866
2867
2868
# File 'lib/fusionauth/fusionauth_client.rb', line 2864

def retrieve_jwt_public_keys
  startAnonymous.uri('/api/jwt/public-key')
      .get
      .go
end

#retrieve_key(key_id) ⇒ FusionAuth::ClientResponse

Retrieves the key for the given Id.

Parameters:

  • key_id (string)

    The Id of the key.

Returns:



2885
2886
2887
2888
2889
2890
# File 'lib/fusionauth/fusionauth_client.rb', line 2885

def retrieve_key(key_id)
  start.uri('/api/key')
      .url_segment(key_id)
      .get
      .go
end

#retrieve_keysFusionAuth::ClientResponse

Retrieves all the keys.

Returns:



2896
2897
2898
2899
2900
# File 'lib/fusionauth/fusionauth_client.rb', line 2896

def retrieve_keys
  start.uri('/api/key')
      .get
      .go
end

#retrieve_lambda(lambda_id) ⇒ FusionAuth::ClientResponse

Retrieves the lambda for the given Id.

Parameters:

  • lambda_id (string)

    The Id of the lambda.

Returns:



2907
2908
2909
2910
2911
2912
# File 'lib/fusionauth/fusionauth_client.rb', line 2907

def retrieve_lambda(lambda_id)
  start.uri('/api/lambda')
      .url_segment(lambda_id)
      .get
      .go
end

#retrieve_lambdasFusionAuth::ClientResponse

Retrieves all the lambdas.

Returns:



2918
2919
2920
2921
2922
# File 'lib/fusionauth/fusionauth_client.rb', line 2918

def retrieve_lambdas
  start.uri('/api/lambda')
      .get
      .go
end

#retrieve_lambdas_by_type(type) ⇒ FusionAuth::ClientResponse

Retrieves all the lambdas for the provided type.

Parameters:

  • type (string)

    The type of the lambda to return.

Returns:



2929
2930
2931
2932
2933
2934
# File 'lib/fusionauth/fusionauth_client.rb', line 2929

def retrieve_lambdas_by_type(type)
  start.uri('/api/lambda')
      .url_parameter('type', type)
      .get
      .go
end

#retrieve_login_report(application_id, start, _end) ⇒ FusionAuth::ClientResponse

Retrieves the login report between the two instants. If you specify an application Id, it will only return the login counts for that application.

Parameters:

  • application_id (string)

    (Optional) The application Id.

  • start (OpenStruct, Hash)

    The start instant as UTC milliseconds since Epoch.

  • _end (OpenStruct, Hash)

    The end instant as UTC milliseconds since Epoch.

Returns:



2944
2945
2946
2947
2948
2949
2950
2951
# File 'lib/fusionauth/fusionauth_client.rb', line 2944

def (application_id, start, _end)
  start.uri('/api/report/login')
      .url_parameter('applicationId', application_id)
      .url_parameter('start', start)
      .url_parameter('end', _end)
      .get
      .go
end

#retrieve_message_template(message_template_id) ⇒ FusionAuth::ClientResponse

Retrieves the message template for the given Id. If you don’t specify the Id, this will return all the message templates.

Parameters:

  • message_template_id (string)

    (Optional) The Id of the message template.

Returns:



2958
2959
2960
2961
2962
2963
# File 'lib/fusionauth/fusionauth_client.rb', line 2958

def retrieve_message_template(message_template_id)
  start.uri('/api/message/template')
      .url_segment(message_template_id)
      .get
      .go
end

#retrieve_message_template_preview(request) ⇒ FusionAuth::ClientResponse

Creates a preview of the message template provided in the request, normalized to a given locale.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains the email template and optionally a locale to render it in.

Returns:



2970
2971
2972
2973
2974
2975
# File 'lib/fusionauth/fusionauth_client.rb', line 2970

def retrieve_message_template_preview(request)
  start.uri('/api/message/template/preview')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#retrieve_message_templatesFusionAuth::ClientResponse

Retrieves all the message templates.

Returns:



2981
2982
2983
2984
2985
# File 'lib/fusionauth/fusionauth_client.rb', line 2981

def retrieve_message_templates
  start.uri('/api/message/template')
      .get
      .go
end

#retrieve_messenger(messenger_id) ⇒ FusionAuth::ClientResponse

Retrieves the messenger with the given Id.

Parameters:

  • messenger_id (string)

    The Id of the messenger.

Returns:



2992
2993
2994
2995
2996
2997
# File 'lib/fusionauth/fusionauth_client.rb', line 2992

def retrieve_messenger(messenger_id)
  start.uri('/api/messenger')
      .url_segment(messenger_id)
      .get
      .go
end

#retrieve_messengersFusionAuth::ClientResponse

Retrieves all the messengers.

Returns:



3003
3004
3005
3006
3007
# File 'lib/fusionauth/fusionauth_client.rb', line 3003

def retrieve_messengers
  start.uri('/api/messenger')
      .get
      .go
end

#retrieve_monthly_active_report(application_id, start, _end) ⇒ FusionAuth::ClientResponse

Retrieves the monthly active user report between the two instants. If you specify an application Id, it will only return the monthly active counts for that application.

Parameters:

  • application_id (string)

    (Optional) The application Id.

  • start (OpenStruct, Hash)

    The start instant as UTC milliseconds since Epoch.

  • _end (OpenStruct, Hash)

    The end instant as UTC milliseconds since Epoch.

Returns:



3017
3018
3019
3020
3021
3022
3023
3024
# File 'lib/fusionauth/fusionauth_client.rb', line 3017

def retrieve_monthly_active_report(application_id, start, _end)
  start.uri('/api/report/monthly-active-user')
      .url_parameter('applicationId', application_id)
      .url_parameter('start', start)
      .url_parameter('end', _end)
      .get
      .go
end

#retrieve_o_auth_scope(application_id, scope_id) ⇒ FusionAuth::ClientResponse

Retrieves a custom OAuth scope.

Parameters:

  • application_id (string)

    The Id of the application that the OAuth scope belongs to.

  • scope_id (string)

    The Id of the OAuth scope to retrieve.

Returns:



3032
3033
3034
3035
3036
3037
3038
3039
# File 'lib/fusionauth/fusionauth_client.rb', line 3032

def retrieve_o_auth_scope(application_id, scope_id)
  start.uri('/api/application')
      .url_segment(application_id)
      .url_segment("scope")
      .url_segment(scope_id)
      .get
      .go
end

#retrieve_oauth_configuration(application_id) ⇒ FusionAuth::ClientResponse

Retrieves the Oauth2 configuration for the application for the given Application Id.

Parameters:

  • application_id (string)

    The Id of the Application to retrieve OAuth configuration.

Returns:



3046
3047
3048
3049
3050
3051
3052
# File 'lib/fusionauth/fusionauth_client.rb', line 3046

def retrieve_oauth_configuration(application_id)
  start.uri('/api/application')
      .url_segment(application_id)
      .url_segment("oauth-configuration")
      .get
      .go
end

#retrieve_open_id_configurationFusionAuth::ClientResponse

Returns the well known OpenID Configuration JSON document

Returns:



3058
3059
3060
3061
3062
# File 'lib/fusionauth/fusionauth_client.rb', line 3058

def retrieve_open_id_configuration
  startAnonymous.uri('/.well-known/openid-configuration')
      .get
      .go
end

#retrieve_password_validation_rulesFusionAuth::ClientResponse

Retrieves the password validation rules for a specific tenant. This method requires a tenantId to be provided through the use of a Tenant scoped API key or an HTTP header X-FusionAuth-TenantId to specify the Tenant Id.

This API does not require an API key.

Returns:



3071
3072
3073
3074
3075
# File 'lib/fusionauth/fusionauth_client.rb', line 3071

def retrieve_password_validation_rules
  startAnonymous.uri('/api/tenant/password-validation-rules')
      .get
      .go
end

#retrieve_password_validation_rules_with_tenant_id(tenant_id) ⇒ FusionAuth::ClientResponse

Retrieves the password validation rules for a specific tenant.

This API does not require an API key.

Parameters:

  • tenant_id (string)

    The Id of the tenant.

Returns:



3084
3085
3086
3087
3088
3089
# File 'lib/fusionauth/fusionauth_client.rb', line 3084

def retrieve_password_validation_rules_with_tenant_id(tenant_id)
  startAnonymous.uri('/api/tenant/password-validation-rules')
      .url_segment(tenant_id)
      .get
      .go
end

#retrieve_pending_children(parent_email) ⇒ FusionAuth::ClientResponse

Retrieves all the children for the given parent email address.

Parameters:

  • parent_email (string)

    The email of the parent.

Returns:



3096
3097
3098
3099
3100
3101
# File 'lib/fusionauth/fusionauth_client.rb', line 3096

def retrieve_pending_children(parent_email)
  start.uri('/api/user/family/pending')
      .url_parameter('parentEmail', parent_email)
      .get
      .go
end

Retrieve a pending identity provider link. This is useful to validate a pending link and retrieve meta-data about the identity provider link.

Parameters:

  • p_ending_link_id (string)

    The pending link Id.

  • user_id (string)

    The optional userId. When provided additional meta-data will be provided to identify how many links if any the user already has.

Returns:



3109
3110
3111
3112
3113
3114
3115
# File 'lib/fusionauth/fusionauth_client.rb', line 3109

def retrieve_pending_link(pending_link_id, user_id)
  start.uri('/api/identity-provider/link/pending')
      .url_segment(pending_link_id)
      .url_parameter('userId', user_id)
      .get
      .go
end

#retrieve_reactor_metricsFusionAuth::ClientResponse

Retrieves the FusionAuth Reactor metrics.

Returns:



3121
3122
3123
3124
3125
# File 'lib/fusionauth/fusionauth_client.rb', line 3121

def retrieve_reactor_metrics
  start.uri('/api/reactor/metrics')
      .get
      .go
end

#retrieve_reactor_statusFusionAuth::ClientResponse

Retrieves the FusionAuth Reactor status.

Returns:



3131
3132
3133
3134
3135
# File 'lib/fusionauth/fusionauth_client.rb', line 3131

def retrieve_reactor_status
  start.uri('/api/reactor')
      .get
      .go
end

#retrieve_recent_logins(offset, limit) ⇒ FusionAuth::ClientResponse

Retrieves the last number of login records.

Parameters:

  • offset (Numeric)

    The initial record. e.g. 0 is the last login, 100 will be the 100th most recent login.

  • limit (Numeric)

    (Optional, defaults to 10) The number of records to retrieve.

Returns:



3143
3144
3145
3146
3147
3148
3149
# File 'lib/fusionauth/fusionauth_client.rb', line 3143

def retrieve_recent_logins(offset, limit)
  start.uri('/api/user/recent-login')
      .url_parameter('offset', offset)
      .url_parameter('limit', limit)
      .get
      .go
end

#retrieve_refresh_token_by_id(token_id) ⇒ FusionAuth::ClientResponse

Retrieves a single refresh token by unique Id. This is not the same thing as the string value of the refresh token. If you have that, you already have what you need.

Parameters:

  • token_id (string)

    The Id of the token.

Returns:



3156
3157
3158
3159
3160
3161
# File 'lib/fusionauth/fusionauth_client.rb', line 3156

def retrieve_refresh_token_by_id(token_id)
  start.uri('/api/jwt/refresh')
      .url_segment(token_id)
      .get
      .go
end

#retrieve_refresh_tokens(user_id) ⇒ FusionAuth::ClientResponse

Retrieves the refresh tokens that belong to the user with the given Id.

Parameters:

  • user_id (string)

    The Id of the user.

Returns:



3168
3169
3170
3171
3172
3173
# File 'lib/fusionauth/fusionauth_client.rb', line 3168

def retrieve_refresh_tokens(user_id)
  start.uri('/api/jwt/refresh')
      .url_parameter('userId', user_id)
      .get
      .go
end

#retrieve_registration(user_id, application_id) ⇒ FusionAuth::ClientResponse

Retrieves the user registration for the user with the given Id and the given application Id.

Parameters:

  • user_id (string)

    The Id of the user.

  • application_id (string)

    The Id of the application.

Returns:



3181
3182
3183
3184
3185
3186
3187
# File 'lib/fusionauth/fusionauth_client.rb', line 3181

def retrieve_registration(user_id, application_id)
  start.uri('/api/user/registration')
      .url_segment(user_id)
      .url_segment(application_id)
      .get
      .go
end

#retrieve_registration_report(application_id, start, _end) ⇒ FusionAuth::ClientResponse

Retrieves the registration report between the two instants. If you specify an application Id, it will only return the registration counts for that application.

Parameters:

  • application_id (string)

    (Optional) The application Id.

  • start (OpenStruct, Hash)

    The start instant as UTC milliseconds since Epoch.

  • _end (OpenStruct, Hash)

    The end instant as UTC milliseconds since Epoch.

Returns:



3197
3198
3199
3200
3201
3202
3203
3204
# File 'lib/fusionauth/fusionauth_client.rb', line 3197

def retrieve_registration_report(application_id, start, _end)
  start.uri('/api/report/registration')
      .url_parameter('applicationId', application_id)
      .url_parameter('start', start)
      .url_parameter('end', _end)
      .get
      .go
end

#retrieve_reindex_statusFusionAuth::ClientResponse

Retrieve the status of a re-index process. A status code of 200 indicates the re-index is in progress, a status code of

404 indicates no re-index is in progress.

Returns:



3211
3212
3213
3214
3215
# File 'lib/fusionauth/fusionauth_client.rb', line 3211

def retrieve_reindex_status
  start.uri('/api/system/reindex')
      .get
      .go
end

#retrieve_system_configurationFusionAuth::ClientResponse

Retrieves the system configuration.

Returns:



3221
3222
3223
3224
3225
# File 'lib/fusionauth/fusionauth_client.rb', line 3221

def retrieve_system_configuration
  start.uri('/api/system-configuration')
      .get
      .go
end

#retrieve_system_healthFusionAuth::ClientResponse

Retrieves the FusionAuth system health. This API will return 200 if the system is healthy, and 500 if the system is un-healthy.

Returns:



3231
3232
3233
3234
3235
# File 'lib/fusionauth/fusionauth_client.rb', line 3231

def retrieve_system_health
  startAnonymous.uri('/api/health')
      .get
      .go
end

#retrieve_system_statusFusionAuth::ClientResponse

Retrieves the FusionAuth system status. This request is anonymous and does not require an API key. When an API key is not provided the response will contain a single value in the JSON response indicating the current health check.

Returns:



3241
3242
3243
3244
3245
# File 'lib/fusionauth/fusionauth_client.rb', line 3241

def retrieve_system_status
  startAnonymous.uri('/api/status')
      .get
      .go
end

#retrieve_system_status_using_api_keyFusionAuth::ClientResponse

Retrieves the FusionAuth system status using an API key. Using an API key will cause the response to include the product version, health checks and various runtime metrics.

Returns:



3251
3252
3253
3254
3255
# File 'lib/fusionauth/fusionauth_client.rb', line 3251

def retrieve_system_status_using_api_key
  start.uri('/api/status')
      .get
      .go
end

#retrieve_tenant(tenant_id) ⇒ FusionAuth::ClientResponse

Retrieves the tenant for the given Id.

Parameters:

  • tenant_id (string)

    The Id of the tenant.

Returns:



3262
3263
3264
3265
3266
3267
# File 'lib/fusionauth/fusionauth_client.rb', line 3262

def retrieve_tenant(tenant_id)
  start.uri('/api/tenant')
      .url_segment(tenant_id)
      .get
      .go
end

#retrieve_tenantsFusionAuth::ClientResponse

Retrieves all the tenants.

Returns:



3273
3274
3275
3276
3277
# File 'lib/fusionauth/fusionauth_client.rb', line 3273

def retrieve_tenants
  start.uri('/api/tenant')
      .get
      .go
end

#retrieve_theme(theme_id) ⇒ FusionAuth::ClientResponse

Retrieves the theme for the given Id.

Parameters:

  • theme_id (string)

    The Id of the theme.

Returns:



3284
3285
3286
3287
3288
3289
# File 'lib/fusionauth/fusionauth_client.rb', line 3284

def retrieve_theme(theme_id)
  start.uri('/api/theme')
      .url_segment(theme_id)
      .get
      .go
end

#retrieve_themesFusionAuth::ClientResponse

Retrieves all the themes.

Returns:



3295
3296
3297
3298
3299
# File 'lib/fusionauth/fusionauth_client.rb', line 3295

def retrieve_themes
  start.uri('/api/theme')
      .get
      .go
end

#retrieve_total_reportFusionAuth::ClientResponse

Retrieves the totals report. This contains all the total counts for each application and the global registration count.

Returns:



3306
3307
3308
3309
3310
# File 'lib/fusionauth/fusionauth_client.rb', line 3306

def retrieve_total_report
  start.uri('/api/report/totals')
      .get
      .go
end

#retrieve_two_factor_recovery_codes(user_id) ⇒ FusionAuth::ClientResponse

Retrieve two-factor recovery codes for a user.

Parameters:

  • user_id (string)

    The Id of the user to retrieve Two Factor recovery codes.

Returns:



3317
3318
3319
3320
3321
3322
# File 'lib/fusionauth/fusionauth_client.rb', line 3317

def retrieve_two_factor_recovery_codes(user_id)
  start.uri('/api/user/two-factor/recovery-code')
      .url_segment(user_id)
      .get
      .go
end

#retrieve_two_factor_status(user_id, application_id, two_factor_trust_id) ⇒ FusionAuth::ClientResponse

Retrieve a user’s two-factor status.

This can be used to see if a user will need to complete a two-factor challenge to complete a login, and optionally identify the state of the two-factor trust across various applications.

Parameters:

  • user_id (string)

    The user Id to retrieve the Two-Factor status.

  • application_id (string)

    The optional applicationId to verify.

  • two_factor_trust_id (string)

    The optional two-factor trust Id to verify.

Returns:



3334
3335
3336
3337
3338
3339
3340
3341
# File 'lib/fusionauth/fusionauth_client.rb', line 3334

def retrieve_two_factor_status(user_id, application_id, two_factor_trust_id)
  start.uri('/api/two-factor/status')
      .url_parameter('userId', user_id)
      .url_parameter('applicationId', application_id)
      .url_segment(two_factor_trust_id)
      .get
      .go
end

#retrieve_user(user_id) ⇒ FusionAuth::ClientResponse

Retrieves the user for the given Id.

Parameters:

  • user_id (string)

    The Id of the user.

Returns:



3348
3349
3350
3351
3352
3353
# File 'lib/fusionauth/fusionauth_client.rb', line 3348

def retrieve_user(user_id)
  start.uri('/api/user')
      .url_segment(user_id)
      .get
      .go
end

#retrieve_user_action(user_action_id) ⇒ FusionAuth::ClientResponse

Retrieves the user action for the given Id. If you pass in null for the Id, this will return all the user actions.

Parameters:

  • user_action_id (string)

    (Optional) The Id of the user action.

Returns:



3361
3362
3363
3364
3365
3366
# File 'lib/fusionauth/fusionauth_client.rb', line 3361

def retrieve_user_action(user_action_id)
  start.uri('/api/user-action')
      .url_segment(user_action_id)
      .get
      .go
end

#retrieve_user_action_reason(user_action_reason_id) ⇒ FusionAuth::ClientResponse

Retrieves the user action reason for the given Id. If you pass in null for the Id, this will return all the user action reasons.

Parameters:

  • user_action_reason_id (string)

    (Optional) The Id of the user action reason.

Returns:



3374
3375
3376
3377
3378
3379
# File 'lib/fusionauth/fusionauth_client.rb', line 3374

def retrieve_user_action_reason(user_action_reason_id)
  start.uri('/api/user-action-reason')
      .url_segment(user_action_reason_id)
      .get
      .go
end

#retrieve_user_action_reasonsFusionAuth::ClientResponse

Retrieves all the user action reasons.

Returns:



3385
3386
3387
3388
3389
# File 'lib/fusionauth/fusionauth_client.rb', line 3385

def retrieve_user_action_reasons
  start.uri('/api/user-action-reason')
      .get
      .go
end

#retrieve_user_actionsFusionAuth::ClientResponse

Retrieves all the user actions.

Returns:



3395
3396
3397
3398
3399
# File 'lib/fusionauth/fusionauth_client.rb', line 3395

def 
  start.uri('/api/user-action')
      .get
      .go
end

#retrieve_user_by_change_password_id(change_password_id) ⇒ FusionAuth::ClientResponse

Retrieves the user by a change password Id. The intended use of this API is to retrieve a user after the forgot password workflow has been initiated and you may not know the user’s email or username.

Parameters:

  • change_password_id (string)

    The unique change password Id that was sent via email or returned by the Forgot Password API.

Returns:



3407
3408
3409
3410
3411
3412
# File 'lib/fusionauth/fusionauth_client.rb', line 3407

def retrieve_user_by_change_password_id(change_password_id)
  start.uri('/api/user')
      .url_parameter('changePasswordId', change_password_id)
      .get
      .go
end

#retrieve_user_by_email(email) ⇒ FusionAuth::ClientResponse

Retrieves the user for the given email.

Parameters:

  • email (string)

    The email of the user.

Returns:



3419
3420
3421
3422
3423
3424
# File 'lib/fusionauth/fusionauth_client.rb', line 3419

def retrieve_user_by_email(email)
  start.uri('/api/user')
      .url_parameter('email', email)
      .get
      .go
end

#retrieve_user_by_login_id(login_id) ⇒ FusionAuth::ClientResponse

Retrieves the user for the loginId. The loginId can be either the username or the email.

Parameters:

  • login_id (string)

    The email or username of the user.

Returns:



3431
3432
3433
3434
3435
3436
# File 'lib/fusionauth/fusionauth_client.rb', line 3431

def ()
  start.uri('/api/user')
      .url_parameter('loginId', )
      .get
      .go
end

#retrieve_user_by_login_id_with_login_id_types(login_id, login_id_types) ⇒ FusionAuth::ClientResponse

Retrieves the user for the loginId, using specific loginIdTypes.

Parameters:

  • login_id (string)

    The email or username of the user.

  • login_id_types (Array)

    The identity types that FusionAuth will compare the loginId to.

Returns:



3444
3445
3446
3447
3448
3449
3450
# File 'lib/fusionauth/fusionauth_client.rb', line 3444

def (, )
  start.uri('/api/user')
      .url_parameter('loginId', )
      .url_parameter('loginIdTypes', )
      .get
      .go
end

#retrieve_user_by_username(username) ⇒ FusionAuth::ClientResponse

Retrieves the user for the given username.

Parameters:

  • username (string)

    The username of the user.

Returns:



3457
3458
3459
3460
3461
3462
# File 'lib/fusionauth/fusionauth_client.rb', line 3457

def retrieve_user_by_username(username)
  start.uri('/api/user')
      .url_parameter('username', username)
      .get
      .go
end

#retrieve_user_by_verification_id(verification_id) ⇒ FusionAuth::ClientResponse

Retrieves the user by a verificationId. The intended use of this API is to retrieve a user after the forgot password workflow has been initiated and you may not know the user’s email or username.

Parameters:

  • verification_id (string)

    The unique verification Id that has been set on the user object.

Returns:



3470
3471
3472
3473
3474
3475
# File 'lib/fusionauth/fusionauth_client.rb', line 3470

def retrieve_user_by_verification_id(verification_id)
  start.uri('/api/user')
      .url_parameter('verificationId', verification_id)
      .get
      .go
end

#retrieve_user_code(client_id, client_secret, user_code) ⇒ FusionAuth::ClientResponse

Retrieve a user_code that is part of an in-progress Device Authorization Grant.

This API is useful if you want to build your own login workflow to complete a device grant.

Parameters:

  • client_id (string)

    The client Id.

  • client_secret (string)

    The client Id.

  • user_code (string)

    The end-user verification code.

Returns:



3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
# File 'lib/fusionauth/fusionauth_client.rb', line 3486

def retrieve_user_code(client_id, client_secret, user_code)
  body = {
    "client_id" => client_id,
    "client_secret" => client_secret,
    "user_code" => user_code
  }
  startAnonymous.uri('/oauth2/device/user-code')
      .body_handler(FusionAuth::FormDataBodyHandler.new(body))
      .get
      .go
end

#retrieve_user_code_using_api_key(user_code) ⇒ FusionAuth::ClientResponse

Retrieve a user_code that is part of an in-progress Device Authorization Grant.

This API is useful if you want to build your own login workflow to complete a device grant.

This request will require an API key.

Parameters:

  • user_code (string)

    The end-user verification code.

Returns:



3507
3508
3509
3510
3511
3512
3513
3514
3515
# File 'lib/fusionauth/fusionauth_client.rb', line 3507

def retrieve_user_code_using_api_key(user_code)
  body = {
    "user_code" => user_code
  }
  startAnonymous.uri('/oauth2/device/user-code')
      .body_handler(FusionAuth::FormDataBodyHandler.new(body))
      .get
      .go
end

#retrieve_user_comments(user_id) ⇒ FusionAuth::ClientResponse

Retrieves all the comments for the user with the given Id.

Parameters:

  • user_id (string)

    The Id of the user.

Returns:



3522
3523
3524
3525
3526
3527
# File 'lib/fusionauth/fusionauth_client.rb', line 3522

def retrieve_user_comments(user_id)
  start.uri('/api/user/comment')
      .url_segment(user_id)
      .get
      .go
end

Retrieve a single User consent by Id.

Parameters:

  • user_consent_id (string)

    The User consent Id

Returns:



3534
3535
3536
3537
3538
3539
# File 'lib/fusionauth/fusionauth_client.rb', line 3534

def retrieve_user_consent(user_consent_id)
  start.uri('/api/user/consent')
      .url_segment(user_consent_id)
      .get
      .go
end

#retrieve_user_consents(user_id) ⇒ FusionAuth::ClientResponse

Retrieves all the consents for a User.

Parameters:

  • user_id (string)

    The User’s Id

Returns:



3546
3547
3548
3549
3550
3551
# File 'lib/fusionauth/fusionauth_client.rb', line 3546

def retrieve_user_consents(user_id)
  start.uri('/api/user/consent')
      .url_parameter('userId', user_id)
      .get
      .go
end

#retrieve_user_info_from_access_token(encoded_jwt) ⇒ FusionAuth::ClientResponse

Call the UserInfo endpoint to retrieve User Claims from the access token issued by FusionAuth.

Parameters:

  • encoded_jwt (string)

    The encoded JWT (access token).

Returns:



3558
3559
3560
3561
3562
3563
# File 'lib/fusionauth/fusionauth_client.rb', line 3558

def (encoded_jwt)
  startAnonymous.uri('/oauth2/userinfo')
      .authorization('Bearer ' + encoded_jwt)
      .get
      .go
end

Retrieve a single Identity Provider user (link).

Parameters:

  • identity_provider_id (string)

    The unique Id of the identity provider.

  • identity_provider_user_id (string)

    The unique Id of the user in the 3rd party identity provider.

  • user_id (string)

    The unique Id of the FusionAuth user.

Returns:



3572
3573
3574
3575
3576
3577
3578
3579
# File 'lib/fusionauth/fusionauth_client.rb', line 3572

def retrieve_user_link(identity_provider_id, identity_provider_user_id, user_id)
  start.uri('/api/identity-provider/link')
      .url_parameter('identityProviderId', identity_provider_id)
      .url_parameter('identityProviderUserId', identity_provider_user_id)
      .url_parameter('userId', user_id)
      .get
      .go
end

Retrieve all Identity Provider users (links) for the user. Specify the optional identityProviderId to retrieve links for a particular IdP.

Parameters:

  • identity_provider_id (string)

    (Optional) The unique Id of the identity provider. Specify this value to reduce the links returned to those for a particular IdP.

  • user_id (string)

    The unique Id of the user.

Returns:



3587
3588
3589
3590
3591
3592
3593
# File 'lib/fusionauth/fusionauth_client.rb', line 3587

def retrieve_user_links_by_user_id(identity_provider_id, user_id)
  start.uri('/api/identity-provider/link')
      .url_parameter('identityProviderId', identity_provider_id)
      .url_parameter('userId', user_id)
      .get
      .go
end

#retrieve_user_login_report(application_id, user_id, start, _end) ⇒ FusionAuth::ClientResponse

Retrieves the login report between the two instants for a particular user by Id. If you specify an application Id, it will only return the login counts for that application.

Parameters:

  • application_id (string)

    (Optional) The application Id.

  • user_id (string)

    The userId Id.

  • start (OpenStruct, Hash)

    The start instant as UTC milliseconds since Epoch.

  • _end (OpenStruct, Hash)

    The end instant as UTC milliseconds since Epoch.

Returns:



3604
3605
3606
3607
3608
3609
3610
3611
3612
# File 'lib/fusionauth/fusionauth_client.rb', line 3604

def (application_id, user_id, start, _end)
  start.uri('/api/report/login')
      .url_parameter('applicationId', application_id)
      .url_parameter('userId', user_id)
      .url_parameter('start', start)
      .url_parameter('end', _end)
      .get
      .go
end

#retrieve_user_login_report_by_login_id(application_id, login_id, start, _end) ⇒ FusionAuth::ClientResponse

Retrieves the login report between the two instants for a particular user by login Id. If you specify an application Id, it will only return the login counts for that application.

Parameters:

  • application_id (string)

    (Optional) The application Id.

  • login_id (string)

    The userId Id.

  • start (OpenStruct, Hash)

    The start instant as UTC milliseconds since Epoch.

  • _end (OpenStruct, Hash)

    The end instant as UTC milliseconds since Epoch.

Returns:



3623
3624
3625
3626
3627
3628
3629
3630
3631
# File 'lib/fusionauth/fusionauth_client.rb', line 3623

def (application_id, , start, _end)
  start.uri('/api/report/login')
      .url_parameter('applicationId', application_id)
      .url_parameter('loginId', )
      .url_parameter('start', start)
      .url_parameter('end', _end)
      .get
      .go
end

#retrieve_user_login_report_by_login_id_and_login_id_types(application_id, login_id, start, _end, login_id_types) ⇒ FusionAuth::ClientResponse

Retrieves the login report between the two instants for a particular user by login Id, using specific loginIdTypes. If you specify an application id, it will only return the login counts for that application.

Parameters:

  • application_id (string)

    (Optional) The application id.

  • login_id (string)

    The userId id.

  • start (OpenStruct, Hash)

    The start instant as UTC milliseconds since Epoch.

  • _end (OpenStruct, Hash)

    The end instant as UTC milliseconds since Epoch.

  • login_id_types (Array)

    The identity types that FusionAuth will compare the loginId to.

Returns:



3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
# File 'lib/fusionauth/fusionauth_client.rb', line 3643

def (application_id, , start, _end, )
  start.uri('/api/report/login')
      .url_parameter('applicationId', application_id)
      .url_parameter('loginId', )
      .url_parameter('start', start)
      .url_parameter('end', _end)
      .url_parameter('loginIdTypes', )
      .get
      .go
end

#retrieve_user_recent_logins(user_id, offset, limit) ⇒ FusionAuth::ClientResponse

Retrieves the last number of login records for a user.

Parameters:

  • user_id (string)

    The Id of the user.

  • offset (Numeric)

    The initial record. e.g. 0 is the last login, 100 will be the 100th most recent login.

  • limit (Numeric)

    (Optional, defaults to 10) The number of records to retrieve.

Returns:



3661
3662
3663
3664
3665
3666
3667
3668
# File 'lib/fusionauth/fusionauth_client.rb', line 3661

def retrieve_user_recent_logins(user_id, offset, limit)
  start.uri('/api/user/recent-login')
      .url_parameter('userId', user_id)
      .url_parameter('offset', offset)
      .url_parameter('limit', limit)
      .get
      .go
end

#retrieve_user_using_jwt(encoded_jwt) ⇒ FusionAuth::ClientResponse

Retrieves the user for the given Id. This method does not use an API key, instead it uses a JSON Web Token (JWT) for authentication.

Parameters:

  • encoded_jwt (string)

    The encoded JWT (access token).

Returns:



3675
3676
3677
3678
3679
3680
# File 'lib/fusionauth/fusionauth_client.rb', line 3675

def retrieve_user_using_jwt(encoded_jwt)
  startAnonymous.uri('/api/user')
      .authorization('Bearer ' + encoded_jwt)
      .get
      .go
end

#retrieve_versionFusionAuth::ClientResponse

Retrieves the FusionAuth version string.

Returns:



3686
3687
3688
3689
3690
# File 'lib/fusionauth/fusionauth_client.rb', line 3686

def retrieve_version
  start.uri('/api/system/version')
      .get
      .go
end

#retrieve_web_authn_credential(id) ⇒ FusionAuth::ClientResponse

Retrieves the WebAuthn credential for the given Id.

Parameters:

  • id (string)

    The Id of the WebAuthn credential.

Returns:



3697
3698
3699
3700
3701
3702
# File 'lib/fusionauth/fusionauth_client.rb', line 3697

def retrieve_web_authn_credential(id)
  start.uri('/api/webauthn')
      .url_segment(id)
      .get
      .go
end

#retrieve_web_authn_credentials_for_user(user_id) ⇒ FusionAuth::ClientResponse

Retrieves all WebAuthn credentials for the given user.

Parameters:

  • user_id (string)

    The user’s ID.

Returns:



3709
3710
3711
3712
3713
3714
# File 'lib/fusionauth/fusionauth_client.rb', line 3709

def retrieve_web_authn_credentials_for_user(user_id)
  start.uri('/api/webauthn')
      .url_parameter('userId', user_id)
      .get
      .go
end

#retrieve_webhook(webhook_id) ⇒ FusionAuth::ClientResponse

Retrieves the webhook for the given Id. If you pass in null for the Id, this will return all the webhooks.

Parameters:

  • webhook_id (string)

    (Optional) The Id of the webhook.

Returns:



3721
3722
3723
3724
3725
3726
# File 'lib/fusionauth/fusionauth_client.rb', line 3721

def retrieve_webhook(webhook_id)
  start.uri('/api/webhook')
      .url_segment(webhook_id)
      .get
      .go
end

#retrieve_webhook_attempt_log(webhook_attempt_log_id) ⇒ FusionAuth::ClientResponse

Retrieves a single webhook attempt log for the given Id.

Parameters:

  • webhook_attempt_log_id (string)

    The Id of the webhook attempt log to retrieve.

Returns:



3733
3734
3735
3736
3737
3738
# File 'lib/fusionauth/fusionauth_client.rb', line 3733

def retrieve_webhook_attempt_log(webhook_attempt_log_id)
  start.uri('/api/system/webhook-attempt-log')
      .url_segment(webhook_attempt_log_id)
      .get
      .go
end

#retrieve_webhook_event_log(webhook_event_log_id) ⇒ FusionAuth::ClientResponse

Retrieves a single webhook event log for the given Id.

Parameters:

  • webhook_event_log_id (string)

    The Id of the webhook event log to retrieve.

Returns:



3745
3746
3747
3748
3749
3750
# File 'lib/fusionauth/fusionauth_client.rb', line 3745

def retrieve_webhook_event_log(webhook_event_log_id)
  start.uri('/api/system/webhook-event-log')
      .url_segment(webhook_event_log_id)
      .get
      .go
end

#retrieve_webhooksFusionAuth::ClientResponse

Retrieves all the webhooks.

Returns:



3756
3757
3758
3759
3760
# File 'lib/fusionauth/fusionauth_client.rb', line 3756

def retrieve_webhooks
  start.uri('/api/webhook')
      .get
      .go
end

#revoke_refresh_token(token, user_id, application_id) ⇒ FusionAuth::ClientResponse

Revokes refresh tokens.

Usage examples:

- Delete a single refresh token, pass in only the token.
    revokeRefreshToken(token)

- Delete all refresh tokens for a user, pass in only the userId.
    revokeRefreshToken(null, userId)

- Delete all refresh tokens for a user for a specific application, pass in both the userId and the applicationId.
    revokeRefreshToken(null, userId, applicationId)

- Delete all refresh tokens for an application
    revokeRefreshToken(null, null, applicationId)

Note: null may be handled differently depending upon the programming language.

See also: (method names may vary by language… but you’ll figure it out)

- revokeRefreshTokenById
- revokeRefreshTokenByToken
- revokeRefreshTokensByUserId
- revokeRefreshTokensByApplicationId
- revokeRefreshTokensByUserIdForApplication

Parameters:

  • token (string)

    (Optional) The refresh token to delete.

  • user_id (string)

    (Optional) The user Id whose tokens to delete.

  • application_id (string)

    (Optional) The application Id of the tokens to delete.

Returns:



3792
3793
3794
3795
3796
3797
3798
3799
# File 'lib/fusionauth/fusionauth_client.rb', line 3792

def revoke_refresh_token(token, user_id, application_id)
  start.uri('/api/jwt/refresh')
      .url_parameter('token', token)
      .url_parameter('userId', user_id)
      .url_parameter('applicationId', application_id)
      .delete
      .go
end

#revoke_refresh_token_by_id(token_id) ⇒ FusionAuth::ClientResponse

Revokes a single refresh token by the unique Id. The unique Id is not sensitive as it cannot be used to obtain another JWT.

Parameters:

  • token_id (string)

    The unique Id of the token to delete.

Returns:



3806
3807
3808
3809
3810
3811
# File 'lib/fusionauth/fusionauth_client.rb', line 3806

def revoke_refresh_token_by_id(token_id)
  start.uri('/api/jwt/refresh')
      .url_segment(token_id)
      .delete
      .go
end

#revoke_refresh_token_by_token(token) ⇒ FusionAuth::ClientResponse

Revokes a single refresh token by using the actual refresh token value. This refresh token value is sensitive, so be careful with this API request.

Parameters:

  • token (string)

    The refresh token to delete.

Returns:



3818
3819
3820
3821
3822
3823
# File 'lib/fusionauth/fusionauth_client.rb', line 3818

def revoke_refresh_token_by_token(token)
  start.uri('/api/jwt/refresh')
      .url_parameter('token', token)
      .delete
      .go
end

#revoke_refresh_tokens_by_application_id(application_id) ⇒ FusionAuth::ClientResponse

Revoke all refresh tokens that belong to an application by applicationId.

Parameters:

  • application_id (string)

    The unique Id of the application that you want to delete all refresh tokens for.

Returns:



3830
3831
3832
3833
3834
3835
# File 'lib/fusionauth/fusionauth_client.rb', line 3830

def revoke_refresh_tokens_by_application_id(application_id)
  start.uri('/api/jwt/refresh')
      .url_parameter('applicationId', application_id)
      .delete
      .go
end

#revoke_refresh_tokens_by_user_id(user_id) ⇒ FusionAuth::ClientResponse

Revoke all refresh tokens that belong to a user by user Id.

Parameters:

  • user_id (string)

    The unique Id of the user that you want to delete all refresh tokens for.

Returns:



3842
3843
3844
3845
3846
3847
# File 'lib/fusionauth/fusionauth_client.rb', line 3842

def revoke_refresh_tokens_by_user_id(user_id)
  start.uri('/api/jwt/refresh')
      .url_parameter('userId', user_id)
      .delete
      .go
end

#revoke_refresh_tokens_by_user_id_for_application(user_id, application_id) ⇒ FusionAuth::ClientResponse

Revoke all refresh tokens that belong to a user by user Id for a specific application by applicationId.

Parameters:

  • user_id (string)

    The unique Id of the user that you want to delete all refresh tokens for.

  • application_id (string)

    The unique Id of the application that you want to delete refresh tokens for.

Returns:



3855
3856
3857
3858
3859
3860
3861
# File 'lib/fusionauth/fusionauth_client.rb', line 3855

def revoke_refresh_tokens_by_user_id_for_application(user_id, application_id)
  start.uri('/api/jwt/refresh')
      .url_parameter('userId', user_id)
      .url_parameter('applicationId', application_id)
      .delete
      .go
end

#revoke_refresh_tokens_with_request(request) ⇒ FusionAuth::ClientResponse

Revokes refresh tokens using the information in the JSON body. The handling for this method is the same as the revokeRefreshToken method and is based on the information you provide in the RefreshDeleteRequest object. See that method for additional information.

Parameters:

  • request (OpenStruct, Hash)

    The request information used to revoke the refresh tokens.

Returns:



3869
3870
3871
3872
3873
3874
# File 'lib/fusionauth/fusionauth_client.rb', line 3869

def revoke_refresh_tokens_with_request(request)
  start.uri('/api/jwt/refresh')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .delete
      .go
end

Revokes a single User consent by Id.

Parameters:

  • user_consent_id (string)

    The User Consent Id

Returns:



3881
3882
3883
3884
3885
3886
# File 'lib/fusionauth/fusionauth_client.rb', line 3881

def revoke_user_consent(user_consent_id)
  start.uri('/api/user/consent')
      .url_segment(user_consent_id)
      .delete
      .go
end

#search_applications(request) ⇒ FusionAuth::ClientResponse

Searches applications with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



3893
3894
3895
3896
3897
3898
# File 'lib/fusionauth/fusionauth_client.rb', line 3893

def search_applications(request)
  start.uri('/api/application/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_audit_logs(request) ⇒ FusionAuth::ClientResponse

Searches the audit logs with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



3905
3906
3907
3908
3909
3910
# File 'lib/fusionauth/fusionauth_client.rb', line 3905

def search_audit_logs(request)
  start.uri('/api/system/audit-log/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_consents(request) ⇒ FusionAuth::ClientResponse

Searches consents with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



3917
3918
3919
3920
3921
3922
# File 'lib/fusionauth/fusionauth_client.rb', line 3917

def search_consents(request)
  start.uri('/api/consent/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_email_templates(request) ⇒ FusionAuth::ClientResponse

Searches email templates with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



3929
3930
3931
3932
3933
3934
# File 'lib/fusionauth/fusionauth_client.rb', line 3929

def search_email_templates(request)
  start.uri('/api/email/template/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_entities(request) ⇒ FusionAuth::ClientResponse

Searches entities with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



3941
3942
3943
3944
3945
3946
# File 'lib/fusionauth/fusionauth_client.rb', line 3941

def search_entities(request)
  start.uri('/api/entity/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_entities_by_ids(ids) ⇒ FusionAuth::ClientResponse

Retrieves the entities for the given Ids. If any Id is invalid, it is ignored.

Parameters:

  • ids (Array)

    The entity ids to search for.

Returns:



3953
3954
3955
3956
3957
3958
# File 'lib/fusionauth/fusionauth_client.rb', line 3953

def search_entities_by_ids(ids)
  start.uri('/api/entity/search')
      .url_parameter('ids', ids)
      .get
      .go
end

#search_entity_grants(request) ⇒ FusionAuth::ClientResponse

Searches Entity Grants with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



3965
3966
3967
3968
3969
3970
# File 'lib/fusionauth/fusionauth_client.rb', line 3965

def search_entity_grants(request)
  start.uri('/api/entity/grant/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_entity_types(request) ⇒ FusionAuth::ClientResponse

Searches the entity types with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



3977
3978
3979
3980
3981
3982
# File 'lib/fusionauth/fusionauth_client.rb', line 3977

def search_entity_types(request)
  start.uri('/api/entity/type/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_event_logs(request) ⇒ FusionAuth::ClientResponse

Searches the event logs with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



3989
3990
3991
3992
3993
3994
# File 'lib/fusionauth/fusionauth_client.rb', line 3989

def search_event_logs(request)
  start.uri('/api/system/event-log/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_group_members(request) ⇒ FusionAuth::ClientResponse

Searches group members with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



4001
4002
4003
4004
4005
4006
# File 'lib/fusionauth/fusionauth_client.rb', line 4001

def search_group_members(request)
  start.uri('/api/group/member/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_groups(request) ⇒ FusionAuth::ClientResponse

Searches groups with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



4013
4014
4015
4016
4017
4018
# File 'lib/fusionauth/fusionauth_client.rb', line 4013

def search_groups(request)
  start.uri('/api/group/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_identity_providers(request) ⇒ FusionAuth::ClientResponse

Searches identity providers with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



4037
4038
4039
4040
4041
4042
# File 'lib/fusionauth/fusionauth_client.rb', line 4037

def search_identity_providers(request)
  start.uri('/api/identity-provider/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_ip_access_control_lists(request) ⇒ FusionAuth::ClientResponse

Searches the IP Access Control Lists with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



4025
4026
4027
4028
4029
4030
# File 'lib/fusionauth/fusionauth_client.rb', line 4025

def search_ip_access_control_lists(request)
  start.uri('/api/ip-acl/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_keys(request) ⇒ FusionAuth::ClientResponse

Searches keys with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



4049
4050
4051
4052
4053
4054
# File 'lib/fusionauth/fusionauth_client.rb', line 4049

def search_keys(request)
  start.uri('/api/key/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_lambdas(request) ⇒ FusionAuth::ClientResponse

Searches lambdas with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



4061
4062
4063
4064
4065
4066
# File 'lib/fusionauth/fusionauth_client.rb', line 4061

def search_lambdas(request)
  start.uri('/api/lambda/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_login_records(request) ⇒ FusionAuth::ClientResponse

Searches the login records with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



4073
4074
4075
4076
4077
4078
# File 'lib/fusionauth/fusionauth_client.rb', line 4073

def (request)
  start.uri('/api/system/login-record/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_tenants(request) ⇒ FusionAuth::ClientResponse

Searches tenants with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



4085
4086
4087
4088
4089
4090
# File 'lib/fusionauth/fusionauth_client.rb', line 4085

def search_tenants(request)
  start.uri('/api/tenant/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_themes(request) ⇒ FusionAuth::ClientResponse

Searches themes with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



4097
4098
4099
4100
4101
4102
# File 'lib/fusionauth/fusionauth_client.rb', line 4097

def search_themes(request)
  start.uri('/api/theme/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_user_comments(request) ⇒ FusionAuth::ClientResponse

Searches user comments with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



4109
4110
4111
4112
4113
4114
# File 'lib/fusionauth/fusionauth_client.rb', line 4109

def search_user_comments(request)
  start.uri('/api/user/comment/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_users(ids) ⇒ FusionAuth::ClientResponse

Deprecated.

This method has been renamed to search_users_by_ids, use that method instead.

Retrieves the users for the given Ids. If any Id is invalid, it is ignored.

Parameters:

  • ids (Array)

    The user ids to search for.

Returns:



4122
4123
4124
4125
4126
4127
# File 'lib/fusionauth/fusionauth_client.rb', line 4122

def search_users(ids)
  start.uri('/api/user/search')
      .url_parameter('ids', ids)
      .get
      .go
end

#search_users_by_ids(ids) ⇒ FusionAuth::ClientResponse

Retrieves the users for the given Ids. If any Id is invalid, it is ignored.

Parameters:

  • ids (Array)

    The user Ids to search for.

Returns:



4134
4135
4136
4137
4138
4139
# File 'lib/fusionauth/fusionauth_client.rb', line 4134

def search_users_by_ids(ids)
  start.uri('/api/user/search')
      .url_parameter('ids', ids)
      .get
      .go
end

#search_users_by_query(request) ⇒ FusionAuth::ClientResponse

Retrieves the users for the given search criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination constraints. Fields used: ids, query, queryString, numberOfResults, orderBy, startRow, and sortFields.

Returns:



4147
4148
4149
4150
4151
4152
# File 'lib/fusionauth/fusionauth_client.rb', line 4147

def search_users_by_query(request)
  start.uri('/api/user/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_users_by_query_string(request) ⇒ FusionAuth::ClientResponse

Deprecated.

This method has been renamed to search_users_by_query, use that method instead.

Retrieves the users for the given search criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination constraints. Fields used: ids, query, queryString, numberOfResults, orderBy, startRow, and sortFields.

Returns:



4161
4162
4163
4164
4165
4166
# File 'lib/fusionauth/fusionauth_client.rb', line 4161

def search_users_by_query_string(request)
  start.uri('/api/user/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_webhook_event_logs(request) ⇒ FusionAuth::ClientResponse

Searches the webhook event logs with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



4173
4174
4175
4176
4177
4178
# File 'lib/fusionauth/fusionauth_client.rb', line 4173

def search_webhook_event_logs(request)
  start.uri('/api/system/webhook-event-log/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#search_webhooks(request) ⇒ FusionAuth::ClientResponse

Searches webhooks with the specified criteria and pagination.

Parameters:

  • request (OpenStruct, Hash)

    The search criteria and pagination information.

Returns:



4185
4186
4187
4188
4189
4190
# File 'lib/fusionauth/fusionauth_client.rb', line 4185

def search_webhooks(request)
  start.uri('/api/webhook/search')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#send_email(email_template_id, request) ⇒ FusionAuth::ClientResponse

Send an email using an email template Id. You can optionally provide requestData to access key value pairs in the email template.

Parameters:

  • email_template_id (string)

    The Id for the template.

  • request (OpenStruct, Hash)

    The send email request that contains all the information used to send the email.

Returns:



4199
4200
4201
4202
4203
4204
4205
# File 'lib/fusionauth/fusionauth_client.rb', line 4199

def send_email(email_template_id, request)
  start.uri('/api/email/send')
      .url_segment(email_template_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#send_family_request_email(request) ⇒ FusionAuth::ClientResponse

Sends out an email to a parent that they need to register and create a family or need to log in and add a child to their existing family.

Parameters:

  • request (OpenStruct, Hash)

    The request object that contains the parent email.

Returns:



4212
4213
4214
4215
4216
4217
# File 'lib/fusionauth/fusionauth_client.rb', line 4212

def send_family_request_email(request)
  start.uri('/api/user/family/request')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#send_passwordless_code(request) ⇒ FusionAuth::ClientResponse

Send a passwordless authentication code in an email to complete login.

Parameters:

  • request (OpenStruct, Hash)

    The passwordless send request that contains all the information used to send an email containing a code.

Returns:



4224
4225
4226
4227
4228
4229
# File 'lib/fusionauth/fusionauth_client.rb', line 4224

def send_passwordless_code(request)
  startAnonymous.uri('/api/passwordless/send')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#send_two_factor_code(request) ⇒ FusionAuth::ClientResponse

Deprecated.

This method has been renamed to send_two_factor_code_for_enable_disable, use that method instead.

Send a Two Factor authentication code to assist in setting up Two Factor authentication or disabling.

Parameters:

  • request (OpenStruct, Hash)

    The request object that contains all the information used to send the code.

Returns:



4237
4238
4239
4240
4241
4242
# File 'lib/fusionauth/fusionauth_client.rb', line 4237

def send_two_factor_code(request)
  start.uri('/api/two-factor/send')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#send_two_factor_code_for_enable_disable(request) ⇒ FusionAuth::ClientResponse

Send a Two Factor authentication code to assist in setting up Two Factor authentication or disabling.

Parameters:

  • request (OpenStruct, Hash)

    The request object that contains all the information used to send the code.

Returns:



4249
4250
4251
4252
4253
4254
# File 'lib/fusionauth/fusionauth_client.rb', line 4249

def send_two_factor_code_for_enable_disable(request)
  start.uri('/api/two-factor/send')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#send_two_factor_code_for_login(two_factor_id) ⇒ FusionAuth::ClientResponse

Deprecated.

This method has been renamed to send_two_factor_code_for_login_using_method, use that method instead.

Send a Two Factor authentication code to allow the completion of Two Factor authentication.

Parameters:

  • two_factor_id (string)

    The Id returned by the Login API necessary to complete Two Factor authentication.

Returns:



4262
4263
4264
4265
4266
4267
# File 'lib/fusionauth/fusionauth_client.rb', line 4262

def (two_factor_id)
  startAnonymous.uri('/api/two-factor/send')
      .url_segment(two_factor_id)
      .post
      .go
end

#send_two_factor_code_for_login_using_method(two_factor_id, request) ⇒ FusionAuth::ClientResponse

Send a Two Factor authentication code to allow the completion of Two Factor authentication.

Parameters:

  • two_factor_id (string)

    The Id returned by the Login API necessary to complete Two Factor authentication.

  • request (OpenStruct, Hash)

    The Two Factor send request that contains all the information used to send the Two Factor code to the user.

Returns:



4275
4276
4277
4278
4279
4280
4281
# File 'lib/fusionauth/fusionauth_client.rb', line 4275

def (two_factor_id, request)
  startAnonymous.uri('/api/two-factor/send')
      .url_segment(two_factor_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#send_verify_identity(request) ⇒ FusionAuth::ClientResponse

Send a verification code using the appropriate transport for the identity type being verified.

Parameters:

  • request (OpenStruct, Hash)

    The identity verify send request that contains all the information used send the code.

Returns:



4288
4289
4290
4291
4292
4293
# File 'lib/fusionauth/fusionauth_client.rb', line 4288

def send_verify_identity(request)
  start.uri('/api/identity/verify/send')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#set_tenant_id(tenant_id) ⇒ Object



40
41
42
# File 'lib/fusionauth/fusionauth_client.rb', line 40

def set_tenant_id(tenant_id)
  @tenant_id = tenant_id
end

#start_identity_provider_login(request) ⇒ FusionAuth::ClientResponse

Begins a login request for a 3rd party login that requires user interaction such as HYPR.

Parameters:

  • request (OpenStruct, Hash)

    The third-party login request that contains information from the third-party login providers that FusionAuth uses to reconcile the user’s account.

Returns:



4301
4302
4303
4304
4305
4306
# File 'lib/fusionauth/fusionauth_client.rb', line 4301

def (request)
  start.uri('/api/identity-provider/start')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#start_passwordless_login(request) ⇒ FusionAuth::ClientResponse

Start a passwordless login request by generating a passwordless code. This code can be sent to the User using the Send Passwordless Code API or using a mechanism outside of FusionAuth. The passwordless login is completed by using the Passwordless Login API with this code.

Parameters:

  • request (OpenStruct, Hash)

    The passwordless start request that contains all the information used to begin the passwordless login request.

Returns:



4314
4315
4316
4317
4318
4319
# File 'lib/fusionauth/fusionauth_client.rb', line 4314

def (request)
  start.uri('/api/passwordless/start')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#start_two_factor_login(request) ⇒ FusionAuth::ClientResponse

Start a Two-Factor login request by generating a two-factor identifier. This code can then be sent to the Two Factor Send API (/api/two-factor/send)in order to send a one-time use code to a user. You can also use one-time use code returned to send the code out-of-band. The Two-Factor login is completed by making a request to the Two-Factor Login API (/api/two-factor/login). with the two-factor identifier and the one-time use code.

This API is intended to allow you to begin a Two-Factor login outside a normal login that originated from the Login API (/api/login).

Parameters:

  • request (OpenStruct, Hash)

    The Two-Factor start request that contains all the information used to begin the Two-Factor login request.

Returns:



4331
4332
4333
4334
4335
4336
# File 'lib/fusionauth/fusionauth_client.rb', line 4331

def (request)
  start.uri('/api/two-factor/start')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#start_verify_identity(request) ⇒ FusionAuth::ClientResponse

Start a verification of an identity by generating a code. This code can be sent to the User using the Verify Send API Verification Code API or using a mechanism outside of FusionAuth. The verification is completed by using the Verify Complete API with this code.

Parameters:

  • request (OpenStruct, Hash)

    The identity verify start request that contains all the information used to begin the request.

Returns:



4344
4345
4346
4347
4348
4349
# File 'lib/fusionauth/fusionauth_client.rb', line 4344

def start_verify_identity(request)
  start.uri('/api/identity/verify/start')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#start_web_authn_login(request) ⇒ FusionAuth::ClientResponse

Start a WebAuthn authentication ceremony by generating a new challenge for the user

Parameters:

  • request (OpenStruct, Hash)

    An object containing data necessary for starting the authentication ceremony

Returns:



4356
4357
4358
4359
4360
4361
# File 'lib/fusionauth/fusionauth_client.rb', line 4356

def (request)
  start.uri('/api/webauthn/start')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#start_web_authn_registration(request) ⇒ FusionAuth::ClientResponse

Start a WebAuthn registration ceremony by generating a new challenge for the user

Parameters:

  • request (OpenStruct, Hash)

    An object containing data necessary for starting the registration ceremony

Returns:



4368
4369
4370
4371
4372
4373
# File 'lib/fusionauth/fusionauth_client.rb', line 4368

def start_web_authn_registration(request)
  start.uri('/api/webauthn/register/start')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#two_factor_login(request) ⇒ FusionAuth::ClientResponse

Complete login using a 2FA challenge

Parameters:

  • request (OpenStruct, Hash)

    The login request that contains the user credentials used to log them in.

Returns:



4380
4381
4382
4383
4384
4385
# File 'lib/fusionauth/fusionauth_client.rb', line 4380

def (request)
  startAnonymous.uri('/api/two-factor/login')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#update_api_key(key_id, request) ⇒ FusionAuth::ClientResponse

Updates an API key with the given Id.

Parameters:

  • key_id (string)

    The Id of the API key to update.

  • request (OpenStruct, Hash)

    The request that contains all the new API key information.

Returns:



4393
4394
4395
4396
4397
4398
4399
# File 'lib/fusionauth/fusionauth_client.rb', line 4393

def update_api_key(key_id, request)
  start.uri('/api/api-key')
      .url_segment(key_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_application(application_id, request) ⇒ FusionAuth::ClientResponse

Updates the application with the given Id.

Parameters:

  • application_id (string)

    The Id of the application to update.

  • request (OpenStruct, Hash)

    The request that contains all the new application information.

Returns:



4407
4408
4409
4410
4411
4412
4413
# File 'lib/fusionauth/fusionauth_client.rb', line 4407

def update_application(application_id, request)
  start.uri('/api/application')
      .url_segment(application_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_application_role(application_id, role_id, request) ⇒ FusionAuth::ClientResponse

Updates the application role with the given Id for the application.

Parameters:

  • application_id (string)

    The Id of the application that the role belongs to.

  • role_id (string)

    The Id of the role to update.

  • request (OpenStruct, Hash)

    The request that contains all the new role information.

Returns:



4422
4423
4424
4425
4426
4427
4428
4429
4430
# File 'lib/fusionauth/fusionauth_client.rb', line 4422

def update_application_role(application_id, role_id, request)
  start.uri('/api/application')
      .url_segment(application_id)
      .url_segment("role")
      .url_segment(role_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_connector(connector_id, request) ⇒ FusionAuth::ClientResponse

Updates the connector with the given Id.

Parameters:

  • connector_id (string)

    The Id of the connector to update.

  • request (OpenStruct, Hash)

    The request object that contains all the new connector information.

Returns:



4438
4439
4440
4441
4442
4443
4444
# File 'lib/fusionauth/fusionauth_client.rb', line 4438

def update_connector(connector_id, request)
  start.uri('/api/connector')
      .url_segment(connector_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

Updates the consent with the given Id.

Parameters:

  • consent_id (string)

    The Id of the consent to update.

  • request (OpenStruct, Hash)

    The request that contains all the new consent information.

Returns:



4452
4453
4454
4455
4456
4457
4458
# File 'lib/fusionauth/fusionauth_client.rb', line 4452

def update_consent(consent_id, request)
  start.uri('/api/consent')
      .url_segment(consent_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_email_template(email_template_id, request) ⇒ FusionAuth::ClientResponse

Updates the email template with the given Id.

Parameters:

  • email_template_id (string)

    The Id of the email template to update.

  • request (OpenStruct, Hash)

    The request that contains all the new email template information.

Returns:



4466
4467
4468
4469
4470
4471
4472
# File 'lib/fusionauth/fusionauth_client.rb', line 4466

def update_email_template(email_template_id, request)
  start.uri('/api/email/template')
      .url_segment(email_template_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_entity(entity_id, request) ⇒ FusionAuth::ClientResponse

Updates the Entity with the given Id.

Parameters:

  • entity_id (string)

    The Id of the Entity to update.

  • request (OpenStruct, Hash)

    The request that contains all the new Entity information.

Returns:



4480
4481
4482
4483
4484
4485
4486
# File 'lib/fusionauth/fusionauth_client.rb', line 4480

def update_entity(entity_id, request)
  start.uri('/api/entity')
      .url_segment(entity_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_entity_type(entity_type_id, request) ⇒ FusionAuth::ClientResponse

Updates the Entity Type with the given Id.

Parameters:

  • entity_type_id (string)

    The Id of the Entity Type to update.

  • request (OpenStruct, Hash)

    The request that contains all the new Entity Type information.

Returns:



4494
4495
4496
4497
4498
4499
4500
# File 'lib/fusionauth/fusionauth_client.rb', line 4494

def update_entity_type(entity_type_id, request)
  start.uri('/api/entity/type')
      .url_segment(entity_type_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_entity_type_permission(entity_type_id, permission_id, request) ⇒ FusionAuth::ClientResponse

Updates the permission with the given Id for the entity type.

Parameters:

  • entity_type_id (string)

    The Id of the entityType that the permission belongs to.

  • permission_id (string)

    The Id of the permission to update.

  • request (OpenStruct, Hash)

    The request that contains all the new permission information.

Returns:



4509
4510
4511
4512
4513
4514
4515
4516
4517
# File 'lib/fusionauth/fusionauth_client.rb', line 4509

def update_entity_type_permission(entity_type_id, permission_id, request)
  start.uri('/api/entity/type')
      .url_segment(entity_type_id)
      .url_segment("permission")
      .url_segment(permission_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_family(family_id, request) ⇒ FusionAuth::ClientResponse

Updates a family with a given Id.

Parameters:

  • family_id (string)

    The Id of the family to update.

  • request (OpenStruct, Hash)

    The request object that contains all the new family information.

Returns:



4525
4526
4527
4528
4529
4530
4531
# File 'lib/fusionauth/fusionauth_client.rb', line 4525

def update_family(family_id, request)
  start.uri('/api/user/family')
      .url_segment(family_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_form(form_id, request) ⇒ FusionAuth::ClientResponse

Updates the form with the given Id.

Parameters:

  • form_id (string)

    The Id of the form to update.

  • request (OpenStruct, Hash)

    The request object that contains all the new form information.

Returns:



4539
4540
4541
4542
4543
4544
4545
# File 'lib/fusionauth/fusionauth_client.rb', line 4539

def update_form(form_id, request)
  start.uri('/api/form')
      .url_segment(form_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_form_field(field_id, request) ⇒ FusionAuth::ClientResponse

Updates the form field with the given Id.

Parameters:

  • field_id (string)

    The Id of the form field to update.

  • request (OpenStruct, Hash)

    The request object that contains all the new form field information.

Returns:



4553
4554
4555
4556
4557
4558
4559
# File 'lib/fusionauth/fusionauth_client.rb', line 4553

def update_form_field(field_id, request)
  start.uri('/api/form/field')
      .url_segment(field_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_group(group_id, request) ⇒ FusionAuth::ClientResponse

Updates the group with the given Id.

Parameters:

  • group_id (string)

    The Id of the group to update.

  • request (OpenStruct, Hash)

    The request that contains all the new group information.

Returns:



4567
4568
4569
4570
4571
4572
4573
# File 'lib/fusionauth/fusionauth_client.rb', line 4567

def update_group(group_id, request)
  start.uri('/api/group')
      .url_segment(group_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_group_members(request) ⇒ FusionAuth::ClientResponse

Creates a member in a group.

Parameters:

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the group member(s).

Returns:



4580
4581
4582
4583
4584
4585
# File 'lib/fusionauth/fusionauth_client.rb', line 4580

def update_group_members(request)
  start.uri('/api/group/member')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_identity_provider(identity_provider_id, request) ⇒ FusionAuth::ClientResponse

Updates the identity provider with the given Id.

Parameters:

  • identity_provider_id (string)

    The Id of the identity provider to update.

  • request (OpenStruct, Hash)

    The request object that contains the updated identity provider.

Returns:



4607
4608
4609
4610
4611
4612
4613
# File 'lib/fusionauth/fusionauth_client.rb', line 4607

def update_identity_provider(identity_provider_id, request)
  start.uri('/api/identity-provider')
      .url_segment(identity_provider_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_integrations(request) ⇒ FusionAuth::ClientResponse

Updates the available integrations.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains all the new integration information.

Returns:



4620
4621
4622
4623
4624
4625
# File 'lib/fusionauth/fusionauth_client.rb', line 4620

def update_integrations(request)
  start.uri('/api/integration')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_ip_access_control_list(access_control_list_id, request) ⇒ FusionAuth::ClientResponse

Updates the IP Access Control List with the given Id.

Parameters:

  • access_control_list_id (string)

    The Id of the IP Access Control List to update.

  • request (OpenStruct, Hash)

    The request that contains all the new IP Access Control List information.

Returns:



4593
4594
4595
4596
4597
4598
4599
# File 'lib/fusionauth/fusionauth_client.rb', line 4593

def update_ip_access_control_list(access_control_list_id, request)
  start.uri('/api/ip-acl')
      .url_segment(access_control_list_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_key(key_id, request) ⇒ FusionAuth::ClientResponse

Updates the key with the given Id.

Parameters:

  • key_id (string)

    The Id of the key to update.

  • request (OpenStruct, Hash)

    The request that contains all the new key information.

Returns:



4633
4634
4635
4636
4637
4638
4639
# File 'lib/fusionauth/fusionauth_client.rb', line 4633

def update_key(key_id, request)
  start.uri('/api/key')
      .url_segment(key_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_lambda(lambda_id, request) ⇒ FusionAuth::ClientResponse

Updates the lambda with the given Id.

Parameters:

  • lambda_id (string)

    The Id of the lambda to update.

  • request (OpenStruct, Hash)

    The request that contains all the new lambda information.

Returns:



4647
4648
4649
4650
4651
4652
4653
# File 'lib/fusionauth/fusionauth_client.rb', line 4647

def update_lambda(lambda_id, request)
  start.uri('/api/lambda')
      .url_segment(lambda_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_message_template(message_template_id, request) ⇒ FusionAuth::ClientResponse

Updates the message template with the given Id.

Parameters:

  • message_template_id (string)

    The Id of the message template to update.

  • request (OpenStruct, Hash)

    The request that contains all the new message template information.

Returns:



4661
4662
4663
4664
4665
4666
4667
# File 'lib/fusionauth/fusionauth_client.rb', line 4661

def update_message_template(message_template_id, request)
  start.uri('/api/message/template')
      .url_segment(message_template_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_messenger(messenger_id, request) ⇒ FusionAuth::ClientResponse

Updates the messenger with the given Id.

Parameters:

  • messenger_id (string)

    The Id of the messenger to update.

  • request (OpenStruct, Hash)

    The request object that contains all the new messenger information.

Returns:



4675
4676
4677
4678
4679
4680
4681
# File 'lib/fusionauth/fusionauth_client.rb', line 4675

def update_messenger(messenger_id, request)
  start.uri('/api/messenger')
      .url_segment(messenger_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_o_auth_scope(application_id, scope_id, request) ⇒ FusionAuth::ClientResponse

Updates the OAuth scope with the given Id for the application.

Parameters:

  • application_id (string)

    The Id of the application that the OAuth scope belongs to.

  • scope_id (string)

    The Id of the OAuth scope to update.

  • request (OpenStruct, Hash)

    The request that contains all the new OAuth scope information.

Returns:



4690
4691
4692
4693
4694
4695
4696
4697
4698
# File 'lib/fusionauth/fusionauth_client.rb', line 4690

def update_o_auth_scope(application_id, scope_id, request)
  start.uri('/api/application')
      .url_segment(application_id)
      .url_segment("scope")
      .url_segment(scope_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_registration(user_id, request) ⇒ FusionAuth::ClientResponse

Updates the registration for the user with the given Id and the application defined in the request.

Parameters:

  • user_id (string)

    The Id of the user whose registration is going to be updated.

  • request (OpenStruct, Hash)

    The request that contains all the new registration information.

Returns:



4706
4707
4708
4709
4710
4711
4712
# File 'lib/fusionauth/fusionauth_client.rb', line 4706

def update_registration(user_id, request)
  start.uri('/api/user/registration')
      .url_segment(user_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_system_configuration(request) ⇒ FusionAuth::ClientResponse

Updates the system configuration.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains all the new system configuration information.

Returns:



4719
4720
4721
4722
4723
4724
# File 'lib/fusionauth/fusionauth_client.rb', line 4719

def update_system_configuration(request)
  start.uri('/api/system-configuration')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_tenant(tenant_id, request) ⇒ FusionAuth::ClientResponse

Updates the tenant with the given Id.

Parameters:

  • tenant_id (string)

    The Id of the tenant to update.

  • request (OpenStruct, Hash)

    The request that contains all the new tenant information.

Returns:



4732
4733
4734
4735
4736
4737
4738
# File 'lib/fusionauth/fusionauth_client.rb', line 4732

def update_tenant(tenant_id, request)
  start.uri('/api/tenant')
      .url_segment(tenant_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_theme(theme_id, request) ⇒ FusionAuth::ClientResponse

Updates the theme with the given Id.

Parameters:

  • theme_id (string)

    The Id of the theme to update.

  • request (OpenStruct, Hash)

    The request that contains all the new theme information.

Returns:



4746
4747
4748
4749
4750
4751
4752
# File 'lib/fusionauth/fusionauth_client.rb', line 4746

def update_theme(theme_id, request)
  start.uri('/api/theme')
      .url_segment(theme_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_user(user_id, request) ⇒ FusionAuth::ClientResponse

Updates the user with the given Id.

Parameters:

  • user_id (string)

    The Id of the user to update.

  • request (OpenStruct, Hash)

    The request that contains all the new user information.

Returns:



4760
4761
4762
4763
4764
4765
4766
# File 'lib/fusionauth/fusionauth_client.rb', line 4760

def update_user(user_id, request)
  start.uri('/api/user')
      .url_segment(user_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_user_action(user_action_id, request) ⇒ FusionAuth::ClientResponse

Updates the user action with the given Id.

Parameters:

  • user_action_id (string)

    The Id of the user action to update.

  • request (OpenStruct, Hash)

    The request that contains all the new user action information.

Returns:



4774
4775
4776
4777
4778
4779
4780
# File 'lib/fusionauth/fusionauth_client.rb', line 4774

def update_user_action(user_action_id, request)
  start.uri('/api/user-action')
      .url_segment(user_action_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_user_action_reason(user_action_reason_id, request) ⇒ FusionAuth::ClientResponse

Updates the user action reason with the given Id.

Parameters:

  • user_action_reason_id (string)

    The Id of the user action reason to update.

  • request (OpenStruct, Hash)

    The request that contains all the new user action reason information.

Returns:



4788
4789
4790
4791
4792
4793
4794
# File 'lib/fusionauth/fusionauth_client.rb', line 4788

def update_user_action_reason(user_action_reason_id, request)
  start.uri('/api/user-action-reason')
      .url_segment(user_action_reason_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

Updates a single User consent by Id.

Parameters:

  • user_consent_id (string)

    The User Consent Id

  • request (OpenStruct, Hash)

    The request that contains the user consent information.

Returns:



4802
4803
4804
4805
4806
4807
4808
# File 'lib/fusionauth/fusionauth_client.rb', line 4802

def update_user_consent(user_consent_id, request)
  start.uri('/api/user/consent')
      .url_segment(user_consent_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#update_webhook(webhook_id, request) ⇒ FusionAuth::ClientResponse

Updates the webhook with the given Id.

Parameters:

  • webhook_id (string)

    The Id of the webhook to update.

  • request (OpenStruct, Hash)

    The request that contains all the new webhook information.

Returns:



4816
4817
4818
4819
4820
4821
4822
# File 'lib/fusionauth/fusionauth_client.rb', line 4816

def update_webhook(webhook_id, request)
  start.uri('/api/webhook')
      .url_segment(webhook_id)
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .put
      .go
end

#upsert_entity_grant(entity_id, request) ⇒ FusionAuth::ClientResponse

Creates or updates an Entity Grant. This is when a User/Entity is granted permissions to an Entity.

Parameters:

  • entity_id (string)

    The Id of the Entity that the User/Entity is being granted access to.

  • request (OpenStruct, Hash)

    The request object that contains all the information used to create the Entity Grant.

Returns:



4830
4831
4832
4833
4834
4835
4836
4837
# File 'lib/fusionauth/fusionauth_client.rb', line 4830

def upsert_entity_grant(entity_id, request)
  start.uri('/api/entity')
      .url_segment(entity_id)
      .url_segment("grant")
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#validate_device(user_code, client_id) ⇒ FusionAuth::ClientResponse

Validates the end-user provided user_code from the user-interaction of the Device Authorization Grant. If you build your own activation form you should validate the user provided code prior to beginning the Authorization grant.

Parameters:

  • user_code (string)

    The end-user verification code.

  • client_id (string)

    The client Id.

Returns:



4846
4847
4848
4849
4850
4851
4852
# File 'lib/fusionauth/fusionauth_client.rb', line 4846

def validate_device(user_code, client_id)
  startAnonymous.uri('/oauth2/device/validate')
      .url_parameter('user_code', user_code)
      .url_parameter('client_id', client_id)
      .get
      .go
end

#validate_jwt(encoded_jwt) ⇒ FusionAuth::ClientResponse

Validates the provided JWT (encoded JWT string) to ensure the token is valid. A valid access token is properly signed and not expired. <p> This API may be used to verify the JWT as well as decode the encoded JWT into human readable identity claims.

Parameters:

  • encoded_jwt (string)

    The encoded JWT (access token).

Returns:



4862
4863
4864
4865
4866
4867
# File 'lib/fusionauth/fusionauth_client.rb', line 4862

def validate_jwt(encoded_jwt)
  startAnonymous.uri('/api/jwt/validate')
      .authorization('Bearer ' + encoded_jwt)
      .get
      .go
end

#vend_jwt(request) ⇒ FusionAuth::ClientResponse

It’s a JWT vending machine!

Issue a new access token (JWT) with the provided claims in the request. This JWT is not scoped to a tenant or user, it is a free form token that will contain what claims you provide. <p> The iat, exp and jti claims will be added by FusionAuth, all other claims must be provided by the caller.

If a TTL is not provided in the request, the TTL will be retrieved from the default Tenant or the Tenant specified on the request either by way of the X-FusionAuth-TenantId request header, or a tenant scoped API key.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains all the claims for this JWT.

Returns:



4882
4883
4884
4885
4886
4887
# File 'lib/fusionauth/fusionauth_client.rb', line 4882

def vend_jwt(request)
  start.uri('/api/jwt/vend')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#verify_email(verification_id) ⇒ FusionAuth::ClientResponse

Deprecated.

This method has been renamed to verify_email_address and changed to take a JSON request body, use that method instead.

Confirms a email verification. The Id given is usually from an email sent to the user.

Parameters:

  • verification_id (string)

    The email verification Id sent to the user.

Returns:



4895
4896
4897
4898
4899
4900
# File 'lib/fusionauth/fusionauth_client.rb', line 4895

def verify_email(verification_id)
  startAnonymous.uri('/api/user/verify-email')
      .url_segment(verification_id)
      .post
      .go
end

#verify_email_address(request) ⇒ FusionAuth::ClientResponse

Confirms a user’s email address.

The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When the tenant is configured to gate a user until their email address is verified, this procedures requires two values instead of one. The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The two values together are able to confirm a user’s email address and mark the user’s email address as verified.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains the verificationId and optional one-time use code paired with the verificationId.

Returns:



4912
4913
4914
4915
4916
4917
# File 'lib/fusionauth/fusionauth_client.rb', line 4912

def verify_email_address(request)
  startAnonymous.uri('/api/user/verify-email')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#verify_email_address_by_user_id(request) ⇒ FusionAuth::ClientResponse

Administratively verify a user’s email address. Use this method to bypass email verification for the user.

The request body will contain the userId to be verified. An API key is required when sending the userId in the request body.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains the userId to verify.

Returns:



4926
4927
4928
4929
4930
4931
# File 'lib/fusionauth/fusionauth_client.rb', line 4926

def verify_email_address_by_user_id(request)
  start.uri('/api/user/verify-email')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#verify_identity(request) ⇒ FusionAuth::ClientResponse

Administratively verify a user identity.

Parameters:

  • request (OpenStruct, Hash)

    The identity verify request that contains information to verify the identity.

Returns:



4938
4939
4940
4941
4942
4943
# File 'lib/fusionauth/fusionauth_client.rb', line 4938

def verify_identity(request)
  start.uri('/api/identity/verify')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end

#verify_registration(verification_id) ⇒ FusionAuth::ClientResponse

Deprecated.

This method has been renamed to verify_user_registration and changed to take a JSON request body, use that method instead.

Confirms an application registration. The Id given is usually from an email sent to the user.

Parameters:

  • verification_id (string)

    The registration verification Id sent to the user.

Returns:



4951
4952
4953
4954
4955
4956
# File 'lib/fusionauth/fusionauth_client.rb', line 4951

def verify_registration(verification_id)
  startAnonymous.uri('/api/user/verify-registration')
      .url_segment(verification_id)
      .post
      .go
end

#verify_user_registration(request) ⇒ FusionAuth::ClientResponse

Confirms a user’s registration.

The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When the application is configured to gate a user until their registration is verified, this procedures requires two values instead of one. The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The two values together are able to confirm a user’s registration and mark the user’s registration as verified.

Parameters:

  • request (OpenStruct, Hash)

    The request that contains the verificationId and optional one-time use code paired with the verificationId.

Returns:



4968
4969
4970
4971
4972
4973
# File 'lib/fusionauth/fusionauth_client.rb', line 4968

def verify_user_registration(request)
  startAnonymous.uri('/api/user/verify-registration')
      .body_handler(FusionAuth::JSONBodyHandler.new(request))
      .post
      .go
end