NAV
php javascript

Info

Welcome to the generated API reference.

Campaign

Campaign objects allow you to manage your campaigns. The API allows you to delete, and update your campaigns. You can retrieve individual campaigns as well as a list of all your campaigns.

Retrieve a campaign

Retrieves the details of an existing campaign. You need only supply the unique campaign identifier that was returned upon campaign creation.

Example request:

curl -X GET -G "https://api.mailforge-api.test/campaign/{campaign}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"campaign":1}'
const url = new URL("https://api.mailforge-api.test/campaign/{campaign}");

    let params = {
            "include": "split,variants,analytic",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "campaign": 1
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "contact_list_id": 1,
    "segment_id": null,
    "title": "Our New Products",
    "type": "mail",
    "split_by": null,
    "track_clicks": false,
    "track_opens": false,
    "total_sent_count": 0,
    "unique_click_with_tracking_count": 0,
    "unique_delivery_count": 0,
    "unique_open_with_tracking_count": 0,
    "approved": 0,
    "scheduled": null,
    "is_processing": false,
    "is_scheduled": false,
    "is_sent": true,
    "metric_click": 0,
    "metric_delivery": 0,
    "metric_open": 0,
    "metric_sent": 0,
    "schedule_date": null,
    "schedule_time": null,
    "schedule_at": null,
    "updated_at": "Apr 11 2019 10:00am",
    "created_at": "Apr 03 2019  3:15pm",
    "sent_at": "Apr 03 2019  3:22pm",
    "queued_at": null,
    "evaluate_at": null,
    "evaluate_queued_at": null,
    "evaluate_sent_at": null
}

HTTP Request

GET campaign/{campaign}

Body Parameters
Parameter Type Description
campaign
required
integer The identifier of the campaign to be retrieved.
Query Parameters
Parameter Description
include
optional
Includes specified relationships on object.

Update a campaign

Updates the specified campaign by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Example request:

curl -X PUT "https://api.mailforge-api.test/campaign/{campaign}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"campaign":1,"title":"03\/04\/2019 15:15","segment_id":1,"contact_list_id":1,"track_opens":true,"track_clicks":true,"variants":[],"split":{},"schedule_at":"2019-04-03 12:00"}'
const url = new URL("https://api.mailforge-api.test/campaign/{campaign}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "campaign": 1,
    "title": "03\/04\/2019 15:15",
    "segment_id": 1,
    "contact_list_id": 1,
    "track_opens": true,
    "track_clicks": true,
    "variants": [],
    "split": {},
    "schedule_at": "2019-04-03 12:00"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "contact_list_id": 1,
    "segment_id": null,
    "title": "Our New Products",
    "type": "mail",
    "split_by": null,
    "track_clicks": false,
    "track_opens": false,
    "total_sent_count": 0,
    "unique_click_with_tracking_count": 0,
    "unique_delivery_count": 0,
    "unique_open_with_tracking_count": 0,
    "approved": 0,
    "scheduled": null,
    "is_processing": false,
    "is_scheduled": false,
    "is_sent": true,
    "metric_click": 0,
    "metric_delivery": 0,
    "metric_open": 0,
    "metric_sent": 0,
    "schedule_date": null,
    "schedule_time": null,
    "schedule_at": null,
    "updated_at": "Apr 11 2019 10:00am",
    "created_at": "Apr 03 2019  3:15pm",
    "sent_at": "Apr 03 2019  3:22pm",
    "queued_at": null,
    "evaluate_at": null,
    "evaluate_queued_at": null,
    "evaluate_sent_at": null
}

HTTP Request

PUT campaign/{campaign}

PATCH campaign/{campaign}

Body Parameters
Parameter Type Description
campaign
required
integer The identifier of the campaign to be updated.
title
required
string The title to regonize the campaign.
segment_id
optional
integer The identifier of the segment to use on contact list.
contact_list_id
optional
integer The identifier of the contact list, which will receive receive this campaign.
track_opens
optional
boolean Whether we should track opens on this campaign or not.
track_clicks
optional
boolean Whether we should track clicks on this campaign or not.
variants
optional
array Array of campaign variant objects.
split
optional
object Object containing split data.
schedule_at
optional
date When this campaign should be sent.

Delete a campaign

Permanently deletes a campaign. It cannot be undone. Also permanently deletes children.

Example request:

curl -X DELETE "https://api.mailforge-api.test/campaign/{campaign}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"campaign":1}'
const url = new URL("https://api.mailforge-api.test/campaign/{campaign}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "campaign": 1
}

