Emelia API API Reference

Welcome the Emelia API reference. Here you can find all the different schemas you can use on Emelia. Our API is build on GraphQL. Feel free to check their docs if you're not familiar with GraphQL.

All of theses schemas are available to every users. You just have to send your API key in the headers.

API Endpoints
https://graphql.emelia.io/graphql
Terms of Service: https://www.emelia.io/cgv
Contact: charles@bridgers-agency.com
Version: 1.0.0

Authentication

api_key

Provides API Key in 'Authorization' field in Header.

You can get one on your Emelia settings.

type
apiKey
name
Authorization
in
header

User Data

Available actions for your account

Get User Data

Get data from your user account

Example

Request Content-Types: application/json
Query
query me{
  me{
    uid
    name
    email
    picture
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "me": {
      "uid": "string",
      "name": "string",
      "email": "string",
      "picture": "string"
    }
  }
}

Campaigns Action

Different actions available for a campaign

Get Campaigns

Get a basic listing of all campaigns including name, status, creation date and statistics

Example

Request Content-Types: application/json
Query
query all_campaigns{
  all_campaigns{
    _id
    name
    status
    createdAt
    stats{
      mailsSent
      uniqueOpensPercent
      opens
      linkClickedPercent
      repliedPercent
      bouncedPercent
      unsubscribePercent
      progressPercent
    }
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "all_campaigns": [
      {
        "_id": "string",
        "name": "string",
        "createdAt": "string",
        "stats": {
          "mailsSent": "integer",
          "uniqueOpensPercent": "number",
          "opens": "integer",
          "linkClickedPercent": "number",
          "repliedPercent": "number",
          "bouncedPercent": "number",
          "unsubscribePercent": "number",
          "progressPercent": "number"
        }
      }
    ]
  }
}

Get a campaign

Get a specific campaign by its id and get all data

id:
string

(no description)

Example

Request Content-Types: application/json
Query
query campaign($id: ID!){
  campaign(id: $id){
    _id
    name
    status
    createdAt
    schedule{
      dailyContact
      dailyLimit
      minInterval
      maxInterval
      trackLinks
      trackOpens
      timeZone
      days
      start
      end
      eventToStopMails
    }
    provider
    startAt
    recipients{
      total_count
    }
    estimatedEnd
  }
}
Variables
{
  "id": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "campaign": {
      "_id": "string",
      "name": "string",
      "createdAt": "string",
      "schedule": {
        "dailyContact": "integer",
        "dailyLimit": "integer",
        "minInterval": "integer",
        "maxInterval": "integer",
        "trackLinks": "boolean",
        "trackOpens": "boolean",
        "timeZone": "string",
        "days": [
          "integer"
        ],
        "start": "string",
        "end": "string",
        "eventToStopMails": [
          null
        ]
      },
      "provider": "string",
      "startAt": "string",
      "recipients": {
        "total_count": "integer"
      },
      "estimatedEnd": "string"
    }
  }
}

Create a campaign

Create a new campaign by providing a name

name:
string

(no description)

Example

Request Content-Types: application/json
Query
mutation createCampaign($name: String!){
  createCampaign(name: $name){
    _id
    name
    status
    createdAt
    provider
    startAt
    estimatedEnd
  }
}
Variables
{
  "name": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createCampaign": {
      "_id": "string",
      "name": "string",
      "createdAt": "string",
      "provider": "string",
      "startAt": "string",
      "estimatedEnd": "string"
    }
  }
}

Start a campaign

Start a cold-mailing campaign by providing its id. You must have a provider and contacts set.

id:
string

(no description)

Example

Request Content-Types: application/json
Query
mutation startCampaign($id: ID!){
  startCampaign(id: $id)
}
Variables
{
  "id": "string"
}
Try it now
200 OK

Successful operation

type
boolean
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "startCampaign": "boolean"
  }
}

Pause a campaign

Pause a campaign with its id. The campaign must be in RUNNING mode

id:
string

(no description)

Example

Request Content-Types: application/json
Query
mutation pauseCampaign($id: ID!){
  pauseCampaign(id: $id)
}
Variables
{
  "id": "string"
}
Try it now
200 OK

Successful operation

