Numberly
Settings

Opt-ins

In the context of GDPR compliance and marketing best practices, consent management (Opt-ins) is central to the Numberly Martech Platform (NMP). To execute marketing sends via the API, it is imperative to link your operations to a specific consent, identified by its unique ID. This guide details how to retrieve the list of configured consents for a group via the /v1/settings/groups/{id}/optins endpoint.

Retrieving Opt-ins

The GET endpoint allows you to list all available opt-ins for a group, with the option to filter by communication channel.

Technical Definition

  • HTTP Method: GET
  • Endpoint: {subdomain}.api.numberly.com/v1/settings/groups/{id}/optins
  • Security: Bearer Token (OAuth2)

Parameters

LocationNameRequiredTypeDescription
PathidYesstringThe group identifier (e.g., 65df0637...).
QuerychannelNostringFilter by channel (email, sms, push_notification).
QuerylimitNointegerPagination: number of items per page (default: 20).
QuerypageNointegerPagination: page number (default: 1).

Request Example

This example retrieves consents for the SMS channel within the specified group.

curl -X GET "https://{subdomain}.api.numberly.com/v1/settings/groups/65df06372b43d70716133716/optins?channel=sms" \
  -H "Authorization: Bearer <VOTRE_TOKEN>" \
  -H "Content-Type: application/json"

Response Structure

The response contains a list of Optin objects. The key element to retrieve is the id, which will serve as a reference in your campaign creations.

{
  "objects": [
    {
      "id": 945,
      "name": "Consentement SMS Marketing",
      "channel": "sms",
      "group_id": "65df06372b43d70716133716"
    },
    {
      "id": 946,
      "name": "Consentement Alertes SMS",
      "channel": "sms",
      "group_id": "65df06372b43d70716133716"
    }
  ],
  "metadata": {
    "timestamp": 1744375392.0
  },
  "pagination": {
    "total": 2,
    "limit": 20,
    "page": 1
  }
}