MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

This API is not authenticated.

Endpoints

Determine if a Discord ID is linked to a user account.

Example request:
curl --request GET \
    --get "https://leadmagnetmarketing.eu/api/discord/verify/architecto" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://leadmagnetmarketing.eu/api/discord/verify/architecto"
);

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

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "error": {
        "code": "unauthorized",
        "message": "Unauthorized"
    }
}
 

Request      

GET api/discord/verify/{discordId}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

discordId   string   

Example: architecto

Landing Pages

List landing pages.

requires authentication

Example request:
curl --request GET \
    --get "https://leadmagnetmarketing.eu/api/v1/landing-pages?locale=en&title=Demo&sort=created_at&order=desc&per_page=15" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"locale\": \"sr_BA\",
    \"title\": \"architecto\",
    \"sort\": \"created_at\",
    \"order\": \"asc\",
    \"per_page\": 22
}"
const url = new URL(
    "https://leadmagnetmarketing.eu/api/v1/landing-pages"
);

const params = {
    "locale": "en",
    "title": "Demo",
    "sort": "created_at",
    "order": "desc",
    "per_page": "15",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "locale": "sr_BA",
    "title": "architecto",
    "sort": "created_at",
    "order": "asc",
    "per_page": 22
};

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

Example response (200):


{
    "data": [
        {
            "id": 1,
            "title": "Demo",
            "locale": "en"
        }
    ]
}
 

Request      

GET api/v1/landing-pages

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

locale   string  optional  

Filter by locale. Example: en

title   string  optional  

Filter by title. Example: Demo

sort   string  optional  

Field to sort by. Example: created_at

order   string  optional  

Sort direction. Example: desc

per_page   integer  optional  

Items per page. Example: 15

Body Parameters

locale   string  optional  

validation.max. Example: sr_BA

title   string  optional  

Example: architecto

sort   string  optional  

Example: created_at

Must be one of:
  • created_at
  • title
order   string  optional  

Example: asc

Must be one of:
  • asc
  • desc
per_page   integer  optional  

validation.max. Example: 22

Create a landing page.

requires authentication

Example request:
curl --request POST \
    "https://leadmagnetmarketing.eu/api/v1/landing-pages" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"lead_magnet_id\": 1,
    \"title\": \"Demo page\",
    \"slug\": \"demo-page\",
    \"template\": \"default\",
    \"content\": \"architecto\",
    \"locale\": \"en\"
}"
const url = new URL(
    "https://leadmagnetmarketing.eu/api/v1/landing-pages"
);

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

let body = {
    "lead_magnet_id": 1,
    "title": "Demo page",
    "slug": "demo-page",
    "template": "default",
    "content": "architecto",
    "locale": "en"
};

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

Example response (201):


{
    "data": {
        "id": 1,
        "title": "Demo page"
    }
}
 

Request      

POST api/v1/landing-pages

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

lead_magnet_id   integer   

The parent lead magnet. Example: 1

title   string   

Title of the page. Example: Demo page

slug   string   

Unique slug. Example: demo-page

template   string   

Template identifier. Example: default

content   string  optional  

HTML content. Example: architecto

locale   string  optional  

Locale code. Example: en

Show a landing page.

requires authentication

Example request:
curl --request GET \
    --get "https://leadmagnetmarketing.eu/api/v1/landing-pages/e-book" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://leadmagnetmarketing.eu/api/v1/landing-pages/e-book"
);

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

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

Example response (200):


{
    "data": {
        "id": 1,
        "title": "Demo"
    }
}
 

Request      

GET api/v1/landing-pages/{landingPage_slug}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

landingPage_slug   string   

The slug of the landingPage. Example: e-book

landing_page   integer   

The ID of the landing page. Example: 1

Update a landing page.

requires authentication

Example request:
curl --request PUT \
    "https://leadmagnetmarketing.eu/api/v1/landing-pages/e-book" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"Updated title\",
    \"slug\": \"updated-page\",
    \"template\": \"default\",
    \"content\": \"architecto\",
    \"locale\": \"en\"
}"
const url = new URL(
    "https://leadmagnetmarketing.eu/api/v1/landing-pages/e-book"
);

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

let body = {
    "title": "Updated title",
    "slug": "updated-page",
    "template": "default",
    "content": "architecto",
    "locale": "en"
};

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

Example response (200):


{
    "data": {
        "id": 1,
        "title": "Updated title"
    }
}
 

Request      

PUT api/v1/landing-pages/{landingPage_slug}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

landingPage_slug   string   

The slug of the landingPage. Example: e-book

landing_page   integer   

The ID of the landing page. Example: 1

Body Parameters

title   string  optional  

Title of the page. Example: Updated title

slug   string  optional  

Unique slug. Example: updated-page

template   string  optional  

Template identifier. Example: default

content   string  optional  

HTML content. Example: architecto

locale   string  optional  

Locale code. Example: en

Delete a landing page.

requires authentication

Example request:
curl --request DELETE \
    "https://leadmagnetmarketing.eu/api/v1/landing-pages/e-book" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://leadmagnetmarketing.eu/api/v1/landing-pages/e-book"
);

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

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

Example response (204):

Empty response
 

Request      

DELETE api/v1/landing-pages/{landingPage_slug}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

landingPage_slug   string   

The slug of the landingPage. Example: e-book

