module Auth0::Api::V1::Users

{auth0.com/docs/api#users}

Public Instance Methods

change_password_ticket(user_id, new_password, result_url=nil) click to toggle source

{auth0.com/docs/api#!#post–api-users–user_id–change_password_ticket}

# File lib/auth0/api/v1/users.rb, line 75
def change_password_ticket(user_id, new_password, result_url=nil)
  request_params = { "newPassword" => new_password, "resultUrl" => result_url }
  path = "/api/users/#{user_id}/change_password_ticket"
  post(path, request_params)
end
client_users(client_id=@client_id) click to toggle source

{auth0.com/docs/api#!#get–api-clients–client-id–users}

# File lib/auth0/api/v1/users.rb, line 55
def client_users(client_id=@client_id)
  path = "/api/clients/#{client_id}/users"
  get(path)
end
connection_users(connection_name, search=nil) click to toggle source

{auth0.com/docs/api#!#get–api-connections–connection–users} {auth0.com/docs/api#!#get–api-connections–connection–users-search–criteria-}

# File lib/auth0/api/v1/users.rb, line 34
def connection_users(connection_name, search=nil)
  path = "/api/connections/#{connection_name}/users"
  path += "?search=#{search.to_s}" unless search.to_s.empty?
  get(path)
end
Also aliased as: search_connection_users
create_public_key(user_id, device, public_key) click to toggle source

{auth0.com/docs/api#!#post–api-users–user_id–publickey}

# File lib/auth0/api/v1/users.rb, line 89
def create_public_key(user_id, device, public_key)
  path = "/api/users/#{user_id}/public_key"
  request_params = { device: device, public_key: public_key }
  post(path, request_params)
end
create_user(email, password, connection_name, request_params={}) click to toggle source

{auth0.com/docs/api#!#post–api-users}

# File lib/auth0/api/v1/users.rb, line 61
def create_user(email, password, connection_name, request_params={})
  options = { email: email, password: password, connection: connection_name }
  request_params.merge!(options)
  path = "/api/users"
  post(path, request_params)
end
delete_user(user_id) click to toggle source

{auth0.com/docs/api#!#delete–api-users–user_id-}

# File lib/auth0/api/v1/users.rb, line 143
def delete_user(user_id)
  raise Auth0::UserIdIsBlank, "if you want to remove all users user delete_users method" if user_id.to_s.empty?
  path = "/api/users/#{user_id}"
  delete(path)
end
delete_users() click to toggle source

{auth0.com/docs/api#!#delete–api-users}

This will remove all your users

# File lib/auth0/api/v1/users.rb, line 137
def delete_users
  path = "/api/users/"
  delete(path)
end
enterpriseconnections_users(search_criteria=nil, per_page=500) click to toggle source

{auth0.com/docs/api#!#get–api-enterpriseconnections-users-search–criteria-}

# File lib/auth0/api/v1/users.rb, line 43
def enterpriseconnections_users(search_criteria=nil, per_page=500)
  path = "/api/enterpriseconnections/users?search=#{search_criteria.to_s}&per_page=#{per_page.to_i.to_s}"
  get(path)
end
get_user(user_id)
Alias for: user
get_users(search=nil)
Alias for: users
patch_user_metadata(user_id, metadata={}) click to toggle source

{auth0.com/docs/api#!#patch–api-users–user_id–metadata}

# File lib/auth0/api/v1/users.rb, line 129
def patch_user_metadata(user_id, metadata={})
  path = "/api/users/#{user_id}/metadata"
  patch(path, metadata)
end
revoke_user_device_public_key(user_id, device) click to toggle source

{auth0.com/docs/api#!#delete–api-users–user_id–publickey-device–device-}

# File lib/auth0/api/v1/users.rb, line 156
def revoke_user_device_public_key(user_id, device)
  path = "/api/users/#{user_id}/publickey?device=#{device}"
  delete(path)
end
revoke_user_refresh_token(user_id, refresh_token) click to toggle source

{auth0.com/docs/api#!#delete–api-users–user_id–refresh_tokens–refresh_token-}

# File lib/auth0/api/v1/users.rb, line 150
def revoke_user_refresh_token(user_id, refresh_token)
  path = "/api/users/#{user_id}/refresh_tokens/#{refresh_token}"
  delete(path)
end
search_connection_users(connection_name, search=nil)
Alias for: connection_users
send_verification_email(user_id) click to toggle source

{auth0.com/docs/api#!#post–api-users–user_id–send_verification_email}

# File lib/auth0/api/v1/users.rb, line 69
def send_verification_email(user_id)
  path = "/api/users/#{user_id}/send_verification_email"
  post(path)
end
socialconnections_users(search_criteria=nil, per_page=500) click to toggle source

{auth0.com/docs/api#!#get–api-socialconnections-users-search–criteria-}

# File lib/auth0/api/v1/users.rb, line 49
def socialconnections_users(search_criteria=nil, per_page=500)
  path =  "/api/socialconnections/users?search=#{search_criteria.to_s}&per_page=#{per_page.to_i.to_s}"
  get(path)
end
update_user_email(user_id, email, verify=true) click to toggle source

{auth0.com/docs/api#!#put–api-users–user_id–email}

# File lib/auth0/api/v1/users.rb, line 96
def update_user_email(user_id, email, verify=true)
  path = "/api/users/#{user_id}/email"
  request_params = { email: email, verify: verify }
  put(path, request_params)
end
update_user_metadata(user_id, metadata={}) click to toggle source

{auth0.com/docs/api#!#put–api-users–user_id–metadata} This will overwrite user’s metadata, be really carefull, preffer using patch instead

# File lib/auth0/api/v1/users.rb, line 104
def update_user_metadata(user_id, metadata={})
  path = "/api/users/#{user_id}/metadata"
  put(path, metadata)
end
update_user_password(user_id, password, verify=true) click to toggle source

{auth0.com/docs/api#!#put–api-users–user_id–password}

# File lib/auth0/api/v1/users.rb, line 110
def update_user_password(user_id, password, verify=true)
  path = "/api/users/#{user_id}/password"
  request_params = { password: password, verify: verify }
  put(path, request_params)
end
update_user_password_using_email(email, password, connection_name, verify=true) click to toggle source

{auth0.com/docs/api#!#put–api-users–email–password}

# File lib/auth0/api/v1/users.rb, line 117
def update_user_password_using_email(email, password, connection_name, verify=true)
  request_params = {
    email:      email,
    password:   password,
    connection: connection_name,
    verify:     verify
  }
  path = "/api/users/#{email}/password"
  put(path, request_params)
end
user(user_id) click to toggle source

{auth0.com/docs/api#!#get–api-users–user_id-}

# File lib/auth0/api/v1/users.rb, line 19
def user(user_id)
  path = "/api/users/#{user_id}"
  get(path)
end
Also aliased as: get_user
user_devices(user_id) click to toggle source

{auth0.com/docs/api#!#get–api-users–user_id–devices}

# File lib/auth0/api/v1/users.rb, line 27
def user_devices(user_id)
  path = "/api/users/#{user_id}/devices"
  get(path)
end
users(search=nil) click to toggle source

{auth0.com/docs/api#!#get–api-users}

{auth0.com/docs/api#!#get–api-users-search–criteria-}

# File lib/auth0/api/v1/users.rb, line 9
def users(search=nil)
  path = "/api/users"
  path += "?search=#{search.to_s}" unless search.to_s.empty?
  get(path)
end
Also aliased as: users_search, get_users
verification_ticket(user_id, result_url=nil) click to toggle source

{auth0.com/docs/api#!#post–api-users–user_id–verification_ticket}

# File lib/auth0/api/v1/users.rb, line 82
def verification_ticket(user_id, result_url=nil)
  request_params = {"resultUrl" => result_url}
  path = "/api/users/#{user_id}/verification_ticket"
  post(path, request_params)
end