Skip to main content

Magic Link Authentication

This endpoint allows you to generate a secure magic link that can be used for logging in without a traditional password. The link is active for a limited time (3 minutes) and provides a streamlined user experience.


HTTP Request

  • Method: POST
  • URL:
    https://api.vinter.me/api/v1/Auth/CreateMagicLink

Request Headers

Header NameDescriptionExample Value
X-Api-KeyAPI key for organizational authentication.api_key
X-User-Secret-KeyUser secret key for organizational user authentication.user_secret_key
Content-TypeSpecifies the media type of the request.application/json

Request Body

The following fields must be included in the request body:

Parameter NameTypeRequiredDescription
firstNameStringYesThe user’s first name.
lastNameStringYesThe user’s last name.
emailStringYesThe user’s email address.
phoneStringYesThe user’s phone number.
languageCodeStringYesThe preferred language for communication.
mailPermissionBooleanYesConsent for receiving email notifications.

Example Request Body

{
"firstName": "Kaan",
"lastName": "KIVIRCIK",
"email": "[email protected]",
"phone": "+905555555555",
"languageCode": "tr-TR",
"mailPermission": true
}

Initial Response Format

Upon the first request, a new SecretKey and MagicLink will be returned. The MagicLink is valid for 3 minutes. Subsequent requests using the same SecretKey will not return a new key but will still return a valid magic link.

Example Response Body (First Request)

{
"Data": {
"SecretKey": "cHXjfI+7gOLBuqAbd62OHA==:OGSrEIkyrzen4IoTsoL8j0OUe0l/Ho3e+kCxRiYZbha1fsrh8UHpFTH7bBdBRiRhEBydIK2UhvbmZm1Osmb3tMz0AYtep+0CTOwecZd5YstURjbKNyll3hvil0vvr4VUjWnatYds5jH6EumUcnkSaswsBV2nH/EGIBLkiTcwjm3CJ5/ZFD+By3AsaXNIhC+eTKmQT8er3ArvW6otZusBsZm7pUWvuxOgheVXpxEU8mz6Ft/fiTNHp8KJLF6U1crP",
"MagicLink": "https://api.vinter.me/loginWithKey?apiKey=BFflidn6j2yTh7ul2pLmpw==:wQLz9jG/T0j6nNHfMCnBMJrekhDaYj6TG5lQ+ikHDcyXcbODkg0wo8wmaFt6isAyzjQWxpRS7P569Cz/GT7sDBKSLy1O03Hca/aaR9ilY20znmDtDCeSGoIm0qUf88s9M+NDQJ0EiF37A+wxmUSj0Es2LZgsvvUVgQzxRvqZnTUzLuD6FRvUV0SGyFkdWN5udZPcbRD3g3ilrtc/60BKhGsK1R81ogCO/pUj7RAH6cNkcbShtLry/4f5+fMRi6NQ"
},
"Success": true,
"Message": null,
"IsResourceKey": true
}

Subsequent Response Format

For subsequent requests using the same SecretKey, the SecretKey field will be null. The returned MagicLink will remain valid for 3 minutes.

Example Response Body (Subsequent Request)

{
"Data": {
"SecretKey": null,
"MagicLink": "https://api.vinter.me/loginWithKey?apiKey=BFflidn6j2yTh7ul2pLmpw==:wQLz9jG/T0j6nNHfMCnBMJrekhDaYj6TG5lQ+ikHDcyXcbODkg0wo8wmaFt6isAyzjQWxpRS7P569Cz/GT7sDBKSLy1O03Hca/aaR9ilY20znmDtDCeSGoIm0qUf88s9M+NDQJ0EiF37A+wxmUSj0Es2LZgsvvUVgQzxRvqZnTUzLuD6FRvUV0SGyFkdWN5udZPcbRD3g3ilrtc/60BKhGsK1R81ogCO/pUj7RAH6cNkcbShtLry/4f5+fMRi6NQ"
},
"Success": true,
"Message": null,
"IsResourceKey": true
}

Detailed Field Descriptions

  • SecretKey:
    A unique key generated on the first request. Used to authenticate subsequent requests without re-issuing a new secret key.

  • MagicLink:
    A secure link for logging in. Valid for 3 minutes.

  • Success:
    Indicates whether the request was successfully processed.

  • Message:
    Any additional information or error messages.

  • IsResourceKey:
    A flag indicating if the response contains a resource key.


Use Cases

  • Passwordless Login:
    Provide users with a fast and secure way to log in without remembering passwords.

  • Secure Access Control:
    Ensure only authorized individuals can generate a valid magic link.

  • Streamlined Onboarding:
    New users can easily set up their accounts and log in using the magic link, reducing the friction of traditional registration processes.