fetch(url, {
    method: "DELETE",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "contact_list_id": 1,
    "segment_id": null,
    "title": "Our New Products",
    "type": "mail",
    "split_by": null,
    "track_clicks": false,
    "track_opens": false,
    "total_sent_count": 0,
    "unique_click_with_tracking_count": 0,
    "unique_delivery_count": 0,
    "unique_open_with_tracking_count": 0,
    "approved": 0,
    "scheduled": null,
    "is_processing": false,
    "is_scheduled": false,
    "is_sent": true,
    "metric_click": 0,
    "metric_delivery": 0,
    "metric_open": 0,
    "metric_sent": 0,
    "schedule_date": null,
    "schedule_time": null,
    "schedule_at": null,
    "updated_at": "Apr 11 2019 10:00am",
    "created_at": "Apr 03 2019  3:15pm",
    "sent_at": "Apr 03 2019  3:22pm",
    "queued_at": null,
    "evaluate_at": null,
    "evaluate_queued_at": null,
    "evaluate_sent_at": null
}

HTTP Request

DELETE campaign/{campaign}

Body Parameters
Parameter Type Description
campaign
required
integer The identifier of the campaign to be deleted.

List all campaigns

Returns a list of your campaigns. The campaigns are returned sorted by creation date, with the most recent campaigns appearing first.

Example request:

curl -X GET -G "https://api.mailforge-api.test/campaign" \
    -H "Authorization: Bearer {token}"
const url = new URL("https://api.mailforge-api.test/campaign");

    let params = {
            "q": "03/04/2019 15:15",
            "sort": "id:desc",
            "filter": "type=eq:mail",
            "include": "split,variants",
            "limit": "15",
            "offset": "15",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 1,
        "contact_list_id": 1,
        "segment_id": null,
        "title": "Our New Products",
        "type": "mail",
        "split_by": null,
        "track_clicks": false,
        "track_opens": false,
        "total_sent_count": 0,
        "unique_click_with_tracking_count": 0,
        "unique_delivery_count": 0,
        "unique_open_with_tracking_count": 0,
        "approved": 0,
        "scheduled": null,
        "is_processing": false,
        "is_scheduled": false,
        "is_sent": true,
        "metric_click": 0,
        "metric_delivery": 0,
        "metric_open": 0,
        "metric_sent": 0,
        "schedule_date": null,
        "schedule_time": null,
        "schedule_at": null,
        "updated_at": "Apr 11 2019 10:00am",
        "created_at": "Apr 03 2019  3:15pm",
        "sent_at": "Apr 03 2019  3:22pm",
        "queued_at": null,
        "evaluate_at": null,
        "evaluate_queued_at": null,
        "evaluate_sent_at": null
    }
]

HTTP Request

GET campaign

Query Parameters
Parameter Description
q
optional
Searching string.
sort
optional
A sorting on the list based on given columns and direction.
filter
optional
A filter on the list based on given columns and rules.
include
optional
Includes specified relationships on object.
limit
optional
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 15..
offset
optional
Also known as "page", the number dictates current page and the default is 1..

Contact

Contact objects allow you to manage your contacts. The API allows you to create, delete, and update your contacts. You can retrieve individual contacts as well as a list of all your contacts.

Create a contact

Creates a new contact object.

Example request:

curl -X POST "https://api.mailforge-api.test/contact-list/{contactlist}/contact" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"email":"dCfBsHnQZz647I2n","permission":true,"":{"field":"uoaNNVQYkau4TBvS"}}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/contact");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "email": "dCfBsHnQZz647I2n",
    "permission": true,
    "": {
        "field": "uoaNNVQYkau4TBvS"
    }
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "source": "manual",
    "email": "john@example.com",
    "confirmed_at": "Mar 29 2019  6:04am",
    "confirmed_ip": "192.168.10.1",
    "optin_at": "Mar 29 2019  6:04am",
    "optin_ip": "192.168.10.1",
    "optout_at": null,
    "optout_ip": null,
    "created_at": "Mar 07 2019  1:36pm",
    "updated_at": "Apr 02 2019  2:28am"
}

HTTP Request

POST contact-list/{contactlist}/contact

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the contact.
email
required
string Email of lead
permission
required
boolean Confirm concent of the added email
[field]
optional
[depends] Custom contact list fields

Retrieve a contact

Retrieves the details of an existing contact. You need only supply the unique contact identifier that was returned upon contact creation.

Example request:

curl -X GET -G "https://api.mailforge-api.test/contact-list/{contactlist}/contact/{contact}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"contact":1}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/contact/{contact}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "contact": 1
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "source": "manual",
    "email": "john@example.com",
    "confirmed_at": "Mar 29 2019  6:04am",
    "confirmed_ip": "192.168.10.1",
    "optin_at": "Mar 29 2019  6:04am",
    "optin_ip": "192.168.10.1",
    "optout_at": null,
    "optout_ip": null,
    "created_at": "Mar 07 2019  1:36pm",
    "updated_at": "Apr 02 2019  2:28am"
}

HTTP Request

GET contact-list/{contactlist}/contact/{contact}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the contact.
contact
required
integer The identifier of the contact to be retrieved.

Update a contact

Updates the specified contact by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Example request:

curl -X PUT "https://api.mailforge-api.test/contact-list/{contactlist}/contact/{contact}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"contact":1,"":{"field":"pmuRHifsER3Z0yW4"}}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/contact/{contact}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "contact": 1,
    "": {
        "field": "pmuRHifsER3Z0yW4"
    }
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "source": "manual",
    "email": "john@example.com",
    "confirmed_at": "Mar 29 2019  6:04am",
    "confirmed_ip": "192.168.10.1",
    "optin_at": "Mar 29 2019  6:04am",
    "optin_ip": "192.168.10.1",
    "optout_at": null,
    "optout_ip": null,
    "created_at": "Mar 07 2019  1:36pm",
    "updated_at": "Apr 02 2019  2:28am"
}

