Numberly
Settings

Tags and tag family

In the NMP ecosystem, tags are used to categorize campaigns for reporting and organizational purposes. To assign tags to a campaign via the API, you must first retrieve their unique identifiers (IDs) along with the constraints imposed by their respective families (mandatory/optional, single/multiple choice). This guide details how to use the /v1/settings/tag-families endpoint to obtain this metadata.

Retrieving Tag Configuration

The GET {subdomain}.api.numberly.com/v1/settings/tag-families endpoint returns all tag families and associated tags configured on your account.

Technical Definition

  • HTTP Method: GET
  • Endpoint: {subdomain}.api.numberly.com/v1/settings/tag-families
  • Security: Bearer Token (OAuth2)

Pagination Handling

If the number of tag families is large, the API supports pagination via standard query parameters:

ParameterTypeDescription
limitintegerNumber of items per page (default: 20, max: 200).
pageintegerPage number to retrieve (default: 1).

Request Example

curl -X GET "https://{subdomain}.api.numberly.com/v1/settings/tag-families?limit=50&page=1" \
  -H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
  -H "Content-Type: application/json"

Response Structure

The JSON response contains a list of TagFamily objects in the objects field. Below is the detailed structure of the returned data:

{
  "objects": [
    {
      "id": 45,
      "name": "Communication Type",
      "required": true,
      "type": "unique",
      "tags": [
        {
          "id": 101,
          "name": "Promotional",
          "channels": ["email", "sms"]
        },
        {
          "id": 102,
          "name": "Informational",
          "channels": ["email"]
        }
      ]
    }
  ],
  "metadata": {
    "timestamp": 1744375392.0
  },
  "pagination": {
    "total": 1,
    "limit": 50,
    "page": 1
  }
}

Data Model Analysis

Tag Family (TagFamily)

This is the parent container. Its properties define the validation rules for campaign creation:

  • id: Unique identifier of the family.
  • name: Display name of the family.
  • required (boolean): If true, you must provide at least one tag from this family when creating a campaign.
  • type (enum): Defines the cardinality of the selection.
    • unique: Only one tag from this family can be selected.
    • multiple: Multiple tags from this family can be selected.
    • hidden: Hidden family (internal use).

Tag (Tag)

These are the selectable values:

  • id: The technical identifier to use in campaign creation payloads.
  • name: The tag label.
  • channels: List of channels (email, sms, push_notification) for which this tag is valid.

Important Note: Tags that are not enabled for at least one channel are not listed in the API response.