Mautic API Quick Start Guide

The REST API serves as a powerful gateway to the Mautic system. It supports an ample amount of calls allowing users to programmatically create, read, delete, and modify different components within Mautic.

The API can be used to:

  1. Build meaningful integrations with in-house systems – CRM, ERP, social, and more.
  2. Batch update Mautic components.
  3. Create advanced triggers and alerts.
  4. Achieve the valuable use case that you envision.

This guide allows you to quickly communicate with the Mautic API. For full API documentation, please refer to


Step 1: Authenticating API Requests

Mautic supports three options for authentication – Basic Authentication, OAuth1a, and OAuth2.

Here, we’ll be using Basic Authentication where your credentials are your Mautic username and password.

To enable Basic Authentication, navigate to Settings -> Configuration -> API Settings and verify that ‘API enabled’ is toggled to ‘Yes’ and ‘Enable HTTP basic auth’ is toggled to ‘Yes’. Copy down your username and password to use in the upcoming sections.


Step 2: Some Quick Basics

The base format for the http request URL is:


Mautic generally supports GET, POST, DELETE, PATCH, and PUT requests which can be examined in more detail in the API documentation.

Successful responses are returned in JSON format.


Step 3: GET a Contact’s Profile Data Using the API

Now that we have authentication and the API request URL, let’s talk to the Mautic API!

This query returns the profile data of an individual Mautic contact:

GET https://[[]]/api/contacts/[[contact-id]]

Choose your preferred environment below and use the code snippets as guides for sending your first Mautic query. Change the [[contact-id]] to the ID of the Mautic contact you want to view. Update your [[username]], [[password]], and [[]].


curl -X GET https://[[]]/api/contacts/[[contact-id]] -u [[username]]:[[password]]


use Mautic\\\\MauticApi;
use Mautic\\\\Auth\\\\ApiAuth;

$initAuth = new ApiAuth();
$auth = $initAuth->newAuth($settings);
$apiUrl = "[[]]";
$api = new MauticApi();
$contactApi = $api->newApi("contacts", $auth, $apiUrl);

$contact = $contactApi->get($[[contact-id]]);


import requests


url = 'https://[[]]/api/contacts/[[contact-id]]'

payload = ""
headers = {'Accept': "application/json"}


r = requests.request("GET", url, data=payload, auth=('[[username]]','[[password]'))




var request = require('request');

var username = "[[username]]";
var password = "[[password]]";
var auth = "Basic " + new Buffer.from(username + ":" + password).toString("base64");

var options = {
url: 'https://[[]]/api/contacts/[[contact-id]]',
headers: {
"Authorization": auth

request(options, function (error, response, body) {
if (error) throw new Error(error);



require 'uri'
require 'net/http'
require 'openssl'

uri = URI.parse("https://[[]/api/contacts/[[contact-id]]")

request =
request.basic_auth '[[username]]','[[password]]'
request.content_type = "application/json"

req_options = {
use_ssl: uri.scheme == "https",

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|

puts response.body


Awesome job! You’re working with the Mautic API and on your way to increasing your Mautic impact. If you have any questions or comments on API use, please contact the Customer Success team at!