Skip to content

Create a magic link

Request

Security
form_session or user_session or component_session or component_token or api_token
Bodyapplication/jsonrequired
user_emailstring, (email)

User email address. Onboarded stores user emails in lowercase, and this value will be lowercased to match against existing users. If not provided, user_external_id is required and must identify a unique user.

user_external_idstring

Custom identifier provided upon user creation. Can be provided with or without user_email. If user_email is omitted, however, this field must uniquely identify a user. An error will be returned if multiple users hold the same external_id.

expire_ininteger, [ 1 .. 86400 ](between(1, 86400))required

a number between 1 and 86400

redirect_pathMagicLinkRedirectPath (string) or null
Any of:

Optional redirect path within the dashboard (must be a relative path starting with '/' and cannot contain external URLs). Examples: /dashboard, /employees/ee_123

string(MagicLinkRedirectPath)
curl -i -X POST \
  https://docs.onboarded.com/_mock/openapi/api/v1/magic_links \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "user_email": "user@example.com",
    "user_external_id": "string",
    "expire_in": 1,
    "redirect_path": "string"
  }'

Responses

Success

Bodyapplication/json
urlstring^https?:\/\/.+required

a string matching the pattern ^https?://.+

expire_atstringrequired
redirect_path_deprecation_deadlinestring, (date-time)required

The date and time when the redirect_path parameter will become invalid and stop working

redirect_path_deprecation_notestringrequired

Information about what to use instead of the deprecated redirect_path parameter

Response
{ "url": "string", "expire_at": "string", "redirect_path_deprecation_deadline": "2019-08-24T14:15:22Z", "redirect_path_deprecation_note": "string" }