type
boolean
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "pauseCampaign": "boolean"
  }
}

Add Contact to a campaign

Add a contact to an existing campaign. If the campaign is the RUNNING, the contact is automatically added to the loop. If the campaign is in FINISHED state, the campaign will be automatically switched to RUNNING until the loop for the new contact is finished.

id:
string

(no description)

contact:
object

(no description)

Example

Request Content-Types: application/json
Query
mutation addContactToCampaignHook($id: ID!, $contact: JSON!){
  addContactToCampaignHook(id: $id, contact: $contact)
}
Variables
{
  "id": "string"
}
Try it now
200 OK

Successful operation

type
string
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "addContactToCampaignHook": "string"
  }
}

Contacts Action

Different actions about contacts and contacts list on Emelia

Get Contacts Lists

Return all contacts lists existants on your account

Example

Request Content-Types: application/json
Query
query contact_lists{
  contact_lists{
    _id
    name
    contactCount
    fields
    usedInCampaign
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "contact_lists": [
      {
        "_id": "string",
        "name": "string",
        "contactCount": "integer",
        "fields": [
          "string"
        ],
        "usedInCampaign": "boolean"
      }
    ]
  }
}

Add Contact to a List

Add a contact to an existing list. If this list is used in a campaign you must use the addContactToCampaignHook mutation instead.

id:
string

(no description)

contact:
object

(no description)

Example

Request Content-Types: application/json
Query
mutation addContactsToListHook($id: ID!, $contact: JSON!){
  addContactsToListHook(id: $id, contact: $contact)
}
Variables
{
  "id": "string"
}
Try it now
200 OK

Successful operation

type
string
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "addContactsToListHook": "string"
  }
}

Schema Definitions

APIKey: object

key:
created_at:
status:
last_usage:
Example
{
  "key": "string",
  "created_at": "string",
  "status": "string",
  "last_usage": "string"
}

Activities: object

total_count:
Int
activities:
Example
{
  "total_count": "number",
  "activities": [
    {
      "_id": "object",
      "contact": {
        "_id": "object",
        "firstName": "string",
        "lastName": "string",
        "phoneNumber": "string",
        "email": "string",
        "custom": "object",
        "interested": "string",
        "mailsSent": "number",
        "status": "string",
        "lastContacted": "string",
        "lastReplied": "string",
        "lastOpen": "string"
      },
      "event": "string",
      "date": "string"
    }
  ]
}

Activity: object

_id:
ID
contact:
event:
date:
Example
{
  "_id": "object",
  "contact": {
    "_id": "object",
    "firstName": "string",
    "lastName": "string",
    "phoneNumber": "string",
    "email": "string",
    "custom": "object",
    "interested": "string",
    "mailsSent": "number",
    "status": "string",
    "lastContacted": "string",
    "lastReplied": "string",
    "lastOpen": "string"
  },
  "event": "string",
  "date": "string"
}

ActivityResume: object

global:
steps:
object[][]
Example
{
  "global": {
    "sent": "number",
    "first_open": "number",
    "first_open_percent": "number",
    "opened": "number",
    "clicked": "number",
    "clicked_percent": "number",
    "replied": "number",
    "replied_percent": "number",
    "bounced": "number",
    "bounced_percent": "number",
    "unsubscribed": "number",
    "unsubscribed_percent": "number",
    "progress_percent": "number"
  },
  "steps": [
    [
      {
        "sent": "number",
        "to_send": "number",
        "delivered": "number",
        "first_open": "number",
        "first_open_percent": "number",
        "opened": "number",
        "clicked": "number",
        "clicked_percent": "number",
        "replied": "number",
        "replied_percent": "number",
        "bounced": "number",
        "bounced_percent": "number",
        "unsubscribed": "number",
        "unsubscribed_percent": "number"
      }
    ]
  ]
}

AdditionalEmail: object

expiration:
active:
Example
{
  "expiration": "string",
  "active": "boolean"
}

BasicCampaign: object

