Send an invite link to an existing user in your OneLogin account. The user clicks the link to set their password and access your OneLogin portal.
A trial account can send at most 3 invitation and notification-rule emails in total, counted across the admin console, the API and notification rules. After that, this API returns 403 Forbidden with error_key set to trial_email_limit_reached, and no email is sent.
Resource URL
https://<subdomain>.onelogin.com/api/1/invites
/send_invite_linkHeader Parameters
Authorization required string | Set to Set Generate the access token with the API credential pair created using the scope required to call this API. Call this API using the |
Content-Type required string | Set to |
Request Parameters
required string | Set to the user email address to generate an invite link. The value is case sensitive. |
personal_email string | To send an invite email to a different address than the one provided in email, provide it here. The invite link is sent to this address instead. |
Sample Request Body
{
"email":"jennifer.hasenfus@mycompany.com",
"personal_email":"jennifer.hasenfus@mail.com"
}Sample Response
- 200 OK
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
{
"status": {
"type": "success",
"message": "Email sent successfully to jennifer.hasenfus@mail.com",
"error": false,
"code": 200
}
}{
"status": {
"type": "bad request",
"message": "No User exists for input email",
"error": true,
"code": 400
}
}{
"status": {
"type": "bad request",
"message": "Email Input is in incorrect format",
"error": true,
"code": 400
}
}{
"status": {
"type": "bad request",
"message": "Email Parameter is missing",
"error": true,
"code": 400
}
}{
"status": {
"error": true,
"code": 400,
"type": "bad request",
"message": "Content Type is not specified or specified incorrectly.
Content-Type header must be set to application/json"
}
}Typically, the following error indicates the Authorization header value is missing or incorrectly formatted. The Authorization header value uses this format: bearer <access_token>.
{
"status": {
"error": true,
"code": 400,
"type": "bad request",
"message": "Authorization Information is incorrect"
}
}{
"status": {
"error": true,
"code": 400,
"type": "bad request",
"message": "Input JSON is not valid"
}
}This error indicates an invalid access token.
{
"status": {
"error": true,
"code": 401,
"type": "Unauthorized",
"message": "Authentication Failure"
}
}The following error indicates that an API with insufficient API credentials generated the access token that made the call. Call this API using the Manage All scope only.
{
"status": {
"error": true,
"code": 401,
"type": "Unauthorized",
"message": "Insufficient Permission"
}
}The following error indicates that email belongs to the account owner. This API can’t send an invite link to the account owner.
{
"status": {
"error": true,
"code": 403,
"type": "forbidden",
"message": "Cannot perform 'send_invite_link' action on Account Owner"
}
}The following error indicates that a trial account has already sent its limit of 3 invitation and notification-rule emails. No email is sent. To send more, upgrade the subscription or contact OneLogin Support. Check error_key to tell this error apart from other 403 responses.
{
"status": {
"error": true,
"code": 403,
"type": "Forbidden",
"message": "This trial account has sent the maximum of 3 invitation and notification emails. To send more, upgrade your subscription or contact OneLogin Support.",
"error_key": "trial_email_limit_reached"
}
}Postman Collection
Sample cURL Request
Replace sample values indicated by < > with your actual values.
curl "https://<subdomain>.onelogin.com/api/1/invites/send_invite_link" \
-X POST \
-H "Authorization: bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"email":"<user_email>",
"personal_email":"<user_personal_email>"
}'Have a Question?
Found a problem or a bug? Submit a support ticket.
Looking for walkthroughs or how-to guides? Check out our Knowledge Base.
Have a product idea or request? Share it in our Ideas Portal.