{ "opencollection": "1.0.0", "info": { "name": "Stytch B2B Authentication Application OTP API", "version": "2.0.0" }, "items": [ { "info": { "name": "OTP", "type": "folder" }, "items": [ { "info": { "name": "Authenticate", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/otps/authenticate", "body": { "type": "json", "data": "{}" } }, "docs": "Authenticate a User given a `method_id` (the associated `email_id` or `phone_id`) and a `code`. This endpoint verifies that the code is valid, hasn't expired or been previously used, and any optional security settings such as IP match or user agent match are satisfied. A given `method_id` may only have a single active OTP code at any given time, if a User requests another OTP code before the first one has expired, the first one will be invalidated." }, { "info": { "name": "Send", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/otps/sms/send", "body": { "type": "json", "data": "{}" } }, "docs": "Send a one-time passcode (OTP) to a user's phone number. If you'd like to create a user and send them a passcode with one request, use our [log in or create](https://stytch.com/docs/api/log-in-or-create-user-by-sms) endpoint.\n\nNote that sending another OTP code before the first has expired will invalidate the first code.\n\n### Cost to send SMS OTP\nBefore configuring SMS or WhatsApp OTPs, please review how Stytch [bills the costs of international OTPs](https://stytch.com/pricing) and understand ho" }, { "info": { "name": "Loginorcreate", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/otps/sms/login_or_create", "body": { "type": "json", "data": "{}" } }, "docs": "Send a One-Time Passcode (OTP) to a User using their phone number. If the phone number is not associated with a user already, a user will be created.\n\n### Cost to send SMS OTP\nBefore configuring SMS or WhatsApp OTPs, please review how Stytch [bills the costs of international OTPs](https://stytch.com/pricing) and understand how to protect your app against [toll fraud](https://stytch.com/docs/guides/passcodes/toll-fraud/overview).\n\n__Note:__ SMS to phone numbers outside of the US and Canada is dis" }, { "info": { "name": "Send", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/otps/whatsapp/send", "body": { "type": "json", "data": "{}" } }, "docs": "Send a One-Time Passcode (OTP) to a User's WhatsApp. If you'd like to create a user and send them a passcode with one request, use our [log in or create](https://stytch.com/docs/api/whatsapp-login-or-create) endpoint.\n\nNote that sending another OTP code before the first has expired will invalidate the first code.\n\n### Cost to send SMS OTP\nBefore configuring SMS or WhatsApp OTPs, please review how Stytch [bills the costs of international OTPs](https://stytch.com/pricing) and understand how to pro" }, { "info": { "name": "Loginorcreate", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/otps/whatsapp/login_or_create", "body": { "type": "json", "data": "{}" } }, "docs": "Send a one-time passcode (OTP) to a User's WhatsApp using their phone number. If the phone number is not associated with a User already, a User will be created.\n\n### Cost to send SMS OTP\nBefore configuring SMS or WhatsApp OTPs, please review how Stytch [bills the costs of international OTPs](https://stytch.com/pricing) and understand how to protect your app against [toll fraud](https://stytch.com/docs/guides/passcodes/toll-fraud/overview).\n\n### Next steps\n\nCollect the OTP which was delivered to " }, { "info": { "name": "Send", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/otps/email/send", "body": { "type": "json", "data": "{}" } }, "docs": "Send a One-Time Passcode (OTP) to a User using their email. If you'd like to create a user and send them a passcode with one request, use our [log in or create endpoint](https://stytch.com/docs/api/log-in-or-create-user-by-email-otp).\n\n### Add an email to an existing user\nThis endpoint also allows you to add a new email address to an existing Stytch User. Including a `user_id`, `session_token`, or `session_jwt` in your Send one-time passcode by email request will add the new, unverified email ad" }, { "info": { "name": "Loginorcreate", "type": "http" }, "http": { "method": "POST", "url": "https://api.stytch.com/v1/otps/email/login_or_create", "body": { "type": "json", "data": "{}" } }, "docs": "Send a one-time passcode (OTP) to a User using their email. If the email is not associated with a User already, a User will be created.\n\n### Next steps\n\nCollect the OTP which was delivered to the User. Call [Authenticate OTP](https://stytch.com/docs/api/authenticate-otp) using the OTP `code` along with the `phone_id` found in the response as the `method_id`." } ] } ], "bundled": true }