HTTP Request

PUT contact-list/{contactlist}/contact/{contact}

PATCH contact-list/{contactlist}/contact/{contact}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the contact.
contact
required
integer The identifier of the contact to be updated.
[field]
required
* Custom contact list fields, except "email" field cannot be updated

Delete a contact

Deletes a contact. It cannot be undone.

Example request:

curl -X DELETE "https://api.mailforge-api.test/contact-list/{contactlist}/contact/{contact}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"contact":1}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/contact/{contact}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "contact": 1
}

fetch(url, {
    method: "DELETE",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "source": "manual",
    "email": "john@example.com",
    "confirmed_at": "Mar 29 2019  6:04am",
    "confirmed_ip": "192.168.10.1",
    "optin_at": "Mar 29 2019  6:04am",
    "optin_ip": "192.168.10.1",
    "optout_at": null,
    "optout_ip": null,
    "created_at": "Mar 07 2019  1:36pm",
    "updated_at": "Apr 02 2019  2:28am"
}

HTTP Request

DELETE contact-list/{contactlist}/contact/{contact}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the contact.
contact
required
integer The identifier of the campaign to be deleted.

List all contacts

Returns a list of your contacts of given contact list. The contacts are returned sorted by creation date, with the most recent contacts appearing first.

Example request:

curl -X GET -G "https://api.mailforge-api.test/contact-list/{contactlist}/contact" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/contact");

    let params = {
            "q": "John Doe",
            "sort": "id:desc",
            "filter": "email=eq:example@mail.com",
            "include": "campaigns,activities",
            "limit": "15",
            "offset": "15",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 1,
        "source": "manual",
        "email": "john@example.com",
        "confirmed_at": "Mar 29 2019  6:04am",
        "confirmed_ip": "192.168.10.1",
        "optin_at": "Mar 29 2019  6:04am",
        "optin_ip": "192.168.10.1",
        "optout_at": null,
        "optout_ip": null,
        "created_at": "Mar 07 2019  1:36pm",
        "updated_at": "Apr 02 2019  2:28am"
    }
]

HTTP Request

GET contact-list/{contactlist}/contact

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the contacts.
Query Parameters
Parameter Description
q
optional
Searching string.
sort
optional
A sorting on the list based on given columns and direction.
filter
optional
A filter on the list based on given columns and rules.
include
optional
Includes specified relationships on object.
limit
optional
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 15..
offset
optional
Also known as "page", the number dictates current page and the default is 1..

Contact list

Contact list objects allow you to manage your contact lists. The API allows you to create, delete, and update your contact lists. You can retrieve individual contact lists as well as a list of all your contact lists.

Create a contact list

Creates a new contact list object.

Example request:

curl -X POST "https://api.mailforge-api.test/contact-list" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"title":"My list","from_name":"1","from_email":"1","description":"zEubYjufwgMO1SYL","company":"1","website":"1","address":"1","zip":"1","city":"1","country":"1","phone":1,"reminder":"1"}'
const url = new URL("https://api.mailforge-api.test/contact-list");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "title": "My list",
    "from_name": "1",
    "from_email": "1",
    "description": "zEubYjufwgMO1SYL",
    "company": "1",
    "website": "1",
    "address": "1",
    "zip": "1",
    "city": "1",
    "country": "1",
    "phone": 1,
    "reminder": "1"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "hash_id": "1G74g",
    "title": "My first list",
    "description": null,
    "company": "Business Inc.",
    "from_email": "hello@example.com",
    "from_name": "John Doe",
    "reminder": null,
    "website": "https:\/\/example.com",
    "phone": "12345678",
    "address": "John Doe Street 4",
    "city": "John City",
    "zip": "24000",
    "country": "US",
    "importing": false,
    "contacts_count": 1,
    "total_sent_count": 5,
    "metric_click": 0,
    "metric_delivery": 20,
    "metric_open": 0,
    "metric_sent": 5,
    "unique_click_with_tracking_count": 0,
    "unique_delivery_count": 1,
    "unique_open_with_tracking_count": 0,
    "updated_at": "Mar 12 2019 10:13am",
    "created_at": "Feb 07 2019  9:08am"
}

HTTP Request

POST contact-list

Body Parameters
Parameter Type Description
title
required
string The title to regonize the contact list.
from_name
required
string The name subscribers will see in emails.
from_email
required
string The email subscribers will see in emails.
description
optional
string A description to describe what this contact list is used for.
company
optional
string Person, Company or Organization associated with the contact list.
website
optional
string Website where the contact list receive leads.
address
optional
string Person, Company or Organization street address.
zip
optional
string Person, Company or Organization zip code.
city
optional
string Person, Company or Organization city.
country
optional
string Person, Company or Organization country.
phone
optional
integer Person, Company or Organization phone number.
reminder
optional
string [Unknown].

Retrieve a contact list

Retrieves the details of an existing contact list. You need only supply the unique contact list identifier that was returned upon contact list creation.

Example request:

