# Mailgun Integration via LowCodeAPI

**Last Updated**: February 10, 2026

## Overview
Email API service

**Categories:**
- {'id': 'transactional-email', 'name': 'Transactional Email'}

## Base Endpoint
https://api.lowcodeapi.com/mailgun

**Important**: Always include the provider name in the URL path after `api.lowcodeapi.com/`

## Authentication
**Type:** TOKEN

**Official Documentation:** https://documentation.mailgun.com/docs/mailgun/api-reference/intro/

## URL Format (Important)

LowCodeAPI supports two URL formats. **Always try the New Format first**, then fall back to Old Format if needed.

### New Format (Priority)
- Path parameters stay in the URL path
- Do NOT include path parameters as query parameters
- Example: `https://api.lowcodeapi.com/{provider}/resource/{id}?api_token=XXX`

### Old Format (Fallback)
- Path parameters become query parameters
- Example: `https://api.lowcodeapi.com/{provider}/resource/id?id={id}&api_token=XXX`

### Decision Flow for AI Agents
1. Always use **New Format** first - keep path parameters in the URL path
2. If you get a 404 or error, try **Old Format** with sanitized path
3. Log which format worked for future requests to this provider

## API Categories

## Common Endpoints

### Send an email

**Method:** POST
**LowCodeAPI Path:** /v3/{domain_name}/messages

**New Format URL:**
https://api.lowcodeapi.com/mailgun/v3/{domain_name}/messages?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/mailgun/v3/domain_name/messages?domain_name={domain_name}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| domain_name | string |  |

**Request Body:**

| Field | Type | Description |
|-------|------|-------------|
| text | string |  |
| amp-html | string |  |
| attachment | string |  |
| bcc | string |  |
| cc | string |  |
| from | string |  |
| html | string |  |
| inline | string |  |
| recipient-variables | string |  |
| subject | string |  |
| template | string |  |
| to | string |  |

**Example Request (New Format):**

```bash
curl -X POST 'https://api.lowcodeapi.com/mailgun/v3/{domain_name}/messages?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Messages/#tag/Messages/operation/httpapi.(*apiHandler).handler-fm-18

### Send an email in MIME format

**Method:** POST
**LowCodeAPI Path:** /v3/{domain_name}/messages.mime

**New Format URL:**
https://api.lowcodeapi.com/mailgun/v3/{domain_name}/messages.mime?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/mailgun/v3/domain_name/messages.mime?domain_name={domain_name}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| domain_name | string |  |

**Request Body:**

| Field | Type | Description |
|-------|------|-------------|
| message | string |  |
| to | string |  |

**Example Request (New Format):**

```bash
curl -X POST 'https://api.lowcodeapi.com/mailgun/v3/{domain_name}/messages.mime?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Messages/#tag/Messages/operation/httpapi.(*apiHandler).handler-fm-19

### Get messages queue status

**Method:** GET
**LowCodeAPI Path:** /v3/domains/{domain_name}/sending_queues

**New Format URL:**
https://api.lowcodeapi.com/mailgun/v3/domains/{domain_name}/sending_queues?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/mailgun/v3/domains/domain_name/sending_queues?domain_name={domain_name}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| domain_name | string |  |

**Example Request (New Format):**

```bash
curl -X GET 'https://api.lowcodeapi.com/mailgun/v3/domains/{domain_name}/sending_queues?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Messages/#tag/Messages/operation/httpapi.(*LegacyHttpApi).GetDomainSendingQueues-fm-70

### Delete scheduled and undelivered mail

**Method:** DELETE
**LowCodeAPI Path:** /v3/{domain_name}/envelopes

**New Format URL:**
https://api.lowcodeapi.com/mailgun/v3/{domain_name}/envelopes?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/mailgun/v3/domain_name/envelopes?domain_name={domain_name}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| domain_name | string |  |

**Example Request (New Format):**

```bash
curl -X DELETE 'https://api.lowcodeapi.com/mailgun/v3/{domain_name}/envelopes?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Messages/#tag/Messages/operation/httpapi.(*Handler).handlePurgeDomainJobs-fm-3

