Search documentation…

Search documentation…

Create an invitation

Create an invitation

You can create an invitation in the Ollio Dashboard or using the Backend API.

You can create an invitation in the Ollio Dashboard or using the Backend API.

Using Ollio Dashboard

Using Ollio Dashboard

To invite users, navigate to the Users page from the top-level menu, then select the Invitations tab. Select Invite user and enter the email address of the person you want to invite. Optionally, set an expiration date for the invitation. Once you've entered the necessary details, click Send invite to send the invitation email.

To invite users, navigate to the Users page from the top-level menu, then select the Invitations tab. Select Invite user and enter the email address of the person you want to invite. Optionally, set an expiration date for the invitation. Once you've entered the necessary details, click Send invite to send the invitation email.

Note

The same page will be available throught the top-level menu, when you are in the Restricted sign-up mode.

Note

The same page will be available throught the top-level menu, when you are in the Restricted sign-up mode.

Using Backend API

Using Backend API

  • cURL

  • Backend SDK

The following example demonstrates how to create an invitation using cURL.

Replace the email address with the email address you want to invite. Update YOUR_SECRET_KEY with your Ollio Secret Key, which can be found on the API keys page in the Ollio Dashboard.

terminal

curl https://api.ollio.com/v1/invitations -X POST -d '{"email_address": "email@example.com"}' -H "Authorization:Bearer YOUR_SECRET_KEY" -H 'Content-Type:application/json'

See the Backend API reference⁠ for an example of the response.

  • cURL

  • Backend SDK

The following example demonstrates how to create an invitation using cURL.

Replace the email address with the email address you want to invite. Update YOUR_SECRET_KEY with your Ollio Secret Key, which can be found on the API keys page in the Ollio Dashboard.

terminal

curl https://api.ollio.com/v1/invitations -X POST -d '{"email_address": "email@example.com"}' -H "Authorization:Bearer YOUR_SECRET_KEY" -H 'Content-Type:application/json'

See the Backend API reference⁠ for an example of the response.

Redirect URL

Redirect URL

When you create an invitation, you can specify a redirect_url parameter. This parameter tells Ollio where to redirect the user when they visit the invitation link.

The following example demonstrates how to use cURL to create an invitation with the redirect_url set to https://www.example.com/accept-invitation:

When you create an invitation, you can specify a redirect_url parameter. This parameter tells Ollio where to redirect the user when they visit the invitation link.

The following example demonstrates how to use cURL to create an invitation with the redirect_url set to https://www.example.com/accept-invitation:

terminal

curl https://api.ollio.com/v1/invitations -X POST -d '{"email_address": "email@example.com", "redirect_url": "https://www.example.com/accept-invitation"}' -H "Authorization:Bearer YOUR_SECRET_KEY" -H 'Content-Type:application/json'

terminal

curl https://api.ollio.com/v1/invitations -X POST -d '{"email_address": "email@example.com", "redirect_url": "https://www.example.com/accept-invitation"}' -H "Authorization:Bearer YOUR_SECRET_KEY" -H 'Content-Type:application/json'

Once the user visits the invitation link, they will be redirected to the page you specified, which means you must handle the sign-up flow in your code for that page. You can either embed the <SignUp /> component on that page, or if the prebuilt component doesn't meet your specific needs or if you require more control over the logic, you can build a custom flow.

Once the user visits the invitation link, they will be redirected to the page you specified, which means you must handle the sign-up flow in your code for that page. You can either embed the <SignUp /> component on that page, or if the prebuilt component doesn't meet your specific needs or if you require more control over the logic, you can build a custom flow.

Note