curl -X GET -G "https://api.mailforge-api.test/contact-list/{contactlist}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}");

    let params = {
            "include": "fields",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "hash_id": "1G74g",
    "title": "My first list",
    "description": null,
    "company": "Business Inc.",
    "from_email": "hello@example.com",
    "from_name": "John Doe",
    "reminder": null,
    "website": "https:\/\/example.com",
    "phone": "12345678",
    "address": "John Doe Street 4",
    "city": "John City",
    "zip": "24000",
    "country": "US",
    "importing": false,
    "contacts_count": 1,
    "total_sent_count": 5,
    "metric_click": 0,
    "metric_delivery": 20,
    "metric_open": 0,
    "metric_sent": 5,
    "unique_click_with_tracking_count": 0,
    "unique_delivery_count": 1,
    "unique_open_with_tracking_count": 0,
    "updated_at": "Mar 12 2019 10:13am",
    "created_at": "Feb 07 2019  9:08am"
}

HTTP Request

GET contact-list/{contactlist}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list to be retrieved.
Query Parameters
Parameter Description
include
optional
Includes specified relationships on object.

Update a contact list

Updates the specified contact list by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Example request:

curl -X PUT "https://api.mailforge-api.test/contact-list/{contactlist}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"title":"My list","from_name":"1","from_email":"1","description":"kutjZy7pYjCJ3t1P","company":"1","website":"1","address":"1","zip":"1","city":"1","country":"1","phone":1,"reminder":"1"}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "title": "My list",
    "from_name": "1",
    "from_email": "1",
    "description": "kutjZy7pYjCJ3t1P",
    "company": "1",
    "website": "1",
    "address": "1",
    "zip": "1",
    "city": "1",
    "country": "1",
    "phone": 1,
    "reminder": "1"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "hash_id": "1G74g",
    "title": "My first list",
    "description": null,
    "company": "Business Inc.",
    "from_email": "hello@example.com",
    "from_name": "John Doe",
    "reminder": null,
    "website": "https:\/\/example.com",
    "phone": "12345678",
    "address": "John Doe Street 4",
    "city": "John City",
    "zip": "24000",
    "country": "US",
    "importing": false,
    "contacts_count": 1,
    "total_sent_count": 5,
    "metric_click": 0,
    "metric_delivery": 20,
    "metric_open": 0,
    "metric_sent": 5,
    "unique_click_with_tracking_count": 0,
    "unique_delivery_count": 1,
    "unique_open_with_tracking_count": 0,
    "updated_at": "Mar 12 2019 10:13am",
    "created_at": "Feb 07 2019  9:08am"
}

HTTP Request

PUT contact-list/{contactlist}

PATCH contact-list/{contactlist}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list to be updated.
title
required
string The title to regonize the contact list.
from_name
required
string The name subscribers will see in emails.
from_email
required
string The email subscribers will see in emails.
description
optional
string A description to describe what this contact list is used for.
company
optional
string Person, Company or Organization associated with the contact list.
website
optional
string Website where the contact list receive leads.
address
optional
string Person, Company or Organization street address.
zip
optional
string Person, Company or Organization zip code.
city
optional
string Person, Company or Organization city.
country
optional
string Person, Company or Organization country.
phone
optional
integer Person, Company or Organization phone number.
reminder
optional
string [Unknown].

Delete a contact list

Permanently deletes a contact list. It cannot be undone.

Example request:

curl -X DELETE "https://api.mailforge-api.test/contact-list/{contactlist}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1
}

fetch(url, {
    method: "DELETE",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "hash_id": "1G74g",
    "title": "My first list",
    "description": null,
    "company": "Business Inc.",
    "from_email": "hello@example.com",
    "from_name": "John Doe",
    "reminder": null,
    "website": "https:\/\/example.com",
    "phone": "12345678",
    "address": "John Doe Street 4",
    "city": "John City",
    "zip": "24000",
    "country": "US",
    "importing": false,
    "contacts_count": 1,
    "total_sent_count": 5,
    "metric_click": 0,
    "metric_delivery": 20,
    "metric_open": 0,
    "metric_sent": 5,
    "unique_click_with_tracking_count": 0,
    "unique_delivery_count": 1,
    "unique_open_with_tracking_count": 0,
    "updated_at": "Mar 12 2019 10:13am",
    "created_at": "Feb 07 2019  9:08am"
}

HTTP Request

DELETE contact-list/{contactlist}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list to be deleted.

List all contact lists

Returns a list of your contact lists. The contact list are returned sorted by creation date, with the most recent contact list appearing first.

Example request:

curl -X GET -G "https://api.mailforge-api.test/contact-list" \
    -H "Authorization: Bearer {token}"
const url = new URL("https://api.mailforge-api.test/contact-list");

    let params = {
            "q": "03/04/2019 15:15",
            "sort": "id:desc",
            "filter": "type=eq:mail",
            "include": "fields",
            "limit": "15",
            "offset": "15",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 1,
        "hash_id": "1G74g",
        "title": "My first list",
        "description": null,
        "company": "Business Inc.",
        "from_email": "hello@example.com",
        "from_name": "John Doe",
        "reminder": null,
        "website": "https:\/\/example.com",
        "phone": "12345678",
        "address": "John Doe Street 4",
        "city": "John City",
        "zip": "24000",
        "country": "US",
        "importing": false,
        "contacts_count": 1,
        "total_sent_count": 5,
        "metric_click": 0,
        "metric_delivery": 20,
        "metric_open": 0,
        "metric_sent": 5,
        "unique_click_with_tracking_count": 0,
        "unique_delivery_count": 1,
        "unique_open_with_tracking_count": 0,
        "updated_at": "Mar 12 2019 10:13am",
        "created_at": "Feb 07 2019  9:08am"
    }
]