### Insert multiple complaint records provided in JSON format

**Method:** POST
**LowCodeAPI Path:** /v3/{domainID}/complaints

**New Format URL:**
https://api.lowcodeapi.com/mailgun/v3/{domainID}/complaints?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/mailgun/v3/domainid/complaints?domainID={domainID}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| domainID | string |  |

**Request Body:**

| Field | Type | Description |
|-------|------|-------------|
| address | string |  |
| created_at | string |  |

**Example Request (New Format):**

```bash
curl -X POST 'https://api.lowcodeapi.com/mailgun/v3/{domainID}/complaints?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Complaints/#tag/Complaints/operation/api.(*ComplaintController).InsertJSON-fm-36

### View single bounce event

**Method:** GET
**LowCodeAPI Path:** /v3/{domainID}/bounces/{address:.+}

**New Format URL:**
https://api.lowcodeapi.com/mailgun/v3/{domainID}/bounces/{address:.+}?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/mailgun /v3/domainid/bounces/address?domainID={domainID}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| domainID | string |  |

**Example Request (New Format):**

```bash
curl -X GET 'https://api.lowcodeapi.com/mailgun/v3/{domainID}/bounces/{address:.+}?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Bounces/#tag/Bounces/operation/api.(*BounceController).Get-fm-20

### Clear a single bounce

**Method:** DELETE
**LowCodeAPI Path:** /v3/{domainID}/bounces/{address:.+}

**New Format URL:**
https://api.lowcodeapi.com/mailgun/v3/{domainID}/bounces/{address:.+}?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/mailgun/v3/domainid/bounces/address?domainID={domainID}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| domainID | string |  |

**Example Request (New Format):**

```bash
curl -X DELETE 'https://api.lowcodeapi.com/mailgun/v3/{domainID}/bounces/{address:.+}?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Bounces/#tag/Bounces/operation/api.(*BounceController).Delete-fm-25

### View all bounces

**Method:** GET
**LowCodeAPI Path:** /v3/{domainID}/bounces

**New Format URL:**
https://api.lowcodeapi.com/mailgun/v3/{domainID}/bounces?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/mailgun/v3/domainid/bounces?domainID={domainID}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| domainID | string |  |

**Query Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| limit | number |  |
| page | string |  |

**Example Request (New Format):**

```bash
curl -X GET 'https://api.lowcodeapi.com/mailgun/v3/{domainID}/bounces?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Bounces/#tag/Bounces/operation/api.(*BounceController).GetPage-fm-21

### Insert bounce records to the bounces list

**Method:** POST
**LowCodeAPI Path:** /v3/{domainID}/bounces

**New Format URL:**
https://api.lowcodeapi.com/mailgun/v3/{domainID}/bounces?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/mailgun/v3/domainid/bounces?domainID={domainID}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| domainID | string |  |

**Request Body:**

| Field | Type | Description |
|-------|------|-------------|
| address | string |  |
| code | string |  |
| created_at | string |  |
| error | string |  |

**Example Request (New Format):**

```bash
curl -X POST 'https://api.lowcodeapi.com/mailgun/v3/{domainID}/bounces?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Bounces/#tag/Bounces/operation/api.(*BounceController).InsertJSON-fm-22

### Delete entire bounce list

**Method:** DELETE
**LowCodeAPI Path:** /v3/{domainID}/bounces

**New Format URL:**
https://api.lowcodeapi.com/mailgun/v3/{domainID}/bounces?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/mailgun/v3/domainid/bounces?domainID={domainID}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| domainID | string |  |

**Example Request (New Format):**

```bash
curl -X DELETE 'https://api.lowcodeapi.com/mailgun/v3/{domainID}/bounces?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Bounces/#tag/Bounces/operation/api.(*BounceController).DeleteAll-fm-26


## Usage Examples

### Example 1: Send an Email