_id:
ID
name:
status:
createdAt:
provider:
Example
{
  "_id": "object",
  "name": "string",
  "status": "string",
  "createdAt": "string",
  "provider": {
    "_id": "object",
    "senderName": "string",
    "senderEmail": "string",
    "senderPassword": "string",
    "emailType": "string",
    "smtp": {
      "login": "string",
      "password": "string",
      "server": "string",
      "port": "number",
      "ssl": "boolean"
    },
    "imap": {
      "login": "string",
      "password": "string",
      "server": "string",
      "port": "number",
      "ssl": "boolean"
    },
    "signature": "object",
    "usedInCampaign": "string"
  }
}

Blacklist: object

_id:
ID
name:
blacklistContent:
Example
{
  "_id": "object",
  "name": "string",
  "blacklistContent": "string"
}

Boolean: boolean

The Boolean scalar type represents true or false.

Example
boolean

Campaign: object

_id:
ID
name:
customDomain:
status:
createdAt:
schedule:
provider:
ID
startAt:
steps:
recipients:
activities_count:
estimatedEnd:
Example
{
  "_id": "object",
  "name": "string",
  "customDomain": {
    "domainName": "string",
    "status": "string",
    "dateAdded": "string"
  },
  "status": "string",
  "createdAt": "string",
  "schedule": {
    "dailyContact": "number",
    "dailyLimit": "number",
    "minInterval": "number",
    "maxInterval": "number",
    "trackLinks": "boolean",
    "trackOpens": "boolean",
    "timeZone": "string",
    "days": [
      "number"
    ],
    "start": "string",
    "end": "string",
    "eventToStopMails": [
      "string"
    ]
  },
  "provider": "object",
  "startAt": "string",
  "steps": [
    {
      "delay": {
        "amount": "number",
        "unit": "string"
      },
      "versions": [
        {
          "_id": "object",
          "subject": "string",
          "message": "string",
          "options": {
            "showHistory": "boolean",
            "schedule": [
              {
                "day": "number",
                "start": "string",
                "end": "string"
              }
            ],
            "trackLinks": "boolean",
            "trackOpens": "boolean",
            "provider": "object"
          }
        }
      ]
    }
  ],
  "recipients": {
    "lists": [
      {
        "_id": "object",
        "name": "string",
        "contactCount": "number",
        "fields": [
          "string"
        ],
        "usedInCampaign": "boolean"
      }
    ]
  }
}

CampaignLine: object

_id:
ID
name:
status:
createdAt:
stats:
Example
{
  "_id": "object",
  "name": "string",
  "status": "string",
  "createdAt": "string",
  "stats": {
    "mailsSent": "number",
    "uniqueOpensPercent": "number",
    "opens": "number",
    "linkClickedPercent": "number",
    "repliedPercent": "number",
    "bouncedPercent": "number",
    "unsubscribePercent": "number",
    "progressPercent": "number"
  }
}

CampaignStat: object

mailsSent:
Int
uniqueOpensPercent:
opens:
Int
linkClickedPercent:
repliedPercent:
bouncedPercent:
unsubscribePercent:
progressPercent:
Example
{
  "mailsSent": "number",
  "uniqueOpensPercent": "number",
  "opens": "number",
  "linkClickedPercent": "number",
  "repliedPercent": "number",
  "bouncedPercent": "number",
  "unsubscribePercent": "number",
  "progressPercent": "number"
}

CampaignStatus: string

object
RUNNING
object
PAUSED
object
DRAFT
object
FINISHED
object
ARCHIVED

Card: object

card_id:
ID
type:
last4:
exp:
Example
{
  "card_id": "object",
  "type": "string",
  "last4": "string",
  "exp": "string"
}

Contact: object

_id:
ID
firstName:
lastName:
phoneNumber:
email:
custom:
interested:
mailsSent:
Int
status:
lastContacted:
lastReplied:
lastOpen:
Example
{
  "_id": "object",
  "firstName": "string",
  "lastName": "string",
  "phoneNumber": "string",
  "email": "string",
  "custom": "object",
  "interested": "string",
  "mailsSent": "number",
  "status": "string",
  "lastContacted": "string",
  "lastReplied": "string",
  "lastOpen": "string"
}

ContactList: object

