REST API

The Tuemilio REST API allows you to interact with your subscriber database. You have full control to retrieve, create, update and delete emails. Use this API as an extension of your app and deploy custom integrations.

WARNING

Never expose or use the REST API on your frontend, for that use the Javascript API.

Authentication

Add your API token as a parameter to all the endpoints as in the example below.

Get your API token here.

GET https://tuemilio.com/api/v1/lists?api_token=XXXXXXXX-XXX-XXX-XXX-XXXXXXXXXXXX

Emails

An email contains information of your subscribers.

Get all Emails

You can see a list of emails belonging to a specific wait list. The emails are returned in sorted order, with the most recent emails appearing first.

Definition

GET https://tuemilio.com/api/v1/lists/{LIST_ID}/emails?api_token=XXXXXXXX

Arguments

Argument Description
list_id required The ID of the list whose emails will be retrieved. Get all your list_id here.

Returns

Returns all emails in a wait list if a valid identifier was provided, and throws an error otherwise.

[ 
  {
    "id": 111,
    "address": "hello@mail.com",
    "ip": "111.170.111.12",
    "points": 1,
    "anti_points": 0,
    "source": "email-form",
    "referrer_id": 109,
    "referrer_url": "https://instagram.com/",
    "subscribed": 1,
    "click_time": 5,
    "created_at": "2020-06-21 16:42:13",
    "blocked": 0,
    "custom_fields": [],
    "shared_on": [],
    "dashboard_link": "https://yourpage.com?email=hello@mail.com"
  }, 
  {...},
  {...},
]

Get an Email

Get an email object from a wait list.

Definition using address

GET https://tuemilio.com/api/v1/lists/{LIST_ID}/emails?address=hello@mail.com&api_token=XXXXXXXX

Arguments using address

Argument Description
list_id required The ID of the list whose emails will be retrieved.
address required The email address that will be retrieved.

Definition using email_id

GET https://tuemilio.com/api/v1/lists/{LIST_ID}/emails/{EMAIL_ID}?api_token=XXXXXXXX

Arguments using email_id

Argument Description
list_id required The ID of the list whose emails will be retrieved.
email_id required The ID of the email that will be retrieved.

Returns

Returns an email object if a valid identifier was provided, and throws an error otherwise.

{
    "address": "hello@mail.com",
    "ip": "192.164.102.13",
    "source": "api",
    "referrer_id": 0,
    "custom_fields": null,
    "points": 1,
    "created_at": "2020-11-09 20:24:09",
    "id": 1112,
    "position": 186,
    "position_ordinal": "186th",
    "people_ahead": 185,
    "dashboard_link": "https://yourapp.com?email=hellome@sdf.com",
    "referral_link": "https://yourapp.com?r=AvzMb",
    "referral_id": "AvzMb",
    "waiters": [
        {
            "address": "h××××@××××××××××××.com",
            "points": 0,
            "deleted_at": null,
            "position": 184
        },
        {...},
        {...},
        {...}
    ]
}

Create an Email

Add a new email to a specific wait list.

If a referrer_id or referral_id is passed to the request, the points of the referrer will be increased automatically.

Definition

POST https://tuemilio.com/api/v1/lists/{LIST_ID}/emails?api_token=XXXXXXXX

Arguments

Argument Description
list_id required The ID of the list where an email will be added.
address required The email address to be added.
referral_id required The unique code appended to the referral link of the referrer. Code after ?r=. Needed for counting referrals.
referrer_id The integer email ID of the referrer. Use referral_id if referrer_id is not available.
custom_fields A flat JSON with subscriber's information. E.g {"name": "rob", "age": 27}
points The points of the email .
ip The ip of the subscriber.

Returns

{
    "address": "hello@mail.com",
    "ip": "192.164.102.13",
    "source": "api",
    "referrer_id": 0,
    "custom_fields": null,
    "points": 1,
    "created_at": "2020-11-09 20:24:09",
    "id": 1112,
    "position": 186,
    "position_ordinal": "186th",
    "people_ahead": 185,
    "dashboard_link": "https://yourapp.com?email=hellome@sdf.com",
    "referral_link": "https://yourapp.com?r=AvzMb",
    "referral_id": "AvzMb",
    "waiters": [
        {
            "address": "h××××@××××××××××××.com",
            "points": 0,
            "deleted_at": null,
            "position": 184
        },
        {...},
        {...},
        {...}
    ]
}

Update an Email

Update an email of an specific wait list.

Definition