```bash
# Send an email - no path parameters needed
curl -X POST "https://api.lowcodeapi.com/mailgun/send?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "[email protected]",
    "to": "[email protected]",
    "subject": "Test Email",
    "text": "This is a test email from Mailgun"
  }'
```

### Example 2: List Sent Emails

```bash
# Get list of sent emails
curl -X GET "https://api.lowcodeapi.com/mailgun/messages?api_token=YOUR_API_TOKEN"
```

### Example 3: Get Email Details

```bash
# Get specific message by ID
curl -X GET "https://api.lowcodeapi.com/mailgun/messages/{MESSAGE_ID}?api_token=YOUR_API_TOKEN"
```

## Error Handling

LowCodeAPI returns standard HTTP status codes. Common errors:

| Status Code | Description |
|-------------|-------------|
| 200 | Success - Request completed successfully |
| 400 | Bad Request - Invalid parameters or request body |
| 401 | Unauthorized - Invalid or missing API token |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Endpoint or resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Provider API error |

All error responses include error details:

```json
{
  "data": {
    "error": {
      "message": "Error description",
      "code": "ERROR_CODE"
    }
  }
}
```

## Complete Endpoint Reference

| Endpoint | Method | Category |
|----------|--------|----------|
| Send an email | POST | Messages |
| Send an email in MIME format | POST | Messages |
| Get messages queue status | GET | Messages |
| Delete scheduled and undelivered mail | DELETE | Messages |
| Insert multiple complaint records provided in JSON... | POST | Complaints |
| View single bounce event | GET | Bounces |
| Clear a single bounce | DELETE | Bounces |
| View all bounces | GET | Bounces |
| Insert bounce records to the bounces list | POST | Bounces |
| Delete entire bounce list | DELETE | Bounces |
| Import list of complaints | POST | Complaints |
| View a single complaint record | GET | Complaints |
| Clear a single complaint event | DELETE | Complaints |
| View all complaints | GET | Complaints |
| Delete entire complaints list | DELETE | Complaints |
| Get connection's details | GET | Domain Connection |
| Update domain connection settings | PUT | Domain Connection |
| List domain keys | GET | Domain Keys |
| Create a domain key | POST | Domain Keys |
| Delete a domain key | DELETE | Domain Keys |
| Activate a domain key | PUT | Domain Keys |
| List domain keys | GET | Domain Keys |
| Deactivate a domain key | PUT | Domain Keys |
| Update DKIM authority | PUT | Domain Keys |
| Update a DKIM selector | PUT | Domain Keys |
| Get tracking status | GET | Domain Tracking |
| Update click tracking settings | PUT | Domain Tracking |
| Update open tracking settings | PUT | Domain Tracking |
| Update unsubscribe tracking settings | PUT | Domain Tracking |
| Get domains | GET | Domains |
| Create a domain | POST | Domains |
| Get domain details | GET | Domains |
| Update a domain | PUT | Domains |
| Set verification state | PUT | Domains |
| Delete a domain | DELETE | Domains |
| Update the message TTL | PUT | Domains |
| Update the mailfrom hostname | PUT | Domains |
| Update domains web prefix | PUT | Domains |
| Retrieves a paginated list of events | GET | Events |
| Remove an IP from the domain pool, unlink a DIPP o... | DELETE | IPs |
| Remove an IP from the domain pool, unlink a DIPP o... | DELETE | IPs |
| Add a new DIPP to the account | POST | IP Pools |
| Get DIPP details | GET | IP Pools |
| Delete the DIPP | DELETE | IP Pools |
| Edit DIPP | PATCH | IP Pools |
| Add an IP to a DIPP | PUT | IP Pools |
| Remove an IP from a DIPP | DELETE | IP Pools |
| Add multiple IPs to the DIPP | POST | IP Pools |
| List account IPs | GET | IPs |
| Get details about account IP | GET | IPs |
| Get all domains of an account where a specific IP ... | GET | IPs |
| Place account IP into a dedicated IP band | POST | IPs |
| Return the number of IPs available to the account ... | GET | IPs |
| Add a new dedicated IP to the account | POST | IPs |
| Create a mailing list | POST | Mailing Lists
 |
