Skip to content

Contact List

Contact list entity. A container for contacts used in Campaigns and Transactional Sends.

Endpoints

Method URL
GET /contact_list/<list>
POST /contact_list
PUT /contact_list/<list>
DELETE /contact_list/<list>

GET /contact_list/<list>

Payload: No payload.

Returns: The contact list and a dictionary of contact counts per subscription state.

Example:

curl -u "username:api_key" -H "Accept: application/json" \
  https://app.duo.pt/contact_list/{list_id}

Response:

{
  "success": true,
  "data": {
    "contact_list": {
      "id": 1,
      "owner": 1,
      "name": "Example...",
      "default_email_out": null,
      "unsubscribe_message": "You have been unsubscribed.",
      "email_out_custom_fields": null,
      "double_optin": false,
      "optout_allowed": false,
      "optout_category": null,
      "optin_email": null,
      "optin_sms": null,
      "shared_with_children": false,
      "read_shared_with_children": false,
      "segments": null
    },
    "custom_fields": [],
    "filter": [],
    "contacts": null,
    "contact_count": {
      "subscribed": {
        "filter": {
          "operator": "...",
          "arguments": "..."
        },
        "count": 0
      },
      "bouncing": {
        "filter": {
          "operator": "...",
          "arguments": "..."
        },
        "count": 0
      },
      "unsubscribed": {
        "filter": {
          "operator": "...",
          "arguments": "..."
        },
        "count": 0
      },
      "pending": {
        "filter": {
          "operator": "...",
          "arguments": "..."
        },
        "count": 0
      }
    }
  }
}

POST /contact_list

Parameter Type Description
name string The contact list name
double_optin boolean Whether new contacts require double opt-in
shared_with_children boolean Share write access with hierarchical child users
read_shared_with_children boolean Share usage access with hierarchical child users
unsubscribe_message string Message shown to contacts who unsubscribe

Returns: The new contact list.

Example:

curl -u "username:api_key" -H "Accept: application/json" \
  -d "name=My+List&double_optin=false&unsubscribe_message=You+have+been+unsubscribed." \
  https://app.duo.pt/contact_list

Response:

{
  "success": true,
  "data": {
    "contact_list": {
      "id": 1,
      "owner": 1,
      "name": "Example...",
      "default_email_out": null,
      "unsubscribe_message": "You have been unsubscribed.",
      "email_out_custom_fields": null,
      "double_optin": false,
      "optout_allowed": null,
      "optout_category": null,
      "optin_email": null,
      "optin_sms": null,
      "shared_with_children": false,
      "read_shared_with_children": false,
      "segments": null
    },
    "success": true
  }
}

PUT /contact_list/<list>

Same payload as POST.

Note

Parameters must be sent as query string (not request body).

Returns: The edited contact list.

Example:

curl -u "username:api_key" -H "Accept: application/json" -X PUT \
  "https://app.duo.pt/contact_list/{list_id}?name=Updated+List+Name&unsubscribe_message=You+have+been+unsubscribed."

Response:

{
  "success": true,
  "data": {
    "contact_list": {
      "id": 1,
      "owner": 1,
      "name": "Updated List Name",
      "double_optin": false,
      "unsubscribe_message": "You have been unsubscribed."
    }
  }
}

DELETE /contact_list/<list>

Payload: No payload.

Returns: The deleted contact list.

Example:

curl -u "username:api_key" -H "Accept: application/json" -X DELETE \
  https://app.duo.pt/contact_list/{list_id}

Response:

{
  "success": true,
  "data": {
    "contact_list": {
      "id": 1,
      "owner": 1,
      "name": "Example...",
      "default_email_out": null,
      "unsubscribe_message": "You have been unsubscribed.",
      "email_out_custom_fields": null,
      "double_optin": false,
      "optout_allowed": false,
      "optout_category": null,
      "optin_email": null,
      "optin_sms": null,
      "shared_with_children": false,
      "read_shared_with_children": false,
      "segments": null
    }
  }
}