HTTP Request

GET contact-list

Query Parameters
Parameter Description
q
optional
Searching string.
sort
optional
A sorting on the list based on given columns and direction.
filter
optional
A filter on the list based on given columns and rules.
include
optional
Includes specified relationships on object.
limit
optional
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 15..
offset
optional
Also known as "page". the number dictates current page and the default is 1..

Domain

Domain objects allow you to manage your domains. The API allows you to create, delete, and update your domains. You can retrieve individual domains as well as a list of all your domains.

Create a domain

Creates a new domain object.

Example request:

curl -X POST "https://api.mailforge-api.test/domain" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"domain":"example.com"}'
const url = new URL("https://api.mailforge-api.test/domain");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "domain": "example.com"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "domain": "example.com",
    "image_tracking_code": "",
    "ownership": true,
    "sending_domain": true,
    "tracking_code": "",
    "tracking_domain": null
}

HTTP Request

POST domain

Body Parameters
Parameter Type Description
domain
required
string The domain itself.

Retrieve a domain

Retrieves the details of an existing domain. You need only supply the unique domain identifier that was returned upon domain creation.

Example request:

curl -X GET -G "https://api.mailforge-api.test/domain/{domain}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"domain":1}'
const url = new URL("https://api.mailforge-api.test/domain/{domain}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "domain": 1
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "domain": "example.com",
    "image_tracking_code": "",
    "ownership": true,
    "sending_domain": true,
    "tracking_code": "",
    "tracking_domain": null
}

HTTP Request

GET domain/{domain}

Body Parameters
Parameter Type Description
domain
required
integer The identifier of the domain to be retrieved.

Update a domain

Updates the specified domain by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Example request:

curl -X PUT "https://api.mailforge-api.test/domain/{domain}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"domain":"example.com","sending_domain":true}'
const url = new URL("https://api.mailforge-api.test/domain/{domain}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "domain": "example.com",
    "sending_domain": true
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "domain": "example.com",
    "image_tracking_code": "",
    "ownership": true,
    "sending_domain": true,
    "tracking_code": "",
    "tracking_domain": null
}

HTTP Request

PUT domain/{domain}

PATCH domain/{domain}

Body Parameters
Parameter Type Description
domain
required
string The domain itself.
sending_domain
optional
boolean The identifier of the campaign to be updated.

Delete a domain

Permanently deletes a campaign. It cannot be undone.

Example request:

curl -X DELETE "https://api.mailforge-api.test/domain/{domain}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"domain":1}'
const url = new URL("https://api.mailforge-api.test/domain/{domain}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "domain": 1
}

fetch(url, {
    method: "DELETE",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "domain": "example.com",
    "image_tracking_code": "",
    "ownership": true,
    "sending_domain": true,
    "tracking_code": "",
    "tracking_domain": null
}

HTTP Request

DELETE domain/{domain}

Body Parameters
Parameter Type Description
domain
required
integer The identifier of the domain to be deleted.

List all domains

Returns a list of your domains. The domains are returned sorted by creation date, with the most recent domains appearing first.

Example request:

curl -X GET -G "https://api.mailforge-api.test/domain" \
    -H "Authorization: Bearer {token}"
const url = new URL("https://api.mailforge-api.test/domain");

    let params = {
            "q": "03/04/2019 15:15",
            "sort": "id:desc",
            "filter": "type=eq:mail",
            "limit": "15",
            "offset": "15",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 1,
        "domain": "example.com",
        "image_tracking_code": "",
        "ownership": true,
        "sending_domain": true,
        "tracking_code": "",
        "tracking_domain": null
    }
]

HTTP Request

GET domain

Query Parameters
Parameter Description
q
optional
Searching string.
sort
optional
A sorting on the list based on given columns and direction.
filter
optional
A filter on the list based on given columns and rules.
limit
optional
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 15..
offset
optional
Also known as "page", the number dictates current page and the default is 1..

Field

Field objects allow you to manage your fields. The API allows you to create, delete, and update your fields. You can retrieve individual fields as well as a list of all your fields.

Create a field

Creates a new field object.

Example request:

curl -X POST "https://api.mailforge-api.test/contact-list/{contactlist}/field" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"field":1,"label":"Firstname","type":"text","required":false,"visible":true}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/field");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "field": 1,
    "label": "Firstname",
    "type": "text",
    "required": false,
    "visible": true
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "contact_list_id": 1,
    "label": "E-mail",
    "input": "text",
    "tag": "email",
    "type": "email",
    "options": null,
    "visible": true,
    "locked": true,
    "required": true,
    "updated_at": "2019-03-07 12:36:05",
    "created_at": "2019-03-07 12:36:05",
    "deleted_at": null
}

