---
title: "API Credentials"
date: "2024-10-25T14:29:14+00:00"
summary: "Discover how to use the Campaign Factory API for efficient automation and management of Campaign Studio instances and templates."
image:
type: "page"
url: "/campaign-studio/add-ons/campaign-factory/api-credentials"
id: "646f8f88-2981-46ca-a98b-cf5e928e426c"
---

This document describes the capabilities of the Campaign Factory API and provides information about how to communicate with it. With this API, you can provision Campaign Studio instances and templates for efficient automation, scalability, and streamlined operations.

Capabilities
------------

Campaign Factory API capabilities include creating and managing operations for the following: 

*   [Accounts](/campaign-studio/add-ons/campaign-factory/accounts "Accounts")
*   [Instance branding](/campaign-studio/add-ons/campaign-factory/branding-campaign-studio-instances "Branding Campaign Studio instances")
*   [Instances](/campaign-studio/add-ons/campaign-factory/instances "Instances")
*   [Roles](/campaign-studio/add-ons/campaign-factory/users-and-roles "Users and roles")
*   [Users](/campaign-studio/add-ons/campaign-factory/users-and-roles "Users and roles")
*   [Templates](/node/56740)

The API also allows you to view resources you have access to but cannot create or manage:

*   [IP Pools](/campaign-studio/add-ons/campaign-factory/dedicated-ip-pools "Dedicated IP pools")
*   [Deployment locations](/campaign-studio/add-ons/campaign-factory/instances "Instances")

Accessing the API
-----------------

[Campaign Factory OpenAPI Description](https://maestro.mautic.com/openapi/swagger-ui) provides a visual interface for the Campaign Factory API. This interface helps you to create and manage Campaign Studio instances, and view available endpoints, parameters, and response formats. Developers and administrators can explore the API's capabilities, test API calls, and learn how to structure requests and interpret responses. This facilitates easier integration and use of the API for provisioning and managing instances and templates within Campaign Factory.

1.  Obtain the Campaign Factory API credentials.
    
    To have the credentials provisioned, [create a Support ticket](https://docs.acquia.com/service-offerings/support#contact-acquia-support).
    
2.  Request an access token from the following token URL:
    
    [https://maestro.mautic.com/oauth/token](https://maestro.mautic.com/oauth/token)
    
3.  To access the API, send a POST request to the token endpoint containing the appropriate fields in the request body. 
    
    The following example outlines the fields in the request body:
    
        // REQUEST URL
        https://maestro.mautic.com/oauth/token
        // REQUEST HEADERS
        Content-Type: application/json
        // REQUEST body
        {
            "grant_type": "password",
            "username": "<YOUR USERNAME>",
            "password": "<YOUR PASSWORD>",
            "scope": "api-access manage-accounts manage-instances",
            "client_id": "<YOUR CLIENT ID>",
            "client_secret": "<YOUR CLIENT SECRET>"
        }
        
        // This request will return a bearer access token which must be used for subsequent requests to the API.
        {
            "token_type": "Bearer",
            "expires_in": 31536000,
            "access_token": "<YOUR ACCESS TOKEN HERE>",
            "refresh_token": "<REFRESH TOKEN>"
        }
        
        // REQUEST URL
        https://maestro.mautic.com/openapi/instances
        // REQUEST HEADERS
        Authorization: Bearer <THE ACCESS TOKEN>
    
4.  When requesting an access token, specify the scopes to grant the correct access to tokens.
    
    A token can specify multiple scopes. Some endpoints require multiple scopes. For example, the `/accounts/{accountUUID}/instances` endpoint requires both the `manage-accounts` and `manage-instances` scopes.
    
    Endpoint Root
    
    Required Scopes
    
    /accounts
    
    manage-accounts
    
    /brandings
    
    manage-brandings
    
    /instances
    
    manage-instances
    
    /ip-pools
    
    view-ip-pools
    
    /locations
    
    manage-locations
    
    /templates
    
    manage-templates
    
    /users
    
    manage-users
    
    /roles
    
    view-roles
    
    /whoami
    
    api-access