landing_page   integer   

The ID of the landing page. Example: 1

Leads

List leads.

requires authentication

Example request:
curl --request GET \
    --get "https://leadmagnetmarketing.eu/api/v1/leads?landing_page_id=1&email=user%40example.com&first_name=John&from=2024-01-01&to=2024-12-31&sort=created_at&order=desc&per_page=15" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"landing_page_id\": 16,
    \"email\": \"gbailey@example.net\",
    \"first_name\": \"architecto\",
    \"from\": \"2025-09-03T21:47:43\",
    \"to\": \"2025-09-03T21:47:43\",
    \"sort\": \"first_name\",
    \"order\": \"asc\",
    \"per_page\": 22
}"
const url = new URL(
    "https://leadmagnetmarketing.eu/api/v1/leads"
);

const params = {
    "landing_page_id": "1",
    "email": "user@example.com",
    "first_name": "John",
    "from": "2024-01-01",
    "to": "2024-12-31",
    "sort": "created_at",
    "order": "desc",
    "per_page": "15",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "landing_page_id": 16,
    "email": "gbailey@example.net",
    "first_name": "architecto",
    "from": "2025-09-03T21:47:43",
    "to": "2025-09-03T21:47:43",
    "sort": "first_name",
    "order": "asc",
    "per_page": 22
};

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

Example response (200):


{
    "data": [
        {
            "id": 1,
            "first_name": "John",
            "email": "john@example.com"
        }
    ]
}
 

Request      

GET api/v1/leads

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

landing_page_id   integer  optional  

Filter by landing page. Example: 1

email   string  optional  

Filter by email. Example: user@example.com

first_name   string  optional  

Filter by first name. Example: John

from   string  optional  

date Only leads created after this date. Example: 2024-01-01

to   string  optional  

date Only leads created before this date. Example: 2024-12-31

sort   string  optional  

Field to sort by. Example: created_at

order   string  optional  

Sort direction. Example: desc

per_page   integer  optional  

Items per page. Example: 15

Body Parameters

landing_page_id   integer  optional  

Example: 16

email   string  optional  

Example: gbailey@example.net

first_name   string  optional  

Example: architecto

from   string  optional  

validation.date. Example: 2025-09-03T21:47:43

to   string  optional  

validation.date. Example: 2025-09-03T21:47:43

sort   string  optional  

Example: first_name

Must be one of:
  • created_at
  • first_name
  • email
order   string  optional  

Example: asc

Must be one of:
  • asc
  • desc
per_page   integer  optional  

validation.max. Example: 22

Create a lead.

requires authentication

Example request:
curl --request POST \
    "https://leadmagnetmarketing.eu/api/v1/leads" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"landing_page_id\": 1,
    \"first_name\": \"John\",
    \"email\": \"john@example.com\",
    \"consent\": true,
    \"tags\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "https://leadmagnetmarketing.eu/api/v1/leads"
);

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

let body = {
    "landing_page_id": 1,
    "first_name": "John",
    "email": "john@example.com",
    "consent": true,
    "tags": [
        "architecto"
    ]
};

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

Example response (201):


{
    "data": {
        "id": 1,
        "first_name": "John"
    }
}
 

Request      

POST api/v1/leads

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

landing_page_id   integer   

The landing page ID. Example: 1

first_name   string   

First name. Example: John

email   string   

Email address. Example: john@example.com

consent   boolean  optional  

Whether consent was given. Example: true

tags   string[]  optional  

List of tags.

Show a lead.

requires authentication

Example request:
curl --request GET \
    --get "https://leadmagnetmarketing.eu/api/v1/leads/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://leadmagnetmarketing.eu/api/v1/leads/1"
);

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

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

Example response (200):


{
    "data": {
        "id": 1,
        "first_name": "John"
    }
}
 

Request      

GET api/v1/leads/{lead_id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

lead_id   integer   

The ID of the lead. Example: 1

lead   string   

The ID of the lead. Example: 1

Update a lead.

requires authentication

Example request:
curl --request PUT \
    "https://leadmagnetmarketing.eu/api/v1/leads/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"first_name\": \"Jane\",
    \"email\": \"jane@example.com\",
    \"consent\": true,
    \"tags\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "https://leadmagnetmarketing.eu/api/v1/leads/1"
);

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

let body = {
    "first_name": "Jane",
    "email": "jane@example.com",
    "consent": true,
    "tags": [
        "architecto"
    ]
};

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

Example response (200):


{
    "data": {
        "id": 1,
        "first_name": "Jane"
    }
}
 

Request      

PUT api/v1/leads/{lead_id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

lead_id   integer   

The ID of the lead. Example: 1

lead   string   

The ID of the lead. Example: 1

Body Parameters

first_name   string  optional  

First name. Example: Jane

email   string  optional  

Email address. Example: jane@example.com

consent   boolean  optional  

Whether consent was given. Example: true

tags   string[]  optional  

List of tags.

Delete a lead.

requires authentication

Example request:
curl --request DELETE \
    "https://leadmagnetmarketing.eu/api/v1/leads/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://leadmagnetmarketing.eu/api/v1/leads/1"
);

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

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

Example response (204):

Empty response
 

Request      

DELETE api/v1/leads/{lead_id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

lead_id   integer   

The ID of the lead. Example: 1

lead   string   

The ID of the lead. Example: 1