HTTP Request

POST contact-list/{contactlist}/field

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the field.
field
required
integer The identifier of the field to be updated.
label
optional
required Label on the field, people can relate to and understand.
type
required
string Type of field.
required
optional
boolean Whether the field is required or not.
visible
optional
boolean Whether the field is visible or not.

Retrieve a field

Retrieves the details of an existing field. You need only supply the unique field identifier that was returned upon field creation.

Example request:

curl -X GET -G "https://api.mailforge-api.test/contact-list/{contactlist}/field/{field}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"field":1}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/field/{field}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "field": 1
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "contact_list_id": 1,
    "label": "E-mail",
    "input": "text",
    "tag": "email",
    "type": "email",
    "options": null,
    "visible": true,
    "locked": true,
    "required": true,
    "updated_at": "2019-03-07 12:36:05",
    "created_at": "2019-03-07 12:36:05",
    "deleted_at": null
}

HTTP Request

GET contact-list/{contactlist}/field/{field}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the field.
field
required
integer The identifier of the field to be retrieved.

Update a field

Updates the specified field by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Example request:

curl -X PUT "https://api.mailforge-api.test/contact-list/{contactlist}/field/{field}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"field":1,"label":"Firstname","type":"text","options":[],"required":false,"visible":true}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/field/{field}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "field": 1,
    "label": "Firstname",
    "type": "text",
    "options": [],
    "required": false,
    "visible": true
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "contact_list_id": 1,
    "label": "E-mail",
    "input": "text",
    "tag": "email",
    "type": "email",
    "options": null,
    "visible": true,
    "locked": true,
    "required": true,
    "updated_at": "2019-03-07 12:36:05",
    "created_at": "2019-03-07 12:36:05",
    "deleted_at": null
}

HTTP Request

PUT contact-list/{contactlist}/field/{field}

PATCH contact-list/{contactlist}/field/{field}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the field.
field
required
integer The identifier of the field to be updated.
label
optional
required Label on the field, people can relate to and understand.
type
required
string Type of field.
options
optional
array Array of strings.
required
optional
boolean Whether the field is required or not.
visible
optional
boolean Whether the field is visible or not.

Delete a field

Permanently deletes a field. It cannot be undone.

Example request:

curl -X DELETE "https://api.mailforge-api.test/contact-list/{contactlist}/field/{field}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"field":1}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/field/{field}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "field": 1
}

fetch(url, {
    method: "DELETE",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "contact_list_id": 1,
    "label": "E-mail",
    "input": "text",
    "tag": "email",
    "type": "email",
    "options": null,
    "visible": true,
    "locked": true,
    "required": true,
    "updated_at": "2019-03-07 12:36:05",
    "created_at": "2019-03-07 12:36:05",
    "deleted_at": null
}

HTTP Request

DELETE contact-list/{contactlist}/field/{field}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the field.
field
required
integer The identifier of the field to be deleted.

List all fields

Returns a list of your fields. The fields are returned sorted by creation date, with the most recent fields appearing first.

Example request:

curl -X GET -G "https://api.mailforge-api.test/contact-list/{contactlist}/field" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/field");

    let params = {
            "q": "03/04/2019 15:15",
            "sort": "id:desc",
            "filter": "type=eq:mail",
            "limit": "15",
            "offset": "15",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 1,
        "contact_list_id": 1,
        "label": "E-mail",
        "input": "text",
        "tag": "email",
        "type": "email",
        "options": null,
        "visible": true,
        "locked": true,
        "required": true,
        "updated_at": "2019-03-07 12:36:05",
        "created_at": "2019-03-07 12:36:05",
        "deleted_at": null
    }
]

HTTP Request

GET contact-list/{contactlist}/field

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the fields.
Query Parameters
Parameter Description
q
optional
Searching string.
sort
optional
A sorting on the list based on given columns and direction.
filter
optional
A filter on the list based on given columns and rules.
limit
optional
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 15..
offset
optional
Also known as "page", the number dictates current page and the default is 1..

Form

Form objects allow you to manage your forms. The API allows you to delete your forms. You can retrieve individual fields as well as a list of all your fields.

Retrieve a form

Retrieves the details of an existing form. You need only supply the unique form identifier that was returned upon form creation.

Example request:

curl -X GET -G "https://api.mailforge-api.test/contact-list/{contactlist}/form/{form}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"form":1}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/form/{form}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "form": 1
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "contact_list_id": 1,
    "title": "Untitled",
    "type": "popup",
    "data": "[Data Object]",
    "embed": "[Embed Script Tag]",
    "updated_at": "2019-03-07 12:36:05",
    "created_at": "2019-03-07 12:36:05",
    "deleted_at": null
}

HTTP Request

GET contact-list/{contactlist}/form/{form}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the form.
form
required
integer The identifier of the form to be retrieved.

Delete a form

Permanently deletes a form. It cannot be undone.

Example request:

curl -X DELETE "https://api.mailforge-api.test/contact-list/{contactlist}/form/{form}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"form":1}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/form/{form}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "form": 1
}