PUT https://tuemilio.com/api/v1/lists/{LIST_ID}/emails/{EMAIL_ID}?api_token=XXXXXXXX

Arguments

Argument Description
list_id required The ID of the list where the email is stored.
email_id required The ID of the email to be updated.
address The email address to be updated.
points The points for the updated email.
custom_fields The custom fields of the updated email.
subscribed Boolean value of the subscription status.
blocked Boolean value blocked or not blocked status.

Returns

Returns the updated email object, and throws an error otherwise.

{
    "address": "hello@mail.com",
    "ip": "192.164.102.13",
    "source": "api",
    "referrer_id": 0,
    "custom_fields": null,
    "points": 1,
    "created_at": "2020-11-09 20:24:09",
    "id": 1112,
    "position": 186,
    "position_ordinal": "186th",
    "people_ahead": 185,
    "dashboard_link": "https://yourapp.com?email=hellome@sdf.com",
    "referral_link": "https://yourapp.com?r=AvzMb",
    "referral_id": "AvzMb",
    "waiters": [
        {
            "address": "h××××@××××××××××××.com",
            "points": 0,
            "deleted_at": null,
            "position": 184
        },
        {...},
        {...},
        {...}
    ]
}

Delete an Email

Delete an email from an specific wait list.

Definition

DELETE https://tuemilio.com/api/v1/lists/{LIST_ID}/emails/{EMAIL_ID}?api_token=XXXXXXXX

Arguments

Argument Description
list_id required The ID of the list from where the email will be deleted.
email_id required The ID of the email to be deleted.

Returns

200 OK

Add Points to an Email

Increase the points of an email of an specific wait list. If a user has 5 points and we pass points = 2, the user will be updated with a total of 7 points.

Definition

PUT https://tuemilio.com/api/v1/lists/{LIST_ID}/emails/{EMAIL_ID}/add-points?api_token=XXXXXXXX

Arguments

Argument Description
list_id required The ID of the list where the email is stored.
email_id required The ID of the email to be updated.
points required Points to be added to the current Email points.

Returns

Returns the updated email object, and throws an error otherwise.

{
    "address": "hello@mail.com",
    "ip": "192.164.102.13",
    "source": "api",
    "referrer_id": 0,
    "custom_fields": null,
    "points": 2,
    "created_at": "2020-11-09 20:24:09",
    "id": 1112,
    "position": 186,
    "position_ordinal": "186th",
    "people_ahead": 185,
    "dashboard_link": "https://yourapp.com?email=hellome@sdf.com",
    "referral_link": "https://yourapp.com?r=AvzMb",
    "referral_id": "AvzMb",
    "waiters": [
        {
            "address": "h××××@××××××××××××.com",
            "points": 0,
            "deleted_at": null,
            "position": 184
        },
        {...},
        {...},
        {...}
    ]
}

Wait Lists

A list contains general information of wait list like all the emails that were submitted. Lists are identified by an unique ID. An Uuid is used for building public links, such as an unsubscription link.

Check all your list_id here

Get all Wait Lists

Get a list of wait lists you have previously created. The lists are returned in sorted order, with the most recent list appearing first.

Definition

GET https://tuemilio.com/api/v1/lists?api_token=XXXXXXXX

Arguments

No arguments.

Returns

Returns an array of wait lists. Each entry in the array is a separate list object. If no lists are available, the resulting array will be empty.

[
    {
        "id": 724,
        "name": "Watape",
        "host": "https://voxremover.com/hardware-on-the-cloud",
        "created_at": "2020-06-21 08:03:47",
        "emails_count": 194,
        "visits_count": 2124,
        "unique_visits": 1599,
        "conversion": 0.12,
        "referrals_count": 20,
        "uuid": "98f5535f-32bc-425c-a3d1-af950f8ac4e6"
    },
    {...},
    {...}
]

Get a Wait List

Get a list object.

Definition

GET https://tuemilio.com/api/v1/lists/{LIST_ID}?api_token=XXXXXXXX

Arguments

Argument Description
list_id required The unique ID of the wait list. Check your list_id here.

Returns

Returns an email object if a valid identifier was provided, and throws an error otherwise.

{
    "id": 724,
    "name": "Watape",
    "host": "https://voxremover.com/hardware-on-the-cloud",
    "created_at": "2020-06-21 08:03:47",
    "emails_count": 194,
    "visits_count": 2124,
    "unique_visits": 1599,
    "conversion": 0.12,
    "referrals_count": 20,
    "uuid": "98f5535f-32bc-425c-a3d1-af950f8ac4e6"
}