Create, update and delete groups, add or remove group members, and read a group's members and events (opens, clicks, unsubscribes and more).

All endpoints use the base URL https://webapi.mymarketing.co.il and an API key in the Authorization header. New to the API? Start with Get started with the ActiveTrail API.

Endpoints

MethodEndpointWhat it does
GET/api/groupsGet account's groups
GET/api/groups/{Id}Get group information by id
POST/api/groupsCreate and return a new Group
PUT/api/groups/{id}Update a given group
DELETE/api/groups/{id}Delete a given group
GET/api/groups/{id}/membersGet all group members
POST/api/groups/{id}/membersAdd contact to a specific group
DELETE/api/groups/{id}/members/{memberId}Remove member from a group
GET/api/groups/{id}/eventsGet all group events

Endpoint details

Get account's groups

GET https://webapi.mymarketing.co.il/api/groups
ParameterInTypeDescription
search_termquerystringGroup name to search for.
pagequeryintegerGet a specific page (number of pages is limited) (Range: inclusive between 1 and 2147483647)
limitqueryintegerLimit the number of items you get in the results. (Removing the "limit" will, by default, display only 20 records) (Range: inclusive between 1 and 100)

Full reference, request and response samples

Get group information by id

GET https://webapi.mymarketing.co.il/api/groups/{Id}
ParameterInTypeDescription
IdpathintegerGroup id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required.

Full reference, request and response samples

Create and return a new Group

POST https://webapi.mymarketing.co.il/api/groups
ParameterInTypeDescription
namebodystringName of the group
active_counterbodyintegerNumber of active contacts in the group
counterbodyintegerTotal contacts in the group
createdbodydateDate of creation of the group
last_generatedbodydateDynamic group only- the last time it generated contacts according to the group conditions

The request body is a JSON object (PostGroupContainer).

Full reference, request and response samples

Update a given group

PUT https://webapi.mymarketing.co.il/api/groups/{id}
ParameterInTypeDescription
idpathintegerGroup id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required.
namebodystringName of the group
active_counterbodyintegerNumber of active contacts in the group
counterbodyintegerTotal contacts in the group
createdbodydateDate of creation of the group
last_generatedbodydateDynamic group only- the last time it generated contacts according to the group conditions

The request body is a JSON object (UpdateGroupContainer).

Full reference, request and response samples

Delete a given group

DELETE https://webapi.mymarketing.co.il/api/groups/{id}
ParameterInTypeDescription
idpathintegerGroup id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required.

Full reference, request and response samples

Get all group members

GET https://webapi.mymarketing.co.il/api/groups/{id}/members

Get all group members. You can get the list filtered by customer status (active, unsubscribed, bounced. etc.,) by the state change date (from/to date, the default is three months back)

ParameterInTypeDescription
idpathintegerGroup id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required.
customer_statesqueryCustomerStatesFilter by contact status. A contact matches if its email or SMS status is one of them. Values: ALL, ACTIVE, INACTIVE, CUSTOMER_REQUEST, BOUNCED, SPAM_COMPLIENT, QUARANTINED.
search_termquerystringSearch by email/sms. please note: you cannot search for emails that contain the plus sign.
from_datequerydateStart of the date range. Format: mm-dd-yyyy.
to_datequerydateEnd of the date range. Format: mm-dd-yyyy.
pagequeryintegerGet a specific page (number of pages is limited) (Range: inclusive between 1 and 2147483647)
limitqueryintegerLimit the number of items you get in the results. (Removing the "limit" will, by default, display only 20 records) (Range: inclusive between 1 and 100)

Full reference, request and response samples

Add contact to a specific group

POST https://webapi.mymarketing.co.il/api/groups/{id}/members

Add contact to a specific group. You can set the contact's status. please note: you cannot import a contact in status subscribe if he is inactive on ActiveTrail

ParameterInTypeDescription
idpathintegerGroup id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required.
campaign_idbodyintegerThe campaign id to send to the imported contact (optional)
subscribe_ipbodystringThe Subscribe Ip
statusbodyApiStatusTypesThe contact's email status. Values: None (0), Subscribed (1), Unsubscribed (2), Pending (3).
sms_statusbodyApiStatusTypesThe contact's SMS status. Values: None (0), Subscribed (1), Unsubscribed (2), Pending (3).
double_optinbodyDoubleOptinSee DoubleOptin
emailbodystringRequired if SMS is null. please note: mandatory in the endpoint "Create a new contact" and in "Send an email operational message to individual contacts"
smsbodystringRequired if email is null.
first_namebodystringContact field
last_namebodystringContact field
anniversarybodydateContact field
birthdaybodydateContact field
citybodystringContact field
faxbodystringContact field
phone1bodystringContact field
phone2bodystringContact field
streetbodystringContact field
zip_codebodystringContact field
ext1 … num5bodystring / date / numberCustom contact fields (35 fields). Same meaning as the contact fields in ActiveTrail.
is_deletedbodybooleanIf true - contact will be deleted. If false - contact will be restored if deleted (their status will be the last status they were on ActiveTrail).

The request body is a JSON object (PostContactTriggerContainer).

Full reference, request and response samples

Remove member from a group

DELETE https://webapi.mymarketing.co.il/api/groups/{id}/members/{memberId}
ParameterInTypeDescription
idpathintegerGroup id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required.
memberIdpathintegerContact id. Can be found using the endpoint "Get all group members...." Required.

Full reference, request and response samples

Get all group events

GET https://webapi.mymarketing.co.il/api/groups/{id}/events

Get all group events. You can get the list filtered by event type (opens, clicks, unsubscribes, etc.), by the event date (from/to date, the default is three months back), by the subscriber creation date (from/to date, the default is three months back)

ParameterInTypeDescription
idpathintegerGroup id. Can be found using the endpoint "Get account's groups" or in the UI (go to Contacts->Groups->click on the group's name -> you'll find the id in the URL) Required.
EventTypequeryGroupEventTypesType of event to retrieve metrics for (opens, clicks, unsubscribes) required
CreatedFromDatequerydateStart date for subscriber creation
CreatedToDatequerydateEnd date for subscriber creation
EventFromDatequerydateStart date for events
EventToDatequerydateEnd date for events

Full reference, request and response samples

This reference is based on the ActiveTrail API documentation, where you can also test each endpoint with your own API key.