_id:
ID
name:
contactCount:
Int
fields:
usedInCampaign:
contacts:
Example
{
  "_id": "object",
  "name": "string",
  "contactCount": "number",
  "fields": [
    "string"
  ],
  "usedInCampaign": "boolean",
  "contacts": {
    "list": [
      {
        "_id": "object",
        "firstName": "string",
        "lastName": "string",
        "phoneNumber": "string",
        "email": "string",
        "custom": "object",
        "interested": "string",
        "mailsSent": "number",
        "status": "string",
        "lastContacted": "string",
        "lastReplied": "string",
        "lastOpen": "string"
      }
    ],
    "count": "number"
  }
}

ContactsResult: object

list:
count:
Int
Example
{
  "list": [
    {
      "_id": "object",
      "firstName": "string",
      "lastName": "string",
      "phoneNumber": "string",
      "email": "string",
      "custom": "object",
      "interested": "string",
      "mailsSent": "number",
      "status": "string",
      "lastContacted": "string",
      "lastReplied": "string",
      "lastOpen": "string"
    }
  ],
  "count": "number"
}

CustomDomain: object

domainName:
status:
dateAdded:
Example
{
  "domainName": "string",
  "status": "string",
  "dateAdded": "string"
}

Delay: object

amount:
Int
unit:
Example
{
  "amount": "number",
  "unit": "string"
}

DelayUnit: string

object
MINUTES
object
HOURS
object
DAYS

EmailConfig: object

login:
password:
server:
port:
Int
ssl:
Example
{
  "login": "string",
  "password": "string",
  "server": "string",
  "port": "number",
  "ssl": "boolean"
}

EmailProvider: object

_id:
ID
senderName:
senderEmail:
senderPassword:
emailType:
smtp:
imap:
signature:
ID
usedInCampaign:
Example
{
  "_id": "object",
  "senderName": "string",
  "senderEmail": "string",
  "senderPassword": "string",
  "emailType": "string",
  "smtp": {
    "login": "string",
    "password": "string",
    "server": "string",
    "port": "number",
    "ssl": "boolean"
  },
  "imap": {
    "login": "string",
    "password": "string",
    "server": "string",
    "port": "number",
    "ssl": "boolean"
  },
  "signature": "object",
  "usedInCampaign": "string"
}

EmailType: string

object
GOOGLE
object
OFFICE
object
EXCHANGE
object
SMTP

EventToStop: string

object
REPLIED
object
CLICKED
object
OPENED

Float: number

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example
number

GlobalActivities: object

sent:
Int
first_open:
Int
first_open_percent:
opened:
Int
clicked:
Int
clicked_percent:
replied:
Int
replied_percent:
bounced:
Int
bounced_percent:
unsubscribed:
Int
unsubscribed_percent:
progress_percent:
Example
{
  "sent": "number",
  "first_open": "number",
  "first_open_percent": "number",
  "opened": "number",
  "clicked": "number",
  "clicked_percent": "number",
  "replied": "number",
  "replied_percent": "number",
  "bounced": "number",
  "bounced_percent": "number",
  "unsubscribed": "number",
  "unsubscribed_percent": "number",
  "progress_percent": "number"
}

ID: object

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Example
object

Int: number

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
number

Invoice: object

id:
url:
price:
date:
Example
{
  "id": "string",
  "url": "string",
  "price": "number",
  "date": "string"
}

JSON: object

The JSON scalar type represents JSON values as specified by ECMA-404.

Example
object

MailEvent: string

object
SENT
object
FIRST_OPEN
object
OPENED
object
CLICKED
object
REPLIED
object
BOUNCED
object
UNSUBSCRIBED

MailVersion: object

_id:
ID
subject:
message:
options:
Example
{
  "_id": "object",
  "subject": "string",
  "message": "string",
  "options": {
    "showHistory": "boolean",
    "schedule": [
      {
        "day": "number",
        "start": "string",
        "end": "string"
      }
    ],
    "trackLinks": "boolean",
    "trackOpens": "boolean",
    "provider": "object"
  }
}

Membership: object

id:
Int
expiration:
additionalEmails:
Example
{
  "id": "number",
  "expiration": "string",
  "additionalEmails": [
    {
      "expiration": "string",
      "active": "boolean"
    }
  ]
}

Recipients: object

