See api-docs Menu

Send Invite Link

Send an invite link to a user that you have already created in your OneLogin account.

The user can click the link to set his password and access your OneLogin portal.

Resource URL

https://api.<us_or_eu>.onelogin.com/api/1/invites
/send_invite_link

Header Parameters

Authorization

required

string

Set to bearer:<access_token>.

Set <access_token> to the access token you generated using the Generate Token API.

The access token must have been generated using an API credential pair created using the scope required to call this API. This API can be called using the Manage All scope only.

Content-Type

required

string

Set to application/json.

Request Parameters

email

required

string

Set to the email address of the user that you want to generate an invite link for.

personal_email

string

If you want to send the invite email to an email other than the one provided in email, provide it here. The invite link will be sent to this address instead.

Sample Request Body

{
  "email":"jennifer.hasenfus@mycompany.com",
  "personal_email":"jennifer.hasenfus@mail.com"
}

Sample Response

{
    "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 means that your Authorization header value is missing or incorrectly formatted. The Authorization header value should use 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"
    }
}

Typically, this error means that your access token value is invalid.

{
    "status": {
        "error": true,
        "code": 401,
        "type": "Unauthorized",
        "message": "Authentication Failure"
    }
}

Typically, the following error means that the access token used to make the call was generated using API credentials that have insufficient permissions. This API can be called using the Manage All scope only.

{
    "status": {
        "error": true,
        "code": 401,
        "type": "Unauthorized",
        "message": "Insufficient Permission"
    }
}

Postman Collection

Replace sample variables indicated by < > in the sample request body with your actual values. Also, be sure to set Postman-specific environment variables indicated by {{ }}.

Download for the Invites API

Sample cURL Request

Replace sample values indicated by < > with your actual values.

curl "https://api.<us_or_eu>.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?

Have a how-to question? Seeing a weird error? Ask us about it on StackOverflow.

Found a bug? Submit a support ticket.

Have a product idea or request? Share it with us in our Ideas Portal.