POST
/
hub
/
auth
/
magic
curl --request POST \
  --url https://api.rownd.io/hub/auth/magic \
  --header 'Content-Type: application/json' \
  --header 'x-rownd-app-key: <api-key>' \
  --header 'x-rownd-app-secret: <api-key>' \
  --data '{
  "verification_mode": "email",
  "data": {
    "email": "gary@foo.com",
    "first_name": "Gary"
  },
  "redirect_url": "/somewhere/in/my/app#",
  "user_id": "<string>",
  "expiration": "90d",
  "group_to_join": "<string>"
}'
{
  "link": "https://rownd.link/c8fLG0a",
  "app_user_id": "user_fmpsrdqfcqzyicf3msor42e8"
}

Authorizations

x-rownd-app-key
string
headerrequired

The publishable key of your application credentials. (more details)

x-rownd-app-secret
string
headerrequired

The private secret of your application credentials. (more details)

Body

application/json
verification_mode
enum<string>
required

The means by which this magic link will be verified by the user. When the magic link is visited, the user's email or phone number will be marked as verified depending on verification mode. In practice, you should set this value to 'phone' if you are sending this link to the user via SMS. Likewise, set to 'email' if you are sending the magic link to the user via email.

Available options:
email,
phone
data
object
required

Data to add to the user's profile

redirect_url
string

The absolute URL or relative path to send your user after sign-in

user_id
string
default: __default__

Specify a user ID. If the user already exists, include their user ID. Otherwise, use one of '__default__', '__uuid__', or '__objectid__'. These special values tell Rownd to generate an ID in the provided format, or use the application's default user ID format.

expiration
string

A string representing the duration for which a magic link is valid.

group_to_join
string

ID of a group to which the user will join upon completing sign-in. The group must have an admission policy of 'open'.`

Response

200 - application/json
link
string

The magic link URL

app_user_id
string

The user ID specified during creation or the resolved user ID if one of the directives was specified (e.g. '__default__')