| Get mailing lists | GET | Mailing Lists
 |
| Get mailing lists members | GET | Mailing Lists
 |
| Create a mailing list member | POST | Mailing Lists
 |
| Bulk upload members to a mailing list (JSON) | POST | Mailing Lists
 |
| Bulk upload members to a mailing list (CSV) | POST | Mailing Lists
 |
| Get a member | GET | Mailing Lists
 |
| Update a mailing list member | PUT | Mailing Lists
 |
| Delete a member | DELETE | Mailing Lists
 |
| Update a mailing list | PUT | Mailing Lists
 |
| Delete mailing list | DELETE | Mailing Lists
 |
| Get a mailing list by address | GET | Mailing Lists
 |
| Get mailing lists by page | GET | Mailing Lists
 |
| Get members by page | GET | Mailing Lists
 |
| Create a route | POST | Routes |
| Get all routes | GET | Routes |
| Get a route | GET | Routes |
| Update a route | PUT | Routes |
| Delete a route | DELETE | Routes |
| Match address to route | GET | Routes |
| Status of x509 TLS certificate | GET | Secure tracking |
| Initiate regeneration of an expired x509 TLS certi... | PUT | Secure tracking |
| Initiate generation of an x509 TLS certificate | POST | Secure tracking |
| Totals for entire account | GET | Stats |
| Totals for entire domain | GET | Stats |
| Totals for account domains for a single time resol... | GET | Stats |
| Filtered/grouped totals for entire account | GET | Stats |
| Aggregate counts by ESP | GET | Stats |
| Aggregate counts by devices triggering events | GET | Stats |
| Aggregate counts by country | GET | Stats |
| List all tags | GET | Tags |
| Get a tag | GET | Tags |
| Update tag | PUT | Tags |
| Delete tag | DELETE | Tags |
| Get aggregate stat types by tag | GET | Tags |
| Get stats by tag | GET | Tags |
| Get tag limits | GET | Tags |
| Get templates | GET | Templates |
| Create a template | POST | Templates |
| Delete all templates | DELETE | Templates |
| Get all template versions | GET | Templates |
| Create a template version | POST | Templates |
| Get template | GET | Templates |
| Update template | PUT | Templates |
| Delete a template | DELETE | Templates |
| Get a version | GET | Templates |
| Update a version | PUT | Templates |
| Delete a version | DELETE | Templates |
| Copy a version | PUT | Templates |
| Import list of unsubscribes | POST | Unsubscribe |
| View a single unsubscribe | GET | Unsubscribe |
| Clear a given unsubscribe event | DELETE | Unsubscribe |
| View all unsubscribes | GET | Unsubscribe |
| Insert multiple unsubscribe records via JSON | POST | Unsubscribe |
| Delete entire unsubscribe list | DELETE | Unsubscribe |
| Get all webhooks | GET | Webhooks |
| Create a webhook | POST | Webhooks |
| Get webhooks by type | GET | Webhooks |
| Update a webhook | PUT | Webhooks |
| Remove all webhooks by webhook type | DELETE | Webhooks |
| View a single whitelist records | GET | Whitelist |
| Remove a record from whitelist | DELETE | Whitelist |
| View all whitelist records for a domain | GET | Whitelist |
| Add a single whitelist record | POST | Whitelist |
| Clear domains whitelist | DELETE | Whitelist |
| Import list of whitelisted addresses/domains | POST | Whitelist |

## API Definition Endpoints

You can fetch the complete API specification for this provider:

**New Format (OpenAPI spec):**
```bash
curl 'https://backend.lowcodeapi.com/mailgun/openapi'
```

**Old Format (API definition):**
```bash
curl 'https://backend.lowcodeapi.com/mailgun/definition'
```

## Response Format

All responses are wrapped in a `data` key:

```json
{
  "data": {
    // Actual response from provider (object or array)
  }
}
```