Numberly
Settings

Targeting procedures

The GET endpoint retrieves the comprehensive list of targeting procedures available for an organization (group). These definitions contain the necessary metadata (fields, types, options) to dynamically build the user interface or the campaign creation payload.

Endpoint Specifications

  • Method: GET
  • URL: {subdomain}.api.numberly.com/v1/settings/groups/{id}/targeting-procedures
  • Authentication: Bearer Token (OAuth2)

Request Parameters

TypeParameterRequiredDescription
PathidYesThe unique identifier of the group (organization).
QuerychannelNoFilters procedures by channel (email, sms, push_notification).
QuerylimitNoNumber of results per page (Default: 20).

Example Call

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

Response Structure

The response returns a list of procedure objects. The critical field is the parameters array, which dictates the inputs expected during execution.

If a parameter is a list type (e.g., DROPDOWN_LIST), the options array provides the valid key/value pairs.

Example Response Body (JSON):

{
  "objects": [
    {
      "id": 33,
      "name": "target_active_users_by_segment",
      "display_name": "Target Active Users by Segment",
      "channel": "email",
      "group_id": "65df06372b43d70716133716",
      "parameters": [
        {
          "name": "segment_id",
          "display_name": "Client Segment",
          "required": true,
          "input_type": "DROPDOWN_LIST",
          "options": [
            { "id": 100, "description": "VIP Clients" },
            { "id": 101, "description": "New Clients" }
          ]
        },
        {
          "name": "min_purchase_amount",
          "display_name": "Minimum purchase amount",
          "required": false,
          "input_type": "NUMBER_INPUT"
        }
      ]
    }
  ],
  "pagination": { "total": 1, "limit": 20, "page": 1 }
}

Implementation: Building the Target Object

To use a procedure during campaign creation (POST /v1/campaigns), you must transform the definition retrieved above into a target object.

Mapping Rules

The table below details the strict correspondence between the definition (GET) and execution (POST).

Source (GET Procedures)Destination (POST Campaigns)Transformation Rule
id (Root object)target.procedure_idThe technical ID of the procedure is assigned directly.
parameters[].nameKey in target.parametersThe parameter name becomes the key (case-sensitive) in the parameters JSON object.
parameters[].options[].idValue in target.parametersIf the parameter has options, the id of the chosen option must be sent as the value.
User ValueValue in target.parametersFor free-text fields (e.g., NUMBER_INPUT), the raw value is sent.

Payload Example

Based on the response example above (Procedure ID 33), here is what the campaign creation request body should look like to target "VIP Clients" (ID 100) with a minimum purchase amount of 50:

// POST {subdomain}.api.numberly.com/v1/campaigns
{
  "name": "VIP Reactivation Campaign",
  "type": "tactical",
  "target": {
    "procedure_id": 33,
    "parameters": {
      "segment_id": 100,
      "min_purchase_amount": 50
    }
  }
  // ... other campaign properties
}