---
title: "Subscribe Request (Double opt-in)"
description: "*Releva* provides an API you can call from your frontend to subscribe users, either right away or after they confirm by email (double opt-in). ### Do I need to call it? If you use the *Releva* JavaScript SDK, `Releva.requestSubscribe(...)` calls…"
url: "https://releva.ai/documentation/consent-status/subscribe-request-double-opt-in/"
updated: "2026-10-09"
category: Developer Documentation / Profiles / Consent status
---

# Subscribe Request (Double opt-in)

*Releva* provides an API you can call from your frontend to subscribe users, either right away or after they confirm by email (double opt-in).

### Do I need to call it?

If you use the *Releva* JavaScript SDK, `Releva.requestSubscribe(...)` calls this endpoint for you, and the forms and banners built in *Releva* use it automatically. Call it yourself only when you build your own subscription form and send the request without the SDK.

This endpoint is authenticated with your **access token**, which is safe to expose in the browser. **Never use your secret key here.** To subscribe users from your backend, use the [subscribe API](/api/v0/subscribe) instead.

### Subscription Request Behavior

What a request does depends on the **Subscription Request Behavior** setting under Settings → Subscription Management. The setting is available when subscription management is set to *Internal*.

- **Subscribe right away**: the user is subscribed immediately. This is easier for the user, but anyone can subscribe any email address.
- **Wait for confirmation**: the user is *not* subscribed yet. *Releva* saves their contact details and records a `subscribeRequest` event. Use that event as the trigger of a flow that sends a confirmation email with a subscribe link. The user is subscribed, with the requested subscriptions, only after they click that link.

### Request Format

The API accepts the following curl equivalent:

```js
curl -H 'Content-Type: application/json' -H 'Authorization: Bearer <accessToken>' -XPOST https://releva.ai/api/v0/subscribe/request -d'{
  "email": "support@releva.ai", "firstName": "John", "lastName": "Doe", "phoneNumber": "+359888123456", "subscriptions": ["list1", "list2"], "addSubscriptions": true, "tags": ["footer-form"], "rejectAlreadySubscribed": false
}'
```

Send at least one of email or phoneNumber.

*OPTIONAL*: You may send firstName, lastName and birthday (an ISO 8601 date, for example "1990-05-21") to store them on the user's profile.

*OPTIONAL*: You may use the subscriptions field to set specific subscriptions, for example "newsletter", "weekly promo", etc., and use these tags when building segments to target users who subscribed to the matching item. In *Wait for confirmation* mode the subscriptions are applied only once the user confirms. If you do not send any subscriptions, the user is subscribed to all of your shop's user-visible subscriptions.

*OPTIONAL*: You may send addSubscriptions if you want to add the subscriptions to the user's current subscriptions. If this is not set, we replace the current subscriptions with the ones from the request.

*OPTIONAL*: You may send tags to tag the user's profile, for example with the form or campaign the subscription came from.

*OPTIONAL*: You may send userId, the visitor's *Releva* user id (the rlv_u cookie). In *Subscribe right away* mode, if the email or phone number already belongs to a known user, that user's profile is kept and the visitor's browsing history is merged into it.

*OPTIONAL*: You may send rejectAlreadySubscribed set to true to reject the request when the email address has ever been subscribed or unsubscribed in *Releva*. This is useful for "subscribe and get a discount" offers that should go only to new subscribers. Rejected requests are rate limited.

*OPTIONAL*: You may send unsubscribeLink if your shop has unique unsubscribe links for each user. This takes precedence over the unsubscribe link configured in your shop settings.

*OPTIONAL*: You may send locale (for example "en" or "bg") to set the language of the request. If it is not set, your shop's default locale is used.

### Response Format

In *Subscribe right away* mode, a successful request returns HTTP status 200 with the user's id ({"userId": "…"}). If you track users with the *Releva* SDK, store this id as the visitor's user id: it may differ from the one you sent if the email or phone number belonged to an existing user.

In *Wait for confirmation* mode, a successful request returns HTTP status 202 with an empty body ({}).

If rejectAlreadySubscribed is set and the email address has been subscribed before, the request returns HTTP status 409 with {"code": "alreadySubscribed"}. If any other error occurs, an appropriate HTTP status code is returned along with a body describing the error ({"message": "…"}).

If the email address or phone number in the request is not tracked in *Releva*, the request creates a user with it.
