{"id":18611086,"url":"https://github.com/loginradius/go-sdk","last_synced_at":"2025-07-05T02:04:25.490Z","repository":{"id":38454632,"uuid":"149497654","full_name":"LoginRadius/go-sdk","owner":"LoginRadius","description":"The LoginRadius Go library will let you integrate LoginRadius' customer identity platform with your Go application(s).","archived":false,"fork":false,"pushed_at":"2022-06-03T11:25:53.000Z","size":266,"stargazers_count":7,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T09:27:05.402Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.loginradius.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LoginRadius.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-19T18:52:59.000Z","updated_at":"2023-08-29T14:37:27.000Z","dependencies_parsed_at":"2022-08-19T22:20:19.990Z","dependency_job_id":null,"html_url":"https://github.com/LoginRadius/go-sdk","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/LoginRadius/go-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoginRadius%2Fgo-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoginRadius%2Fgo-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoginRadius%2Fgo-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoginRadius%2Fgo-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LoginRadius","download_url":"https://codeload.github.com/LoginRadius/go-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoginRadius%2Fgo-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263645555,"owners_count":23494005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T03:12:35.161Z","updated_at":"2025-07-05T02:04:25.473Z","avatar_url":"https://github.com/LoginRadius.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LoginRadius Go SDK\n\n![Home Image](http://docs.lrcontent.com/resources/github/banner-1544x500.png)\n\n## Introduction \n\nLoginRadius Customer Registration wrapper provides access to LoginRadius Identity Management Platform API.\n\nLoginRadius is an Identity Management Platform that simplifies user registration while securing data. LoginRadius Platform simplifies and secures your user registration process, increases conversion with Social Login that combines 30 major social platforms, and offers a full solution with Traditional Customer Registration. You can gather a wealth of user profile data from Social Login or Traditional Customer Registration. \n\nLoginRadius centralizes it all in one place, making it easy to manage and access. Easily integrate LoginRadius with all of your third-party applications, like MailChimp, Google Analytics, Livefyre and many more, making it easy to utilize the data you are capturing.\n\nLoginRadius helps businesses boost user engagement on their web/mobile platform, manage online identities, utilize social media for marketing, capture accurate consumer data, and get unique social insight into their customer base.\n\nPlease visit [here](http://www.loginradius.com/) for more information.\n\n\n## Contents\n\n* [Demo](https://github.com/LoginRadius/go-sdk/tree/master/demo) - contains a demo of LoginRadius user auth workflow.\n\n\n## Documentation\n\n* [Configuration](https://docs.loginradius.comhttps://www.loginradius.com/docs/api/v2/deployment/sdk-libraries/golang-library) - Everything you need to begin using the LoginRadius SDK.\n\n\n## Installation\n\nTo install, run:\n`go get github.com/loginradius/go-sdk`\n\nImport the package:\n\n`import \"github.com/loginradius/go-sdk\"`\n\nInstall all package dependencies by running `go get ./...` in the root folder of this SDK.  \n\n\n## Usage\n\nTake a peek:\n\nBefore making any API calls, the LoginRadius API client must be initialized with your Loginradius API key and API secret, This information can be found in your LoginRadius account as described [here](https://www.loginradius.com/docshttps://www.loginradius.com/docs/api/v2/admin-console/platform-security/api-key-and-secret/#api-key-and-secret)\nSample code:\n\n```go\ncfg := lr.Config{\n    ApiKey:    \u003cyour API key\u003e,\n    ApiSecret: \u003cyour API secret\u003e,\n}\n\nlrclient, err := lr.NewLoginradius(\u0026cfg)\n\nif err != nil {\n    // handle error\n}\n```\n\nMany API calls included in this SDK must be completed with an access token, which can be obtained after calling the Authentication Login API and reading the token from the response or from generating an access token through the UID in the Accounts API.\n\nFor APIs that require the user's credentials to function properly, the access token must be passed in the `Authorization: Bearer` header; this is handled by the SDK. For APIs that require the user's access token, initialize the LoginRadius client like so:\n\n```go\nlrclient, err := lr.NewLoginradius(\u0026cfg, map[string]string{\"token\": \u003caccess token\u003e})\n\nif err != nil {\n    // handle error\n}\n```\n\nAlternatively an already-initalized client can be reused like so:\n\n```go\nlrclient.Context.Token = \u003caccess token\u003e\n```\n\nPlease be aware of the dangers of using global variables to store individual user's access token if you choose to reuse an already-initalized client.\n\n## Calling an API provided by the LoginRadius Golang SDK\n\n### Calling an API\n\nAPI calls are separated into separate packages. Each package contains a struct holding the LoginRadius client object as an embedded struct, e.g.:\n\n```go\npackage mfa\n\nimport (\n\tlr \"github.com/LoginRadius/go-sdk\"\n)\n\n// Embed Loginradius struct\ntype Loginradius struct {\n\tClient *lr.Loginradius\n}\n```\n\nThis allows for the individual API calls to be defined as methods of the Loginradius API client struct.\n\nRequire the package containing the API to be called, and type assert the initialized LoginRadius client into the specific package's client struct when calling the API:\n\n```go\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).PostMFAEmailLogin(login)\n\n```\n\n### Passing Body Parameters\n\nThe SDK includes the package `lrbody`, which contains structs for various API endpoints. This package is provided for convenience only, and does not contain every single struct needed to fulfill API requirements. It is useful for endpoints requiring key values to be submitted as nested objects. Alternatively, anonymous structs could be used as well.\n\nAdditionally, all API calls included in this SDK requiring body parameters expect `interface{}` as input, allowing for structs or `[]byte({})` as the body parameter.\n\nPassing an anonymous struct initialized with value as body:\n\n```go\nbody := struct{\n  Username string\n}{\"newname\"}\n\nres, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).PutManageAccountUpdate(\n    uid,\n    body,\n  )\n```\n\nPassing `[]byte({})` as body:\n\n```go\nres, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).PutManageAccountUpdate(\n  uid,\n  []byte(`{\"Username\":\"newname\"}`),\n)\n```\n\nBoth of these would work.\n\nFor more information on this package and the structs it contains: https://godoc.org/github.com/LoginRadius/go-sdk/lrbody\n\n### Passing query parameters\n\nSome APIs mandate the submission of requests with certain query parameters, for these endpoints the SDK methods expect a `map[string]string` containing the key value pairs for query parameters. Some APIs can take optional query parameters but have no required query parameters, these can be called with or without passing queries.\n\nPassing query parameter:\n\n```go\nresponse, err := tokenmanagement.Loginradius(tokenmanagement.Loginradius{lrclient}).GetRefreshToken(\n    map[string]string{\"expiresin\": expiresIn}, // this is the query parameter\n)\n```\n\nAlternatively, calling this end point without passing the optional query parameter:\n\n```go\nresponse, err := tokenmanagement.Loginradius(tokenmanagement.Loginradius{lrclient}).GetRefreshToken()\n```\n\n## Handling the Response Returned by an API Method\n\nAll APIs included in the LoginRadius Golang SDK return `httprutils.Response` and `Error`. For additional information about the `httprutils.Response` struct, please see [Handling the response](#Handling-the-response).\n\nThis SDK includes a package called `lrjson`, which contains the method `DynamicUnmarshall`. To access the fields in `response.Body`, call the method like so:\n\n```go\nres, err = mfa.Loginradius(mfa.Loginradius{lrclient}).PostMFAUsernameLogin(\n  map[string]string{\"username\": username, \"password\": password},\n  map[string]string{\"emailtemplate\": \"hello\"},\n)\n\nif err != nil {\n  // handle error\n}\n\nsession, err = lrjson.DynamicUnmarshal(res.Body)\nif err != nil {\n  // handle error\n}\n\ntoken, ok := session[\"access_token\"].(string); ok{\n  // use the token\n}\n```\n\nSome end points return an array rather than an object, here is a code snippet for handling the returned body from these endpoints:\n\n```go\nresp, err := lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialAlbum()\ndata := []interface{}{}\nerr = json.Unmarshal([]byte(resp.Body), \u0026data)\nif err != nil {\n  // handle error\n}\n\nfirstAlbum, ok := data[0].(map[string]interface{}); ok {\n  id := firstAlbum[\"ID\"].(string); ok = {\n    // use the id\n  }\n}\n```\n\nSome endpoints return nested objects. Here is a code snippet for retrieving data from a nested array:\n\n```go\nresp, err := customobject.Loginradius(customobject.Loginradius{lrclient}).GetCustomObjectByToken(map[string]string{\"objectname\": \u003cobject})\nif err != nil {\n  // handle error\n}\nobj, err := lrjson.DynamicUnmarshal(resp.Body)\nif err != nil {\n  // handle error\n}\ndata, ok := obj[\"data\"].([]interface{}); ok {\n  // Only get the ID of the first item of the slice\n  id, ok := data[0].(map[string]interface{})[\"Id\"].(string); ok {\n    // do something with the ID\n  }\n}\n```\n\nA detailed list of LoginRadius datapoints and their types can be found [here.](https://www.loginradius.com/docs/api/v2/getting-started/data-points/detailed-data-points)\n\nAn alternative to dynamically unmarshalling the body is to create a struct based on the expected return, and unmarshal the body into the struct; this would be marginally faster, but will not be able to handle all future changes in the API returns. The returned `httprutils.Response` struct contains two fields: string `Body` and []byte `OrigBody` to allow more flexibility in your implementation of the SDK.\n\n## Making Requests and Handling Responses with the httprutils Package\n\nThe Loginradius Golang SDK comes with the package `httprutils`(named for HTTP Response/request Utils, as well as to avoid namesquatting the useful package name `httputils`), which contains structs and functions for making REST requests.\n\nThis includes utilities for holding and building the response and request struct, as well as for making the request.\n\nFor more information on the package `httprutils` please see https://godoc.org/github.com/LoginRadius/go-sdk/httprutils.\n\n### Encoding Body\n\nThe package offers a function for encoding body parameters for PUT, POST, and DELETE requests.\n\nSample code:\n\n```go\nencodedBody, error := httprutils.EncodeBody(body)\nif error != nil {\n  // handle error\n}\n```\n\n### Building request using the httprutils package\n\nSample code:\n\n```go\nrequest := \u0026httprutils.Request{\n  Method: httprutils.Post,\n  URL:    \u003cpath\u003e,\n  Headers: map[string]string{\n    \"content-Type\":  \"application/x-www-form-urlencoded\",\n    \"Authorization\": \"Bearer \u003caccess token\u003e\"\n  },\n  QueryParams: map[string]string{\n    \"apiKey\": \u003capi key\u003e,\n  },\n  Body: \u003cencodedBody\u003e,\n}\n```\n\n### Making request using the httprutils package\n\nSample code:\n\n```go\nres, err := httprutils.TimeoutClient.Send(*request)\nif err!= nil {\n  // handle error\n}\n```\n\n### Handling the response\n\nThe response returned from the previous code snippet will be a struct like so\n(defined in httprutils package):\n\n```go\ntype Response struct {\n  StatusCode int\n  Body       string\n  Headers    map[string][]string\n  OrigBody   []byte\n}\n```\n\nThe response body, status code and the headers can be accessed through this struct.\n\nFor complete documentation on this package, please refer to https://godoc.org/github.com/LoginRadius/go-sdk/httprutils\n\n## Error package\n\nThe LoginRadius Golang SDK also includes an error package, `lrerror`. This package provides the API error interface accessors for the SDK.\n\nExample:\n\n```go\noutput, err := loginradius.GetAuthVerifyEmail()\nif err != nil {\n    if lrError, ok := err.(lrError.Error); ok {\n        // Get error details\n        log.Println(\"Error:\", lrError.Code(), lrError.Message())\n        // Prints out full error message, including original error if there was one.\n        log.Println(\"Error:\", lrError.Error())\n        // Get original error\n        if origErr := lrError.OrigErr(); origErr != nil {\n            // operate on original error.\n        }\n    } else {\n        ...\n    }\n}\n```\n\nFor complete documentation on this package, please refer to https://godoc.org/github.com/LoginRadius/go-sdk\n\n## SOTT Generation\n\nSOTT is a secure one-time token that can be created using the API key, API secret, and a timestamp ( start time and end time ). You can manually create a SOTT using the following util function.\n\n```go\n\n// You can pass the start and end time interval and the SOTT will be valid for this time duration. \n\nstartTime:=\"2021-01-10 07:10:42\"  // Valid Start Date with Date and time\n\nendTime:=\"2023-01-15 07:20:42\" // Valid End Date with Date and time\n\t\t\t\t\t\t\t\t\n//do not pass the time difference if you are passing startTime \u0026 endTime.\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ntimeDifference:=\"20\" // (Optional) The time difference will be used to set the expiration time of SOTT, If you do not pass time difference then the default expiration time of SOTT is 10 minutes.\n\napiKey:=\"\" //LoginRadius Api Key.\napiSecret:=\"\" //LoginRadius Api Secret (Only Primary Api Secret is used to generate the SOTT manually).\n\t\t\n\nsott := sott.Generate(apiKey, apiSecret,timeDifference,startTime,endTime)\t\t\t\t\t\t\n\t\t\t\t\n```\n\n\n## Tests\n\nAll APIs in the LoginRadius Go SDK are covered by tests; these tests are placed in the lrtest directory, divided into the `lrintegrationtest` and `lrunittest` packages.\n\nThe integration tests in the `lrintegrationtest` package must be run with an internet connection as they make calls to the LoginRadius cloud. To run the tests, create /lrtest/lrintegrationtest/config/secret.env based on the content provided by secret.env.example, then run `go test`.\n\nSome tests are skipped by default, uncomment `t.SkipNow()` and manually set the required variable values to run these tests.\n\n## Static Analysis\n\nTo analyze the code, [golangci-lint](https://github.com/golangci/golangci-lint) was used. `gometalinter` contains a number of static analysis tools for Go code, including a tool to analyze security issues within the code. Follow the instructions on Github to install and run.\n\n## Demo\n\nA demo project utilizing the SDK is included in the LoginRadius Go SDK. You can find the demo here: https://github.com/LoginRadius/go-sdk/tree/master/demo.\nThis is a simple project containing a backend server written in Go that exposes endpoints serving JSON returns to a Javascript and HTML frontend. The demo project contains basic functionalities for demonstration purposes; these functionalities include user registration, authentication, forgot-password, multifactor authentication workflows, roles, custom object. A single page application called \"Login Screen\" is also included in the project for reference purposes.\n\nTo configure and run the server, follow these steps:\n\n1. Follow the Installation and Quick Start guide to set up the SDK.\n2. Create /demo/config/secret.env based on the example provided by /demo/config/secret.env.example\n3. Configure /demo/config.public.env with the base url of your server if needed; the default is localhost:3000\n4. Create /demo/ui/assets/js/options.js based on the example provided by /demo/ui/assets/js/options.sample.js\n5. Configure /demo/ui/assets/js/loginScreen.js to handle proper link redirection when using the LoginScreen application.\n6. Run the server by running `go run main.go` from /demo/cmd/app\n\nInside the demo project, a playground has also been added for you to try out API calls. You can add your code in /demo/cmd/playground/main.go and run it with `go run main.go` to explore the API calls during development.\n\n## APIs\n\nPlease note that that before APIs can be called, the LoginRadius client struct must be initalized with your API key and secret. Please jump to [Initializing the LoginRadius Client](#Intializing-the-LoginRadius-Client) for instructions on how to do so. View [Calling an API](#Calling-an-API) to see general instructions regarding how methods should be invoked. Read on for details about individual API methods.\n\n### Authentication APIs\n\nThe Authentication (Auth) APIs allow changes to the account once some form of authentication has been performed. For this reason, they are considered to be user facing client-side/front-end API calls.\n\nTo call an Authentication API, import the authentication package like so:\n\n```go\nimport (\n \"github.com/LoginRadius/go-sdk/api/role\"\n)\n```\n\n**List of APIs in this Section:**\n\n- [POST: Auth Add Email](#auth-add-email)\n- [POST: Auth Forgot Password](#forgot-password)\n- [POST: Auth User Registration by Email](#auth-user-registration-by-email)\n- [POST: Auth Login by Email](#auth-login-by-email)\n- [POST: Auth Login by Username](#auth-login-by-username)\n- [GET: Auth Email Availability](#auth-email-availability)\n- [GET: Auth Username Availability](#auth-username-availability)\n- [GET: Auth Read Profiles By Token](#auth-read-profiles-by-token)\n- [GET: Auth Privacy Policy Accept](#auth-privacy-policy-accept)\n- [GET: Auth Send Welcome Email](#auth-send-welcome-email)\n- [GET: Auth Social Identity](#auth-social-identity)\n- [GET: Auth Validate Access Token](#auth-validate-access-token)\n- [GET: Auth Verify Email](#auth-verify-email)\n- [GET: Auth Delete Account](#auth-delete-account)\n- [GET: Auth Invalidate Access Token](#auth-invalidate-access-token)\n- [GET: Security Questions By Token](#security-questions-by-token)\n- [GET: Security Questions By Email](#security-questions-by-email)\n- [GET: Security Questions By User Name](#security-questions-by-user-name)\n- [GET: Security Questions By Phone](#security-questions-by-phone)\n- [PUT: Auth Verify Email By OTP](#auth-verify-email-by-otp)\n- [PUT: Auth Change Password](#auth-change-password)\n- [PUT: Auth Link Social Identities](#auth-link-social-identities)\n- [PUT: Auth Resend Email Verification](#auth-resend-email-verification)\n- [PUT: Auth Reset Password By Reset Token](#auth-reset-password-by-reset-token)\n- [PUT: Auth Reset Password By Email](#auth-reset-password-by-email)\n- [PUT: Auth Reset Password By Phone](#auth-reset-password-by-phone)\n- [PUT: Auth Reset Password By Username](#auth-reset-password-by-username)\n- [PUT: Auth Set or Change Username](#auth-set-or-change-username)\n- [PUT: Auth Update Profile By Token](#auth-update-profile-by-token)\n- [PUT: Auth Update Security Question By Access Token](#auth-update-security-question-by-access-token)\n- [DELETE: Auth Delete Account with Email Confirmation](#auth-delete-account-with-email-confirmation)\n- [DELETE: Auth Remove Email](#auth-remove-email)\n- [DELETE: Auth Unlink Social Identities](#auth-unlink-social-identities)\n\n##### Auth Add Email\n\nThis API is used to add emails to an existing account.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-add-email)\n\nExample:\n\n```go\n// use an anonymous struct, alternatively []byte could be passed\nbody := struct {\n  Email string\n  Type string\n}{\n  \"example@example.com\",\n  \"Primary\", //This can be a value of your designation\n}\n\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}) .\n  PostAuthAddEmail(\n    body,\n  )\n\nif err != nil {\n    // handle error\n}\n```\n\n##### Auth Forgot Password\n\nThis API is used to initiate the Forgot Password workflow.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-forgot-password)\n\nExample:\n\n```go\n// use an anonymous struct, alternatively []byte could be passed\nemail := struct {\n  Email string\n}{\n  \"example@example.com,\n}\n\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).\n    PostAuthForgotPassword(\n      email,\n      map[string]string{\"resetpasswordurl\": \"example.com/password/reset\"},\n    )\nif err != nil {\n    // handle error\n}\n```\n\n##### Auth User Registration by Email\n\nThis API is used to register a user with the authentication API.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-user-registration-by-email)\n\nExample:\n\n```go\n// Use struct provided by lrbody package to construct body\n// alternatively you could initialize your own struct\n// []byte could also be passed in lieu of a struct\nuser := lrbody.RegistrationUser{\n    Email: []lrbody.AuthEmail{\n      lrbody.AuthEmail{\n        Type:  \"Primary\", //This can be any value of your designation\n        Value: \"example@example.com\",\n      },\n    },\n    Password: \"password\",\n}\nsott:=\"\"//(Required) Pass SOTT\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).\n    PostAuthUserRegistrationByEmail(sott,user,)\n\nif err != nil {\n    // handle error\n}\n```\n\n##### Auth Login by Email\n\nThis API is used to create an access token for the account used, along with fetching profile data.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-email)\n\nExample:\n\n```go\n// use an anonymous struct, alternatively []byte could be passed in lieu of struct\nbody := struct {\n  Emailstring\n  Password string\n}{\n  userName,\n  email, // uses generated email as password\n}\n\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient})    .PostAuthLoginByEmail(body)\n\nif err != nil {\n    // handle error\n}\n```\n\n##### Auth Login by Username\n\nThis API is used to create an access token for the account used, along with fetching profile data. Uses a username instead of email.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-username)\n\nExample:\n\n```go\n// use an anonymous struct, alternatively []byte could be passed in lieu of struct\nbody := struct {\n  Username string\n  Password string\n}{\n  userName,\n  email, // uses generated email as password\n}\n\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PostAuthLoginByUsername(body)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Email Availability\n\nThis API is used to check used to check whether an email exists or not on your site.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-email-availability)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{loginradius}).\n  GetAuthCheckEmailAvailability(map[string]string{\"email\": \"example@example.com\"})\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Username Availability\n\nThis API is used to check used to check whether a username exists or not on your site.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-username-availability)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{loginradius}).\n  GetAuthCheckUsernameAvailability(map[string]string{\"username\": \"exampleusername\"})\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Read Profile By Token\n\nThis API is used to get the profile data of a user with an access token.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-read-profiles-by-token)\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\nExample:\n\n```go\nresponse, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).\n  GetAuthReadProfilesByToken()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Privacy Policy Accept\n\nThis API is used to update the privacy policy of a user using their access token.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-privacy-policy-accept)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).\n  GetAuthPrivatePolicyAccept()\n\nif err != nil {\n  //handle error\n}\n\n```\n\n##### Auth Send Welcome Email\n\nThis API is used to send a welcome email to the user associated with the access token.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-send-welcome-email)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).GetAuthSendWelcomeEmail(map[string]string{\"welcomeemailtemplate\": \"customer-email-template\"})\n\nif err != nil {\n  //handle error\n}\n\n```\n\n##### Auth Social Identity\n\nThis API is called before the account linking API to prevent a second profile from being created.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-social-identity)\n\nExample:\n\n```go\n//optional queries could also be passed\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).\n  GetAuthSendWelcomeEmail()\n\nif err != nil {\n  //handle error\n}\n```\n\n##### Auth Validate Access Token\n\nThis API is used to validate the access token passed in.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-validate-access-token)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).\n  GetAuthValidateAccessToken()\n\nif err != nil {\n  //handle error\n}\n```\n\n##### Auth Verify Email\n\nThis API is used to verify the account using the verification token sent in the verification email.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-verify-email)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).GetAuthVerifyEmail(\n  map[string]string{\"verificationtoken\": \u003cverificationToken\u003e},\n)\n\nif err != nil {\n  //handle error\n}\n```\n\n##### Auth Delete Account\n\nThis API is used to delete an account using a delete token sent to the user's email.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-delete-account)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).GetAuthDeleteAccount(\n  map[string]string{\"deletetoken\": \"\u003cdelete token\u003e\"}\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Invalidate Access Token\n\nThis API is used to invalidate the access token passed in.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-invalidate-access-token)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).GetAuthInvalidateAccessToken()\n\nif err != nil {\n  // handle error\n}\n\n```\n\n##### Security Questions By Access Token\n\nThis API is used to retrieve the list of security questions configured for a user using the access token.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-access-token)\n\nFor additional information on security questions, please refer the [documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-access-token/)\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).GetAuthSecurityQuestionByAccessToken()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Security Questions By Email\n\nThis API is used to retrieve the list of security questions configured for a customer using their email.\n\n[Documentation](https://docs.loginradius.comhttps://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-email)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).GetAuthSecurityQuestionByEmail(\n  map[string]string{\"email\": \u003cemail\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Security Questions By User Name\n\nThis API is used to retrieve the list of security questions configured for a user using their username.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-user-name)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).GetAuthSecurityQuestionByUsername(\n  map[string]string{\"username\": \u003cusername\u003e},\n)\nif err!= nil {\n  // handle error\n}\n```\n\n##### Security Questions By Phone\n\nThis API is used to retrieve the list of security questions configured for a user using their phone number.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-phone)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).GetAuthSecurityQuestionByPhone(\n  map[string]string{\"phone\": \u003cphone\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Verify Email By OTP\n\nThis API is used to verify an account with an OTP. OTP workflow must be enabled in the customer account.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-verify-email-by-otp)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PutAuthVerifyEmailByOtp(\n  map[string]string{\n    \"email\": \u003cemail\u003e,\n    \"otp\": \u003cotp\u003e,\n  },\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Change Password\n\nThis API is used to change the user's password.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-change-password)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PutAuthChangePassword(\n  map[string]string{\n    \"oldpassword\": \u003coldpassword\u003e,\n    \"newpassword\": \u003cnewpassword\u003e,\n  }\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Link Social Identities\n\nThis API is used to link the user's account with a social account.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-link-social-identities)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PutAuthLinkSocialIdentities(\n  map[string]string{\n    \"candidatetoken\": \u003ccandidatetoken\u003e,\n  }\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Resend Email Verification\n\nThis API is used to resend the email verification to the user's email.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-resend-email-verification)\n\nExample:\n\n```go\nres, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PutResendEmailVerification(\n  map[string]string{\"email\": \u003cemail\u003e},\n)\n\nif err != nil {\n  //handle error\n}\n```\n\n##### Auth Reset Password By Reset Token\n\nThis API is used to reset the password for a user using a reset token received from the user's email.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-reset-token)\n\nExample:\n\n```go\nresponse, err = lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PutAuthResetPasswordByResetToken(\n  map[string]string{\n    \"resettoken\":\u003cresettoken\u003e,\n    \"password\":\u003cpassword\u003e,\n    // add optional body parameters as needed\n  }\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Reset Password By OTP\n\nThis API is used to reset the password for a user using an OTP received from the user's email. OTP workflow must be enabled for the customer for them to receive an OTP by email.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-otp)\n\nExample:\n\n```go\nresponse, err = lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PutAuthResetPasswordByResetToken(\n    map[string]string{\n    \"resettoken\":\u003cresettoken\u003e,\n    \"password\":\u003cpassword\u003e,\n    \"otp\":\u003cotp\u003e,\n    // add optional body parameters as needed\n  }\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Reset Password By Email\n\nThis API is used to initiate reset password using a security answer and the user's email.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-email)\n\nFor additional information on security questions, please refer the [documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-email/)\n\nExample:\n\n```go\n// Initialize struct to use for body\n// Alternatively, the helper struct lrbody.ResetPwSecurityQuestionEmail from the lrbody package\n// could be used, or []byte could be passed as body\ntype ResetPasswordBySecurityAnswerAndEmailStruct struct {\n    SecurityAnswer SecurityQandA `json:\"securityanswer\"`\n    Email string `json:\"email\"`\n    Password string `json:\"password\"`\n}\n\ntype SecurityQandA struct {\n    SecurityQuestion string `json:\u003cid of security question\u003e`\n    // Use your secret question IDs in the json field\n    // this would be a random string\n    // for more information on this see the security question documentation\n}\n\nsecurityQuestion := SecurityQuestion{\"Answer\"}\nbody := ResetPasswordBySecurityAnswerAndEmailStruct{\n  securityQuestion,\n  \u003cemail\u003e,\n  \u003cpassword\u003e\n}\n\nresponse, err = lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PutAuthResetPasswordBySecurityAnswerAndEmail(\n  body,\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Reset Password By Phone\n\nThis API is used to initiate reset password using a security answer and the user's phone number.\n\nFor additional information on security questions, please refer the [documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-phone/)\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-phone)\n\nExample:\n\n```go\n// Initialize struct to use for body\n// Alternatively, the helper struct lrbody.ResetPwSecurityQuestionUsername from the lrbody package\n// could be used, or []byte could be passed as body\ntype ResetPasswordBySecurityAnswerAndUsernameStruct struct {\n    SecurityAnswer SecurityQandA `json:\"securityanswer\"`\n    Username string `json:\"username\"`\n    Password string `json:\"password\"`\n}\n\ntype SecurityQandA struct {\n    SecurityQuestion string `json:\u003cid of security question\u003e`\n    // Use your secret question IDs in the json field\n    // this would be a random string\n    // for more information on this see the security question documentation\n}\n\nsecurityQuestion := SecurityQuestion{\"Answer\"}\nbody := ResetPasswordBySecurityAnswerAndUsernameStruct{\n  securityQuestion,\n  \u003cusername\u003e,\n  \u003cpassword\u003e\n}\n\nresponse, err = lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PutAuthResetPasswordBySecurityAnswerAndUsername(\n  body,\n)\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Reset Password By Username\n\nThis API is used to initiate reset password using a security answer and the username.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-username)\n\nFor additional information on security questions, please refer the [documentation](https://www.loginradius.com/docs/api/v2/admin-console/platform-security/password-policy/#password-policy)\n\nExample:\n\n```go\n// Initialize struct to use for body\n// Alternatively, the helper struct lrbody.ResetPwSecurityQuestionPhone from the lrbody package\n// could be used, or []byte could be passed as body\ntype ResetPasswordBySecurityAnswerAndPhoneStruct struct {\n    SecurityAnswer SecurityQandA `json:\"securityanswer\"`\n    Phone string `json:\"phone\"`\n    Password string `json:\"password\"`\n}\n\ntype SecurityQandA struct {\n    SecurityQuestion string `json:\u003cid of security question\u003e`\n    // Use your secret question IDs in the json field\n    // this would be a random string\n    // for more information on this see the security question documentation\n}\n\nsecurityQuestion := SecurityQuestion{\"Answer\"}\nbody := ResetPasswordBySecurityAnswerAndPhoneStruct{\n  securityQuestion,\n  \u003cphone\u003e,\n  \u003cpassword\u003e\n}\n\nresponse, err = lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PutAuthResetPasswordBySecurityAnswerAndPhone(\n  body,\n)\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Set or Change User Name\n\nThis API is used to add a username to an account, or to update the current username.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-set-or-change-user-name)\n\nExample:\n\n```go\n_, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PutAuthSetOrChangeUsername(\n  map[string]string{\"username\":\u003cnew username\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Update Profile By Token\n\nThis API is used to update the profile of a user using an access token associated with their account.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-update-profile-by-token)\n\nExample:\n\n```go\n_, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PutAuthUpdateProfileByToken(\n  map[string]string{\n    \"Username\":\u003cnew username\u003e,\n    \"Suffix\": \u003cnew suffix\u003e,\n    // add fields to be updated for the user to the body as needed\n  }\n)\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Update Security Question By Access Token\n\nThis API is used to update the security questions using a user's access token.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\nFor additional information on security questions, please refer the [documentation](https://www.loginradius.com/docs/api/v2/admin-console/platform-security/security-question/#password-policy)\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-update-security-question-by-access-token)\n\nExample:\n\n```go\n// Initialize struct to use for body\n// Alternatively, the helper struct lrbody.ResetPwSecurityQuestionUsername from the lrbody package\n// could be used, or []byte could be passed as body\ntype PutAuthUpdateSecurityQuestionByAccessTokenStruct struct {\n    SecurityAnswer SecurityQandA `json:\"securityanswer\"`\n}\n\ntype SecurityQandA struct {\n  SecurityQuestion string `json:\u003cid of security question\u003e`\n  // Use your secret question IDs in the json field\n  // this would be a random string\n  // for more information on this see the security question documentation\n}\n\nsecurityQuestion := SecurityQuestion{\"Answer\"}\nbody := PutAuthUpdateSecurityQuestionByAccessTokenStruct{\n  securityQuestion,\n}\n\nresponse, err = lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PutAuthUpdateSecurityQuestionByAccessToken(\n  body,\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Delete Account with Email Confirmation\n\nThis API is used to delete a user account by passing in their access token.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-delete-account-with-email-confirmation)\n\nExample:\n\n```go\nresp, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).DeleteAuthDeleteAccountEmailConfirmation()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Remove Email\n\nThis API is used to remove emails from an account. An account should\nhave at least one email at all times when used as an identifier.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-remove-email)\n\nExample:\n\n```go\nresp, err := lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).DeleteAuthDeleteAccountEmailConfirmation()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Auth Unlink Social Identities\n\nThis API is used to unlink a social provider account from the user associated with the access token.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-unlink-social-identities)\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\nExample:\n\n```go\nresponse, err = lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).DeleteAuthUnlinkSocialIdentities(\n  map[string]string{\n    \"provider\": \u003cprovider\u003e,\n    \"providerid\": \u003cproviderid\u003e,\n  },\n)\n\nif err != nil {\n  // handle error\n}\n\n```\n\n### Account APIs\n\nThe Account Management APIs are used to manage a user's account. These calls require the API Key and API Secret and often the User's Account UID (Unified Identifier) to perform an operation. For this reason, these APIs are considered to be for back-end purposes.\n\nTo call an Account API, import the account package like so:\n\n```go\nimport (\n\tlraccount \"github.com/LoginRadius/go-sdk/api/account\"\n)\n```\n\n**List of APIs in this Section:**\n\n- [POST: Account Create](#account-create)\n- [POST: Get Email Verification Token](#get-email-verification-token)\n- [POST: Get Forgot Password Token](#get-forgot-password-token)\n- [GET: Account Identities By Email](#account-identities-by-email)\n- [GET: Account Impersonation API](#account-impersonation-api)\n- [GET: Account Password](#account-password)\n- [GET: Account Profiles By Email](#account-profiles-by-email)\n- [GET: Account Profiles By Username](#account-profiles-by-username)\n- [GET: Account Profiles By Phone ID](#account-profiles-by-phone-id)\n- [GET: Account Profiles By UID](#account-profiles-by-uid)\n- [GET: Refresh Access Token By RefreshToken API](#refresh-access-token-by-refreshtoken-api)\n- [GET: Revoke Refresh Token API](#revoke-refresh-token-api)\n- [PUT: Account Set Password](#account-set-password)\n- [PUT: Account Update](#account-update)\n- [PUT: Account Update Security Question Config](#account-update-security-question-config)\n- [PUT: Account Invalidate Verification Email](#account-invalidate-verification-email)\n- [DELETE: Account Email Delete](#account-email-delete)\n- [DELETE: Account Delete](#account-delete)\n\n##### Account Create\n\nThis API is used to create an account which bypasses email verification.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-create)\n\nExample:\n\n```go\n// Use struct provided by lrbody package to construct body\n// alternatively you could initialize your own struct\n// []byte could also be passed in lieu of a struct\nuser := lrbody.AccountCreate{\n    Email: []lrbody.EmailArray{\n      lrbody.EmailArray{\n        Type:  \"Primary\", //This can be any value of your designation\n        Value: \"example@example.com\",\n      },\n    },\n    Password: \"password\",\n    // add more profile fields as needed\n}\n\nresponse, err := lraccount.Loginradius(loginradius).PostManageAccountCreate(user)\nif err != nil {\n  // handle error\n}\n```\n\n##### Get Email Verification Token\n\nThis API is used to generate an email verification token.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/get-email-verification-token)\n\nExample:\n\n```go\nresponse, err := lraccount.Loginradius(lraccount.Loginradius{loginradius}).PostManageEmailVerificationToken(\n  map[string]string{\"email\": \u003cemail\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Get Forgot Password Token\n\nThis API is used to generate a token to reset the user's password.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/get-forgot-password-token)\n\nExample:\n\n```go\nresponse, err = lraccount.Loginradius(lraccount.Loginradius{loginradius}).PostManageForgotPasswordToken(\n  map[string]string{\"email\":\u003cemail\u003e},\n  map[string]string{\"sendemail\": \"true\"}), //queries are optional\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Account Identities By Email\n\nThis API is used to fetch the account identities associated with an email.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-identities-by-email)\n\nExample:\n\n```go\nresponse, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).GetManageAccountIdentitiesByEmail(\n  map[string]string{\"email\": \u003cemail\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n\n// This end point returns data in an array, the response needs to be handled like so:\n// (please note this is a preliminary example, you may wish to do something\n// different with the returned profiles)\nbody, _ := lrjson.DynamicUnmarshal(response.Body) // unmarshals body\nprofiles := body[\"Data\"].([]interface{}) // type assertion\nprofile := profiles[0].(map[string]interface{}) // get first profile\nuid := profile[\"Uid\"].(string) // get id of first profile\n```\n\n##### Account Impersonation API\n\nThis API is used to generate a token by passing in a User ID.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-impersonation-api)\n\nExample:\n\n```go\nresponse, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).GetManageAccountProfilesByUid(\u003cuid\u003e)\nif err != nil {\n  // handle error\n}\n```\n\n##### Account Password\n\nThis API is used to get the hashed password for an account.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-password)\n\nExample:\n\n```go\nresponse, err := lraccount.Loginradius(lraccount.Loginradius{loginradius}).GetManageAccountPassword(uid)\nif err != nil {\n  // handle error\n}\n```\n\n##### Account Profiles By Email\n\nThis API is used to get the profile of an account associated with the passed in email.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-email)\n\nExample:\n\n```go\nresponse, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).GetManageAccountProfilesByEmail(\n  map[string]string{\"email\": \u003cemail\u003e},\n)\nif err != nil {\n  // handle error\n}\n```\n\n##### Account Profiles By Username\n\nThis API is used to get the profile of an account associated with the passed in username.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-user-name/)\n\nExample:\n\n```go\nresponse, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).GetManageAccountProfilesByUsername(\n  map[string]string{\"username\": \u003cusername\u003e},\n)\nif err != nil {\n  // handle error\n}\n```\n\n##### Account Profiles By Phone ID\n\nThis API is used to get the profile of an account associated with the passed in phone number.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-phone-id)\n\nExample:\n\n```go\nresponse, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).GetManageAccountProfilesByPhone(\n  map[string]string{\"phone\": \u003cphone\u003e},\n)\nif err != nil {\n  // handle error\n}\n```\n\n##### Account Profiles By UID\n\nThis API is used to get the profile of an account associated with the passed in user ID.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-uid)\n\nExample:\n\n```go\nresponse, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).GetManageAccountProfilesByUid(\u003cuid\u003e)\nif err != nil {\n    // handle error\n}\n```\n\n\n##### Refresh Access Token By RefreshToken API\n\nThis API will be used to Refresh Access token using the refresh token API.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-access-token-by-refresh-token)\n\nExample:\n\n```go\nresponse, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).GetRefreshAccessTokenByRefreshToken(\n  map[string]string{\"refresh_token\": \u003cReferesh_Token\u003e},\n)\nif err != nil {\n  // handle error\n}\n```\n\n\n##### Revoke Refresh Token API\n\nThis API will be used to Revoke the Refresh token.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/revoke-refresh-token)\n\nExample:\n\n```go\nresponse, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).GetRevokeRefreshToken(\n  map[string]string{\"refresh_token\": \u003cReferesh_Token\u003e},\n)\nif err != nil {\n  // handle error\n}\n```\n\n\n##### Account Set Password\n\nThis API is used to set the password for a user.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-set-password)\n\nExample:\n\n```go\nresponse, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).PutManageAccountSetPassword(\n  \u003cuid\u003e,\n  map[string]string{\"password\":\u003cnew password\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Account Update\n\nThis API is used to update the profile of a user.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-update)\n\nExample:\n\n```go\n// This example passes a []byte as body\n// Alternatively a struct containing fields to be updated\n// can also be passed in the body\n_, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).PutManageAccountUpdate(\n  uid,\n  []byte(`{\"Username\":\"newname\"}`), // add profile fields as needed\n)\nif err != nil {\n  // handle error\n}\n```\n\n##### Account Update Security Questiong\n\nThis API is used to update security question configurations for an account.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-update-security-question)\n\nFor additional information on security questions, please refer the [documentation](https://www.loginradius.com/docs/api/v2/admin-console/platform-security/security-question/#password-policy)\n\nExample:\n\n```go\n// Initialize struct to use for body\n// Alternatively, the helper struct lrbody.ResetPwSecurityQuestionEmail from the lrbody package\n// could be used, or []byte could be passed as body\ntype AccountUpdateSecurityQuestionConfigStruct struct {\n    SecurityAnswer SecurityQandA `json:\"securityanswer\"`\n}\n\ntype SecurityQandA struct {\n    SecurityQuestion string `json:\u003cid of security question\u003e`\n    // Use your secret question IDs in the json field\n    // this would be a random string\n    // for more information on this see the security question documentation\n}\n\nsecurityQuestion := SecurityQuestion{\"Answer\"}\nbody := ResetPasswordBySecurityAnswerAndEmailStruct{\n  securityQuestion,\n  \u003cemail\u003e,\n  \u003cpassword\u003e\n}\n\nresponse, err = lrauthentication.Loginradius(lrauthentication.Loginradius{lrclient}).PutManageAccountUpdateSecurityQuestionConfig(\n  \u003cuid\u003e,\n  body,\n)\nif err != nil {\n  // handle error\n}\n```\n\n##### Account Invalidate Verification Email\n\nThis API is used to invalidate the verification email status on an account.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-invalidate-verification-email)\n\nExample:\n\n```go\nresponse, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).PutManageAccountInvalidateVerificationEmail(\u003cuid\u003e)\nif err != nil {\n  // handle error\n}\n```\n\n##### Account Email Delete\n\nThis API is used to delete an email off of an account. When emails are set as identifiers, an account should always have at least one email.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-email-delete)\n\nExample:\n\n```go\nresponse, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).DeleteManageAccountEmail(\n  uid,\n  map[string]string{\"email\":\u003cemail to delete\u003e},\n)\nif err != nil {\n  // handle error\n}\n```\n\n##### Account Delete\n\nThis API is used to delete an account.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-delete)\n\nExample:\n\n```go\n_, err := lraccount.Loginradius(lraccount.Loginradius{lrclient}).DeleteManageAccount(\u003cuid\u003e)\nif err != nil {\n  // handle error\n}\n```\n\n\n### Roles API\n\nThe Roles APIs are used to manage the creation and assignment of user roles for a customer account.\n\nTo call a Roles API, import the role package like so:\n\n```go\nimport (\n\t\"github.com/LoginRadius/go-sdk/api/role\"\n)\n```\n\n**List of APIs in this Section:**\n\n- [POST: Roles Create](#roles-create)\n- [GET: Get Context](#get-context)\n- [GET: Roles List](#roles-list)\n- [GET: Get Roles By UID](#get-roles-by-uid)\n- [PUT: Add Permissions To Role](#add-permissions-to-role)\n- [PUT: Assign Roles By UID](#assign-roles-by-uid)\n- [PUT: Upsert Context](#upsert-context)\n- [DELETE: Delete Role](#delete-role)\n- [DELETE: Unassign Role By UID](#unassign-role-by-uid)\n- [DELETE: Remove Permissions](#remove-permissions)\n- [DELETE: Delete Context](#delete-context)\n- [DELETE: Delete Role From Context](#delete-role-from-context)\n- [DELETE: Delete Permissions From Context](#delete-permissions-from-context)\n\n##### Roles Create\n\nThis API is used to create a role.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/roles-create)\n\nExample:\n\n```go\n// uses struct offered by lrbody package\n// alternatively an anonymous struct could be used, or a []byte\nrole := lrbody.Role{\n  Name: \u003crolename\u003e,\n  Permissions: map[string]bool{\n    \u003cpermission name\u003e:         true,\n    \u003cpermission name\u003e:         true,\n  },\n}\nroles := lrbody.Roles{[]lrbody.Role{role}}\n\nres, err = role.Loginradius(role.Loginradius{lrclient}).PostRolesCreate(roles)\nif err != nil {\n  // handle error\n}\n```\n\n##### Get Context\n\nThis API is used to get a context associated with an account.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/get-context)\n\nExample:\n\n```go\nres, err := role.Loginradius(role.Loginradius{lrclient}).GetContextRolesPermissions(\u003cuid\u003e)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Roles List\n\nThis API is used to get a list of roles within the customer account.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/roles-list)\n\nExample:\n\n```go\nres, err := role.Loginradius(role.Loginradius{lrclient}).GetRolesList()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Get Roles By UID\n\nThis API is used to retrieve all the assigned roles for a particular user.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/get-roles-by-uid)\n\nExample:\n\n```go\nres, err := role.Loginradius(role.Loginradius{lrclient}).GetRolesByUID(\u003cuid\u003e)\nif err != nil {\n  // handle error\n}\n```\n\n##### Add Permissions To Role\n\nThis API is used to add permissions to an existing role.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/add-permissions-to-role)\n\nExample:\n\n```go\n// This example uses a helper struct from the lrbody package\n// Alternatively you could initialize your own struct, or pass a []byte as body\nres, err := role.Loginradius(role.Loginradius{lrclient}).PutAccountAddPermissionsToRole(\n  \u003crole name\u003e,\n  lrbody.PermissionList{[]string{\u003cpermission name}},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Assign Roles By UID\n\nThis API is used to assign your desired roles to a given user.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/assign-roles-by-uid)\n\nExample:\n\n```go\nres, err := role.Loginradius(role.Loginradius{lrclient}).PutRolesAssignToUser(\n  uid,\n  // this example uses a []byte as body, alternatively a struct or map[string]string // could be passed as well\n  []byte(`{\"roles\": [\"`+\u003crole name\u003e+`\"]}`),\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Upsert Context\n\nThis API is used to create a context with a set of rules.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/upsert-context)\n\nExample:\n\n```go\n// This example uses a []byte as body, alternatively a struct or map[string]string // could be passed as well\nbody := []byte(`{\"rolecontext\":[{\"context\":\u003ccontext name\u003e, \"roles\":[\"\u003crole name\u003e\"], \"additionalpermissions\":[\u003cpermission\u003e, \u003cpermission\u003e]}]}`)\n\nres, err := role.Loginradius(role.Loginradius{lrclient}).PutRolesUpsertContext(\n  \u003cuid\u003e,\n  body,\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Delete Role\n\nThis API is used to delete a role.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-role)\n\nExample:\n\n```go\nres, err := role.Loginradius(role.Loginradius{lrclient}).DeleteAccountRole(\u003crolename\u003e)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Unassign Role By UID\n\nThis API is used to unassign a role.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/unassign-roles-by-uid)\n\nExample:\n\n```go\n// This example uses a []byte as body, alternatively a struct or map[string]string // could be passed as well\nres, err := role.Loginradius(role.Loginradius{lrclient}).PutRolesAssignToUser(\n  uid,\n  []byte(`{\"roles\": [\"example_role_name\"]}`),\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Remove Permissions\n\nThis API is used to remove permissions from a role.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/remove-permissions)\n\nExample:\n\n```go\n// This example uses a helper struct offered by the lrbody package as body, alternatively a []byte could be used as well\nres, err := role.Loginradius(role.Loginradius{lrclient}).DeleteRolesAccountRemovePermissions(\n  \u003crolename\u003e,\n  lrbody.PermissionList{[]string{\u003cpermissionName\u003e}},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Delete Context\n\nThis API deletes the passed in role context.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-context)\n\nExample:\n\n```go\nres, err = role.Loginradius(role.Loginradius{lrclient}).DeleteContextFromRole(\n  uid,\n  \u003cexample_context\u003e,\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Delete Role From Context\n\nThis API deletes the specified role from a context.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-role-from-context)\n\nExample:\n\n```go\n// This example uses a []byte as body, alternatively a struct or map[string]string\n// could be passed as well\nres, err = role.Loginradius(role.Loginradius{lrclient}).DeleteRoleFromContext(\n  uid,\n  \u003cexample_context\u003e,\n  []byte(`{\"roles\":[\"\u003crolename\u003e\"]}`),\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Delete Permissions From Context\n\nThis API deletes additional permissions from a context.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-permissions-from-context)\n\nExample:\n\n```go\n// This example uses a []byte as body, alternatively a struct or map[string]string\n// could be passed as well\nres, err = role.Loginradius(role.Loginradius{lrclient}).DeleteAdditionalPermissionFromContext(\n  \u003cuid\u003e,\n  \u003ccontext name\u003e,\n  []byte(`{\"additionalpermissions\":[\"\u003cpermission name\u003e\"]}`),\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n### Multi-Factor Authentication APIs\n\nThe Multi-Factor Authentication APIs are used to handle Multi-Factor Authentication for users. Multi-Factor Authentication should be enabled on the admin console before utilizing these APIs. Take note, the access tokens used for this section are different from the access tokens obtained from standard login and is obtained from calling the validate Backup Code/OTP/Google Auth Code API.\n\nTo call a Multi-Factor Authentication API, import the `mfa` package like so:\n\n```go\nimport (\n\t\"github.com/LoginRadius/go-sdk/api/mfa\"\n)\n```\n\n**List of APIs in this Section:**\n\n- [POST: MFA Email Login](#mfa-email-login)\n- [POST: MFA User Name Login](#mfa-user-name-login)\n- [POST: MFA Phone Login](#mfa-phone-login)\n- [GET: MFA Validate Access Token](#mfa-validate-access-token)\n- [GET: MFA Backup Code By Access Token](#mfa-backup-code-by-access-token)\n- [GET: MFA Reset Backup Code By Access Token](#mfa-reset-backup-code-by-access-token)\n- [GET: MFA Backup Code By UID](#mfa-backup-code-by-uid)\n- [GET: MFA Reset Backup Code By UID](#mfa-reset-backup-code-by-uid)\n- [PUT: MFA Validate Backup Code](#mfa-validate-backup-code)\n- [PUT: Validate MFA by OTP](#validate-mfa-by-otp)\n- [PUT: Validate MFA by Google Authenticator Code](#validate-mfa-by-google-authenticator-code)\n- [PUT: MFA Update Phone Number](#mfa-update-phone-number)\n- [PUT: MFA Update Phone Number By Token](#mfa-update-phone-number-by-token)\n- [PUT: Update MFA By Access Token](#update-mfa-by-access-token)\n- [PUT: Update MFA Settings](#update-mfa-settings)\n- [DELETE: MFA Reset Google Authenticator By Token](#mfa-reset-google-authenticator-by-token)\n- [DELETE: MFA Reset SMS Authenticator By Token](#mfa-reset-sms-authenticator-by-token)\n- [DELETE: MFA Reset Google Authenticator By UID](#mfa-reset-google-authenticator-by-uid)\n- [DELETE: MFA Reset SMS Authenticator By UID](#mfa-reset-sms-authenticator-by-uid)\n\n##### MFA Email Login\n\nThis API uses the multi-factor process to perform an authentication using email.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-email-login)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively []byte or\n// struct could be passed as body as well\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).PostMFAEmailLogin(\n  map[string]string{\"email\":\u003cemail\u003e, \"password\":\u003cpassword\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA User Name Login\n\nThis API uses the multi-factor process to perform an authentication using username.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-user-name-login)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively []byte or\n// struct could be passed as body as well\nres, err = mfa.Loginradius(mfa.Loginradius{lrclient}).PostMFAUsernameLogin(\n  map[string]string{\"username\": username, \"password\": password},\n  map[string]string{\"emailtemplate\": \"hello\"},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Phone Login\n\nThis API uses the multi-factor process to perform an authentication using phone.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-phone-login)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively []byte or\n// struct could be passed as body as well\nres, err = mfa.Loginradius(mfa.Loginradius{lrclient}).PostMFAPhoneLogin(\n  map[string]string{\"phone\": phone, \"password\": password},\n  map[string]string{\"emailtemplate\": \"hello\"},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Validate Access Token\n\nThis API validates the access token after logging in with an optional MFA setting. Take note, the access tokens used for this section are different from the access tokens obtained from standard login and is obtained from calling the validate Backup Code/OTP/Google Auth Code API.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-validate-access-token)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively []byte or\n// struct could be passed as body as well\nres, err = mfa.Loginradius(mfa.Loginradius{lrclient}).GetMFAValidateAccessToken(\n  map[string]string{\"smstemplate2fa\": \"hello\"}, // this is an optional query parameter\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Backup Code By Access Token\n\nThis API creates backup codes for user login after passing in a valid access token. Take note, the access tokens used for this section are different from the access tokens obtained from standard login and is obtained from calling the validate Backup Code/OTP/Google Auth Code API.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-backup-code-by-access-token)\n\nExample:\n\n```go\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).GetMFABackUpCodeByAccessToken()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Reset Backup Code By Access Token\n\nThis API resets any backup codes created for the account when passed in an access token. Take note, the access tokens used for this section are different from the access tokens obtained from standard login and is obtained from calling the validate Backup Code/OTP/Google Auth Code API.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-reset-backup-code-by-access-token)\n\nExample:\n\n```go\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).GetMFAResetBackUpCodeByAccessToken()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Backup Code By UID\n\nThis API creates backup codes for a user after passing in a UID. The UID passed in must have an account with a valid Multi-Factor Authentication setup.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-backup-code-by-uid)\n\nExample:\n\n```go\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).GetMFABackUpCodeByUID(\u003cuid\u003e)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Reset Backup Code By UID\n\nThis API resets any backup codes created for the account when passed in a UID. The UID passed in must have an account with a valid Multi-Factor Authentication setup.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-reset-backup-code-by-uid)\n\nExample:\n\n```go\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).GetMFAResetBackUpCodeByUID(\u003cuid\u003e)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Validate Backup Code\n\nThis API validates the passed in backup code and returns a multi-factor access token. For more information on the Multi-Factor Authentication token, read the overview document for Multi-Factor Authentication. It can be obtained from calling one of the multi-factor login APIs.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-validate-backup-code)\n\nExample:\n\n```go\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).GetMFAResetBackUpCodeByAccessToken()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Validate OTP\n\nThis API validates the OTP sent for Multi-Factor Authentication. For more information on the Multi-Factor Authentication token, read the overview document for Multi-Factor Authentication. It can be obtained from calling one of the multi-factor login APIs.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-validate-otp)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a struct or a\n// []byte could be passed as body as well.\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).PostMFAEmailLogin(\n  map[string]string{\"email\": \u003cemail\u003e, \"password\": \u003cpassword\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Validate Google Auth Code\n\nThis API validates the Google Auth Code generated for Multi-Factor Authentication. For more information on the Multi-Factor Authentication token, read the overview document for Multi-Factor Authentication. It can be obtained from calling one of the multi-factor login APIs.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/mfa-validate-google-auth-code/)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a struct or a\n// []byte could be passed as body as well.\nres, err = mfa.Loginradius(mfa.Loginradius{lrclient}).PutMFAValidateGoogleAuthCode(\n  map[string]string{\"secondfactorauthenticationtoken\": \u003ctoken\u003e},\n  map[string]string{\"googleauthenticatorcode\": \u003cgoogle authenticator code\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Update Phone Number\n\nThis API updates the phone number associated with MFA OTPs if configured for the account. For more information on the Multi-factor Authentication token, read the overview document for Multi-Factor Authentication. It can be obtained from calling one of the multi-factor login APIs.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-update-phone-number)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a struct or a\n// []byte could be passed as body as well.\nres, err = mfa.Loginradius(mfa.Loginradius{lrclient}).PutMFAUpdatePhoneNumber(\n  map[string]string{\"secondfactorauthenticationtoken\": \u003ctoken\u003e},\n  map[string]string{\"phoneno2fa\": \u003cphone number\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Update Phone Number By Token\n\nThis API updates the phone number associated with MFA OTPs if configured for the account. This API uses the access token to update instead of second factor auth token.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-update-phone-number-by-token)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a struct or a\n// []byte could be passed as body as well.\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).PutMFAUpdatePhoneNumberByToken(\n  map[string]string{\"phoneno2fa\": \u003cphone number\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Update MFA By Access Token\n\nThis API enables MFA authentication through Google Authenticator Codes when the user is already logged in.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/update-mfa-by-access-token)\n\nExample:\n\n```go\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).PutMFAUpdateByToken(\u003cgoogle authenticator code\u003e)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Update MFA Settings\n\nThis API enables MFA authentication through OTP after login.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/update-mfa-setting)\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a struct or a\n// []byte could be passed as body as well.\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).PutMFAUpdateSettings(\n  map[string]string{\"otp\":\u003cotp\u003e}, // add optional body parameters in map if any\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Reset Google Authenticator By Token\n\nThis API resets the MFA configuration for a Google Authenticator associated with a user's account.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/mfa-reset-google-authenticator-by-token)\n\nExample:\n\n```go\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).DeleteMFAResetGoogleAuthenticatorByToken()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Reset SMS Authenticator By Token\n\nThis API resets the MFA configuration for a phone device associated with a user's account.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-reset-sms-authenticator-by-token)\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\nExample:\n\n```go\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).DeleteMFAResetSMSAuthenticatorByToken()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Reset Google Authenticator By UID\n\nThis API resets the MFA configuration for a Google Authenticator associated with a user's account.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/mfa-reset-google-authenticator-by-uid)\n\nExample:\n\n```go\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).DeleteMFAResetGoogleAuthenticatorByUid(\u003cuid\u003e)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Reset SMS Authenticator By UID\n\nThis API resets the MFA configuration for a phone device associated with a user's account.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-reset-sms-authenticator-by-uid)\n\nExample:\n\n```go\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).DeleteMFAResetSMSAuthenticatorByUid(\u003cuid\u003e)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### MFA Re-authenticate\n\nThis API is used to trigger the Multi-Factor Autentication workflow for the provided access_token\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/mfa-re-authenticate)\n\nExample:\n\n```go\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).GetMFAReAuthenticate()\nif err != nil {\n  // handle error\n}\n```\n\n##### Validate MFA by Google Authenticator Code\n\nThis API is used to re-authenticate via Multi-Factor Authentication by passing the Google Authenticator code.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-by-google-authenticator-code/)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a []byte or\n// a struct could also be passed as body.\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).PutMFAReauthenticateByGoogleAuthenticator(\n  map[string]string{\"googleauthenticatorcode\": \u003cgoogle authenticator code\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Validate MFA by OTP\n\nThis API is used to re-authenticate via Multi-Factor Authentication by passing the One-Time Passcode received via SMS authentication.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-by-otp)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a []byte or\n// a struct could also be passed as body.\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).PutMFAReauthenticateByOTP(\n  map[string]string{\"otp\": \u003cotp?},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Validate MFA by Backup Code\n\nThis API is used to re-authenticate by set of backup codes via access_token on the site that has Multi-Factor Authentication enabled in re-authentication for the user that does not have the device.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/validate-mfa-by-backup-code)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a []byte or\n// a struct could also be passed as body.\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).PutMFAReauthenticateByBackupCode(\n  map[string]string{\"backupcode\": \u003cbackup code\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Validate MFA by Password\n\nThis API is used to re-authenticate via Multi-Factor Authentication by passing in the password.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docshttps://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/re-auth-validate-password)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a []byte or\n// a struct could also be passed as body.\nres, err := mfa.Loginradius(mfa.Loginradius{lrclient}).PutMFAReauthenticateByPassword(\n  map[string]string{\"password\": \"password\"},\n)\nif err != nil {\n  // handle error\n}\n```\n\n### Social APIs\n\nThe Social APIs are used to fetch user profile and other data from providers linked to the user accounts. The access tokens in this section are obtained after validating an access token using a social provider. Look at Access Token via Facebook, Access Token via Twitter, Access Token via VKontakte to get these access tokens.\n\nTo call a Social API, import the social package like so:\n\n```go\nimport (\n  lrsocial \"github.com/LoginRadius/go-sdk/api/social\"\n)\n```\n\n**List of APIs in this Section:**\n\n- [POST: Post Message API](#post-message-api)\n- [POST: Trackable Status Posting](#trackable-status-posting)\n- [GET: Access Token](#access-token)\n- [GET: Validate Access Token](#validate-access-token)\n- [GET: Invalidate Access Token](#invalidate-access-token)\n- [GET: Album](#album)\n- [GET: Audio](#audio)\n- [GET: Check-in](#check-in)\n- [GET: Company](#company)\n- [GET: Contact](#contact)\n- [GET: Event](#event)\n- [GET: Following](#following)\n- [GET: Group](#group)\n- [GET: Like](#like)\n- [GET: Mention](#mention)\n- [GET: Get Message API](#get-message-api)\n- [GET: Page](#page)\n- [GET: Photo](#photo)\n- [GET: Post](#post)\n- [GET: Status Fetching](#status-fetching)\n- [GET: Status Posting](#status-posting)\n- [GET: Video](#video)\n\n##### Post Message API\n\nThis API is used to send messages through the user's provider account.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post-message-api)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a []byte or\n// a struct could also be passed as body.\nresp, err := lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).PostSocialMessageAPI(\n  map[string]string{\n    \"to\":      \u003creceipient's social provider id\u003e,\n    \"subject\": \u003cmessage subject\u003e,\n    \"message\": \u003cmessage content\u003e,\n  },\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Trackable Status Posting\n\nThis API is used to post a new status for the user through their provider account.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/trackable-status-posting)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a []byte or\n// a struct could also be passed as body.\nqueries := map[string]string{\n  \"url\":         \u003curl\u003e,\n  \"title\":       \u003ctitle\u003e,\n  \"imageurl\":    \u003cimg url\u003e,\n  \"status\":      \u003cstatus\u003e,\n  \"caption\":     \u003ccaption\u003e,\n  \"description\": \u003cdescription\u003e,\n}\n\nresp, err := lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).PostSocialStatusPost(queries)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Access Token\n\nThis API is used to translate a LoginRadius Request Token into an Access Token that can be used with all APIs.\n\nFor more information on LoginRadius Request Tokens, see [this documentation](/infrastructure-and-security/loginradius-tokens#loginradius-request-token-expiration-15-mins-).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/access-token)\n\nExample:\n\n```go\nresp, err := lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialAccessToken(\u003crequest token\u003e)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Validate Access Token\n\nThis API validates the passed in access token for social API usage.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/validate-access-token)\n\nExample:\n\n```go\nresp, err := lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialTokenValidate()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Invalidate Access Token\n\nThis API invalidates the access token passed in.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/invalidate-access-token)\n\nExample:\n\n```go\nresp, err := lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialTokenInvalidate()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Album\n\nThis API retrieves Album data associated with the user's provider.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/album)\n\nExample:\n\n```go\nresp, err := lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialAlbum()\n\nif err!= nil {\n  // handle error\n}\n```\n\n##### Audio\n\nThis API retrieves Audio associated with the user's provider.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/audio)\n\nExample:\n\n```go\nresp, err := lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialAudio()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Check-in\n\nThis API retrieves Check-in data associated with the user's provider.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/check-in)\n\nExample:\n\n```go\nres, err = lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialCheckin()\nif err != nil {\n  // handle error\n}\n```\n\n##### Company\n\nThis API retrieves Company data associated with the user's provider.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/company)\n\nExample:\n\n```go\nres, err = lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialCompany()\nif err != nil {\n  // handle error\n}\n```\n\n##### Contact\n\nThis API retrieves Contact data associated with the user's provider.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/contact)\n\nExample:\n\n```go\nres, err = lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialContact()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Event\n\nThis API retrieves Event data associated with the user's provider.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/event)\n\nExample:\n\n```go\nres, err = lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialEvent()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Following\n\nThis API retrieves follower data associated with the user's provider.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/following)\n\nExample:\n\n```go\nres, err = lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialFollowing()\nif err != nil {\n  // handle error\n}\n```\n\n##### Group\n\nThis API retrieves Group data associated with the user's provider.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/group)\n\nExample:\n\n```go\nres, err = lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialGroup()\nif err != nil {\n  // handle error\n}\n```\n\n##### Like\n\nThis API retrieves Like data associated with the user's provider.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/like)\n\nExample:\n\n```go\nres, err = lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialLike()\nif err != nil {\n  // handle error\n}\n```\n\n##### Mention\n\nThis API retrieves Mention data associated with the user's provider.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/mention)\n\nExample:\n\n```go\nres, err = lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialMention()\nif err != nil {\n  // handle error\n}\n```\n\n##### Get Message API\n\nThe Message API is used to post messages to the user’s contacts.\n\nSupported Providers: LinkedIn, Twitter\n\nThe Message API is used to post messages to the user’s contacts. This is one of the APIs that makes up the LoginRadius Friend Invite System. After using the Contact API, you can send messages to the retrieved contacts. This API requires setting permissions in your LoginRadius Admin Console.\n\nGET and POST Message APIs work the same way except the API method is different.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/get-message-api)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a []byte or\n// a struct could also be passed as body.\nqueries := map[string]string{\n  \"url\":         \u003curl\u003e,\n  \"title\":       \u003ctitle\u003e,\n  \"imageurl\":    \u003cimg url\u003e,\n  \"status\":      \u003cstatus\u003e,\n  \"caption\":     \u003ccaption\u003e,\n  \"description\": \u003cdescription\u003e,\n}\n\nresp, err := lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialStatusPost(queries)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Page\n\nThis API retrieves Page data for the page passed in. The passed in page typically is an ID designated by the provider.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/page)\n\nExample:\n\n```go\n_, err = lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialPage(\u003cpagename\u003e)\nif err != nil {\n  // handle error\n}\n```\n\n##### Photo\n\nThis API retrieves Photo data associated with a passed in Album ID.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/photo)\n\nExample:\n\n```\n// Takes string as argument\nres, err = lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialPhoto(\u003calbumid\u003e)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Post\n\nThis API retrieves Post data associated with a user's account.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post)\n\nExample:\n\n```go\nres, err = lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialPost()\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Status Fetching\n\nThis API retrieves Status data associated with a user's account.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/status-fetching)\n\nExample:\n\n```go\nres, err = lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialStatus()\nif err != nil {\n  // handle error\n}\n```\n\n##### Status Posting\n\nThis API is used to post a new status for the user through their provider account.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/status-posting)\n\nExample:\n\n```go\nfunc StatusPostingGet() {\n    // Set LoginRadius Environment Here\n    loginradius.SetLoginRadiusEnv(\"MyAPIKey\", \"MyAPISecret\", \"https://api.loginradius.com\")\n\n    // Call the API\n    response, err := loginradius.GetSocialStatusPost(\"AccessToken\", \"StatusTitle\", \"StatusURL\", \"StatusImageURL\", \"StatusMessage\", \"StatusCaption\", \"StatusDescription\")\n    if(err != nil) {\n        // handle the error\n    }\n\n    // Use the returned object\n    fmt.Printf(\"%+v\\n\", response)\n}\n```\n\n##### Video\n\nThis API retrieves Video data associated with a user's account.\n\nPlease note this API requires the access token to be passed in. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/video)\nExample:\n\n```go\nres, err = lrsocial.Loginradius(lrsocial.Loginradius{lrclient}).GetSocialVideo()\n\nif err != nil {\n  // handle error\n}\n```\n\n### Phone Authentication APIs\n\nThe Phone Authentication APIs are used similar to the regular Login Authentication APIs, but consist of a flow using an SMS device instead. Phone OTPs are used for verification instead of email verification for the APIs that need verification.\n\nTo call a Phone Authentication API, import the `phoneauthentication` package like so:\n\n```go\nimport (\n  \"github.com/LoginRadius/go-sdk/api/phoneauthentication\"\n)\n```\n\n**List of APIs in this Section:**\n\n- [POST: Phone Login](#phone-login)\n- [POST: Phone Forgot Password By OTP](#phone-forgot-password-by-otp)\n- [POST: Phone Resend OTP](#phone-resend-otp)\n- [POST: Phone Resend OTP By Token](#phone-otp-by-token)\n- [POST: Phone User Registration By SMS](#phone-user-registration-by-sms)\n- [GET: Passwordless Login By Phone](#passwordless-login-by-phone)\n- [GET: Phone Number Availability](#phone-number-availability)\n- [GET: Passwordless Login Phone Verification](#passwordless-login-phone-verification)\n- [PUT: Phone Number Update](#phone-number-update)\n- [PUT: Phone Reset Password By OTP](#phone-reset-password-by-otp)\n- [PUT: Phone Verify OTP](#phone-verify-otp)\n- [PUT: Phone Verify OTP By Token](#phone-verify-otp-by-token)\n- [PUT: Reset Phone ID Verification](#reset-phone-id-verification)\n- [DELETE: Remove Phone ID By Access Token](#remove-phone-id-by-access-token)\n\n##### Phone Login\n\nThis API logs in a user using their PhoneId and returns an access token and profile data.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-login)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a struct or\n// []byte could be passed as well\nresp, err := phoneauthentication.Loginradius(phoneauthentication.Loginradius{lrclient}).PostPhoneLogin(\n  map[string]string{\"phone\": \u003cphone id\u003e, \"password\": \u003cpassword\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Phone Forgot Password By OTP\n\nThis API starts the forgot password flow for a phone user by sending a forgot password OTP to their phone.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-forgot-password-by-otp)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a struct or\n// []byte could be passed as well\nresp, err := phoneauthentication.Loginradius(phoneauthentication.Loginradius{lrclient}).PostPhoneForgotPasswordByOTP(\n  map[string]string{\"phone\": \u003cphone number\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Phone Resend OTP\n\nThis API resends the account verification OTP to the PhoneId associated with the user account.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-resend-otp)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a struct or\n// []byte could be passed as well\nresp, err := phoneauthentication.Loginradius(phoneauthentication.Loginradius{lrclient}).PostPhoneResendVerificationOTP(\n  map[string]string{\"phone\": \u003cphone number\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Phone Resend OTP By Token\n\nThis API resends the account verification OTP to the PhoneId associated with the user account in cases where an active token exists.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-resend-otp-by-token)\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a struct or\n// []byte could be passed as well\nresp, err := phoneauthentication.Loginradius(phoneauthentication.Loginradius{lrclient}).PostPhoneResendVerificationOTPByToken(\n  map[string]string{\"phone\": \u003cphone number\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Phone User Registration By SMS\n\nThis API registers a user with the profile data provided in the body.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-user-registration-by-sms)\n\nExample:\n\n```go\n// This example uses initialized struct, alternatively a helper struct from lrbody\n// package could be used, an anonymous struct or []byte would also work.\ntype Email struct {\n\tType  string `json:\"Type\"`\n\tValue string `json:\"Value\"`\n}\n\ntype User struct {\n\tEmail    []Email `json:\"Email\"`\n\tPassword string  `json:\"Password\"`\n  PhoneId string  `json:\"PhoneId\"`\n\n}\n\nuser:= User{\n  Email: []Email{\n    Email{\n      Type:  \"Primary\",\n      Value: \u003cemail\u003e,\n    },\n  },\n  Password: \"password\",\n  PhoneId:\"phone_number\",\n}\nsott:=\"\" //(Required) Sott\nres, err:= phoneauthentication.Loginradius(phoneauthentication.Loginradius{lrclient}).PostPhoneUserRegistrationBySMS(sott,user,)\nif err != nil {\n  // handle error\n}\n```\n\n##### Passwordless Login By Phone\n\nThis API sends an OTP to the phone. This API is part of the Passwordless Login module.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-by-phone)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a struct or\n// []byte could be passed as well\nres, err := phoneauthentication.Loginradius(phoneauthentication.Loginradius{lrclient}).PutPhoneLoginUsingOTP(\n  map[string]string{\"phone\": \"\", \"otp\": \"871962\"},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Phone Number Availability\n\nThis API checks whether a phone number is available for use within the database.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-number-availability)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a struct or\n// []byte could be passed as well\nresp, err := phoneauthentication.Loginradius(phoneauthentication.Loginradius{lrclient}).GetPhoneNumberAvailability(\n  map[string]string{\"phone\": \u003cphone number\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Passwordlass Login Phone Verification\n\nThis API logs in a user using an OTP. This API is part of the Passwordless Login module.\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-phone-verification)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a struct or\n// []byte could be passed as well\nres, err := phoneauthentication.Loginradius(phoneauthentication.Loginradius{lrclient}).PutPhoneLoginUsingOTP(\n  map[string]string{\"phone\": \"\", \"otp\": \u003cotp\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Phone Number Update\n\nThis API updates a user's SMS PhoneId.\n\nPlease note this API requires the access token to be passed in the `Authorization Bearer` header. The LoginRadius API client struct [must be initialized with a token](#Intializing-the-LoginRadius-Client).\n\n[Documentation](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-number-update)\n\nExample:\n\n```go\n// This example uses a map[string]string as body, alternatively a struct or\n// []byte could be passed as well\nres, err := phoneauthentication.Loginradius(phoneauthentication.Loginradius{lrclient}).PutPhoneNumberUpdate(\n  map[string]string{\"phone\": \u003cphone number\u003e},\n)\n\nif err != nil {\n  // handle error\n}\n```\n\n##### Phone Reset Password By OTP\n\nThis API resets the user's passw","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floginradius%2Fgo-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floginradius%2Fgo-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floginradius%2Fgo-sdk/lists"}