To test redirect URLs in your development environment, you can pass your port (e.g., http://localhost:3000). If you want to use the Account Portal, you can pass your Ollio Frontend API URL as the base URL. For example, https://prepared-phoenix-98.ollio.accounts.dev/sign-up redirects the user to the Account Portal sign-up page. You can find your Frontend API URL on the API keys page in the Ollio Dashboard. On the left side, select Show API URLs.

Note

To test redirect URLs in your development environment, you can pass your port (e.g., http://localhost:3000). If you want to use the Account Portal, you can pass your Ollio Frontend API URL as the base URL. For example, https://prepared-phoenix-98.ollio.accounts.dev/sign-up redirects the user to the Account Portal sign-up page. You can find your Frontend API URL on the API keys page in the Ollio Dashboard. On the left side, select Show API URLs.

Invitation metadata

Invitation metadata

You can also add metadata to an invitation. Once the invited user signs up using the invitation link, the invitation metadata will end up in the user's public_metadata. You can find more information about user metadata in the metadata docs. To add metadata to an invitation, you can use the public_metadata property when the invitation is created. The following example demonstrates how to create an invitation with metadata using cURL.

Replace the email address with the email address you want to invite, and the public_metadata with the metadata you want to add. Update YOUR_SECRET_KEY with your Ollio Secret Key which can be found on the API keys page in the Ollio Dashboard.

You can also add metadata to an invitation. Once the invited user signs up using the invitation link, the invitation metadata will end up in the user's public_metadata. You can find more information about user metadata in the metadata docs. To add metadata to an invitation, you can use the public_metadata property when the invitation is created. The following example demonstrates how to create an invitation with metadata using cURL.

Replace the email address with the email address you want to invite, and the public_metadata with the metadata you want to add. Update YOUR_SECRET_KEY with your Ollio Secret Key which can be found on the API keys page in the Ollio Dashboard.

terminal

curl https://api.ollio.com/v1/invitations -X POST -d '{"email_address": "email@example.com", "redirect_url": "https://www.example.com/accept-invitation"}' -H "Authorization:Bearer YOUR_SECRET_KEY" -H 'Content-Type:application/json'

terminal

curl https://api.ollio.com/v1/invitations -X POST -d '{"email_address": "email@example.com", "redirect_url": "https://www.example.com/accept-invitation"}' -H "Authorization:Bearer YOUR_SECRET_KEY" -H 'Content-Type:application/json'

Revoking invitations

Revoking invitations

You can revoke an invitation at any time. Revoking an invitation prevents the user from using the invitation link that was sent to them.

You can revoke an invitation at any time. Revoking an invitation prevents the user from using the invitation link that was sent to them.

Using Ollio Dashboard

Using Ollio Dashboard

To revoke an invitation, navigate to the Users page from the top-level menu, then select the Invitations tab. Find the invitation you want to revoke and select Revoke from the dropdown menu on the right.

To revoke an invitation, navigate to the Users page from the top-level menu, then select the Invitations tab. Find the invitation you want to revoke and select Revoke from the dropdown menu on the right.

Note

The same page will be available throught the top-level menu, when you are in the Restricted sign-up mode.

Note

The same page will be available throught the top-level menu, when you are in the Restricted sign-up mode.

Using Backend API

Using Backend API

You can either use a cURL command or the JavaScript Backend SDK to create an invitation. Use the following tabs to see examples for each method.

You can either use a cURL command or the JavaScript Backend SDK to create an invitation. Use the following tabs to see examples for each method.

  • cURL

  • Backend SDK

The following example demonstrates how to revoke an invitation using cURL.

Replace the <invitation_id> with the ID of the invitation you want to revoke and replace YOUR_SECRET_KEY with your Clerk Secret Key. You can find your Secret Key on the API keys page in the Ollio Dashboard.

terminal

curl https://api.ollio.com/v1/invitations/<invitation_id>/revoke -X POST -H "Authorization:Bearer YOUR_SECRET_KEY" -H 'Content-Type:application/json'

See the Backend API reference⁠ for an example of the response.

  • cURL

  • Backend SDK

The following example demonstrates how to revoke an invitation using cURL.

Replace the <invitation_id> with the ID of the invitation you want to revoke and replace YOUR_SECRET_KEY with your Clerk Secret Key. You can find your Secret Key on the API keys page in the Ollio Dashboard.

terminal

curl https://api.ollio.com/v1/invitations/<invitation_id>/revoke -X POST -H "Authorization:Bearer YOUR_SECRET_KEY" -H 'Content-Type:application/json'

See the Backend API reference⁠ for an example of the response.

Warning

Revoking an invitation does not prevent the user from signing up on their own. If you're looking to restrict access to invited users only, refer to the Restricted sign-up mode.

Warning

Revoking an invitation does not prevent the user from signing up on their own. If you're looking to restrict access to invited users only, refer to the Restricted sign-up mode.

Custom flow

Custom flow

Ollio's prebuilt components and Account Portal pages handle the sign-up flow for you, including the invitation flow. If you want to build a custom sign-up flow, see the custom flow guide.

Ollio's prebuilt components and Account Portal pages handle the sign-up flow for you, including the invitation flow. If you want to build a custom sign-up flow, see the custom flow guide.

What did you think of this content?

It was helpful

It was not helpful

I have feedback

What did you think of this content?

Helpful

Not helpful

Feedback

Last updated on

Dec

4,

2024

Last updated on

Dec

4,

2024