fetch(url, {
    method: "DELETE",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "contact_list_id": 1,
    "title": "Untitled",
    "type": "popup",
    "data": "[Data Object]",
    "embed": "[Embed Script Tag]",
    "updated_at": "2019-03-07 12:36:05",
    "created_at": "2019-03-07 12:36:05",
    "deleted_at": null
}

HTTP Request

DELETE contact-list/{contactlist}/form/{form}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the form.
form
required
integer The identifier of the form to be deleted.

List all forms

Returns a list of your forms. The forms are returned sorted by creation date, with the most recent fields appearing first.

Example request:

curl -X GET -G "https://api.mailforge-api.test/contact-list/{contactlist}/form" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/form");

    let params = {
            "q": "03/04/2019 15:15",
            "sort": "id:desc",
            "filter": "type=eq:mail",
            "limit": "15",
            "offset": "15",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 1,
        "contact_list_id": 1,
        "title": "Untitled",
        "type": "popup",
        "data": "[Data Object]",
        "embed": "[Embed Script Tag]",
        "updated_at": "2019-03-07 12:36:05",
        "created_at": "2019-03-07 12:36:05",
        "deleted_at": null
    }
]

HTTP Request

GET contact-list/{contactlist}/form

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the fields.
Query Parameters
Parameter Description
q
optional
Searching string.
sort
optional
A sorting on the list based on given columns and direction.
filter
optional
A filter on the list based on given columns and rules.
limit
optional
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 15..
offset
optional
Also known as "page", the number dictates current page and the default is 1..

Profile

Profile objects allow you to manage your profile. The API allows you to update your profile.

Retrieve profile

Retrieves the details of your account.

Example request:

curl -X GET -G "https://api.mailforge-api.test/profile" \
    -H "Authorization: Bearer {token}"
const url = new URL("https://api.mailforge-api.test/profile");

let headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "account_type": "company",
    "first_name": "John",
    "last_name": "Doe",
    "name": "John Doe",
    "email": "john@example.com",
    "company": "",
    "vat_id": null,
    "phone": "12345678",
    "address": "John Doe Street 4",
    "zip": "24000",
    "city": "John City",
    "country": "US",
    "language": "en",
    "date_format": "%b %d %Y",
    "time_format": "%l:%M%P",
    "timezone": "Europe\/Copenhagen",
    "is_active": 1,
    "is_company": false,
    "reached_limit": false,
    "dpa_signed_at": null,
    "enable_agency": 0,
    "has_subscription": false,
    "intercom": "{token}"
}

HTTP Request

GET profile

Update your profile

Updates your profile by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Example request:

curl -X PATCH "https://api.mailforge-api.test/profile" \
    -H "Authorization: Bearer {token}"
const url = new URL("https://api.mailforge-api.test/profile");

    let params = {
            "first_name": "49Kb29IjA3i7aTTS",
            "last_name": "hkPYSzQY5aFK7PGo",
            "phone": "RK6ROwgAWNmr9Cbs",
            "address": "gLBj9h4esoXa1au3",
            "zip": "bGVGxNipMwKsmWcJ",
            "city": "yU9zYe3ZdZLezwUs",
            "language": "QvGDa4PfnUghj32c",
            "time_format": "T4hv0D6Iy1IRIzoZ",
            "date_format": "iGDBluEoi28hcGSa",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "PATCH",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "account_type": "company",
    "first_name": "John",
    "last_name": "Doe",
    "name": "John Doe",
    "email": "john@example.com",
    "company": "",
    "vat_id": null,
    "phone": "12345678",
    "address": "John Doe Street 4",
    "zip": "24000",
    "city": "John City",
    "country": "US",
    "language": "en",
    "date_format": "%b %d %Y",
    "time_format": "%l:%M%P",
    "timezone": "Europe\/Copenhagen",
    "is_active": 1,
    "is_company": false,
    "reached_limit": false,
    "dpa_signed_at": null,
    "enable_agency": 0,
    "has_subscription": false,
    "intercom": "{token}"
}

HTTP Request

PATCH profile

Query Parameters
Parameter Description
first_name
required
The id of the location.
last_name
required
The id of the location.
phone
optional
The id of the location.
address
required
The id of the location.
zip
required
The id of the location.
city
required
The id of the location.
language
required
The id of the location.
time_format
required
The id of the location.
date_format
required
The id of the location.

Segment

Segment objects allow you to manage your segments. The API allows you to create, delete, and update your segments. You can retrieve individual segments as well as a list of all your segments.

Create a segment

Creates a new segment object.

Example request:

curl -X POST "https://api.mailforge-api.test/contact-list/{contactlist}/segment" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"name":"My segment","description":"RLjr9CSCiiQZYE13","segments":[]}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/segment");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "name": "My segment",
    "description": "RLjr9CSCiiQZYE13",
    "segments": []
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "contact_list_id": 1,
    "name": "Only Gmail",
    "description": "List of contacts with emails that ends with \"gmail.com\" ",
    "contacts_count": 1,
    "segmented_contacts_count": null,
    "segments": [
        {
            "group": "and",
            "conditions": [
                {
                    "field": "data->field",
                    "operator": "ew",
                    "value": "gmail.com"
                }
            ]
        }
    ],
    "created_at": "Mar 08 2019  1:25pm",
    "updated_at": "Mar 08 2019  1:25pm"
}