lists:
contacts:
total_count:
Int
Example
{
  "lists": [
    {
      "_id": "object",
      "name": "string",
      "contactCount": "number",
      "fields": [
        "string"
      ],
      "usedInCampaign": "boolean",
      "contacts": {
        "list": [
          {
            "_id": "object",
            "firstName": "string",
            "lastName": "string",
            "phoneNumber": "string",
            "email": "string",
            "custom": "object",
            "interested": "string",
            "mailsSent": "number",
            "status": "string",
            "lastContacted": "string",
            "lastReplied": "string",
            "lastOpen": "string"
          }
        ],
        "count": "number"
      }
    }
  ],
  "contacts": {
    "list": [
      {
        "_id": "object",
        "firstName": "string",
        "lastName": "string",
        "phoneNumber": "string",
        "email": "string",
        "custom": "object",
        "interested": "string",
        "mailsSent": "number",
        "status": "string",
        "lastContacted": "string",
        "lastReplied": "string",
        "lastOpen": "string"
      }
    ],
    "count": "number"
  },
  "total_count": "number"
}

Schedule: object

dailyContact:
Int
dailyLimit:
Int
minInterval:
Int
maxInterval:
Int
trackLinks:
trackOpens:
timeZone:
days:
Int
start:
end:
eventToStopMails:
Example
{
  "dailyContact": "number",
  "dailyLimit": "number",
  "minInterval": "number",
  "maxInterval": "number",
  "trackLinks": "boolean",
  "trackOpens": "boolean",
  "timeZone": "string",
  "days": [
    "number"
  ],
  "start": "string",
  "end": "string",
  "eventToStopMails": [
    "string"
  ]
}

Signature: object

_id:
ID
name:
content:
Example
{
  "_id": "object",
  "name": "string",
  "content": "string"
}

Step: object

delay:
versions:
Example
{
  "delay": {
    "amount": "number",
    "unit": "string"
  },
  "versions": [
    {
      "_id": "object",
      "subject": "string",
      "message": "string",
      "options": {
        "showHistory": "boolean",
        "schedule": [
          {
            "day": "number",
            "start": "string",
            "end": "string"
          }
        ],
        "trackLinks": "boolean",
        "trackOpens": "boolean",
        "provider": "object"
      }
    }
  ]
}

String: string

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Upload: object

Example
object

User: object

uid:
ID
name:
email:
picture:
subscription:
credit_cards:
invoices:
api_keys:
Example
{
  "uid": "object",
  "name": "string",
  "email": "string",
  "picture": "string",
  "subscription": {
    "id": "number",
    "expiration": "string",
    "additionalEmails": [
      {
        "expiration": "string",
        "active": "boolean"
      }
    ]
  },
  "credit_cards": [
    {
      "card_id": "object",
      "type": "string",
      "last4": "string",
      "exp": "string"
    }
  ],
  "invoices": [
    {
      "id": "string",
      "url": "string",
      "price": "number",
      "date": "string"
    }
  ],
  "api_keys": [
    {
      "key": "string",
      "created_at": "string",
      "status": "string",
      "last_usage": "string"
    }
  ]
}

VersionActivities: object

sent:
Int
to_send:
Int
delivered:
Int
first_open:
Int
first_open_percent:
opened:
Int
clicked:
Int
clicked_percent:
replied:
Int
replied_percent:
bounced:
Int
bounced_percent:
unsubscribed:
Int
unsubscribed_percent:
Example
{
  "sent": "number",
  "to_send": "number",
  "delivered": "number",
  "first_open": "number",
  "first_open_percent": "number",
  "opened": "number",
  "clicked": "number",
  "clicked_percent": "number",
  "replied": "number",
  "replied_percent": "number",
  "bounced": "number",
  "bounced_percent": "number",
  "unsubscribed": "number",
  "unsubscribed_percent": "number"
}

VersionOption: object

showHistory:
schedule:
trackLinks:
trackOpens:
provider:
ID
Example
{
  "showHistory": "boolean",
  "schedule": [
    {
      "day": "number",
      "start": "string",
      "end": "string"
    }
  ],
  "trackLinks": "boolean",
  "trackOpens": "boolean",
  "provider": "object"
}

VersionSchedule: object

day:
Int
start:
end:
Example
{
  "day": "number",
  "start": "string",
  "end": "string"
}