NAV
bash javascript php python

Info

Welcome to the generated API reference. Get Postman Collection

Authentication

API for user authentication.

Create personal access token

If you are a registered user, then you can get you personal access token without any additional setting.

This endpoint will require your password just like login page of our website and we are using encrypted connection to protect your credentials.

Example request:

curl -X POST \
    "https://postback.email/api/v1/auth/login" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"email":"[email protected]","password":"secret"}'
const url = new URL(
    "https://postback.email/api/v1/auth/login"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "[email protected]",
    "password": "secret"
}

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

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://postback.email/api/v1/auth/login',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => '[email protected]',
            'password' => 'secret',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://postback.email/api/v1/auth/login'
payload = {
    "email": "[email protected]",
    "password": "secret"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):

{
    "code": 201,
    "access_token": "1|cJDP8AqfFExbX2dSKKxObGy8p1sPcmZRoyHOEotU",
    "token_type": "Bearer"
}

Example response (400):

{
    "code": 400,
    "error": {
        "password": [
            "The password field is required."
        ]
    }
}

Example response (401):

{
    "code": 401,
    "error": "Unauthorized"
}

Example response (500):

{
    "code": 500,
    "error": "Internal Server Error"
}

HTTP Request

POST api/v1/auth/login

Body Parameters

Parameter Type Status Description
email email required Email address associated with your account.
password string required Your password.

Delete personal access token

Personal access tokens have no expiration time. Therefore, it is suggested to delete your tokens if you will not continue using it.

Example request:

curl -X DELETE \
    "https://postback.email/api/v1/auth/delete-token" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://postback.email/api/v1/auth/delete-token"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://postback.email/api/v1/auth/delete-token',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://postback.email/api/v1/auth/delete-token'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200):

{
    "code": 200
}

Example response (401):

{
    "code": 401,
    "error": "Unauthorized"
}

Example response (500):

{
    "code": 500,
    "error": "Internal Server Error"
}

HTTP Request

DELETE api/v1/auth/delete-token

Emails

API for your emails.

List of emails

Returns list of emails.

Example request:

curl -X GET \
    -G "https://postback.email/api/v1/emails/getEmails" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://postback.email/api/v1/emails/getEmails"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://postback.email/api/v1/emails/getEmails',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://postback.email/api/v1/emails/getEmails'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "data": [
        {
            "id": 1,
            "email_from": "[email protected]",
            "email_to": "[email protected]",
            "subject": "example subject",
            "body": "example body",
            "code": "examplecode123",
            "created_at": "2020-12-07 11:23:46",
            "updated_at": "2020-12-07 11:23:46",
            "domain": {
                "id": 1,
                "name": "example.site"
            }
        },
        {
            "id": 2,
            "email_from": "[email protected]",
            "email_to": "[email protected]",
            "subject": "example subject 2",
            "body": "example body 2",
            "code": "examplecode1234",
            "created_at": "2020-12-07 11:23:46",
            "updated_at": "2020-12-07 11:23:46",
            "domain": {
                "id": 1,
                "name": "example.site"
            }
        }
    ]
}

Example response (400):

{
    "code": 400,
    "error": {
        "id": [
            "The selected id is invalid."
        ]
    }
}

Example response (401):

{
    "code": 401,
    "error": "Unauthorized"
}

Example response (500):

{
    "code": 500,
    "error": "Internal Server Error"
}

HTTP Request

GET api/v1/emails/getEmails

URL Parameters

Parameter Status Description
domain optional string: Domain name to search.If is_regex=1, then this should be regular expression.
from optional email: Email address of sender.If is_regex=1, then this should be regular expression.
to optional email: Email address of receiver.If is_regex=1, then this should be regular expression.
subject optional string: Subject of the email.If is_regex=1, then this should be regular expression.
is_regex optional boolean: If set to 1, any other parameter will expect regular expression to search.
code_only optional boolean: If set to 1, email data will not contain message body.

Read email

Returns an email.

Example request:

curl -X GET \
    -G "https://postback.email/api/v1/emails/getEmail/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://postback.email/api/v1/emails/getEmail/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

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

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://postback.email/api/v1/emails/getEmail/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://postback.email/api/v1/emails/getEmail/1'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "data": [
        {
            "id": 1,
            "email_from": "[email protected]",
            "email_to": "[email protected]",
            "subject": "example subject",
            "body": "example body",
            "code": "examplecode123",
            "created_at": "2020-12-07 11:23:46",
            "updated_at": "2020-12-07 11:23:46",
            "domain": {
                "id": 1,
                "name": "example.site"
            }
        }
    ]
}

Example response (400):

{
    "code": 400,
    "error": {
        "id": [
            "The selected id is invalid."
        ]
    }
}

Example response (401):

{
    "code": 401,
    "error": "Unauthorized"
}

Example response (500):

{
    "code": 500,
    "error": "Internal Server Error"
}

HTTP Request

GET api/v1/emails/getEmail/{id}

URL Parameters

Parameter Status Description
id optional integer: ID of email.