Skip to content

Contact List — Custom Field

Custom field entity for a contact list.

Endpoints

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

GET /contact_list/<list>/custom_field/<customfield>

Payload: No payload.

Returns: The custom field.

Example:

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

Response:

{
  "success": true,
  "data": {
    "custom_field": {
      "id": 1,
      "list": 1,
      "name": "Birth Year",
      "type": "int",
      "constraints": null
    }
  }
}

POST /contact_list/<list>/custom_field

Parameter Type Description
name string Custom field name
type string Field type: text, int, date, datetime, email

Returns: The new custom field.

Example:

curl -u "username:api_key" -H "Accept: application/json" \
  -d "name=Birth+Year&type=int" \
  https://app.duo.pt/contact_list/{list_id}/custom_field

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_field": {
      "id": 1,
      "list": 1,
      "name": "Birth Year",
      "type": "int",
      "constraints": null
    },
    "success": true
  }
}

PUT /contact_list/<list>/custom_field/<customfield>

Same payload as POST.

Note

Parameters must be sent as query string (not request body), and must include id set to the custom field ID.

Returns: The edited custom field.

Example:

curl -u "username:api_key" -H "Accept: application/json" -X PUT \
  "https://app.duo.pt/contact_list/{list_id}/custom_field/{field_id}?id={field_id}&name=Updated+Field+Name"

Response:

{
  "success": true,
  "data": {
    "custom_field": {
      "id": 1,
      "list": 1,
      "name": "Updated Field Name",
      "type": "text",
      "constraints": null
    }
  }
}

DELETE /contact_list/<list>/custom_field/<customfield>

Payload: No payload.

Returns: The deleted custom field.

Example:

curl -u "username:api_key" -H "Accept: application/json" -X DELETE \
  https://app.duo.pt/contact_list/{list_id}/custom_field/{field_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_field": {
      "id": 1,
      "list": 1,
      "name": "Birth Year",
      "type": "int",
      "constraints": null
    }
  }
}