See api-docs Menu

Generate Invite Link

Generate an invite link for a user already created in your OneLogin account.

Provide the link to the user to enable her to set her password to access your OneLogin portal.

Resource URL

https://<api-domain>/api/1/invites/
get_invite_link

Header Parameters

Authorization

required

string

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

Generate the access token with the API credential pair created using the scope required to call this API. Call this API using the Manage All scope only.

Content-Type

required

string

Set to application/json.

Request Parameter

email

required

string

Set to the user email address to generate an invite link.

Sample Request Body

{
  "email":"jennifer.hasenfus@mycompany.com"
}

Sample Response

{
    "status": {
        "type": "success",
        "message": "Success",
        "code": 200,
        "error": false
    },
    "data": [
        "http://app.onelogin.com/password/reset?token=
         1111111cf892e56957e35c9c12f128483031dd11"
    ]
}

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": {
        "type": "bad request",
        "message": "No User exists for input email",
        "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"
    }
}

{
    "status": {
        "type": "bad request",
        "message": "Email Input is in incorrect format",
        "error": true,
        "code": 400
    }
}

{
    "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"
    }
}

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"
    }
}

Response Elements

data Provides a reset password link.

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 {{ }}.

Run in Postman

    Clicking Run in Postman button navigates to the page where you can fork the collection to your workspace. Forking the collection into your workspace will enable you to contribute to the source collection using pull requests. You can also view the collection in a public workspace if you like and even import a copy of the collection using the links present on the screen.

Sample cURL Request

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

curl "https://<api-domain>/api/1/invites/get_invite_link" \
-X POST \
-H "Authorization: bearer:<access_token>" \
-H "Content-Type: application/json" \
-d '{
    "email":"<user_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.