HTTP Request

POST contact-list/{contactlist}/segment

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the segment.
name
required
string The name to regonize the contact list.
description
optional
string A description to describe what this segment does or used for.
segments
required
array Array of groups and conditions

Retrieve a segment

Retrieves the details of an existing segment. You need only supply the unique segment identifier that was returned upon segment creation.

Example request:

curl -X GET -G "https://api.mailforge-api.test/contact-list/{contactlist}/segment/{segment}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"segment":1}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/segment/{segment}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "segment": 1
}

fetch(url, {
    method: "GET",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "contact_list_id": 1,
    "name": "Only Gmail",
    "description": "List of contacts with emails that ends with \"gmail.com\" ",
    "contacts_count": 1,
    "segmented_contacts_count": null,
    "segments": [
        {
            "group": "and",
            "conditions": [
                {
                    "field": "data->field",
                    "operator": "ew",
                    "value": "gmail.com"
                }
            ]
        }
    ],
    "created_at": "Mar 08 2019  1:25pm",
    "updated_at": "Mar 08 2019  1:25pm"
}

HTTP Request

GET contact-list/{contactlist}/segment/{segment}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the segment.
segment
required
integer The identifier of the segment to be retrieved.

Update a segment

Updates the specified segment by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Example request:

curl -X PUT "https://api.mailforge-api.test/contact-list/{contactlist}/segment/{segment}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"segment":1,"name":"My segment","description":"7RqQxnDK96ClOcD4","segments":[]}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/segment/{segment}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "segment": 1,
    "name": "My segment",
    "description": "7RqQxnDK96ClOcD4",
    "segments": []
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "contact_list_id": 1,
    "name": "Only Gmail",
    "description": "List of contacts with emails that ends with \"gmail.com\" ",
    "contacts_count": 1,
    "segmented_contacts_count": null,
    "segments": [
        {
            "group": "and",
            "conditions": [
                {
                    "field": "data->field",
                    "operator": "ew",
                    "value": "gmail.com"
                }
            ]
        }
    ],
    "created_at": "Mar 08 2019  1:25pm",
    "updated_at": "Mar 08 2019  1:25pm"
}

HTTP Request

PUT contact-list/{contactlist}/segment/{segment}

PATCH contact-list/{contactlist}/segment/{segment}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the segment.
segment
required
integer The identifier of the segment to be updated.
name
required
string The name to regonize the contact list.
description
optional
string A description to describe what this segment does or used for.
segments
required
array Array of groups and conditions

Delete a segment

Permanently deletes a segment. It cannot be undone.

Example request:

curl -X DELETE "https://api.mailforge-api.test/contact-list/{contactlist}/segment/{segment}" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"contactlist":1,"segment":1}'
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/segment/{segment}");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "contactlist": 1,
    "segment": 1
}

fetch(url, {
    method: "DELETE",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "contact_list_id": 1,
    "name": "Only Gmail",
    "description": "List of contacts with emails that ends with \"gmail.com\" ",
    "contacts_count": 1,
    "segmented_contacts_count": null,
    "segments": [
        {
            "group": "and",
            "conditions": [
                {
                    "field": "data->field",
                    "operator": "ew",
                    "value": "gmail.com"
                }
            ]
        }
    ],
    "created_at": "Mar 08 2019  1:25pm",
    "updated_at": "Mar 08 2019  1:25pm"
}

HTTP Request

DELETE contact-list/{contactlist}/segment/{segment}

Body Parameters
Parameter Type Description
contactlist
required
integer The identifier of the contact list containing the segment.
segment
required
integer The identifier of the segment to be updated.

List all segments

Returns a list of your segments. The segments are returned sorted by creation date, with the most recent segments appearing first.

Example request:

curl -X GET -G "https://api.mailforge-api.test/contact-list/{contactlist}/segment" \
    -H "Authorization: Bearer {token}"
const url = new URL("https://api.mailforge-api.test/contact-list/{contactlist}/segment");

    let params = {
            "q": "03/04/2019 15:15",
            "sort": "id:desc",
            "filter": "type=eq:mail",
            "include": "split,variants",
            "limit": "15",
            "offset": "15",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 1,
        "contact_list_id": 1,
        "name": "Only Gmail",
        "description": "List of contacts with emails that ends with \"gmail.com\" ",
        "contacts_count": 1,
        "segmented_contacts_count": null,
        "segments": [
            {
                "group": "and",
                "conditions": [
                    {
                        "field": "data->field",
                        "operator": "ew",
                        "value": "gmail.com"
                    }
                ]
            }
        ],
        "created_at": "Mar 08 2019  1:25pm",
        "updated_at": "Mar 08 2019  1:25pm"
    }
]

HTTP Request

GET contact-list/{contactlist}/segment

Query Parameters
Parameter Description
q
optional
Searching string.
sort
optional
A sorting on the list based on given columns and direction.
filter
optional
A filter on the list based on given columns and rules.
include
optional
Includes specified relationships on object.
limit
optional
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 15..
offset
optional
Also known as "page", the number dictates current page and the default is 1..